@deephaven/code-studio 0.85.3-core-plugins.6 → 0.86.1-beta.0

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 (48) hide show
  1. package/build/assets/{AppRoot-7520324e.js → AppRoot-d6529975.js} +3 -3
  2. package/build/assets/{AppRoot-7520324e.js.map → AppRoot-d6529975.js.map} +1 -1
  3. package/build/assets/{Chart-2f002578.js → Chart-91302dcf.js} +2 -2
  4. package/build/assets/{Chart-2f002578.js.map → Chart-91302dcf.js.map} +1 -1
  5. package/build/assets/{ControlType-cfc1c3e1.js → ControlType-a12820cc.js} +3 -3
  6. package/build/assets/{ControlType-cfc1c3e1.js.map → ControlType-a12820cc.js.map} +1 -1
  7. package/build/assets/{FontBootstrap-06690988.js → FontBootstrap-f6c0d03d.js} +2 -2
  8. package/build/assets/{FontBootstrap-06690988.js.map → FontBootstrap-f6c0d03d.js.map} +1 -1
  9. package/build/assets/{FormatterUtils-9bd2c159.js → FormatterUtils-d09cd5a2.js} +2 -2
  10. package/build/assets/{FormatterUtils-9bd2c159.js.map → FormatterUtils-d09cd5a2.js.map} +1 -1
  11. package/build/assets/{Grid-1ba47c26.js → Grid-fef80846.js} +3 -3
  12. package/build/assets/{Grid-1ba47c26.js.map → Grid-fef80846.js.map} +1 -1
  13. package/build/assets/IrisGrid-4bf5ddc8.js +3 -0
  14. package/build/assets/IrisGrid-4bf5ddc8.js.map +1 -0
  15. package/build/assets/{IrisGrid-4424e8a8.css → IrisGrid-ec8fa78b.css} +1 -1
  16. package/build/assets/{IrisGridModel-cb877250.js → IrisGridModel-538a8746.js} +2 -2
  17. package/build/assets/{IrisGridModel-cb877250.js.map → IrisGridModel-538a8746.js.map} +1 -1
  18. package/build/assets/{IrisGridShortcuts-2be0ae9a.js → IrisGridShortcuts-0a8dd775.js} +2 -2
  19. package/build/assets/{IrisGridShortcuts-2be0ae9a.js.map → IrisGridShortcuts-0a8dd775.js.map} +1 -1
  20. package/build/assets/IrisGridThemeProvider-6bbaf5e5.js +11 -0
  21. package/build/assets/IrisGridThemeProvider-6bbaf5e5.js.map +1 -0
  22. package/build/assets/{LocalWorkspaceStorage-189efbdd.js → LocalWorkspaceStorage-c474272c.js} +2 -2
  23. package/build/assets/{LocalWorkspaceStorage-189efbdd.js.map → LocalWorkspaceStorage-c474272c.js.map} +1 -1
  24. package/build/assets/{MarkdownEditor-1fd855de.js → MarkdownEditor-bc7f8b86.js} +2 -2
  25. package/build/assets/{MarkdownEditor-1fd855de.js.map → MarkdownEditor-bc7f8b86.js.map} +1 -1
  26. package/build/assets/{MarkdownNotebook-358e8855.js → MarkdownNotebook-08e7e6b2.js} +2 -2
  27. package/build/assets/{MarkdownNotebook-358e8855.js.map → MarkdownNotebook-08e7e6b2.js.map} +1 -1
  28. package/build/assets/{MissingPartitionError-2ce3c7bd.js → MissingPartitionError-ccd1b92c.js} +2 -2
  29. package/build/assets/{MissingPartitionError-2ce3c7bd.js.map → MissingPartitionError-ccd1b92c.js.map} +1 -1
  30. package/build/assets/{StyleGuideRoot-47492098.js → StyleGuideRoot-5adc572a.js} +2 -2
  31. package/build/assets/{StyleGuideRoot-47492098.js.map → StyleGuideRoot-5adc572a.js.map} +1 -1
  32. package/build/assets/{TokenBoxCellRenderer-41f0d306.js → TokenBoxCellRenderer-fc88dfbc.js} +2 -2
  33. package/build/assets/{TokenBoxCellRenderer-41f0d306.js.map → TokenBoxCellRenderer-fc88dfbc.js.map} +1 -1
  34. package/build/assets/index-cd00d63a.js +8 -0
  35. package/build/assets/index-cd00d63a.js.map +1 -0
  36. package/build/assets/index-e1b9aa32.js +2 -0
  37. package/build/assets/{index-711ab532.js.map → index-e1b9aa32.js.map} +1 -1
  38. package/build/assets/{index-45b0033f.js → index-ec91dba2.js} +2 -2
  39. package/build/assets/{index-45b0033f.js.map → index-ec91dba2.js.map} +1 -1
  40. package/build/index.html +2 -2
  41. package/package.json +30 -30
  42. package/build/assets/IrisGrid-4ae57087.js +0 -3
  43. package/build/assets/IrisGrid-4ae57087.js.map +0 -1
  44. package/build/assets/IrisGridThemeProvider-714dca48.js +0 -11
  45. package/build/assets/IrisGridThemeProvider-714dca48.js.map +0 -1
  46. package/build/assets/index-2d2b053a.js +0 -8
  47. package/build/assets/index-2d2b053a.js.map +0 -1
  48. package/build/assets/index-711ab532.js +0 -2
