@deephaven/code-studio 0.85.35-alpha-pivots.8 → 0.85.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/build/assets/{AppRoot-8a327571.js → AppRoot-19b11e6b.js} +4 -4
  2. package/build/assets/{AppRoot-8a327571.js.map → AppRoot-19b11e6b.js.map} +1 -1
  3. package/build/assets/{Chart-fec9fb12.js → Chart-c30c7b05.js} +2 -2
  4. package/build/assets/{Chart-fec9fb12.js.map → Chart-c30c7b05.js.map} +1 -1
  5. package/build/assets/{ControlType-4d2db3f8.js → ControlType-fdebc440.js} +3 -3
  6. package/build/assets/{ControlType-4d2db3f8.js.map → ControlType-fdebc440.js.map} +1 -1
  7. package/build/assets/{FontBootstrap-7f62c245.js → FontBootstrap-65e1bbdc.js} +2 -2
  8. package/build/assets/{FontBootstrap-7f62c245.js.map → FontBootstrap-65e1bbdc.js.map} +1 -1
  9. package/build/assets/{FormatterUtils-62fff8ca.js → FormatterUtils-dfcff087.js} +2 -2
  10. package/build/assets/{FormatterUtils-62fff8ca.js.map → FormatterUtils-dfcff087.js.map} +1 -1
  11. package/build/assets/{Grid-86e8f08f.js → Grid-e422b389.js} +2 -2
  12. package/build/assets/{Grid-86e8f08f.js.map → Grid-e422b389.js.map} +1 -1
  13. package/build/assets/IrisGrid-17d7bf74.js +3 -0
  14. package/build/assets/IrisGrid-17d7bf74.js.map +1 -0
  15. package/build/assets/{IrisGridModel-333276d9.js → IrisGridModel-b1559f8c.js} +2 -2
  16. package/build/assets/{IrisGridModel-333276d9.js.map → IrisGridModel-b1559f8c.js.map} +1 -1
  17. package/build/assets/{IrisGridShortcuts-6203452e.js → IrisGridShortcuts-b43fa62c.js} +2 -2
  18. package/build/assets/{IrisGridShortcuts-6203452e.js.map → IrisGridShortcuts-b43fa62c.js.map} +1 -1
  19. package/build/assets/{IrisGridThemeProvider-61ce65e1.js → IrisGridThemeProvider-ae2d47b6.js} +2 -2
  20. package/build/assets/{IrisGridThemeProvider-61ce65e1.js.map → IrisGridThemeProvider-ae2d47b6.js.map} +1 -1
  21. package/build/assets/{LocalWorkspaceStorage-1a4c6924.js → LocalWorkspaceStorage-15cbc5a8.js} +2 -2
  22. package/build/assets/{LocalWorkspaceStorage-1a4c6924.js.map → LocalWorkspaceStorage-15cbc5a8.js.map} +1 -1
  23. package/build/assets/{MarkdownEditor-4cc569e9.js → MarkdownEditor-ee3c3287.js} +2 -2
  24. package/build/assets/{MarkdownEditor-4cc569e9.js.map → MarkdownEditor-ee3c3287.js.map} +1 -1
  25. package/build/assets/{MarkdownNotebook-2645714a.js → MarkdownNotebook-317f9431.js} +2 -2
  26. package/build/assets/{MarkdownNotebook-2645714a.js.map → MarkdownNotebook-317f9431.js.map} +1 -1
  27. package/build/assets/{MissingPartitionError-16d79190.js → MissingPartitionError-2c2c8db9.js} +2 -2
  28. package/build/assets/{MissingPartitionError-16d79190.js.map → MissingPartitionError-2c2c8db9.js.map} +1 -1
  29. package/build/assets/{StyleGuideRoot-13debcf0.js → StyleGuideRoot-d1439318.js} +2 -2
  30. package/build/assets/{StyleGuideRoot-13debcf0.js.map → StyleGuideRoot-d1439318.js.map} +1 -1
  31. package/build/assets/{TokenBoxCellRenderer-f79f4451.js → TokenBoxCellRenderer-faf3c888.js} +2 -2
  32. package/build/assets/{TokenBoxCellRenderer-f79f4451.js.map → TokenBoxCellRenderer-faf3c888.js.map} +1 -1
  33. package/build/assets/{index-c9ed1c30.js → index-08bb8ee7.js} +3 -3
  34. package/build/assets/{index-c9ed1c30.js.map → index-08bb8ee7.js.map} +1 -1
  35. package/build/assets/{index-1d16611f.js → index-21ce7bac.js} +2 -2
  36. package/build/assets/{index-1d16611f.js.map → index-21ce7bac.js.map} +1 -1
  37. package/build/assets/{index-533cbb3f.js → index-3dbc80f4.js} +2 -2
  38. package/build/assets/{index-533cbb3f.js.map → index-3dbc80f4.js.map} +1 -1
  39. package/build/index.html +2 -2
  40. package/package.json +30 -30
  41. package/build/assets/IrisGrid-45b7b70d.js +0 -3
  42. package/build/assets/IrisGrid-45b7b70d.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as c,J as d,bu as ct,a9 as dt,M as A,ay as ft,V as W,L as ht,a3 as U,bv as vt,N as ie,bw as pt,bx as mt,av as gt,I as fe,by as Xe,a5 as bt,a1 as yt}from"./vendor-3e5e4180.js";import{E as wt,t as L,P as B,aI as Pt,aH as oe,ai as St,u as Ot,az as J,aY as xt,bM as Mt,ct as Et,bU as Ct,bR as Dt,cu as Tt,bS as _t,cv as jt,a8 as Rt,Y as It,X as Lt,ci as At,ck as be,ak as Nt,cr as $t,aX as Ft,aW as Ut,a5 as kt,cw as I,cs as Kt,cx as Bt,cy as Wt,cz as ye,cA as we,cB as Pe,cC as Se,b as Oe,a as Gt,I as zt}from"./ControlType-4d2db3f8.js";import{t as Ht,k as xe}from"./IrisGridShortcuts-6203452e.js";import{L as N,U as qt,j as Yt,ak as Zt,al as Xt,J as he}from"./index-533cbb3f.js";function Je(r,e){c.useEffect(()=>{if(r!=null){var t=new window.ResizeObserver(e);return t.observe(r),()=>{r!=null&&t.unobserve(r)}}},[r,e])}function An(){var{selectedThemeKey:r,setSelectedThemeKey:e,themes:t}=wt(),n=c.useCallback(i=>{e(i)},[e]);return d.jsx(ct,{label:"Pick a color scheme",items:t,selectedKey:r,onSelectionChange:n,children:i=>d.jsx(dt,{children:i.name},i.themeKey)})}function Nn(r){var{className:e,style:t}=r;return d.jsx("div",{className:A("dh-logo",e),style:t})}var Jt=["color","UNSAFE_style"];function Me(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Y(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Me(Object(t),!0).forEach(function(n){Qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Qt(r,e,t){return e=Vt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Vt(r){var e=er(r,"string");return typeof e=="symbol"?e:String(e)}function er(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function tr(r,e){if(r==null)return{};var t=rr(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function rr(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var nr=c.forwardRef((r,e)=>{var{color:t,UNSAFE_style:n}=r,i=tr(r,Jt),o=c.useMemo(()=>Y(Y({},n),{},{color:Ht(t)}),[t,n]);return d.jsx(ft,Y(Y({},i),{},{ref:e,UNSAFE_style:o}))});nr.displayName="Heading";function Ee(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ir(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ee(Object(t),!0).forEach(function(n){R(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function R(r,e,t){return e=or(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function or(r){var e=ar(r,"string");return typeof e=="symbol"?e:String(e)}function ar(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ce=N.module("ContextMenu");class G extends c.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),R(this,"container",void 0),R(this,"oldFocus",void 0),R(this,"activeSubMenuRef",void 0),R(this,"subMenuTimer",void 0),R(this,"rAF",void 0),R(this,"initialPosition",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=W.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=W.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:n}=this.props,{activeSubMenu:i}=this.state;if(i!==t.activeSubMenu)if(i==null){var o;(o=this.container.current)===null||o===void 0||o.focus()}else this.setActiveSubMenuPosition();if(e.actions!==n&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var s;(s=this.container.current)===null||s===void 0||s.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:n}=this.props,i=L.getMenuItems(n),o=[],s=i.length-1;s>=0;s-=1){var a=i[s];a instanceof Promise?this.initMenuPromise(a):o.push(a)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:L.sortActions(o)})}initMenuPromise(e){var t=B.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(i=>{var o=i.pendingItems.indexOf(t);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{menuItems:L.sortActions(i.menuItems.concat(n)),pendingItems:s}}return null})},n=>{B.isCanceled(n)||(this.setState(i=>{var o=i.pendingItems.indexOf(t);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{pendingItems:s}}return null}),Ce.error(n))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,n,i,{options:o,updatePosition:s,subMenuParentWidth:a,subMenuParentHeight:u,top:l,left:b}=this.props;if(!(!this.container.current||o.doNotVerifyPosition!=null&&o.doNotVerifyPosition)){var{top:f,left:g}=this.initialPosition,{width:y,height:m}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},M=((n=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&n!==void 0?n:0)>window.innerHeight;m===0||y===0||(f+m>window.innerHeight&&(f-m-u>0?f-=m-u:f=window.innerHeight-m),g+y>window.innerWidth&&(g=g-y-a),(b!==g||l!==f)&&(this.setState({hasOverflow:M}),s(f,g)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Ce.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,n=!1;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),i=n,o=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?o=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=L.getNextMenuItem(i,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(i=L.getNextMenuItem(i,1,t)),o){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:n}=this.state,i=t[e].actions?e:null;n!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();var{menuItems:n}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:n}=this.props,{activeSubMenu:i,hasOverflow:o,keyboardIndex:s,menuItems:a,mouseIndex:u,pendingItems:l,subMenuTop:b,subMenuLeft:f,subMenuParentWidth:g,subMenuParentHeight:y}=this.state,m=0;m<a.length;m+=1){var M=a[m];m>0&&M.group!==a[m-1].group&&e.push(d.jsx("hr",{},"".concat(m,".separator")));var p=d.jsx(Pt,{ref:i===m?this.activeSubMenuRef:null,isKeyboardSelected:s===m,isMouseSelected:u===m,menuItem:M,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},m);e.push(p)}var S=null;l.length>0&&(S=d.jsx("div",{className:"loading",children:d.jsx(qt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:F,"data-testid":H}=this.props,E=i!==null&&b!==null&&f!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:A({"has-overflow":o},"context-menu-container"),style:ir({top:t,left:n},F),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:G.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":H,children:[e,S]}),E&&i!==null&&b!==null&&f!==null&&d.jsx(G,{actions:a[i].actions||[],closeMenu:this.handleCloseSubMenu,top:b,left:f,updatePosition:(O,_)=>{this.setState({subMenuTop:O,subMenuLeft:_})},subMenuParentWidth:g,subMenuParentHeight:y},"sub-".concat(i))]})}}R(G,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const sr=G;function De(r,e,t){return e=ur(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ur(r){var e=lr(r,"string");return typeof e=="symbol"?e:String(e)}function lr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cr extends c.Component{constructor(e){super(e),De(this,"container",void 0),De(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=W.createRef(),this.openMenu=W.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),n=e.clientY-t.top,i=e.clientX-t.left,{actions:o}=this.state;if(o!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var a=document.elementFromPoint(i,n),u=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});a?.dispatchEvent(u)});return}if(L.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var s=L.getMenuItems(e.contextActions);s.length!==0&&(e.preventDefault(),this.setState({actions:s,top:n,left:i}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:n,top:i,left:o}=this.state;return n&&(e=d.jsx(sr,{ref:this.openMenu,actions:n,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(s,a)=>{this.setState({top:s,left:a})},"data-testid":t})),d.jsx("div",{className:A("context-menu-root",{active:n}),ref:this.container,children:e})}}const $n=cr;function Qe(r,e,t){return e=dr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dr(r){var e=fr(r,"string");return typeof e=="symbol"?e:String(e)}function fr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class T extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(T.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(T.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){var i=t.querySelector("input, select, textarea");i?.focus()}}render(){var{children:e,className:t,in:n,"data-testid":i}=this.props;return d.jsx(ht,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:T.handleEnter,onEntering:T.handleEntering,onEntered:this.handleEntered,onExit:T.handleExit,onExiting:T.handleExiting,timeout:350,children:o=>d.jsx("div",{className:A({collapse:o==="exited"},t),"data-testid":i,children:e})})}}Qe(T,"propTypes",{className:U.string,in:U.bool.isRequired,children:U.node.isRequired,autoFocusOnShow:U.bool,"data-testid":U.string});Qe(T,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Fn=T;function Te(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function te(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Te(Object(t),!0).forEach(function(n){hr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Te(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function hr(r,e,t){return e=vr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function vr(r){var e=pr(r,"string");return typeof e=="symbol"?e:String(e)}function pr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ve=c.memo(r=>{var{tab:e,onClose:t,onSelect:n,isActive:i,activeRef:o,index:s,isDraggable:a,contextActions:u}=r,{key:l,isClosable:b=t!=null,title:f,icon:g}=e,y;return g!=null&&(y=W.isValidElement(g)?g:d.jsx(ie,{icon:g})),d.jsx(vt,{draggableId:l,index:s,isDragDisabled:!a,children:(m,M)=>d.jsxs("div",{className:"context-menu-wrapper",ref:i?o:null,children:[d.jsxs("div",te(te(te({ref:m.innerRef},m.draggableProps),m.dragHandleProps),{},{className:A("btn btn-link btn-nav-tab",{active:i},{dragging:M.isDragging}),"data-testid":"btn-nav-tab-".concat(f),role:"tab",tabIndex:0,onAuxClick:p=>{b&&p.button===1&&p.buttons===0&&t?.(l)},onClick:p=>{if(b&&p.button===1&&p.buttons===0){t?.(l);return}p.button===0&&p.buttons===0&&(p.target.focus(),n(l))},onKeyPress:p=>{p.key==="Enter"&&n(l)},children:[y,f,b&&d.jsx(oe,{kind:"ghost",className:"btn-nav-tab-close",onClick:p=>{t?.(l),p.stopPropagation(),p.preventDefault()},icon:Yt,tooltip:"Close"})]})),d.jsx(St,{actions:u})]})},l)});Ve.displayName="NavTab";const mr=Ve;function _e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function je(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_e(Object(t),!0).forEach(function(n){gr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function gr(r,e,t){return e=br(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function br(r){var e=yr(r,"string");return typeof e=="symbol"?e:String(e)}function yr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var wr=500,Pr=.01,Sr=5e-4;function Re(r){return r.scrollLeft===0}function Ie(r){return r.scrollLeft+r.clientWidth===r.scrollWidth||r.scrollWidth===0}function Or(r,e,t){var{isClosable:n=!1,key:i}=r,o=[];if(n&&t!=null){o.push({title:"Close",order:10,group:20,action:()=>{t(i)}});for(var s=!0,a=e.length-1;a>0&&e[a].key!==r.key;a-=1)if(e[a].isClosable===!0){s=!1;break}o.push({title:"Close to the Right",order:20,group:20,action:()=>{for(var u=e.length-1;u>0&&e[u].key!==i;u-=1)e[u].isClosable===!0&&t(e[u].key)},disabled:s}),o.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(u=>{u.isClosable===!0&&t(u.key)})}})}return o}function Un(r){var{activeKey:e,tabs:t,onSelect:n,onReorder:i,onClose:o,makeContextActions:s}=r,a=c.useRef(),[u,l]=c.useState(!0),[b,f]=c.useState(!0),[g,y]=c.useState(!0),m=c.useCallback(()=>{a.current!=null&&(a.current.clientWidth<a.current.scrollWidth&&t.length>0?l(!0):l(!1),f(Re(a.current)),y(Ie(a.current)))},[t]);Je(a.current,m);var M=c.useCallback(h=>{xe.stopDragging(),h.destination&&i?.(h.source.index,h.destination.index)},[i]),p=c.useCallback(()=>{if(a.current!=null){var h=Re(a.current);h!==b&&f(h);var v=Ie(a.current);v!==g&&y(v)}},[b,g]),S=c.useRef({cancelClick:!1}),F=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=h.length-1;v>=0;v-=1){var w=h[v];if(w.offsetLeft<a.current.scrollLeft-5){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),H=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=0;v<h.length;v+=1){var w=h[v];if(w.offsetLeft+5>a.current.scrollLeft+a.current.offsetWidth){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),E=c.useCallback(function(h,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=arguments.length>3?arguments[3]:void 0,C=a.current;C!=null&&(S.current.cancelClick=!0,h==="left"?C.scrollLeft=v-w:h==="right"&&(C.scrollLeft=v+w),S.current.rAF=requestAnimationFrame(q=>{var me=P??q,ge=q-me,ee=Pr*ge+.5*Sr*ge**2;ee=Math.min(ee,C.scrollWidth),E(h,v,ee,me)}))},[]),O=c.useCallback(()=>{var{holdTimer:h,rAF:v}=S.current;h!=null&&(clearTimeout(h),S.current.holdTimer=void 0),v!=null&&(cancelAnimationFrame(v),S.current.rAF=void 0),window.removeEventListener("mouseup",O)},[]);c.useEffect(()=>()=>window.removeEventListener("mouseup",O),[O]);var _=c.useCallback(h=>{a.current!=null&&(S.current.holdTimer=window.setTimeout(E,wr,h,a.current.scrollLeft)),S.current.cancelClick=!1,window.addEventListener("mouseup",O)},[O,E]),ot=c.useCallback(()=>{_("left")},[_]),at=c.useCallback(()=>{_("right")},[_]);c.useEffect(function(){var v,w=P=>{P.stopPropagation(),P.preventDefault();var C=P.currentTarget,q=Math.abs(P.deltaY)>Math.abs(P.deltaX)?P.deltaY:P.deltaX;C.scrollLeft+=gt(q,-30,30)};return(v=a.current)===null||v===void 0||v.addEventListener("wheel",w),()=>{var P;(P=a.current)===null||P===void 0||P.removeEventListener("wheel",w)}},[]);var st=c.useMemo(()=>{var h=new Map;return t.forEach(v=>{var{key:w}=v,P=[()=>Or(v,t,o),()=>{var C;return(C=s?.(v))!==null&&C!==void 0?C:[]}];h.set(w,P)}),h},[s,t,o]),V=c.useRef(null),ut=t.find(h=>h.key===e),lt=t.map((h,v)=>{var{key:w}=h,P=h===ut;return d.jsx(mr,{tab:h,index:v,isActive:P,activeRef:V,onSelect:n,onClose:o,isDraggable:i!=null,contextActions:st.get(w)},w)});return c.useEffect(function(){V.current!=null&&V.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),d.jsxs("nav",{className:"nav-container",children:[u&&d.jsx(oe,{kind:"ghost",icon:d.jsx(ie,{icon:Zt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:F,onMouseDown:ot,disabled:b}),d.jsx(pt,{onDragStart:xe.startDragging,onDragEnd:M,children:d.jsx(mt,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(h,v)=>d.jsxs("div",je(je({ref:w=>{w!=null&&(a.current=w,h.innerRef(w))}},h.droppableProps),{},{className:A("nav nav-tabs",{dragging:v.draggingFromThisWith}),role:"tablist",onScroll:p,children:[lt,h.placeholder]}))})}),u&&d.jsx(oe,{kind:"ghost",icon:d.jsx(ie,{icon:Xt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:H,onMouseDown:at,disabled:g})]})}function xr(r,e){var t=Ot(),n=c.useMemo(()=>new t.CoreClient(r,e),[t,r,e]);return c.useEffect(()=>()=>{n.disconnect()},[n]),n}var et=c.createContext(null);function kn(r){var{serverUrl:e,options:t,children:n}=r,i=xr(e,t);return d.jsx(et.Provider,{value:i,children:n})}function Mr(){return J(et,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}function Le(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Er(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Le(o,n,i,s,a,"next",u)}function a(u){Le(o,n,i,s,a,"throw",u)}s(void 0)})}}var re=N.module("MessageUtils"),Kn="io.deephaven.message.LoginOptions.request",Cr="io.deephaven.message.SessionDetails.request",Bn="io.deephaven.broadcast",Dr="io.deephaven.broadcast.Login",Tr="io.deephaven.broadcast.Logout";function tt(r){var e=r;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Wn(r){return tt(r)&&r.message===Dr}function Gn(r){return tt(r)&&r.message===Tr}function _r(r){var e=r;return e!=null&&typeof e.id=="string"}function jr(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe(),t=arguments.length>2?arguments[2]:void 0;return{message:r,id:e,payload:t}}function zn(r,e){return{id:r,payload:e}}function Rr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Ir(r){return ae.apply(this,arguments)}function ae(){return ae=Er(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=Rr();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((n,i)=>{var o,s=fe(),a=u=>{var{data:l}=u;if(!_r(l)){re.debug("Ignoring non-deephaven response",l);return}if(re.debug("Received message",l),l?.id!==s){re.debug("Ignore message, id doesn't match",l);return}window.clearTimeout(o),window.removeEventListener("message",a),n(l.payload)};window.addEventListener("message",a),o=window.setTimeout(()=>{window.removeEventListener("message",a),i(new xt("Request timed out"))},e),t.postMessage(jr(r,s),"*")})}),ae.apply(this,arguments)}function Lr(r,e,t){return e=Ar(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ar(r){var e=Nr(r,"string");return typeof e=="symbol"?e:String(e)}function Nr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $r extends Error{constructor(){super(...arguments),Lr(this,"isNoConsolesError",!0)}}function Fr(r){return r.isNoConsolesError}function Ae(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Q(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ae(o,n,i,s,a,"next",u)}function a(u){Ae(o,n,i,s,a,"throw",u)}s(void 0)})}}var K=N.module("SessionUtils");function Ur(r,e,t){return se.apply(this,arguments)}function se(){return se=Q(function*(r,e,t){K.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new $r("No console types available");K.info("Available types:",n);var i=n[0];K.info("Starting session with type",i);var o=yield e.startSession(i),s={type:i,id:fe()};return K.info("Console session established",s),{session:o,config:s,connection:e,details:t,dh:r}}),se.apply(this,arguments)}function Hn(r,e,t){return K.info("createCoreClient",e),new r.CoreClient(e,t)}function kr(r){return r!=null&&typeof r=="object"}function Kr(){return ue.apply(this,arguments)}function ue(){return ue=Q(function*(){var r=yield Ir(Cr);if(!kr(r))throw new Error("Unexpected session details response: ".concat(r));return r}),ue.apply(this,arguments)}function qn(){return le.apply(this,arguments)}function le(){return le=Q(function*(){var r=new URLSearchParams(window.location.search);switch(r.get("authProvider")){case"parent":return Kr()}return{}}),le.apply(this,arguments)}function Yn(r,e,t){return ce.apply(this,arguments)}function ce(){return ce=Q(function*(r,e,t){var n;try{n=yield Ur(r,e,t)}catch(i){if(!Fr(i))throw i}return n}),ce.apply(this,arguments)}function Ne(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Br(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ne(Object(t),!0).forEach(function(n){Wr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wr(r,e,t){return e=Gr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gr(r){var e=zr(r,"string");return typeof e=="symbol"?e:String(e)}function zr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Hr=100,ne=()=>{},qr=Object.freeze({});function Yr(r){var{id:e="default",children:t,emptyDashboard:n,layoutConfig:i,layoutSettings:o=qr,onLayoutConfigChange:s=ne,onGoldenLayoutChange:a=ne,onLayoutInitialized:u=ne,fallbackComponent:l=jt,hydrate:b,dehydrate:f,panelWrapper:g}=r,y=c.useRef(null),[m,M]=c.useState(!1),[p,S]=c.useState();c.useEffect(function(){if(!y.current){S(void 0);return}var E=Br({},Mt.makeDefaultLayout());E.settings===void 0&&(E.settings={}),Object.assign(E.settings,o),E.content=[];var O=new Et(E,y.current),_=()=>{O.off("initialised",_),M(!0)};return O.on("initialised",_),l!=null&&O.setFallbackComponent(l),O.init(),S(O),a(O),()=>{O.destroy()}},[o,l,a,M,S]);var F=c.useMemo(()=>Xe(()=>{p!=null&&p.isInitialised&&p?.updateSize()},Hr),[p]);return Je(y.current,F),d.jsxs("div",{className:"dashboard-container w-100 h-100",children:[d.jsx("div",{className:"w-100 h-100",ref:y}),m&&p&&d.jsx(Ct.Provider,{value:p,children:d.jsx(Dt.Provider,{value:e,children:d.jsx(Tt,{children:d.jsx(_t,{emptyDashboard:n,id:e,layout:p,layoutConfig:i,onLayoutChange:s,onLayoutInitialized:u,hydrate:b,dehydrate:f,panelWrapper:g,children:t})})})})]})}var ve="CREATE_DASHBOARD";function Zr(r,e){try{r.off(ve,e)}catch{}}function Zn(r,e){return r.on(ve,e),()=>Zr(r,e)}function Xn(r,e){r.emit(ve,e)}var Xr=["id","isActive","plugins"];function $e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Fe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$e(Object(t),!0).forEach(function(n){Jr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Jr(r,e,t){return e=Qr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qr(r){var e=Vr(r,"string");return typeof e=="symbol"?e:String(e)}function Vr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function en(r,e){if(r==null)return{};var t=tn(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function tn(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function rn(r){var{id:e,isActive:t,plugins:n}=r,i=en(r,Xr),[o,s]=c.useState(t),a=bt(),u=c.useCallback(l=>{a(e===Rt?It({layoutConfig:l}):Lt(e,{layoutConfig:l}))},[e,a]);return!o&&t&&s(!0),o?d.jsx(Yr,Fe(Fe({id:e,onLayoutConfigChange:u},i),{},{children:n})):d.jsx(he,{})}function nn(r){var e=[...r.entries()].filter(t=>{var[,n]=t;return At(n)||be(n)});return e.map(t=>{var[n,i]=t;if(be(i)){var{DashboardPlugin:o}=i;return d.jsx(o,{},n)}var{component:s}=i;return d.jsx(s,{},n)})}function Jn(){var r=Nt(),e=c.useMemo(()=>nn(r),[r]);return e}var Qn=c.createContext({}),Vn=c.createContext({}),on=c.createContext(null),an=c.createContext(null);function Ue(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function sn(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ue(o,n,i,s,a,"next",u)}function a(u){Ue(o,n,i,s,a,"throw",u)}s(void 0)})}}var rt=c.createContext(null);function ei(r){var{children:e}=r,t=Mr(),[n,i]=c.useState(),[o,s]=c.useState();c.useEffect(function(){var l=!1;function b(){return f.apply(this,arguments)}function f(){return f=sn(function*(){try{var g=yield t.getServerConfigValues();l||i(new Map(g))}catch(y){l||s(y)}}),f.apply(this,arguments)}return b(),()=>{l=!0}},[t]);var a=n==null;return a||o!=null?d.jsx(he,{isLoading:a&&o==null,errorMessage:$t(o)}):d.jsx(rt.Provider,{value:n,children:e})}function ti(){return J(rt,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function ke(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function un(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){ke(o,n,i,s,a,"next",u)}function a(u){ke(o,n,i,s,a,"throw",u)}s(void 0)})}}function Ke(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Be(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ke(Object(t),!0).forEach(function(n){ln(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ke(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ln(r,e,t){return e=cn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function cn(r){var e=dn(r,"string");return typeof e=="symbol"?e:String(e)}function dn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ri(r){var{dashboards:e,activeDashboard:t,onLayoutInitialized:n,onGoldenLayoutChange:i,plugins:o,emptyDashboard:s=d.jsx(he,{})}=r,a=Ft(),u=c.useCallback((l,b)=>{var{metadata:f}=l;try{if(f!=null){var g=Ut(f);return Be(Be({fetch:function(){var y=un(function*(){return a(g)});function m(){return y.apply(this,arguments)}return m}()},l),{},{localDashboardId:b})}}catch{}return kt.hydrate(l,b)},[a]);return d.jsx("div",{className:"tab-content",children:e.map(l=>d.jsx("div",{className:A("tab-pane",{active:l.id===t}),children:d.jsx(rn,{id:l.id,isActive:l.id===t,emptyDashboard:s,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:n,onGoldenLayoutChange:i,hydrate:u,plugins:o},l.key)},l.id))})}function ni(){return J(an,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function ii(){return J(on,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}function We(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function fn(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){We(o,n,i,s,a,"next",u)}function a(u){We(o,n,i,s,a,"throw",u)}s(void 0)})}}function D(r,e,t){return e=hn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hn(r){var e=vn(r,"string");return typeof e=="symbol"?e:String(e)}function vn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var k=N.module("GrpcFileStorageTable");class z{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;D(this,"storageService",void 0),D(this,"baseRoot",void 0),D(this,"root",void 0),D(this,"currentSize",0),D(this,"currentViewport",void 0),D(this,"listeners",[]),D(this,"viewportUpdatePromise",void 0),D(this,"currentViewportData",void 0),D(this,"childTables",new Map),this.storageService=e,this.baseRoot=t,this.root=n,n===t&&(this.doRefresh=yt(this.doRefresh.bind(this),z.REFRESH_DEBOUNCE))}removeBaseRoot(e){return I.removeRoot(this.baseRoot,e)}getViewportData(){var e;return this.viewportUpdatePromise||this.refreshInternal(),(e=this.viewportUpdatePromise)!==null&&e!==void 0?e:Promise.resolve({items:[],offset:0})}getSnapshot(e){throw new Error("Method not implemented.")}get size(){return this.currentSize}setExpanded(e,t){var n=e.split("/"),i=n.shift();if((i===void 0||i==="")&&(i=n.shift()),i===void 0||i==="")throw new Error("Invalid path: ".concat(e));var o=n.join("/");if(t){if(!this.childTables.has(i)){var s=new z(this.storageService,this.baseRoot,"".concat(this.root,"/").concat(i));this.childTables.set(i,s)}if(o){var a=this.childTables.get(i);a?.setExpanded(o,t)}}else if(this.childTables.has(i))if(o){var u=this.childTables.get(i);u?.setExpanded(o,t)}else this.childTables.delete(i);this.currentViewport&&this.refreshInternal()}collapseAll(){this.childTables.clear(),this.currentViewport&&this.refreshInternal()}setSearch(e){throw new Error("Method not implemented.")}setViewport(e){this.currentViewport=e,this.refreshInternal()}setFilters(){throw new Error("Method not implemented.")}setSorts(){throw new Error("Method not implemented.")}setReversed(){throw new Error("Method not implemented.")}close(){this.listeners=[]}onUpdate(e){return this.listeners=[...this.listeners,e],()=>{this.listeners=this.listeners.filter(t=>t!==e)}}doRefresh(e){k.debug2("doRefresh",this.root),e(this.fetchData())}refresh(){var e;k.debug2("refresh",this.root),(e=this.viewportUpdatePromise)===null||e===void 0||e.cancel();var t=new Promise(i=>{this.doRefresh(i)}),n=B.makeCancelable(t.then(i=>{if(this.viewportUpdatePromise!==n)throw new Kt;return this.currentViewportData=i,this.sendUpdate(),i}));n.catch(i=>{B.isCanceled(i)||k.error("Error updating viewport",i)}),this.viewportUpdatePromise=n}refreshInternal(){try{this.refresh()}catch(e){B.isCanceled(e)||k.error("Unable to refresh data",e)}}fetchData(){var e=this;return fn(function*(){var{currentViewport:t}=e;if(!t)throw new Error("No viewport set");for(var n=yield e.storageService.listItems(e.root),i=n.map(f=>({type:f.type,filename:e.removeBaseRoot(f.filename),basename:f.basename,id:e.removeBaseRoot(f.filename),isExpanded:f.type==="directory"?e.childTables.has(f.basename):void 0})).sort((f,g)=>f.type!==g.type?f.type==="directory"?-1:1:f.basename.localeCompare(g.basename)),o=0;o<i.length;o+=1){var s=i[o],{basename:a,filename:u}=s;if(u===e.removeBaseRoot("".concat(e.root,"/").concat(a))&&s.type==="directory"){var l=e.childTables.get(a);if(l!=null){l.setViewport({top:0,bottom:t.bottom-o});var b=yield l.getViewportData();i.splice(o+1,0,...b.items)}}}return e.currentSize=i.length,k.debug2(e.root,"items",i,t),i=i.slice(t.top,t.bottom),{items:i,offset:t.top}})()}sendUpdate(){for(var e,{listeners:t}=this,n=(e=this.currentViewportData)!==null&&e!==void 0?e:{items:[],offset:0},i=0;i<t.length;i+=1)t[i](n)}}D(z,"REFRESH_DEBOUNCE",50);function Ge(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function j(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ge(o,n,i,s,a,"next",u)}function a(u){Ge(o,n,i,s,a,"throw",u)}s(void 0)})}}function $(r,e,t){return e=pn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pn(r){var e=mn(r,"string");return typeof e=="symbol"?e:String(e)}function mn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var gn=N.module("GrpcFileStorage");class pe{constructor(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";$(this,"dh",void 0),$(this,"storageService",void 0),$(this,"tables",[]),$(this,"root",void 0),$(this,"refreshTables",Xe(()=>{this.tables.forEach(i=>i.refresh())},pe.REFRESH_THROTTLE)),this.dh=e,this.storageService=t,this.root=n}removeRoot(e){return I.removeRoot(this.root,e)}addRoot(e){return I.addRoot(this.root,e)}createDirectory(e){var t=this;return j(function*(){return yield t.storageService.createDirectory(t.addRoot(e)),t.refreshTables(),{type:"directory",id:e,filename:e,basename:I.getBaseName(e)}})()}getTable(){var e=this;return j(function*(){var t=new z(e.storageService,e.root);return e.tables.push(t),t})()}saveFile(e){var t=this;return j(function*(){var n=t.dh.storage.FileContents.text(e.content);return yield t.storageService.saveFile(t.addRoot(e.filename),n,!0),t.refreshTables(),e})()}loadFile(e){var t=this;return j(function*(){var n=yield t.storageService.loadFile(t.addRoot(e)),i=yield n.text();return{filename:e,basename:I.getBaseName(e),content:i}})()}copyFile(e,t){var n=this;return j(function*(){var i=yield n.storageService.loadFile(n.addRoot(e));yield n.storageService.saveFile(n.addRoot(t),i,!1),n.refreshTables()})()}deleteFile(e){var t=this;return j(function*(){yield t.storageService.deleteItem(t.addRoot(e)),t.refreshTables()})()}moveFile(e,t){var n=this;return j(function*(){yield n.storageService.moveItem(n.addRoot(e),n.addRoot(t)),n.refreshTables()})()}info(e){var t=this;return j(function*(){var n=yield t.storageService.listItems(t.addRoot(I.getPath(e)),I.getBaseName(e));if(n.length===0)throw new Bt;if(n.length>1)throw gn.error("More than one matching file found, should never happen.",n),new Error("More than one matching file found");var i=n[0];if(!Wt(i.type))throw new Error("Unexpected file type: ".concat(i.type));return{filename:t.removeRoot(i.filename),basename:i.basename,id:t.removeRoot(i.filename),type:i.type}})()}}$(pe,"REFRESH_THROTTLE",150);function ze(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function He(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){ze(o,n,i,s,a,"next",u)}function a(u){ze(o,n,i,s,a,"throw",u)}s(void 0)})}}function qe(r,e,t){return e=bn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bn(r){var e=yn(r,"string");return typeof e=="symbol"?e:String(e)}function yn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class oi{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";qe(this,"storageService",void 0),qe(this,"root",void 0),this.storageService=e,this.root=t}getLayouts(){var e=this;return He(function*(){var t=yield e.storageService.listItems(e.root,"*.json");return t.map(n=>n.basename)})()}getLayout(e){var t=this;return He(function*(){var n=yield t.storageService.loadFile("".concat(t.root,"/").concat(e)),i=yield n.text();return JSON.parse(i)})()}}function wn(r){return r.version===2}function Pn(r){return Array.isArray(r)}function Ye(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Sn(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ye(o,n,i,s,a,"next",u)}function a(u){Ye(o,n,i,s,a,"throw",u)}s(void 0)})}}var Z=N.module("UserLayoutUtils"),On={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:ye.COMPONENT,title:ye.TITLE,isClosable:!1},{type:"react-component",component:we.COMPONENT,title:we.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:Pe.COMPONENT,title:Pe.TITLE,isClosable:!1},{type:"react-component",component:Se.COMPONENT,title:Se.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},xn={layoutConfig:[],links:[],filterSets:[],version:2};function nt(r){if(wn(r))return r;if(Pn(r)){var e=r;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(r))}function Mn(r){return de.apply(this,arguments)}function de(){return de=Sn(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;try{var t=yield r.getLayouts();if(t.length>0)try{var n=yield r.getLayout(t[0]);return nt(n)}catch(i){Z.error("Unable to load layout",t[0],":",i),Z.warn("No valid layouts found, falling back to default layout")}}catch(i){Z.error("Unable to fetch layout list",i),Z.warn("Falling back to default layout")}return e?On:xn}),de.apply(this,arguments)}function En(r){var{filterSets:e,layoutConfig:t,links:n,pluginDataMap:i}=r,o={filterSets:e,layoutConfig:t,links:n,pluginDataMap:i,version:2};return o}const Cn={exportLayout:En,getDefaultLayout:Mn,normalizeLayout:nt};function Ze(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function X(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ze(o,n,i,s,a,"next",u)}function a(u){Ze(o,n,i,s,a,"throw",u)}s(void 0)})}}function it(r,e,t){return e=Dn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dn(r){var e=Tn(r,"string");return typeof e=="symbol"?e:String(e)}function Tn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _n=N.module("LocalWorkspaceStorage");class x{static getBooleanServerConfig(e,t){var n,i;if((e==null||(n=e.get(t))===null||n===void 0?void 0:n.toLowerCase())==="true")return!0;if((e==null||(i=e.get(t))===null||i===void 0?void 0:i.toLowerCase())==="false")return!1}static makeDefaultWorkspaceSettings(e){for(var t={defaultDateTimeFormat:Oe.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:Oe.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:Gt.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:zt.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0,gridDensity:"regular"},n={defaultDateTimeFormat:e?.get("dateTimeFormat"),formatter:[],timeZone:e?.get("timeZone"),showTimeZone:x.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:x.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:x.getBooleanServerConfig(e,"disableMoveConfirmation"),defaultDecimalFormatOptions:e?.get("decimalFormat")!==void 0?{defaultFormatString:e?.get("decimalFormat")}:void 0,defaultIntegerFormatOptions:e?.get("integerFormat")!==void 0?{defaultFormatString:e?.get("integerFormat")}:void 0,truncateNumbersWithPound:x.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:x.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:x.getBooleanServerConfig(e,"showNullStrings"),defaultNotebookSettings:e?.get("isMinimapEnabled")!==void 0?{isMinimapEnabled:x.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:x.getBooleanServerConfig(e,"web.webgl"),webglEditable:x.getBooleanServerConfig(e,"web.webgl.editable")},i=Object.keys(n),o=0;o<i.length;o+=1){var s=i[o];n[s]!==void 0&&(t[s]=n[s])}return t}static makeWorkspaceData(e,t){return X(function*(){var{filterSets:n,links:i,layoutConfig:o,pluginDataMap:s={}}=yield Cn.getDefaultLayout(e,t?.isConsoleAvailable);return{settings:{},layoutConfig:o,closed:[{}],links:i,filterSets:n,pluginDataMap:s}})()}static makeDefaultWorkspace(e,t){return X(function*(){return{data:yield x.makeWorkspaceData(e,t)}})()}constructor(e){it(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var t=this;return X(function*(){try{var n,i=JSON.parse((n=localStorage.getItem(x.STORAGE_KEY))!==null&&n!==void 0?n:"");return i}catch{return _n.info("Unable to load workspace data, initializing to default data"),x.makeDefaultWorkspace(t.layoutStorage,e)}})()}save(e){return X(function*(){return localStorage.setItem(x.STORAGE_KEY,JSON.stringify(e)),e})()}}it(x,"STORAGE_KEY","deephaven.WorkspaceStorage");export{On as $,ri as A,Bn as B,Fn as C,Fr as D,_r as E,zn as F,oi as G,nr as H,Ir as I,Yr as J,ve as K,Nn as L,rn as M,Un as N,Xn as O,Jn as P,Vn as Q,on as R,Cr as S,An as T,Cn as U,Qn as V,an as W,ei as X,z as Y,wn as Z,Pn as _,Tr as a,xn as a0,nt as a1,Mn as a2,En as a3,$n as b,ni as c,ti as d,ii as e,qn as f,nn as g,Yn as h,pe as i,x as j,Je as k,Zn as l,jr as m,kn as n,et as o,Dr as p,Kn as q,$r as r,Zr as s,Hn as t,Mr as u,Ur as v,Rr as w,Wn as x,Gn as y,tt as z};
2
- //# sourceMappingURL=LocalWorkspaceStorage-1a4c6924.js.map
1
+ import{r as c,J as d,bu as ct,a9 as dt,M as A,ay as ft,V as W,L as ht,a3 as U,bv as vt,N as ie,bw as pt,bx as mt,av as gt,I as fe,by as Xe,a5 as bt,a1 as yt}from"./vendor-3e5e4180.js";import{E as wt,t as L,P as B,aI as Pt,aH as oe,ai as St,u as Ot,az as J,aY as xt,bM as Mt,ct as Et,bU as Ct,bR as Dt,cu as Tt,bS as _t,cv as jt,a8 as Rt,Y as It,X as Lt,ci as At,ck as be,ak as Nt,cr as $t,aX as Ft,aW as Ut,a5 as kt,cw as I,cs as Kt,cx as Bt,cy as Wt,cz as ye,cA as we,cB as Pe,cC as Se,b as Oe,a as Gt,I as zt}from"./ControlType-fdebc440.js";import{t as Ht,k as xe}from"./IrisGridShortcuts-b43fa62c.js";import{L as N,U as qt,j as Yt,ak as Zt,al as Xt,J as he}from"./index-3dbc80f4.js";function Je(r,e){c.useEffect(()=>{if(r!=null){var t=new window.ResizeObserver(e);return t.observe(r),()=>{r!=null&&t.unobserve(r)}}},[r,e])}function An(){var{selectedThemeKey:r,setSelectedThemeKey:e,themes:t}=wt(),n=c.useCallback(i=>{e(i)},[e]);return d.jsx(ct,{label:"Pick a color scheme",items:t,selectedKey:r,onSelectionChange:n,children:i=>d.jsx(dt,{children:i.name},i.themeKey)})}function Nn(r){var{className:e,style:t}=r;return d.jsx("div",{className:A("dh-logo",e),style:t})}var Jt=["color","UNSAFE_style"];function Me(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Y(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Me(Object(t),!0).forEach(function(n){Qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Qt(r,e,t){return e=Vt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Vt(r){var e=er(r,"string");return typeof e=="symbol"?e:String(e)}function er(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function tr(r,e){if(r==null)return{};var t=rr(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function rr(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var nr=c.forwardRef((r,e)=>{var{color:t,UNSAFE_style:n}=r,i=tr(r,Jt),o=c.useMemo(()=>Y(Y({},n),{},{color:Ht(t)}),[t,n]);return d.jsx(ft,Y(Y({},i),{},{ref:e,UNSAFE_style:o}))});nr.displayName="Heading";function Ee(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ir(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ee(Object(t),!0).forEach(function(n){R(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function R(r,e,t){return e=or(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function or(r){var e=ar(r,"string");return typeof e=="symbol"?e:String(e)}function ar(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ce=N.module("ContextMenu");class G extends c.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),R(this,"container",void 0),R(this,"oldFocus",void 0),R(this,"activeSubMenuRef",void 0),R(this,"subMenuTimer",void 0),R(this,"rAF",void 0),R(this,"initialPosition",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=W.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=W.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:n}=this.props,{activeSubMenu:i}=this.state;if(i!==t.activeSubMenu)if(i==null){var o;(o=this.container.current)===null||o===void 0||o.focus()}else this.setActiveSubMenuPosition();if(e.actions!==n&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var s;(s=this.container.current)===null||s===void 0||s.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:n}=this.props,i=L.getMenuItems(n),o=[],s=i.length-1;s>=0;s-=1){var a=i[s];a instanceof Promise?this.initMenuPromise(a):o.push(a)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:L.sortActions(o)})}initMenuPromise(e){var t=B.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(i=>{var o=i.pendingItems.indexOf(t);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{menuItems:L.sortActions(i.menuItems.concat(n)),pendingItems:s}}return null})},n=>{B.isCanceled(n)||(this.setState(i=>{var o=i.pendingItems.indexOf(t);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{pendingItems:s}}return null}),Ce.error(n))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,n,i,{options:o,updatePosition:s,subMenuParentWidth:a,subMenuParentHeight:u,top:l,left:b}=this.props;if(!(!this.container.current||o.doNotVerifyPosition!=null&&o.doNotVerifyPosition)){var{top:f,left:g}=this.initialPosition,{width:y,height:m}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},M=((n=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&n!==void 0?n:0)>window.innerHeight;m===0||y===0||(f+m>window.innerHeight&&(f-m-u>0?f-=m-u:f=window.innerHeight-m),g+y>window.innerWidth&&(g=g-y-a),(b!==g||l!==f)&&(this.setState({hasOverflow:M}),s(f,g)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Ce.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,n=!1;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),i=n,o=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?o=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=L.getNextMenuItem(i,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(i=L.getNextMenuItem(i,1,t)),o){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:n}=this.state,i=t[e].actions?e:null;n!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();var{menuItems:n}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:n}=this.props,{activeSubMenu:i,hasOverflow:o,keyboardIndex:s,menuItems:a,mouseIndex:u,pendingItems:l,subMenuTop:b,subMenuLeft:f,subMenuParentWidth:g,subMenuParentHeight:y}=this.state,m=0;m<a.length;m+=1){var M=a[m];m>0&&M.group!==a[m-1].group&&e.push(d.jsx("hr",{},"".concat(m,".separator")));var p=d.jsx(Pt,{ref:i===m?this.activeSubMenuRef:null,isKeyboardSelected:s===m,isMouseSelected:u===m,menuItem:M,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},m);e.push(p)}var S=null;l.length>0&&(S=d.jsx("div",{className:"loading",children:d.jsx(qt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:F,"data-testid":H}=this.props,E=i!==null&&b!==null&&f!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:A({"has-overflow":o},"context-menu-container"),style:ir({top:t,left:n},F),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:G.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":H,children:[e,S]}),E&&i!==null&&b!==null&&f!==null&&d.jsx(G,{actions:a[i].actions||[],closeMenu:this.handleCloseSubMenu,top:b,left:f,updatePosition:(O,_)=>{this.setState({subMenuTop:O,subMenuLeft:_})},subMenuParentWidth:g,subMenuParentHeight:y},"sub-".concat(i))]})}}R(G,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const sr=G;function De(r,e,t){return e=ur(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ur(r){var e=lr(r,"string");return typeof e=="symbol"?e:String(e)}function lr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cr extends c.Component{constructor(e){super(e),De(this,"container",void 0),De(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=W.createRef(),this.openMenu=W.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),n=e.clientY-t.top,i=e.clientX-t.left,{actions:o}=this.state;if(o!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var a=document.elementFromPoint(i,n),u=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});a?.dispatchEvent(u)});return}if(L.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var s=L.getMenuItems(e.contextActions);s.length!==0&&(e.preventDefault(),this.setState({actions:s,top:n,left:i}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:n,top:i,left:o}=this.state;return n&&(e=d.jsx(sr,{ref:this.openMenu,actions:n,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(s,a)=>{this.setState({top:s,left:a})},"data-testid":t})),d.jsx("div",{className:A("context-menu-root",{active:n}),ref:this.container,children:e})}}const $n=cr;function Qe(r,e,t){return e=dr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dr(r){var e=fr(r,"string");return typeof e=="symbol"?e:String(e)}function fr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class T extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(T.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(T.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){var i=t.querySelector("input, select, textarea");i?.focus()}}render(){var{children:e,className:t,in:n,"data-testid":i}=this.props;return d.jsx(ht,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:T.handleEnter,onEntering:T.handleEntering,onEntered:this.handleEntered,onExit:T.handleExit,onExiting:T.handleExiting,timeout:350,children:o=>d.jsx("div",{className:A({collapse:o==="exited"},t),"data-testid":i,children:e})})}}Qe(T,"propTypes",{className:U.string,in:U.bool.isRequired,children:U.node.isRequired,autoFocusOnShow:U.bool,"data-testid":U.string});Qe(T,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Fn=T;function Te(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function te(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Te(Object(t),!0).forEach(function(n){hr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Te(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function hr(r,e,t){return e=vr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function vr(r){var e=pr(r,"string");return typeof e=="symbol"?e:String(e)}function pr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ve=c.memo(r=>{var{tab:e,onClose:t,onSelect:n,isActive:i,activeRef:o,index:s,isDraggable:a,contextActions:u}=r,{key:l,isClosable:b=t!=null,title:f,icon:g}=e,y;return g!=null&&(y=W.isValidElement(g)?g:d.jsx(ie,{icon:g})),d.jsx(vt,{draggableId:l,index:s,isDragDisabled:!a,children:(m,M)=>d.jsxs("div",{className:"context-menu-wrapper",ref:i?o:null,children:[d.jsxs("div",te(te(te({ref:m.innerRef},m.draggableProps),m.dragHandleProps),{},{className:A("btn btn-link btn-nav-tab",{active:i},{dragging:M.isDragging}),"data-testid":"btn-nav-tab-".concat(f),role:"tab",tabIndex:0,onAuxClick:p=>{b&&p.button===1&&p.buttons===0&&t?.(l)},onClick:p=>{if(b&&p.button===1&&p.buttons===0){t?.(l);return}p.button===0&&p.buttons===0&&(p.target.focus(),n(l))},onKeyPress:p=>{p.key==="Enter"&&n(l)},children:[y,f,b&&d.jsx(oe,{kind:"ghost",className:"btn-nav-tab-close",onClick:p=>{t?.(l),p.stopPropagation(),p.preventDefault()},icon:Yt,tooltip:"Close"})]})),d.jsx(St,{actions:u})]})},l)});Ve.displayName="NavTab";const mr=Ve;function _e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function je(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_e(Object(t),!0).forEach(function(n){gr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function gr(r,e,t){return e=br(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function br(r){var e=yr(r,"string");return typeof e=="symbol"?e:String(e)}function yr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var wr=500,Pr=.01,Sr=5e-4;function Re(r){return r.scrollLeft===0}function Ie(r){return r.scrollLeft+r.clientWidth===r.scrollWidth||r.scrollWidth===0}function Or(r,e,t){var{isClosable:n=!1,key:i}=r,o=[];if(n&&t!=null){o.push({title:"Close",order:10,group:20,action:()=>{t(i)}});for(var s=!0,a=e.length-1;a>0&&e[a].key!==r.key;a-=1)if(e[a].isClosable===!0){s=!1;break}o.push({title:"Close to the Right",order:20,group:20,action:()=>{for(var u=e.length-1;u>0&&e[u].key!==i;u-=1)e[u].isClosable===!0&&t(e[u].key)},disabled:s}),o.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(u=>{u.isClosable===!0&&t(u.key)})}})}return o}function Un(r){var{activeKey:e,tabs:t,onSelect:n,onReorder:i,onClose:o,makeContextActions:s}=r,a=c.useRef(),[u,l]=c.useState(!0),[b,f]=c.useState(!0),[g,y]=c.useState(!0),m=c.useCallback(()=>{a.current!=null&&(a.current.clientWidth<a.current.scrollWidth&&t.length>0?l(!0):l(!1),f(Re(a.current)),y(Ie(a.current)))},[t]);Je(a.current,m);var M=c.useCallback(h=>{xe.stopDragging(),h.destination&&i?.(h.source.index,h.destination.index)},[i]),p=c.useCallback(()=>{if(a.current!=null){var h=Re(a.current);h!==b&&f(h);var v=Ie(a.current);v!==g&&y(v)}},[b,g]),S=c.useRef({cancelClick:!1}),F=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=h.length-1;v>=0;v-=1){var w=h[v];if(w.offsetLeft<a.current.scrollLeft-5){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),H=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=0;v<h.length;v+=1){var w=h[v];if(w.offsetLeft+5>a.current.scrollLeft+a.current.offsetWidth){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),E=c.useCallback(function(h,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=arguments.length>3?arguments[3]:void 0,C=a.current;C!=null&&(S.current.cancelClick=!0,h==="left"?C.scrollLeft=v-w:h==="right"&&(C.scrollLeft=v+w),S.current.rAF=requestAnimationFrame(q=>{var me=P??q,ge=q-me,ee=Pr*ge+.5*Sr*ge**2;ee=Math.min(ee,C.scrollWidth),E(h,v,ee,me)}))},[]),O=c.useCallback(()=>{var{holdTimer:h,rAF:v}=S.current;h!=null&&(clearTimeout(h),S.current.holdTimer=void 0),v!=null&&(cancelAnimationFrame(v),S.current.rAF=void 0),window.removeEventListener("mouseup",O)},[]);c.useEffect(()=>()=>window.removeEventListener("mouseup",O),[O]);var _=c.useCallback(h=>{a.current!=null&&(S.current.holdTimer=window.setTimeout(E,wr,h,a.current.scrollLeft)),S.current.cancelClick=!1,window.addEventListener("mouseup",O)},[O,E]),ot=c.useCallback(()=>{_("left")},[_]),at=c.useCallback(()=>{_("right")},[_]);c.useEffect(function(){var v,w=P=>{P.stopPropagation(),P.preventDefault();var C=P.currentTarget,q=Math.abs(P.deltaY)>Math.abs(P.deltaX)?P.deltaY:P.deltaX;C.scrollLeft+=gt(q,-30,30)};return(v=a.current)===null||v===void 0||v.addEventListener("wheel",w),()=>{var P;(P=a.current)===null||P===void 0||P.removeEventListener("wheel",w)}},[]);var st=c.useMemo(()=>{var h=new Map;return t.forEach(v=>{var{key:w}=v,P=[()=>Or(v,t,o),()=>{var C;return(C=s?.(v))!==null&&C!==void 0?C:[]}];h.set(w,P)}),h},[s,t,o]),V=c.useRef(null),ut=t.find(h=>h.key===e),lt=t.map((h,v)=>{var{key:w}=h,P=h===ut;return d.jsx(mr,{tab:h,index:v,isActive:P,activeRef:V,onSelect:n,onClose:o,isDraggable:i!=null,contextActions:st.get(w)},w)});return c.useEffect(function(){V.current!=null&&V.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),d.jsxs("nav",{className:"nav-container",children:[u&&d.jsx(oe,{kind:"ghost",icon:d.jsx(ie,{icon:Zt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:F,onMouseDown:ot,disabled:b}),d.jsx(pt,{onDragStart:xe.startDragging,onDragEnd:M,children:d.jsx(mt,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(h,v)=>d.jsxs("div",je(je({ref:w=>{w!=null&&(a.current=w,h.innerRef(w))}},h.droppableProps),{},{className:A("nav nav-tabs",{dragging:v.draggingFromThisWith}),role:"tablist",onScroll:p,children:[lt,h.placeholder]}))})}),u&&d.jsx(oe,{kind:"ghost",icon:d.jsx(ie,{icon:Xt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:H,onMouseDown:at,disabled:g})]})}function xr(r,e){var t=Ot(),n=c.useMemo(()=>new t.CoreClient(r,e),[t,r,e]);return c.useEffect(()=>()=>{n.disconnect()},[n]),n}var et=c.createContext(null);function kn(r){var{serverUrl:e,options:t,children:n}=r,i=xr(e,t);return d.jsx(et.Provider,{value:i,children:n})}function Mr(){return J(et,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}function Le(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Er(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Le(o,n,i,s,a,"next",u)}function a(u){Le(o,n,i,s,a,"throw",u)}s(void 0)})}}var re=N.module("MessageUtils"),Kn="io.deephaven.message.LoginOptions.request",Cr="io.deephaven.message.SessionDetails.request",Bn="io.deephaven.broadcast",Dr="io.deephaven.broadcast.Login",Tr="io.deephaven.broadcast.Logout";function tt(r){var e=r;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Wn(r){return tt(r)&&r.message===Dr}function Gn(r){return tt(r)&&r.message===Tr}function _r(r){var e=r;return e!=null&&typeof e.id=="string"}function jr(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe(),t=arguments.length>2?arguments[2]:void 0;return{message:r,id:e,payload:t}}function zn(r,e){return{id:r,payload:e}}function Rr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Ir(r){return ae.apply(this,arguments)}function ae(){return ae=Er(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=Rr();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((n,i)=>{var o,s=fe(),a=u=>{var{data:l}=u;if(!_r(l)){re.debug("Ignoring non-deephaven response",l);return}if(re.debug("Received message",l),l?.id!==s){re.debug("Ignore message, id doesn't match",l);return}window.clearTimeout(o),window.removeEventListener("message",a),n(l.payload)};window.addEventListener("message",a),o=window.setTimeout(()=>{window.removeEventListener("message",a),i(new xt("Request timed out"))},e),t.postMessage(jr(r,s),"*")})}),ae.apply(this,arguments)}function Lr(r,e,t){return e=Ar(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ar(r){var e=Nr(r,"string");return typeof e=="symbol"?e:String(e)}function Nr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $r extends Error{constructor(){super(...arguments),Lr(this,"isNoConsolesError",!0)}}function Fr(r){return r.isNoConsolesError}function Ae(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Q(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ae(o,n,i,s,a,"next",u)}function a(u){Ae(o,n,i,s,a,"throw",u)}s(void 0)})}}var K=N.module("SessionUtils");function Ur(r,e,t){return se.apply(this,arguments)}function se(){return se=Q(function*(r,e,t){K.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new $r("No console types available");K.info("Available types:",n);var i=n[0];K.info("Starting session with type",i);var o=yield e.startSession(i),s={type:i,id:fe()};return K.info("Console session established",s),{session:o,config:s,connection:e,details:t,dh:r}}),se.apply(this,arguments)}function Hn(r,e,t){return K.info("createCoreClient",e),new r.CoreClient(e,t)}function kr(r){return r!=null&&typeof r=="object"}function Kr(){return ue.apply(this,arguments)}function ue(){return ue=Q(function*(){var r=yield Ir(Cr);if(!kr(r))throw new Error("Unexpected session details response: ".concat(r));return r}),ue.apply(this,arguments)}function qn(){return le.apply(this,arguments)}function le(){return le=Q(function*(){var r=new URLSearchParams(window.location.search);switch(r.get("authProvider")){case"parent":return Kr()}return{}}),le.apply(this,arguments)}function Yn(r,e,t){return ce.apply(this,arguments)}function ce(){return ce=Q(function*(r,e,t){var n;try{n=yield Ur(r,e,t)}catch(i){if(!Fr(i))throw i}return n}),ce.apply(this,arguments)}function Ne(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Br(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ne(Object(t),!0).forEach(function(n){Wr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wr(r,e,t){return e=Gr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gr(r){var e=zr(r,"string");return typeof e=="symbol"?e:String(e)}function zr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Hr=100,ne=()=>{},qr=Object.freeze({});function Yr(r){var{id:e="default",children:t,emptyDashboard:n,layoutConfig:i,layoutSettings:o=qr,onLayoutConfigChange:s=ne,onGoldenLayoutChange:a=ne,onLayoutInitialized:u=ne,fallbackComponent:l=jt,hydrate:b,dehydrate:f,panelWrapper:g}=r,y=c.useRef(null),[m,M]=c.useState(!1),[p,S]=c.useState();c.useEffect(function(){if(!y.current){S(void 0);return}var E=Br({},Mt.makeDefaultLayout());E.settings===void 0&&(E.settings={}),Object.assign(E.settings,o),E.content=[];var O=new Et(E,y.current),_=()=>{O.off("initialised",_),M(!0)};return O.on("initialised",_),l!=null&&O.setFallbackComponent(l),O.init(),S(O),a(O),()=>{O.destroy()}},[o,l,a,M,S]);var F=c.useMemo(()=>Xe(()=>{p!=null&&p.isInitialised&&p?.updateSize()},Hr),[p]);return Je(y.current,F),d.jsxs("div",{className:"dashboard-container w-100 h-100",children:[d.jsx("div",{className:"w-100 h-100",ref:y}),m&&p&&d.jsx(Ct.Provider,{value:p,children:d.jsx(Dt.Provider,{value:e,children:d.jsx(Tt,{children:d.jsx(_t,{emptyDashboard:n,id:e,layout:p,layoutConfig:i,onLayoutChange:s,onLayoutInitialized:u,hydrate:b,dehydrate:f,panelWrapper:g,children:t})})})})]})}var ve="CREATE_DASHBOARD";function Zr(r,e){try{r.off(ve,e)}catch{}}function Zn(r,e){return r.on(ve,e),()=>Zr(r,e)}function Xn(r,e){r.emit(ve,e)}var Xr=["id","isActive","plugins"];function $e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Fe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$e(Object(t),!0).forEach(function(n){Jr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Jr(r,e,t){return e=Qr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qr(r){var e=Vr(r,"string");return typeof e=="symbol"?e:String(e)}function Vr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function en(r,e){if(r==null)return{};var t=tn(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function tn(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function rn(r){var{id:e,isActive:t,plugins:n}=r,i=en(r,Xr),[o,s]=c.useState(t),a=bt(),u=c.useCallback(l=>{a(e===Rt?It({layoutConfig:l}):Lt(e,{layoutConfig:l}))},[e,a]);return!o&&t&&s(!0),o?d.jsx(Yr,Fe(Fe({id:e,onLayoutConfigChange:u},i),{},{children:n})):d.jsx(he,{})}function nn(r){var e=[...r.entries()].filter(t=>{var[,n]=t;return At(n)||be(n)});return e.map(t=>{var[n,i]=t;if(be(i)){var{DashboardPlugin:o}=i;return d.jsx(o,{},n)}var{component:s}=i;return d.jsx(s,{},n)})}function Jn(){var r=Nt(),e=c.useMemo(()=>nn(r),[r]);return e}var Qn=c.createContext({}),Vn=c.createContext({}),on=c.createContext(null),an=c.createContext(null);function Ue(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function sn(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ue(o,n,i,s,a,"next",u)}function a(u){Ue(o,n,i,s,a,"throw",u)}s(void 0)})}}var rt=c.createContext(null);function ei(r){var{children:e}=r,t=Mr(),[n,i]=c.useState(),[o,s]=c.useState();c.useEffect(function(){var l=!1;function b(){return f.apply(this,arguments)}function f(){return f=sn(function*(){try{var g=yield t.getServerConfigValues();l||i(new Map(g))}catch(y){l||s(y)}}),f.apply(this,arguments)}return b(),()=>{l=!0}},[t]);var a=n==null;return a||o!=null?d.jsx(he,{isLoading:a&&o==null,errorMessage:$t(o)}):d.jsx(rt.Provider,{value:n,children:e})}function ti(){return J(rt,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function ke(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function un(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){ke(o,n,i,s,a,"next",u)}function a(u){ke(o,n,i,s,a,"throw",u)}s(void 0)})}}function Ke(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Be(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ke(Object(t),!0).forEach(function(n){ln(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ke(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ln(r,e,t){return e=cn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function cn(r){var e=dn(r,"string");return typeof e=="symbol"?e:String(e)}function dn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ri(r){var{dashboards:e,activeDashboard:t,onLayoutInitialized:n,onGoldenLayoutChange:i,plugins:o,emptyDashboard:s=d.jsx(he,{})}=r,a=Ft(),u=c.useCallback((l,b)=>{var{metadata:f}=l;try{if(f!=null){var g=Ut(f);return Be(Be({fetch:function(){var y=un(function*(){return a(g)});function m(){return y.apply(this,arguments)}return m}()},l),{},{localDashboardId:b})}}catch{}return kt.hydrate(l,b)},[a]);return d.jsx("div",{className:"tab-content",children:e.map(l=>d.jsx("div",{className:A("tab-pane",{active:l.id===t}),children:d.jsx(rn,{id:l.id,isActive:l.id===t,emptyDashboard:s,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:n,onGoldenLayoutChange:i,hydrate:u,plugins:o},l.key)},l.id))})}function ni(){return J(an,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function ii(){return J(on,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}function We(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function fn(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){We(o,n,i,s,a,"next",u)}function a(u){We(o,n,i,s,a,"throw",u)}s(void 0)})}}function D(r,e,t){return e=hn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hn(r){var e=vn(r,"string");return typeof e=="symbol"?e:String(e)}function vn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var k=N.module("GrpcFileStorageTable");class z{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;D(this,"storageService",void 0),D(this,"baseRoot",void 0),D(this,"root",void 0),D(this,"currentSize",0),D(this,"currentViewport",void 0),D(this,"listeners",[]),D(this,"viewportUpdatePromise",void 0),D(this,"currentViewportData",void 0),D(this,"childTables",new Map),this.storageService=e,this.baseRoot=t,this.root=n,n===t&&(this.doRefresh=yt(this.doRefresh.bind(this),z.REFRESH_DEBOUNCE))}removeBaseRoot(e){return I.removeRoot(this.baseRoot,e)}getViewportData(){var e;return this.viewportUpdatePromise||this.refreshInternal(),(e=this.viewportUpdatePromise)!==null&&e!==void 0?e:Promise.resolve({items:[],offset:0})}getSnapshot(e){throw new Error("Method not implemented.")}get size(){return this.currentSize}setExpanded(e,t){var n=e.split("/"),i=n.shift();if((i===void 0||i==="")&&(i=n.shift()),i===void 0||i==="")throw new Error("Invalid path: ".concat(e));var o=n.join("/");if(t){if(!this.childTables.has(i)){var s=new z(this.storageService,this.baseRoot,"".concat(this.root,"/").concat(i));this.childTables.set(i,s)}if(o){var a=this.childTables.get(i);a?.setExpanded(o,t)}}else if(this.childTables.has(i))if(o){var u=this.childTables.get(i);u?.setExpanded(o,t)}else this.childTables.delete(i);this.currentViewport&&this.refreshInternal()}collapseAll(){this.childTables.clear(),this.currentViewport&&this.refreshInternal()}setSearch(e){throw new Error("Method not implemented.")}setViewport(e){this.currentViewport=e,this.refreshInternal()}setFilters(){throw new Error("Method not implemented.")}setSorts(){throw new Error("Method not implemented.")}setReversed(){throw new Error("Method not implemented.")}close(){this.listeners=[]}onUpdate(e){return this.listeners=[...this.listeners,e],()=>{this.listeners=this.listeners.filter(t=>t!==e)}}doRefresh(e){k.debug2("doRefresh",this.root),e(this.fetchData())}refresh(){var e;k.debug2("refresh",this.root),(e=this.viewportUpdatePromise)===null||e===void 0||e.cancel();var t=new Promise(i=>{this.doRefresh(i)}),n=B.makeCancelable(t.then(i=>{if(this.viewportUpdatePromise!==n)throw new Kt;return this.currentViewportData=i,this.sendUpdate(),i}));n.catch(i=>{B.isCanceled(i)||k.error("Error updating viewport",i)}),this.viewportUpdatePromise=n}refreshInternal(){try{this.refresh()}catch(e){B.isCanceled(e)||k.error("Unable to refresh data",e)}}fetchData(){var e=this;return fn(function*(){var{currentViewport:t}=e;if(!t)throw new Error("No viewport set");for(var n=yield e.storageService.listItems(e.root),i=n.map(f=>({type:f.type,filename:e.removeBaseRoot(f.filename),basename:f.basename,id:e.removeBaseRoot(f.filename),isExpanded:f.type==="directory"?e.childTables.has(f.basename):void 0})).sort((f,g)=>f.type!==g.type?f.type==="directory"?-1:1:f.basename.localeCompare(g.basename)),o=0;o<i.length;o+=1){var s=i[o],{basename:a,filename:u}=s;if(u===e.removeBaseRoot("".concat(e.root,"/").concat(a))&&s.type==="directory"){var l=e.childTables.get(a);if(l!=null){l.setViewport({top:0,bottom:t.bottom-o});var b=yield l.getViewportData();i.splice(o+1,0,...b.items)}}}return e.currentSize=i.length,k.debug2(e.root,"items",i,t),i=i.slice(t.top,t.bottom),{items:i,offset:t.top}})()}sendUpdate(){for(var e,{listeners:t}=this,n=(e=this.currentViewportData)!==null&&e!==void 0?e:{items:[],offset:0},i=0;i<t.length;i+=1)t[i](n)}}D(z,"REFRESH_DEBOUNCE",50);function Ge(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function j(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ge(o,n,i,s,a,"next",u)}function a(u){Ge(o,n,i,s,a,"throw",u)}s(void 0)})}}function $(r,e,t){return e=pn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pn(r){var e=mn(r,"string");return typeof e=="symbol"?e:String(e)}function mn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var gn=N.module("GrpcFileStorage");class pe{constructor(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";$(this,"dh",void 0),$(this,"storageService",void 0),$(this,"tables",[]),$(this,"root",void 0),$(this,"refreshTables",Xe(()=>{this.tables.forEach(i=>i.refresh())},pe.REFRESH_THROTTLE)),this.dh=e,this.storageService=t,this.root=n}removeRoot(e){return I.removeRoot(this.root,e)}addRoot(e){return I.addRoot(this.root,e)}createDirectory(e){var t=this;return j(function*(){return yield t.storageService.createDirectory(t.addRoot(e)),t.refreshTables(),{type:"directory",id:e,filename:e,basename:I.getBaseName(e)}})()}getTable(){var e=this;return j(function*(){var t=new z(e.storageService,e.root);return e.tables.push(t),t})()}saveFile(e){var t=this;return j(function*(){var n=t.dh.storage.FileContents.text(e.content);return yield t.storageService.saveFile(t.addRoot(e.filename),n,!0),t.refreshTables(),e})()}loadFile(e){var t=this;return j(function*(){var n=yield t.storageService.loadFile(t.addRoot(e)),i=yield n.text();return{filename:e,basename:I.getBaseName(e),content:i}})()}copyFile(e,t){var n=this;return j(function*(){var i=yield n.storageService.loadFile(n.addRoot(e));yield n.storageService.saveFile(n.addRoot(t),i,!1),n.refreshTables()})()}deleteFile(e){var t=this;return j(function*(){yield t.storageService.deleteItem(t.addRoot(e)),t.refreshTables()})()}moveFile(e,t){var n=this;return j(function*(){yield n.storageService.moveItem(n.addRoot(e),n.addRoot(t)),n.refreshTables()})()}info(e){var t=this;return j(function*(){var n=yield t.storageService.listItems(t.addRoot(I.getPath(e)),I.getBaseName(e));if(n.length===0)throw new Bt;if(n.length>1)throw gn.error("More than one matching file found, should never happen.",n),new Error("More than one matching file found");var i=n[0];if(!Wt(i.type))throw new Error("Unexpected file type: ".concat(i.type));return{filename:t.removeRoot(i.filename),basename:i.basename,id:t.removeRoot(i.filename),type:i.type}})()}}$(pe,"REFRESH_THROTTLE",150);function ze(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function He(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){ze(o,n,i,s,a,"next",u)}function a(u){ze(o,n,i,s,a,"throw",u)}s(void 0)})}}function qe(r,e,t){return e=bn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bn(r){var e=yn(r,"string");return typeof e=="symbol"?e:String(e)}function yn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class oi{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";qe(this,"storageService",void 0),qe(this,"root",void 0),this.storageService=e,this.root=t}getLayouts(){var e=this;return He(function*(){var t=yield e.storageService.listItems(e.root,"*.json");return t.map(n=>n.basename)})()}getLayout(e){var t=this;return He(function*(){var n=yield t.storageService.loadFile("".concat(t.root,"/").concat(e)),i=yield n.text();return JSON.parse(i)})()}}function wn(r){return r.version===2}function Pn(r){return Array.isArray(r)}function Ye(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Sn(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ye(o,n,i,s,a,"next",u)}function a(u){Ye(o,n,i,s,a,"throw",u)}s(void 0)})}}var Z=N.module("UserLayoutUtils"),On={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:ye.COMPONENT,title:ye.TITLE,isClosable:!1},{type:"react-component",component:we.COMPONENT,title:we.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:Pe.COMPONENT,title:Pe.TITLE,isClosable:!1},{type:"react-component",component:Se.COMPONENT,title:Se.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},xn={layoutConfig:[],links:[],filterSets:[],version:2};function nt(r){if(wn(r))return r;if(Pn(r)){var e=r;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(r))}function Mn(r){return de.apply(this,arguments)}function de(){return de=Sn(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;try{var t=yield r.getLayouts();if(t.length>0)try{var n=yield r.getLayout(t[0]);return nt(n)}catch(i){Z.error("Unable to load layout",t[0],":",i),Z.warn("No valid layouts found, falling back to default layout")}}catch(i){Z.error("Unable to fetch layout list",i),Z.warn("Falling back to default layout")}return e?On:xn}),de.apply(this,arguments)}function En(r){var{filterSets:e,layoutConfig:t,links:n,pluginDataMap:i}=r,o={filterSets:e,layoutConfig:t,links:n,pluginDataMap:i,version:2};return o}const Cn={exportLayout:En,getDefaultLayout:Mn,normalizeLayout:nt};function Ze(r,e,t,n,i,o,s){try{var a=r[o](s),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function X(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){Ze(o,n,i,s,a,"next",u)}function a(u){Ze(o,n,i,s,a,"throw",u)}s(void 0)})}}function it(r,e,t){return e=Dn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dn(r){var e=Tn(r,"string");return typeof e=="symbol"?e:String(e)}function Tn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _n=N.module("LocalWorkspaceStorage");class x{static getBooleanServerConfig(e,t){var n,i;if((e==null||(n=e.get(t))===null||n===void 0?void 0:n.toLowerCase())==="true")return!0;if((e==null||(i=e.get(t))===null||i===void 0?void 0:i.toLowerCase())==="false")return!1}static makeDefaultWorkspaceSettings(e){for(var t={defaultDateTimeFormat:Oe.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:Oe.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:Gt.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:zt.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0,gridDensity:"regular"},n={defaultDateTimeFormat:e?.get("dateTimeFormat"),formatter:[],timeZone:e?.get("timeZone"),showTimeZone:x.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:x.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:x.getBooleanServerConfig(e,"disableMoveConfirmation"),defaultDecimalFormatOptions:e?.get("decimalFormat")!==void 0?{defaultFormatString:e?.get("decimalFormat")}:void 0,defaultIntegerFormatOptions:e?.get("integerFormat")!==void 0?{defaultFormatString:e?.get("integerFormat")}:void 0,truncateNumbersWithPound:x.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:x.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:x.getBooleanServerConfig(e,"showNullStrings"),defaultNotebookSettings:e?.get("isMinimapEnabled")!==void 0?{isMinimapEnabled:x.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:x.getBooleanServerConfig(e,"web.webgl"),webglEditable:x.getBooleanServerConfig(e,"web.webgl.editable")},i=Object.keys(n),o=0;o<i.length;o+=1){var s=i[o];n[s]!==void 0&&(t[s]=n[s])}return t}static makeWorkspaceData(e,t){return X(function*(){var{filterSets:n,links:i,layoutConfig:o,pluginDataMap:s={}}=yield Cn.getDefaultLayout(e,t?.isConsoleAvailable);return{settings:{},layoutConfig:o,closed:[{}],links:i,filterSets:n,pluginDataMap:s}})()}static makeDefaultWorkspace(e,t){return X(function*(){return{data:yield x.makeWorkspaceData(e,t)}})()}constructor(e){it(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var t=this;return X(function*(){try{var n,i=JSON.parse((n=localStorage.getItem(x.STORAGE_KEY))!==null&&n!==void 0?n:"");return i}catch{return _n.info("Unable to load workspace data, initializing to default data"),x.makeDefaultWorkspace(t.layoutStorage,e)}})()}save(e){return X(function*(){return localStorage.setItem(x.STORAGE_KEY,JSON.stringify(e)),e})()}}it(x,"STORAGE_KEY","deephaven.WorkspaceStorage");export{On as $,ri as A,Bn as B,Fn as C,Fr as D,_r as E,zn as F,oi as G,nr as H,Ir as I,Yr as J,ve as K,Nn as L,rn as M,Un as N,Xn as O,Jn as P,Vn as Q,on as R,Cr as S,An as T,Cn as U,Qn as V,an as W,ei as X,z as Y,wn as Z,Pn as _,Tr as a,xn as a0,nt as a1,Mn as a2,En as a3,$n as b,ni as c,ti as d,ii as e,qn as f,nn as g,Yn as h,pe as i,x as j,Je as k,Zn as l,jr as m,kn as n,et as o,Dr as p,Kn as q,$r as r,Zr as s,Hn as t,Mr as u,Ur as v,Rr as w,Wn as x,Gn as y,tt as z};
2
+ //# sourceMappingURL=LocalWorkspaceStorage-15cbc5a8.js.map