@@ -1,2 +1,2 @@
1
- import{r as c,I as d,b9 as ct,aj as dt,K as A,am as ft,M as W,J as ht,V as K,ba as vt,L as ie,bb as pt,bc as mt,ai as gt,a1 as fe,bd as Je,Y as bt,T as yt}from"./vendor-6520fd55.js";import{aZ as wt,t as L,P as B,aL as St,aK as oe,al as Pt,u as Ot,aC as X,b4 as Et,by as Mt,c8 as Ct,bB as xt,bD as Dt,c9 as Tt,aa as _t,_ as jt,Z as Rt,b_ as It,c0 as be,an as Lt,b3 as At,b2 as Nt,a7 as $t,ca as I,c7 as Ft,cb as Ut,cc as Kt,cd as ye,ce as we,cf as Se,cg as Pe,b as Oe,a as kt,I as Bt}from"./ControlType-cfc1c3e1.js";import{c as Wt,a as Ee}from"./IrisGridShortcuts-2be0ae9a.js";import{L as N,Q as Gt,j as Ht,ag as zt,ah as qt,G as he}from"./index-45b0033f.js";function Yt(r){var e=r;r instanceof CustomEvent&&(e=r.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function Xe(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 In(){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 Ln(r){var{className:e,style:t}=r;return d.jsx("div",{className:A("dh-logo",e),style:t})}var Zt=["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){Jt(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 Jt(r,e,t){return e=Xt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xt(r){var e=Qt(r,"string");return typeof e=="symbol"?e:String(e)}function Qt(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 Vt(r,e){if(r==null)return{};var t=er(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 er(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 tr=c.forwardRef((r,e)=>{var{color:t,UNSAFE_style:n}=r,i=Vt(r,Zt),o=c.useMemo(()=>Y(Y({},n),{},{color:Wt(t)}),[t,n]);return d.jsx(ft,Y(Y({},i),{},{ref:e,UNSAFE_style:o}))});tr.displayName="Heading";function Ce(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 rr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ce(Object(t),!0).forEach(function(n){R(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function R(r,e,t){return e=nr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nr(r){var e=ir(r,"string");return typeof e=="symbol"?e:String(e)}function ir(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 xe=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}),xe.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){xe.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(St,{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 P=null;l.length>0&&(P=d.jsx("div",{className:"loading",children:d.jsx(Gt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:U,"data-testid":z}=this.props,C=i!==null&&b!==null&&f!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:A({"has-overflow":o},"context-menu-container"),style:rr({top:t,left:n},U),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":z,children:[e,P]}),C&&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 or=G;function De(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=sr(r,"string");return typeof e=="symbol"?e:String(e)}function sr(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 ur 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(or,{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 An=ur;function Qe(r,e,t){return e=lr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lr(r){var e=cr(r,"string");return typeof e=="symbol"?e:String(e)}function cr(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:K.string,in:K.bool.isRequired,children:K.node.isRequired,autoFocusOnShow:K.bool,"data-testid":K.string});Qe(T,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Nn=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){dr(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 dr(r,e,t){return e=fr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fr(r){var e=hr(r,"string");return typeof e=="symbol"?e:String(e)}function hr(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:Ht,tooltip:"Close"})]})),d.jsx(Pt,{actions:u})]})},l)});Ve.displayName="NavTab";const vr=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){pr(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 pr(r,e,t){return e=mr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mr(r){var e=gr(r,"string");return typeof e=="symbol"?e:String(e)}function gr(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 br=500,yr=.01,wr=5e-4;function Re(r){return r.scrollLeft===0}function Ie(r){return r.scrollLeft+r.clientWidth===r.scrollWidth||r.scrollWidth===0}function Sr(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 $n(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]);Xe(a.current,m);var M=c.useCallback(h=>{Ee.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]),P=c.useRef({cancelClick:!1}),U=c.useCallback(()=>{if(!(a.current==null||P.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}}},[]),z=c.useCallback(()=>{if(!(a.current==null||P.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}}},[]),C=c.useCallback(function(h,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,S=arguments.length>3?arguments[3]:void 0,x=a.current;x!=null&&(P.current.cancelClick=!0,h==="left"?x.scrollLeft=v-w:h==="right"&&(x.scrollLeft=v+w),P.current.rAF=requestAnimationFrame(q=>{var me=S??q,ge=q-me,ee=yr*ge+.5*wr*ge**2;ee=Math.min(ee,x.scrollWidth),C(h,v,ee,me)}))},[]),O=c.useCallback(()=>{var{holdTimer:h,rAF:v}=P.current;h!=null&&(clearTimeout(h),P.current.holdTimer=void 0),v!=null&&(cancelAnimationFrame(v),P.current.rAF=void 0),window.removeEventListener("mouseup",O)},[]);c.useEffect(()=>()=>window.removeEventListener("mouseup",O),[O]);var _=c.useCallback(h=>{a.current!=null&&(P.current.holdTimer=window.setTimeout(C,br,h,a.current.scrollLeft)),P.current.cancelClick=!1,window.addEventListener("mouseup",O)},[O,C]),ot=c.useCallback(()=>{_("left")},[_]),at=c.useCallback(()=>{_("right")},[_]);c.useEffect(function(){var v,w=S=>{S.stopPropagation(),S.preventDefault();var x=S.currentTarget,q=Math.abs(S.deltaY)>Math.abs(S.deltaX)?S.deltaY:S.deltaX;x.scrollLeft+=gt(q,-30,30)};return(v=a.current)===null||v===void 0||v.addEventListener("wheel",w),()=>{var S;(S=a.current)===null||S===void 0||S.removeEventListener("wheel",w)}},[]);var st=c.useMemo(()=>{var h=new Map;return t.forEach(v=>{var{key:w}=v,S=[()=>Sr(v,t,o),()=>{var x;return(x=s?.(v))!==null&&x!==void 0?x:[]}];h.set(w,S)}),h},[s,t,o]),V=c.useRef(null),ut=t.find(h=>h.key===e),lt=t.map((h,v)=>{var{key:w}=h,S=h===ut;return d.jsx(vr,{tab:h,index:v,isActive:S,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:U,onMouseDown:ot,disabled:b}),d.jsx(pt,{onDragStart:Ee.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:qt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:z,onMouseDown:at,disabled:g})]})}function Pr(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 Fn(r){var{serverUrl:e,options:t,children:n}=r,i=Pr(e,t);return d.jsx(et.Provider,{value:i,children:n})}function Or(){return X(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"),Un="io.deephaven.message.LoginOptions.request",Mr="io.deephaven.message.SessionDetails.request",Kn="io.deephaven.broadcast",Cr="io.deephaven.broadcast.Login",xr="io.deephaven.broadcast.Logout";function tt(r){var e=r;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function kn(r){return tt(r)&&r.message===Cr}function Bn(r){return tt(r)&&r.message===xr}function Dr(r){var e=r;return e!=null&&typeof e.id=="string"}function Tr(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 Wn(r,e){return{id:r,payload:e}}function _r(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function jr(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=_r();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(!Dr(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 Et("Request timed out"))},e),t.postMessage(Tr(r,s),"*")})}),ae.apply(this,arguments)}function Rr(r,e,t){return e=Ir(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ir(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 Ar extends Error{constructor(){super(...arguments),Rr(this,"isNoConsolesError",!0)}}function Nr(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 F=N.module("SessionUtils");function Gn(r,e){return F.info("Starting connection to '".concat(e,"'...")),new r.IdeConnection(e)}function $r(r,e,t){return se.apply(this,arguments)}function se(){return se=Q(function*(r,e,t){F.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new Ar("No console types available");F.info("Available types:",n);var i=n[0];F.info("Starting session with type",i);var o=yield e.startSession(i),s={type:i,id:fe()};return F.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 F.info("createCoreClient",e),new r.CoreClient(e,t)}function Fr(r){return r!=null&&typeof r=="object"}function Ur(){return ue.apply(this,arguments)}function ue(){return ue=Q(function*(){var r=yield jr(Mr);if(!Fr(r))throw new Error("Unexpected session details response: ".concat(r));return r}),ue.apply(this,arguments)}function zn(){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 Ur()}return{}}),le.apply(this,arguments)}function qn(r,e,t){return ce.apply(this,arguments)}function ce(){return ce=Q(function*(r,e,t){var n;try{n=yield $r(r,e,t)}catch(i){if(!Nr(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 Kr(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){kr(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 kr(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=Wr(r,"string");return typeof e=="symbol"?e:String(e)}function Wr(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 Gr=100,ne=()=>{},Hr=Object.freeze({});function zr(r){var{id:e="default",children:t,emptyDashboard:n,layoutConfig:i,layoutSettings:o=Hr,onLayoutConfigChange:s=ne,onGoldenLayoutChange:a=ne,onLayoutInitialized:u=ne,fallbackComponent:l=Tt,hydrate:b,dehydrate:f,panelWrapper:g}=r,y=c.useRef(null),[m,M]=c.useState(!1),[p,P]=c.useState();c.useEffect(function(){if(!y.current){P(void 0);return}var C=Kr({},Mt.makeDefaultLayout());C.settings===void 0&&(C.settings={}),Object.assign(C.settings,o),C.content=[];var O=new Ct(C,y.current),_=()=>{O.off("initialised",_),M(!0)};return O.on("initialised",_),l!=null&&O.setFallbackComponent(l),O.init(),P(O),a(O),()=>{O.destroy()}},[o,l,a,M,P]);var U=c.useMemo(()=>Je(()=>{p!=null&&p.isInitialised&&p?.updateSize()},Gr),[p]);return Xe(y.current,U),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(xt.Provider,{value:p,children:d.jsx(Dt,{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 qr(r,e){try{r.off(ve,e)}catch{}}function Yn(r,e){return r.on(ve,e),()=>qr(r,e)}function Zn(r,e){r.emit(ve,e)}var Yr=["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){Zr(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 Zr(r,e,t){return e=Jr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jr(r){var e=Xr(r,"string");return typeof e=="symbol"?e:String(e)}function Xr(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 Qr(r,e){if(r==null)return{};var t=Vr(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 Vr(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 en(r){var{id:e,isActive:t,plugins:n}=r,i=Qr(r,Yr),[o,s]=c.useState(t),a=bt(),u=c.useCallback(l=>{a(e===_t?jt({layoutConfig:l}):Rt(e,{layoutConfig:l}))},[e,a]);return!o&&t&&s(!0),o?d.jsx(zr,Fe(Fe({id:e,onLayoutConfigChange:u},i),{},{children:n})):d.jsx(he,{})}function tn(r){var e=[...r.entries()].filter(t=>{var[,n]=t;return It(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=Lt(),e=c.useMemo(()=>tn(r),[r]);return e}var Xn=c.createContext({}),Qn=c.createContext({}),rn=c.createContext(null),nn=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 on(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 Vn(r){var{children:e}=r,t=Or(),[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=on(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:Yt(o)}):d.jsx(rt.Provider,{value:n,children:e})}function ei(){return X(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 an(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){sn(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 sn(r,e,t){return e=un(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function un(r){var e=ln(r,"string");return typeof e=="symbol"?e:String(e)}function ln(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 ti(r){var{dashboards:e,activeDashboard:t,onLayoutInitialized:n,onGoldenLayoutChange:i,plugins:o,emptyDashboard:s=d.jsx(he,{})}=r,a=At(),u=c.useCallback((l,b)=>{var{metadata:f}=l;try{if(f!=null){var g=Nt(f);return Be(Be({fetch:function(){var y=an(function*(){return a(g)});function m(){return y.apply(this,arguments)}return m}()},l),{},{localDashboardId:b})}}catch{}return $t.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(en,{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 ri(){return X(nn,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function ni(){return X(rn,"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 cn(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=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=fn(r,"string");return typeof e=="symbol"?e:String(e)}function fn(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 H{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),H.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 H(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 Ft;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 cn(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(H,"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=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 pn=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",Je(()=>{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 H(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 Ut;if(n.length>1)throw pn.error("More than one matching file found, should never happen.",n),new Error("More than one matching file found");var i=n[0];if(!Kt(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 He(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 ze(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){He(o,n,i,s,a,"next",u)}function a(u){He(o,n,i,s,a,"throw",u)}s(void 0)})}}function qe(r,e,t){return e=mn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mn(r){var e=gn(r,"string");return typeof e=="symbol"?e:String(e)}function gn(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 ii{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 ze(function*(){var t=yield e.storageService.listItems(e.root,"*.json");return t.map(n=>n.basename)})()}getLayout(e){var t=this;return ze(function*(){var n=yield t.storageService.loadFile("".concat(t.root,"/").concat(e)),i=yield n.text();return JSON.parse(i)})()}}function bn(r){return r.version===2}function yn(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 wn(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"),Sn={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:Se.COMPONENT,title:Se.TITLE,isClosable:!1},{type:"react-component",component:Pe.COMPONENT,title:Pe.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},Pn={layoutConfig:[],links:[],filterSets:[],version:2};function nt(r){if(bn(r))return r;if(yn(r)){var e=r;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(r))}function On(r){return de.apply(this,arguments)}function de(){return de=wn(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?Sn:Pn}),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 Mn={exportLayout:En,getDefaultLayout:On,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 J(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=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=xn(r,"string");return typeof e=="symbol"?e:String(e)}function xn(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 Dn=N.module("LocalWorkspaceStorage");class E{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:kt.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Bt.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0},n={defaultDateTimeFormat:e?.get("dateTimeFormat"),formatter:[],timeZone:e?.get("timeZone"),showTimeZone:E.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:E.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:E.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:E.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:E.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:E.getBooleanServerConfig(e,"showNullStrings"),defaultNotebookSettings:e?.get("isMinimapEnabled")!==void 0?{isMinimapEnabled:E.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:E.getBooleanServerConfig(e,"web.webgl"),webglEditable:E.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 J(function*(){var{filterSets:n,links:i,layoutConfig:o,pluginDataMap:s={}}=yield Mn.getDefaultLayout(e,t?.isConsoleAvailable);return{settings:{},layoutConfig:o,closed:[{}],links:i,filterSets:n,pluginDataMap:s}})()}static makeDefaultWorkspace(e,t){return J(function*(){return{data:yield E.makeWorkspaceData(e,t)}})()}constructor(e){it(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var t=this;return J(function*(){try{var n,i=JSON.parse((n=localStorage.getItem(E.STORAGE_KEY))!==null&&n!==void 0?n:"");return i}catch{return Dn.info("Unable to load workspace data, initializing to default data"),E.makeDefaultWorkspace(t.layoutStorage,e)}})()}save(e){return J(function*(){return localStorage.setItem(E.STORAGE_KEY,JSON.stringify(e)),e})()}}it(E,"STORAGE_KEY","deephaven.WorkspaceStorage");export{bn as $,ti as A,Kn as B,Nn as C,tt as D,Nr as E,Dr as F,ii as G,tr as H,Wn as I,jr as J,zr as K,Ln as L,ve as M,$n as N,en as O,Zn as P,Jn as Q,Yt as R,Mr as S,In as T,Mn as U,Qn as V,rn as W,Xn as X,nn as Y,Vn as Z,H as _,xr as a,yn as a0,Sn as a1,Pn as a2,nt as a3,On as a4,En as a5,An as b,ri as c,ei as d,ni as e,zn as f,tn as g,qn as h,pe as i,E as j,Xe as k,Yn as l,Tr as m,Fn as n,et as o,Cr as p,Un as q,Ar as r,qr as s,Gn as t,Or as u,Hn as v,$r as w,_r as x,kn as y,Bn as z};
2
- //# sourceMappingURL=LocalWorkspaceStorage-189efbdd.js.map
1
+ import{r as c,I as d,b9 as ct,aj as dt,K as A,am as ft,M as W,J as ht,V as K,ba as vt,L as ie,bb as pt,bc as mt,ai as gt,a1 as fe,bd as Je,Y as bt,T as yt}from"./vendor-6520fd55.js";import{aZ as wt,t as L,P as B,aL as St,aK as oe,al as Pt,u as Ot,aC as X,b4 as Et,by as Mt,c8 as Ct,bB as xt,bD as Dt,c9 as Tt,aa as _t,_ as jt,Z as Rt,b_ as It,c0 as be,an as Lt,b3 as At,b2 as Nt,a7 as $t,ca as I,c7 as Ft,cb as Ut,cc as Kt,cd as ye,ce as we,cf as Se,cg as Pe,b as Oe,a as kt,I as Bt}from"./ControlType-a12820cc.js";import{c as Wt,a as Ee}from"./IrisGridShortcuts-0a8dd775.js";import{L as N,Q as Gt,j as Ht,ag as zt,ah as qt,G as he}from"./index-ec91dba2.js";function Yt(r){var e=r;r instanceof CustomEvent&&(e=r.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function Xe(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 In(){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 Ln(r){var{className:e,style:t}=r;return d.jsx("div",{className:A("dh-logo",e),style:t})}var Zt=["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){Jt(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 Jt(r,e,t){return e=Xt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xt(r){var e=Qt(r,"string");return typeof e=="symbol"?e:String(e)}function Qt(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 Vt(r,e){if(r==null)return{};var t=er(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 er(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 tr=c.forwardRef((r,e)=>{var{color:t,UNSAFE_style:n}=r,i=Vt(r,Zt),o=c.useMemo(()=>Y(Y({},n),{},{color:Wt(t)}),[t,n]);return d.jsx(ft,Y(Y({},i),{},{ref:e,UNSAFE_style:o}))});tr.displayName="Heading";function Ce(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 rr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ce(Object(t),!0).forEach(function(n){R(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function R(r,e,t){return e=nr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nr(r){var e=ir(r,"string");return typeof e=="symbol"?e:String(e)}function ir(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 xe=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}),xe.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){xe.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(St,{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 P=null;l.length>0&&(P=d.jsx("div",{className:"loading",children:d.jsx(Gt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:U,"data-testid":z}=this.props,C=i!==null&&b!==null&&f!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:A({"has-overflow":o},"context-menu-container"),style:rr({top:t,left:n},U),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":z,children:[e,P]}),C&&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 or=G;function De(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=sr(r,"string");return typeof e=="symbol"?e:String(e)}function sr(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 ur 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(or,{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 An=ur;function Qe(r,e,t){return e=lr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lr(r){var e=cr(r,"string");return typeof e=="symbol"?e:String(e)}function cr(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:K.string,in:K.bool.isRequired,children:K.node.isRequired,autoFocusOnShow:K.bool,"data-testid":K.string});Qe(T,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Nn=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){dr(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 dr(r,e,t){return e=fr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fr(r){var e=hr(r,"string");return typeof e=="symbol"?e:String(e)}function hr(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:Ht,tooltip:"Close"})]})),d.jsx(Pt,{actions:u})]})},l)});Ve.displayName="NavTab";const vr=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){pr(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 pr(r,e,t){return e=mr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mr(r){var e=gr(r,"string");return typeof e=="symbol"?e:String(e)}function gr(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 br=500,yr=.01,wr=5e-4;function Re(r){return r.scrollLeft===0}function Ie(r){return r.scrollLeft+r.clientWidth===r.scrollWidth||r.scrollWidth===0}function Sr(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 $n(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]);Xe(a.current,m);var M=c.useCallback(h=>{Ee.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]),P=c.useRef({cancelClick:!1}),U=c.useCallback(()=>{if(!(a.current==null||P.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}}},[]),z=c.useCallback(()=>{if(!(a.current==null||P.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}}},[]),C=c.useCallback(function(h,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,S=arguments.length>3?arguments[3]:void 0,x=a.current;x!=null&&(P.current.cancelClick=!0,h==="left"?x.scrollLeft=v-w:h==="right"&&(x.scrollLeft=v+w),P.current.rAF=requestAnimationFrame(q=>{var me=S??q,ge=q-me,ee=yr*ge+.5*wr*ge**2;ee=Math.min(ee,x.scrollWidth),C(h,v,ee,me)}))},[]),O=c.useCallback(()=>{var{holdTimer:h,rAF:v}=P.current;h!=null&&(clearTimeout(h),P.current.holdTimer=void 0),v!=null&&(cancelAnimationFrame(v),P.current.rAF=void 0),window.removeEventListener("mouseup",O)},[]);c.useEffect(()=>()=>window.removeEventListener("mouseup",O),[O]);var _=c.useCallback(h=>{a.current!=null&&(P.current.holdTimer=window.setTimeout(C,br,h,a.current.scrollLeft)),P.current.cancelClick=!1,window.addEventListener("mouseup",O)},[O,C]),ot=c.useCallback(()=>{_("left")},[_]),at=c.useCallback(()=>{_("right")},[_]);c.useEffect(function(){var v,w=S=>{S.stopPropagation(),S.preventDefault();var x=S.currentTarget,q=Math.abs(S.deltaY)>Math.abs(S.deltaX)?S.deltaY:S.deltaX;x.scrollLeft+=gt(q,-30,30)};return(v=a.current)===null||v===void 0||v.addEventListener("wheel",w),()=>{var S;(S=a.current)===null||S===void 0||S.removeEventListener("wheel",w)}},[]);var st=c.useMemo(()=>{var h=new Map;return t.forEach(v=>{var{key:w}=v,S=[()=>Sr(v,t,o),()=>{var x;return(x=s?.(v))!==null&&x!==void 0?x:[]}];h.set(w,S)}),h},[s,t,o]),V=c.useRef(null),ut=t.find(h=>h.key===e),lt=t.map((h,v)=>{var{key:w}=h,S=h===ut;return d.jsx(vr,{tab:h,index:v,isActive:S,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:U,onMouseDown:ot,disabled:b}),d.jsx(pt,{onDragStart:Ee.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:qt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:z,onMouseDown:at,disabled:g})]})}function Pr(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 Fn(r){var{serverUrl:e,options:t,children:n}=r,i=Pr(e,t);return d.jsx(et.Provider,{value:i,children:n})}function Or(){return X(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"),Un="io.deephaven.message.LoginOptions.request",Mr="io.deephaven.message.SessionDetails.request",Kn="io.deephaven.broadcast",Cr="io.deephaven.broadcast.Login",xr="io.deephaven.broadcast.Logout";function tt(r){var e=r;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function kn(r){return tt(r)&&r.message===Cr}function Bn(r){return tt(r)&&r.message===xr}function Dr(r){var e=r;return e!=null&&typeof e.id=="string"}function Tr(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 Wn(r,e){return{id:r,payload:e}}function _r(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function jr(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=_r();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(!Dr(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 Et("Request timed out"))},e),t.postMessage(Tr(r,s),"*")})}),ae.apply(this,arguments)}function Rr(r,e,t){return e=Ir(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ir(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 Ar extends Error{constructor(){super(...arguments),Rr(this,"isNoConsolesError",!0)}}function Nr(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 F=N.module("SessionUtils");function Gn(r,e){return F.info("Starting connection to '".concat(e,"'...")),new r.IdeConnection(e)}function $r(r,e,t){return se.apply(this,arguments)}function se(){return se=Q(function*(r,e,t){F.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new Ar("No console types available");F.info("Available types:",n);var i=n[0];F.info("Starting session with type",i);var o=yield e.startSession(i),s={type:i,id:fe()};return F.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 F.info("createCoreClient",e),new r.CoreClient(e,t)}function Fr(r){return r!=null&&typeof r=="object"}function Ur(){return ue.apply(this,arguments)}function ue(){return ue=Q(function*(){var r=yield jr(Mr);if(!Fr(r))throw new Error("Unexpected session details response: ".concat(r));return r}),ue.apply(this,arguments)}function zn(){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 Ur()}return{}}),le.apply(this,arguments)}function qn(r,e,t){return ce.apply(this,arguments)}function ce(){return ce=Q(function*(r,e,t){var n;try{n=yield $r(r,e,t)}catch(i){if(!Nr(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 Kr(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){kr(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 kr(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=Wr(r,"string");return typeof e=="symbol"?e:String(e)}function Wr(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 Gr=100,ne=()=>{},Hr=Object.freeze({});function zr(r){var{id:e="default",children:t,emptyDashboard:n,layoutConfig:i,layoutSettings:o=Hr,onLayoutConfigChange:s=ne,onGoldenLayoutChange:a=ne,onLayoutInitialized:u=ne,fallbackComponent:l=Tt,hydrate:b,dehydrate:f,panelWrapper:g}=r,y=c.useRef(null),[m,M]=c.useState(!1),[p,P]=c.useState();c.useEffect(function(){if(!y.current){P(void 0);return}var C=Kr({},Mt.makeDefaultLayout());C.settings===void 0&&(C.settings={}),Object.assign(C.settings,o),C.content=[];var O=new Ct(C,y.current),_=()=>{O.off("initialised",_),M(!0)};return O.on("initialised",_),l!=null&&O.setFallbackComponent(l),O.init(),P(O),a(O),()=>{O.destroy()}},[o,l,a,M,P]);var U=c.useMemo(()=>Je(()=>{p!=null&&p.isInitialised&&p?.updateSize()},Gr),[p]);return Xe(y.current,U),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(xt.Provider,{value:p,children:d.jsx(Dt,{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 qr(r,e){try{r.off(ve,e)}catch{}}function Yn(r,e){return r.on(ve,e),()=>qr(r,e)}function Zn(r,e){r.emit(ve,e)}var Yr=["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){Zr(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 Zr(r,e,t){return e=Jr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jr(r){var e=Xr(r,"string");return typeof e=="symbol"?e:String(e)}function Xr(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 Qr(r,e){if(r==null)return{};var t=Vr(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 Vr(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 en(r){var{id:e,isActive:t,plugins:n}=r,i=Qr(r,Yr),[o,s]=c.useState(t),a=bt(),u=c.useCallback(l=>{a(e===_t?jt({layoutConfig:l}):Rt(e,{layoutConfig:l}))},[e,a]);return!o&&t&&s(!0),o?d.jsx(zr,Fe(Fe({id:e,onLayoutConfigChange:u},i),{},{children:n})):d.jsx(he,{})}function tn(r){var e=[...r.entries()].filter(t=>{var[,n]=t;return It(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=Lt(),e=c.useMemo(()=>tn(r),[r]);return e}var Xn=c.createContext({}),Qn=c.createContext({}),rn=c.createContext(null),nn=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 on(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 Vn(r){var{children:e}=r,t=Or(),[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=on(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:Yt(o)}):d.jsx(rt.Provider,{value:n,children:e})}function ei(){return X(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 an(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){sn(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 sn(r,e,t){return e=un(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function un(r){var e=ln(r,"string");return typeof e=="symbol"?e:String(e)}function ln(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 ti(r){var{dashboards:e,activeDashboard:t,onLayoutInitialized:n,onGoldenLayoutChange:i,plugins:o,emptyDashboard:s=d.jsx(he,{})}=r,a=At(),u=c.useCallback((l,b)=>{var{metadata:f}=l;try{if(f!=null){var g=Nt(f);return Be(Be({fetch:function(){var y=an(function*(){return a(g)});function m(){return y.apply(this,arguments)}return m}()},l),{},{localDashboardId:b})}}catch{}return $t.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(en,{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 ri(){return X(nn,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function ni(){return X(rn,"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 cn(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=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=fn(r,"string");return typeof e=="symbol"?e:String(e)}function fn(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 H{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),H.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 H(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 Ft;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 cn(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(H,"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=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 pn=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",Je(()=>{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 H(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 Ut;if(n.length>1)throw pn.error("More than one matching file found, should never happen.",n),new Error("More than one matching file found");var i=n[0];if(!Kt(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 He(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 ze(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function s(u){He(o,n,i,s,a,"next",u)}function a(u){He(o,n,i,s,a,"throw",u)}s(void 0)})}}function qe(r,e,t){return e=mn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mn(r){var e=gn(r,"string");return typeof e=="symbol"?e:String(e)}function gn(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 ii{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 ze(function*(){var t=yield e.storageService.listItems(e.root,"*.json");return t.map(n=>n.basename)})()}getLayout(e){var t=this;return ze(function*(){var n=yield t.storageService.loadFile("".concat(t.root,"/").concat(e)),i=yield n.text();return JSON.parse(i)})()}}function bn(r){return r.version===2}function yn(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 wn(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"),Sn={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:Se.COMPONENT,title:Se.TITLE,isClosable:!1},{type:"react-component",component:Pe.COMPONENT,title:Pe.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},Pn={layoutConfig:[],links:[],filterSets:[],version:2};function nt(r){if(bn(r))return r;if(yn(r)){var e=r;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(r))}function On(r){return de.apply(this,arguments)}function de(){return de=wn(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?Sn:Pn}),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 Mn={exportLayout:En,getDefaultLayout:On,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 J(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=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=xn(r,"string");return typeof e=="symbol"?e:String(e)}function xn(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 Dn=N.module("LocalWorkspaceStorage");class E{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:kt.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Bt.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0},n={defaultDateTimeFormat:e?.get("dateTimeFormat"),formatter:[],timeZone:e?.get("timeZone"),showTimeZone:E.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:E.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:E.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:E.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:E.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:E.getBooleanServerConfig(e,"showNullStrings"),defaultNotebookSettings:e?.get("isMinimapEnabled")!==void 0?{isMinimapEnabled:E.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:E.getBooleanServerConfig(e,"web.webgl"),webglEditable:E.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 J(function*(){var{filterSets:n,links:i,layoutConfig:o,pluginDataMap:s={}}=yield Mn.getDefaultLayout(e,t?.isConsoleAvailable);return{settings:{},layoutConfig:o,closed:[{}],links:i,filterSets:n,pluginDataMap:s}})()}static makeDefaultWorkspace(e,t){return J(function*(){return{data:yield E.makeWorkspaceData(e,t)}})()}constructor(e){it(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var t=this;return J(function*(){try{var n,i=JSON.parse((n=localStorage.getItem(E.STORAGE_KEY))!==null&&n!==void 0?n:"");return i}catch{return Dn.info("Unable to load workspace data, initializing to default data"),E.makeDefaultWorkspace(t.layoutStorage,e)}})()}save(e){return J(function*(){return localStorage.setItem(E.STORAGE_KEY,JSON.stringify(e)),e})()}}it(E,"STORAGE_KEY","deephaven.WorkspaceStorage");export{bn as $,ti as A,Kn as B,Nn as C,tt as D,Nr as E,Dr as F,ii as G,tr as H,Wn as I,jr as J,zr as K,Ln as L,ve as M,$n as N,en as O,Zn as P,Jn as Q,Yt as R,Mr as S,In as T,Mn as U,Qn as V,rn as W,Xn as X,nn as Y,Vn as Z,H as _,xr as a,yn as a0,Sn as a1,Pn as a2,nt as a3,On as a4,En as a5,An as b,ri as c,ei as d,ni as e,zn as f,tn as g,qn as h,pe as i,E as j,Xe as k,Yn as l,Tr as m,Fn as n,et as o,Cr as p,Un as q,Ar as r,qr as s,Gn as t,Or as u,Hn as v,$r as w,_r as x,kn as y,Bn as z};
2
+ //# sourceMappingURL=LocalWorkspaceStorage-c474272c.js.map