@deephaven/code-studio 0.94.1-beta.0 → 0.95.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 (45) hide show
  1. package/build/assets/{AppRoot-2QqbS1nC.js → AppRoot-BAdlVp-2.js} +4 -4
  2. package/build/assets/AppRoot-BAdlVp-2.js.map +1 -0
  3. package/build/assets/{Chart-Cm7qWO9E.js → Chart-CAbfBNKX.js} +2 -2
  4. package/build/assets/{Chart-Cm7qWO9E.js.map → Chart-CAbfBNKX.js.map} +1 -1
  5. package/build/assets/{ControlType-CckisQF4.js → ControlType-NUmGfTww.js} +4 -4
  6. package/build/assets/{ControlType-CckisQF4.js.map → ControlType-NUmGfTww.js.map} +1 -1
  7. package/build/assets/{FontBootstrap-CvnhQGa5.js → FontBootstrap-Bl6vq41v.js} +2 -2
  8. package/build/assets/{FontBootstrap-CvnhQGa5.js.map → FontBootstrap-Bl6vq41v.js.map} +1 -1
  9. package/build/assets/{FormatterUtils-BAfeV5hG.js → FormatterUtils-iauIVwuu.js} +2 -2
  10. package/build/assets/{FormatterUtils-BAfeV5hG.js.map → FormatterUtils-iauIVwuu.js.map} +1 -1
  11. package/build/assets/{Grid-PyvX8Ljr.js → Grid-CjnujVEX.js} +2 -2
  12. package/build/assets/{Grid-PyvX8Ljr.js.map → Grid-CjnujVEX.js.map} +1 -1
  13. package/build/assets/{IrisGrid-C7qtaa22.js → IrisGrid-BGnzpzYu.js} +2 -2
  14. package/build/assets/{IrisGrid-C7qtaa22.js.map → IrisGrid-BGnzpzYu.js.map} +1 -1
  15. package/build/assets/{IrisGridModel-CCMYIR29.js → IrisGridModel-CAsjFilJ.js} +3 -3
  16. package/build/assets/{IrisGridModel-CCMYIR29.js.map → IrisGridModel-CAsjFilJ.js.map} +1 -1
  17. package/build/assets/{IrisGridShortcuts-B3PQt1Dg.js → IrisGridShortcuts-BwHkgvtW.js} +2 -2
  18. package/build/assets/{IrisGridShortcuts-B3PQt1Dg.js.map → IrisGridShortcuts-BwHkgvtW.js.map} +1 -1
  19. package/build/assets/{IrisGridThemeProvider-Cf0M-Qvb.js → IrisGridThemeProvider-Atqacw7P.js} +2 -2
  20. package/build/assets/{IrisGridThemeProvider-Cf0M-Qvb.js.map → IrisGridThemeProvider-Atqacw7P.js.map} +1 -1
  21. package/build/assets/{LocalWorkspaceStorage-CFBIVjrj.js → LocalWorkspaceStorage-h3-A9jVy.js} +2 -2
  22. package/build/assets/{LocalWorkspaceStorage-CFBIVjrj.js.map → LocalWorkspaceStorage-h3-A9jVy.js.map} +1 -1
  23. package/build/assets/{MarkdownEditor-fe6mc7KC.js → MarkdownEditor-C8u19ocy.js} +2 -2
  24. package/build/assets/{MarkdownEditor-fe6mc7KC.js.map → MarkdownEditor-C8u19ocy.js.map} +1 -1
  25. package/build/assets/{MarkdownNotebook-2wkzDKT_.js → MarkdownNotebook-CEg2045K.js} +2 -2
  26. package/build/assets/{MarkdownNotebook-2wkzDKT_.js.map → MarkdownNotebook-CEg2045K.js.map} +1 -1
  27. package/build/assets/{MissingPartitionError-Dj2Y-FKf.js → MissingPartitionError-yhygxxeZ.js} +2 -2
  28. package/build/assets/{MissingPartitionError-Dj2Y-FKf.js.map → MissingPartitionError-yhygxxeZ.js.map} +1 -1
  29. package/build/assets/{StyleGuideRoot-DWcUvpZo.js → StyleGuideRoot-C-Kz5fEa.js} +2 -2
  30. package/build/assets/StyleGuideRoot-C-Kz5fEa.js.map +1 -0
  31. package/build/assets/{TokenBoxCellRenderer-DfZgvoE0.js → TokenBoxCellRenderer-DH2eZRQH.js} +2 -2
  32. package/build/assets/{TokenBoxCellRenderer-DfZgvoE0.js.map → TokenBoxCellRenderer-DH2eZRQH.js.map} +1 -1
  33. package/build/assets/{index-B0jej1Vv.js → index-B8xrSWbn.js} +5 -5
  34. package/build/assets/index-B8xrSWbn.js.map +1 -0
  35. package/build/assets/index-Bkz3vMXy.css +1 -0
  36. package/build/assets/{index-A37_P9XP.js → index-By1dHjp4.js} +3 -3
  37. package/build/assets/{index-A37_P9XP.js.map → index-By1dHjp4.js.map} +1 -1
  38. package/build/assets/{index-DVqL-niD.js → index-C159LUCr.js} +2 -2
  39. package/build/assets/{index-DVqL-niD.js.map → index-C159LUCr.js.map} +1 -1
  40. package/build/index.html +2 -2
  41. package/package.json +31 -31
  42. package/build/assets/AppRoot-2QqbS1nC.js.map +0 -1
  43. package/build/assets/StyleGuideRoot-DWcUvpZo.js.map +0 -1
  44. package/build/assets/index-B0jej1Vv.js.map +0 -1
  45. package/build/assets/index-DrdNUMrr.css +0 -1
@@ -1,2 +1,2 @@
1
- import{r as c,J as d,bf as Ve,a9 as vt,M as I,V as K,bg as pt,L as mt,a2 as k,bh as gt,N as ie,bi as bt,bj as yt,aq as wt,I as fe,bk as et,a5 as Pt,a0 as St}from"./vendor-CohWXWuY.js";import{G as Ot,v as N,P as W,aK as Et,B as oe,ak as xt,u as Ct,aB as X,b6 as Mt,bV as Dt,cw as Tt,bY as _t,b_ as jt,cx as Rt,a9 as It,Z as Lt,Y as Nt,cl as At,cn as be,am as $t,cu as Ft,b5 as Kt,a6 as Ut,cy as L,cv as kt,cz as Bt,cA as Wt,cB as ye,cC as we,cD as Pe,cE as Se,b as Oe,a as Gt,I as Ht}from"./ControlType-CckisQF4.js";import{N as zt,r as qt,k as Ee}from"./IrisGridShortcuts-B3PQt1Dg.js";import{u as Yt}from"./useMergeRef-CdbLELuv.js";import{L as A,U as Zt,j as Jt,an as Xt,ao as Qt,J as he}from"./index-A37_P9XP.js";function tt(t,e){c.useEffect(()=>{if(t!=null){var r=new window.ResizeObserver(e);return r.observe(t),()=>{t!=null&&r.unobserve(t)}}},[t,e])}function Wn(){var{selectedThemeKey:t,setSelectedThemeKey:e,themes:r}=Ot(),n=c.useCallback(i=>{e(i)},[e]);return d.jsx(Ve,{label:"Pick a color scheme",items:r,selectedKey:t,onSelectionChange:n,children:i=>d.jsx(vt,{children:i.name},i.themeKey)})}function Gn(t){var{className:e,style:r}=t;return d.jsx("div",{className:I("dh-logo",e),style:r})}var Vt=["UNSAFE_className"],er=["defaultSelectedKey","disabledKeys","selectedKey","ref"];function xe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xe(Object(r),!0).forEach(function(n){tr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function tr(t,e,r){return e=rr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rr(t){var e=nr(t,"string");return typeof e=="symbol"?e:String(e)}function nr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Me(t,e){if(t==null)return{};var r=ir(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ir(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var or=K.forwardRef(function(e,r){var{UNSAFE_className:n}=e,i=Me(e,Vt),o=zt(i),{defaultSelectedKey:s,disabledKeys:a,selectedKey:u,ref:l}=o,g=Me(o,er),f=Yt(r,l);return d.jsx(Ve,Ce(Ce({},g),{},{ref:f,UNSAFE_className:I("dh-picker",n),defaultSelectedKey:s,disabledKeys:a,selectedKey:u}))});or.displayName="Picker";var ar=["color","UNSAFE_style"];function De(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?De(Object(r),!0).forEach(function(n){sr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sr(t,e,r){return e=ur(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ur(t){var e=lr(t,"string");return typeof e=="symbol"?e:String(e)}function lr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cr(t,e){if(t==null)return{};var r=dr(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function dr(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var fr=c.forwardRef((t,e)=>{var{color:r,UNSAFE_style:n}=t,i=cr(t,ar),o=c.useMemo(()=>Y(Y({},n),{},{color:qt(r)}),[r,n]);return d.jsx(pt,Y(Y({},i),{},{ref:e,UNSAFE_style:o}))});fr.displayName="Heading";function Te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function hr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Te(Object(r),!0).forEach(function(n){R(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function R(t,e,r){return e=vr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t){var e=pr(t,"string");return typeof e=="symbol"?e:String(e)}function pr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _e=A.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=K.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=K.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:r}=this.props;r(this)})}componentDidUpdate(e,r){var{actions:n}=this.props,{activeSubMenu:i}=this.state;if(i!==r.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:r}=this.state;return r}return this.getMouseIndex()}setKeyboardIndex(e){var{options:r}=this.props;r.separateKeyboardMouse!==void 0&&r.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,r=e.initialKeyboardIndex;r===void 0&&(r=-1);for(var{actions:n}=this.props,i=N.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:r,activeSubMenu:null,menuItems:N.sortActions(o)})}initMenuPromise(e){var r=W.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(r)})),r.then(n=>{this.setState(i=>{var o=i.pendingItems.indexOf(r);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{menuItems:N.sortActions(i.menuItems.concat(n)),pendingItems:s}}return null})},n=>{W.isCanceled(n)||(this.setState(i=>{var o=i.pendingItems.indexOf(r);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{pendingItems:s}}return null}),_e.error(n))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(r=>r.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,r,n,i,{options:o,updatePosition:s,subMenuParentWidth:a,subMenuParentHeight:u,top:l,left:g}=this.props;if(!(!this.container.current||o.doNotVerifyPosition!=null&&o.doNotVerifyPosition)){var{top:f,left:m}=this.initialPosition,{width:y,height:b}=(e=(r=this.container.current)===null||r===void 0?void 0:r.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},x=((n=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&n!==void 0?n:0)>window.innerHeight;b===0||y===0||(f+b>window.innerHeight&&(f-b-u>0?f-=b-u:f=window.innerHeight-b),m+y>window.innerWidth&&(m=m-y-a),(g!==m||l!==f)&&(this.setState({hasOverflow:x}),s(f,m)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){_e.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var r=e.relatedTarget,n=!1;r&&!n;)n=r.hasAttribute("data-dh-context-menu"),r=r.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){var{left:r}=this.props;return e==="Escape"||r<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:r}=this.state,n=this.getKeyboardIndex(),i=n,o=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<r.length&&this.handleMenuItemClick(r[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=r.length?o=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=N.getNextMenuItem(i,-1,r):(e.key==="ArrowDown"||e.key==="Tab")&&(i=N.getNextMenuItem(i,1,r)),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:r,activeSubMenu:n}=this.state,i=r[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:r,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,r){r.preventDefault(),r.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(r.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,r){r.metaKey||this.handleMenuItemClick(e,r)}handleMenuItemMouseMove(e){var{menuItems:r}=this.state,n=r.indexOf(e);this.setMouseIndex(n),n>=0&&n<r.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:r,left:n}=this.props,{activeSubMenu:i,hasOverflow:o,keyboardIndex:s,menuItems:a,mouseIndex:u,pendingItems:l,subMenuTop:g,subMenuLeft:f,subMenuParentWidth:m,subMenuParentHeight:y}=this.state,b=0;b<a.length;b+=1){var x=a[b];b>0&&x.group!==a[b-1].group&&e.push(d.jsx("hr",{},"".concat(b,".separator")));var p=d.jsx(Et,{ref:i===b?this.activeSubMenuRef:null,isKeyboardSelected:s===b,isMouseSelected:u===b,menuItem:x,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},b);e.push(p)}var S=null;l.length>0&&(S=d.jsx("div",{className:"loading",children:d.jsx(Zt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:U,"data-testid":z}=this.props,C=i!==null&&g!==null&&f!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:I({"has-overflow":o},"context-menu-container"),style:hr({top:r,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,S]}),C&&i!==null&&g!==null&&f!==null&&d.jsx(G,{actions:a[i].actions||[],closeMenu:this.handleCloseSubMenu,top:g,left:f,updatePosition:(E,_)=>{this.setState({subMenuTop:E,subMenuLeft:_})},subMenuParentWidth:m,subMenuParentHeight:y},"sub-".concat(i))]})}}R(G,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function je(t,e,r){return e=mr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mr(t){var e=gr(t,"string");return typeof e=="symbol"?e:String(e)}function gr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class br extends c.Component{constructor(e){super(e),je(this,"container",void 0),je(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=K.createRef(),this.openMenu=K.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 r=this.container.current.getBoundingClientRect(),n=e.clientY-r.top,i=e.clientX-r.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==null||a.dispatchEvent(u)});return}if(N.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var s=N.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":r}=this.props,{actions:n,top:i,left:o}=this.state;return n&&(e=d.jsx(G,{ref:this.openMenu,actions:n,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(s,a)=>{this.setState({top:s,left:a})},"data-testid":r})),d.jsx("div",{className:I("context-menu-root",{active:n}),ref:this.container,children:e})}}const Hn=br;function rt(t,e,r){return e=yr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yr(t){var e=wr(t,"string");return typeof e=="symbol"?e:String(e)}function wr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class T extends c.Component{static handleEnter(e){var r=e;r.style.height="0"}static handleEntering(e){var r=e;r.style.height="".concat(T.getHeight(r),"px")}static handleExiting(e){var r=e;r.style.height="0"}static handleExit(e){var r=e;r.style.height="".concat(T.getHeight(r),"px")}static getHeight(e){var r=e.scrollWidth-e.clientWidth;return e.scrollHeight-r}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var r=e;r.style.height="";var{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){var i=r.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:r,in:n,"data-testid":i}=this.props;return d.jsx(mt,{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:I({collapse:o==="exited"},r),"data-testid":i,children:e})})}}rt(T,"propTypes",{className:k.string,in:k.bool.isRequired,children:k.node.isRequired,autoFocusOnShow:k.bool,"data-testid":k.string});rt(T,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const zn=T;function Re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Re(Object(r),!0).forEach(function(n){Pr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pr(t,e,r){return e=Sr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sr(t){var e=Or(t,"string");return typeof e=="symbol"?e:String(e)}function Or(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var nt=c.memo(t=>{var{tab:e,onClose:r,onSelect:n,isActive:i,activeRef:o,index:s,isDraggable:a,contextActions:u}=t,{key:l,isClosable:g=r!=null,title:f,icon:m}=e,y;return m!=null&&(y=K.isValidElement(m)?m:d.jsx(ie,{icon:m})),d.jsx(gt,{draggableId:l,index:s,isDragDisabled:!a,children:(b,x)=>d.jsxs("div",{className:"context-menu-wrapper",ref:i?o:null,children:[d.jsxs("div",te(te(te({ref:b.innerRef},b.draggableProps),b.dragHandleProps),{},{className:I("btn btn-link btn-nav-tab",{active:i},{dragging:x.isDragging}),"data-testid":"btn-nav-tab-".concat(f),role:"tab",tabIndex:0,onAuxClick:p=>{g&&p.button===1&&p.buttons===0&&(r==null||r(l))},onClick:p=>{if(g&&p.button===1&&p.buttons===0){r==null||r(l);return}p.button===0&&p.buttons===0&&(p.target.focus(),n(l))},onKeyPress:p=>{p.key==="Enter"&&n(l)},children:[y,f,g&&d.jsx(oe,{kind:"ghost",className:"btn-nav-tab-close",onClick:p=>{r==null||r(l),p.stopPropagation(),p.preventDefault()},icon:Jt,tooltip:"Close"})]})),d.jsx(xt,{actions:u})]})},l)});nt.displayName="NavTab";function Ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Le(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ie(Object(r),!0).forEach(function(n){Er(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Er(t,e,r){return e=xr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xr(t){var e=Cr(t,"string");return typeof e=="symbol"?e:String(e)}function Cr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mr=500,Dr=.01,Tr=5e-4;function Ne(t){return t.scrollLeft===0}function Ae(t){return t.scrollLeft+t.clientWidth===t.scrollWidth||t.scrollWidth===0}function _r(t,e,r){var{isClosable:n=!1,key:i}=t,o=[];if(n&&r!=null){o.push({title:"Close",order:10,group:20,action:()=>{r(i)}});for(var s=!0,a=e.length-1;a>0&&e[a].key!==t.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&&r(e[u].key)},disabled:s}),o.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(u=>{u.isClosable===!0&&r(u.key)})}})}return o}function qn(t){var{activeKey:e,tabs:r,onSelect:n,onReorder:i,onClose:o,makeContextActions:s}=t,a=c.useRef(),[u,l]=c.useState(!0),[g,f]=c.useState(!0),[m,y]=c.useState(!0),b=c.useCallback(()=>{a.current!=null&&(a.current.clientWidth<a.current.scrollWidth&&r.length>0?l(!0):l(!1),f(Ne(a.current)),y(Ae(a.current)))},[r]);tt(a.current,b);var x=c.useCallback(h=>{Ee.stopDragging(),h.destination&&(i==null||i(h.source.index,h.destination.index))},[i]),p=c.useCallback(()=>{if(a.current!=null){var h=Ne(a.current);h!==g&&f(h);var v=Ae(a.current);v!==m&&y(v)}},[g,m]),S=c.useRef({cancelClick:!1}),U=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=h.length-1;v>=0;v-=1){var w=h[v];if(w.offsetLeft<a.current.scrollLeft-5){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),z=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=0;v<h.length;v+=1){var w=h[v];if(w.offsetLeft+5>a.current.scrollLeft+a.current.offsetWidth){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),C=c.useCallback(function(h,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=arguments.length>3?arguments[3]:void 0,M=a.current;M!=null&&(S.current.cancelClick=!0,h==="left"?M.scrollLeft=v-w:h==="right"&&(M.scrollLeft=v+w),S.current.rAF=requestAnimationFrame(q=>{var me=P??q,ge=q-me,ee=Dr*ge+.5*Tr*ge**2;ee=Math.min(ee,M.scrollWidth),C(h,v,ee,me)}))},[]),E=c.useCallback(()=>{var{holdTimer:h,rAF:v}=S.current;h!=null&&(clearTimeout(h),S.current.holdTimer=void 0),v!=null&&(cancelAnimationFrame(v),S.current.rAF=void 0),window.removeEventListener("mouseup",E)},[]);c.useEffect(()=>()=>window.removeEventListener("mouseup",E),[E]);var _=c.useCallback(h=>{a.current!=null&&(S.current.holdTimer=window.setTimeout(C,Mr,h,a.current.scrollLeft)),S.current.cancelClick=!1,window.addEventListener("mouseup",E)},[E,C]),lt=c.useCallback(()=>{_("left")},[_]),ct=c.useCallback(()=>{_("right")},[_]);c.useEffect(function(){var v,w=P=>{P.stopPropagation(),P.preventDefault();var M=P.currentTarget,q=Math.abs(P.deltaY)>Math.abs(P.deltaX)?P.deltaY:P.deltaX;M.scrollLeft+=wt(q,-30,30)};return(v=a.current)===null||v===void 0||v.addEventListener("wheel",w),()=>{var P;(P=a.current)===null||P===void 0||P.removeEventListener("wheel",w)}},[]);var dt=c.useMemo(()=>{var h=new Map;return r.forEach(v=>{var{key:w}=v,P=[()=>_r(v,r,o),()=>{var M;return(M=s==null?void 0:s(v))!==null&&M!==void 0?M:[]}];h.set(w,P)}),h},[s,r,o]),V=c.useRef(null),ft=r.find(h=>h.key===e),ht=r.map((h,v)=>{var{key:w}=h,P=h===ft;return d.jsx(nt,{tab:h,index:v,isActive:P,activeRef:V,onSelect:n,onClose:o,isDraggable:i!=null,contextActions:dt.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:Xt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:U,onMouseDown:lt,disabled:g}),d.jsx(bt,{onDragStart:Ee.startDragging,onDragEnd:x,children:d.jsx(yt,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(h,v)=>d.jsxs("div",Le(Le({ref:w=>{w!=null&&(a.current=w,h.innerRef(w))}},h.droppableProps),{},{className:I("nav nav-tabs",{dragging:v.draggingFromThisWith}),role:"tablist",onScroll:p,children:[ht,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:ct,disabled:m})]})}function jr(t,e){var r=Ct(),n=c.useMemo(()=>new r.CoreClient(t,e),[r,t,e]);return c.useEffect(()=>()=>{n.disconnect()},[n]),n}var it=c.createContext(null);function Yn(t){var{serverUrl:e,options:r,children:n}=t,i=jr(e,r);return d.jsx(it.Provider,{value:i,children:n})}function Rr(){return X(it,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}function $e(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Ir(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){$e(o,n,i,s,a,"next",u)}function a(u){$e(o,n,i,s,a,"throw",u)}s(void 0)})}}var re=A.module("MessageUtils"),Zn="io.deephaven.message.LoginOptions.request",Lr="io.deephaven.message.SessionDetails.request",Jn="io.deephaven.broadcast",Nr="io.deephaven.broadcast.Login",Ar="io.deephaven.broadcast.Logout";function ot(t){var e=t;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Xn(t){return ot(t)&&t.message===Nr}function Qn(t){return ot(t)&&t.message===Ar}function $r(t){var e=t;return e!=null&&typeof e.id=="string"}function Fr(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe(),r=arguments.length>2?arguments[2]:void 0;return{message:t,id:e,payload:r}}function Vn(t,e){return{id:t,payload:e}}function Kr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Ur(t){return ae.apply(this,arguments)}function ae(){return ae=Ir(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,r=Kr();if(r==null)throw new Error("window parent is null, unable to send request.");return new Promise((n,i)=>{var o,s=fe(),a=u=>{var{data:l}=u;if(!$r(l)){re.debug("Ignoring non-deephaven response",l);return}if(re.debug("Received message",l),(l==null?void 0: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 Mt("Request timed out"))},e),r.postMessage(Fr(t,s),"*")})}),ae.apply(this,arguments)}function kr(t,e,r){return e=Br(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Br(t){var e=Wr(t,"string");return typeof e=="symbol"?e:String(e)}function Wr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Gr extends Error{constructor(){super(...arguments),kr(this,"isNoConsolesError",!0)}}function Hr(t){return t.isNoConsolesError}function Fe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Q(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Fe(o,n,i,s,a,"next",u)}function a(u){Fe(o,n,i,s,a,"throw",u)}s(void 0)})}}var F=A.module("SessionUtils");function ei(t,e){return F.info("Starting connection to '".concat(e,"'...")),new t.IdeConnection(e)}function zr(t,e,r){return se.apply(this,arguments)}function se(){return se=Q(function*(t,e,r){F.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new Gr("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:r,dh:t}}),se.apply(this,arguments)}function ti(t,e,r){return F.info("createCoreClient",e),new t.CoreClient(e,r)}function qr(t){return t!=null&&typeof t=="object"}function Yr(){return ue.apply(this,arguments)}function ue(){return ue=Q(function*(){var t=yield Ur(Lr);if(!qr(t))throw new Error("Unexpected session details response: ".concat(t));return t}),ue.apply(this,arguments)}function ri(){return le.apply(this,arguments)}function le(){return le=Q(function*(){var t=new URLSearchParams(window.location.search);switch(t.get("authProvider")){case"parent":return Yr()}return{}}),le.apply(this,arguments)}function ni(t,e,r){return ce.apply(this,arguments)}function ce(){return ce=Q(function*(t,e,r){var n;try{n=yield zr(t,e,r)}catch(i){if(!Hr(i))throw i}return n}),ce.apply(this,arguments)}function Ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ke(Object(r),!0).forEach(function(n){Jr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Jr(t,e,r){return e=Xr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xr(t){var e=Qr(t,"string");return typeof e=="symbol"?e:String(e)}function Qr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Vr=100,ne=()=>{},en=Object.freeze({});function tn(t){var{id:e="default",children:r,emptyDashboard:n,layoutConfig:i,layoutSettings:o=en,onLayoutConfigChange:s=ne,onGoldenLayoutChange:a=ne,onLayoutInitialized:u=ne,fallbackComponent:l=Rt,hydrate:g,dehydrate:f,panelWrapper:m}=t,y=c.useRef(null),[b,x]=c.useState(!1),[p,S]=c.useState();c.useEffect(function(){if(!y.current){S(void 0);return}var C=Zr({},Dt.makeDefaultLayout());C.settings===void 0&&(C.settings={}),Object.assign(C.settings,o),C.content=[];var E=new Tt(C,y.current),_=()=>{E.off("initialised",_),x(!0)};return E.on("initialised",_),l!=null&&E.setFallbackComponent(l),E.init(),S(E),a(E),()=>{E.destroy()}},[o,l,a,x,S]);var U=c.useMemo(()=>et(()=>{p!=null&&p.isInitialised&&(p==null||p.updateSize())},Vr),[p]);return tt(y.current,U),d.jsxs("div",{className:"dashboard-container w-100 h-100",children:[d.jsx("div",{className:"w-100 h-100",ref:y}),b&&p&&d.jsx(_t.Provider,{value:p,children:d.jsx(jt,{emptyDashboard:n,id:e,layout:p,layoutConfig:i,onLayoutChange:s,onLayoutInitialized:u,hydrate:g,dehydrate:f,panelWrapper:m,children:r})})]})}var ve="CREATE_DASHBOARD";function rn(t,e){try{t.off(ve,e)}catch{}}function ii(t,e){return t.on(ve,e),()=>rn(t,e)}function oi(t,e){t.emit(ve,e)}var nn=["id","isActive","plugins"];function Ue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ke(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ue(Object(r),!0).forEach(function(n){on(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function on(t,e,r){return e=an(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function an(t){var e=sn(t,"string");return typeof e=="symbol"?e:String(e)}function sn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function un(t,e){if(t==null)return{};var r=ln(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ln(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function cn(t){var{id:e,isActive:r,plugins:n}=t,i=un(t,nn),[o,s]=c.useState(r),a=Pt(),u=c.useCallback(l=>{a(e===It?Lt({layoutConfig:l}):Nt(e,{layoutConfig:l}))},[e,a]);return!o&&r&&s(!0),o?d.jsx(tn,ke(ke({id:e,onLayoutConfigChange:u},i),{},{children:n})):d.jsx(he,{})}function dn(t){var e=[...t.entries()].filter(r=>{var[,n]=r;return At(n)||be(n)});return e.map(r=>{var[n,i]=r;if(be(i)){var{DashboardPlugin:o}=i;return d.jsx(o,{},n)}var{component:s}=i;return d.jsx(s,{},n)})}function ai(){var t=$t(),e=c.useMemo(()=>dn(t),[t]);return e}var si=c.createContext({}),ui=c.createContext({}),fn=c.createContext(null),hn=c.createContext(null);function Be(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Be(o,n,i,s,a,"next",u)}function a(u){Be(o,n,i,s,a,"throw",u)}s(void 0)})}}var at=c.createContext(null);function li(t){var{children:e}=t,r=Rr(),[n,i]=c.useState(),[o,s]=c.useState();c.useEffect(function(){var l=!1;function g(){return f.apply(this,arguments)}function f(){return f=vn(function*(){try{var m=yield r.getServerConfigValues();l||i(new Map(m))}catch(y){l||s(y)}}),f.apply(this,arguments)}return g(),()=>{l=!0}},[r]);var a=n==null;return a||o!=null?d.jsx(he,{isLoading:a&&o==null,errorMessage:Ft(o)}):d.jsx(at.Provider,{value:n,children:e})}function ci(){return X(at,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function We(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function pn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);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 Ge(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function He(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ge(Object(r),!0).forEach(function(n){mn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mn(t,e,r){return e=gn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gn(t){var e=bn(t,"string");return typeof e=="symbol"?e:String(e)}function bn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function di(t){var{dashboards:e,activeDashboard:r,onLayoutInitialized:n,onGoldenLayoutChange:i,plugins:o,emptyDashboard:s=d.jsx(he,{})}=t,a=Kt(),u=c.useCallback((l,g)=>{var{metadata:f}=l;try{if(f!=null)return He(He({fetch:function(){var m=pn(function*(){return a(f)});function y(){return m.apply(this,arguments)}return y}()},l),{},{localDashboardId:g})}catch{}return Ut.hydrate(l,g)},[a]);return d.jsx("div",{className:"tab-content",children:e.map(l=>d.jsx("div",{className:I("tab-pane",{active:l.id===r}),children:d.jsx(cn,{id:l.id,isActive:l.id===r,emptyDashboard:s,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:n,onGoldenLayoutChange:i,hydrate:u,plugins:o},l.key)},l.id))})}function fi(){return X(hn,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function hi(){return X(fn,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}function ze(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function yn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);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 D(t,e,r){return e=wn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wn(t){var e=Pn(t,"string");return typeof e=="symbol"?e:String(e)}function Pn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var B=A.module("GrpcFileStorageTable");class H{constructor(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;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=r,this.root=n,n===r&&(this.doRefresh=St(this.doRefresh.bind(this),H.REFRESH_DEBOUNCE))}removeBaseRoot(e){return L.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,r){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(r){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==null||a.setExpanded(o,r)}}else if(this.childTables.has(i))if(o){var u=this.childTables.get(i);u==null||u.setExpanded(o,r)}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(r=>r!==e)}}doRefresh(e){B.debug2("doRefresh",this.root),e(this.fetchData())}refresh(){var e;B.debug2("refresh",this.root),(e=this.viewportUpdatePromise)===null||e===void 0||e.cancel();var r=new Promise(i=>{this.doRefresh(i)}),n=W.makeCancelable(r.then(i=>{if(this.viewportUpdatePromise!==n)throw new kt;return this.currentViewportData=i,this.sendUpdate(),i}));n.catch(i=>{W.isCanceled(i)||B.error("Error updating viewport",i)}),this.viewportUpdatePromise=n}refreshInternal(){try{this.refresh()}catch(e){W.isCanceled(e)||B.error("Unable to refresh data",e)}}fetchData(){var e=this;return yn(function*(){var{currentViewport:r}=e;if(!r)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,m)=>f.type!==m.type?f.type==="directory"?-1:1:f.basename.localeCompare(m.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:r.bottom-o});var g=yield l.getViewportData();i.splice(o+1,0,...g.items)}}}return e.currentSize=i.length,B.debug2(e.root,"items",i,r),i=i.slice(r.top,r.bottom),{items:i,offset:r.top}})()}sendUpdate(){for(var e,{listeners:r}=this,n=(e=this.currentViewportData)!==null&&e!==void 0?e:{items:[],offset:0},i=0;i<r.length;i+=1)r[i](n)}}D(H,"REFRESH_DEBOUNCE",50);function qe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function j(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){qe(o,n,i,s,a,"next",u)}function a(u){qe(o,n,i,s,a,"throw",u)}s(void 0)})}}function $(t,e,r){return e=Sn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sn(t){var e=On(t,"string");return typeof e=="symbol"?e:String(e)}function On(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var En=A.module("GrpcFileStorage");class pe{constructor(e,r){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",et(()=>{this.tables.forEach(i=>i.refresh())},pe.REFRESH_THROTTLE)),this.dh=e,this.storageService=r,this.root=n}removeRoot(e){return L.removeRoot(this.root,e)}addRoot(e){return L.addRoot(this.root,e)}createDirectory(e){var r=this;return j(function*(){return yield r.storageService.createDirectory(r.addRoot(e)),r.refreshTables(),{type:"directory",id:e,filename:e,basename:L.getBaseName(e)}})()}getTable(){var e=this;return j(function*(){var r=new H(e.storageService,e.root);return e.tables.push(r),r})()}saveFile(e){var r=this;return j(function*(){var n=r.dh.storage.FileContents.text(e.content);return yield r.storageService.saveFile(r.addRoot(e.filename),n,!0),r.refreshTables(),e})()}loadFile(e){var r=this;return j(function*(){var n=yield r.storageService.loadFile(r.addRoot(e)),i=yield n.text();return{filename:e,basename:L.getBaseName(e),content:i}})()}copyFile(e,r){var n=this;return j(function*(){var i=yield n.storageService.loadFile(n.addRoot(e));yield n.storageService.saveFile(n.addRoot(r),i,!1),n.refreshTables()})()}deleteFile(e){var r=this;return j(function*(){yield r.storageService.deleteItem(r.addRoot(e)),r.refreshTables()})()}moveFile(e,r){var n=this;return j(function*(){yield n.storageService.moveItem(n.addRoot(e),n.addRoot(r)),n.refreshTables()})()}info(e){var r=this;return j(function*(){var n=yield r.storageService.listItems(r.addRoot(L.getPath(e)),L.getBaseName(e));if(n.length===0)throw new Bt;if(n.length>1)throw En.error("More than one matching file found, should never happen.",n),new Error("More than one matching file found");var i=n[0];if(!Wt(i.type))throw new Error("Unexpected file type: ".concat(i.type));return{filename:r.removeRoot(i.filename),basename:i.basename,id:r.removeRoot(i.filename),type:i.type}})()}}$(pe,"REFRESH_THROTTLE",150);function Ye(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Ze(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);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)})}}function Je(t,e,r){return e=xn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xn(t){var e=Cn(t,"string");return typeof e=="symbol"?e:String(e)}function Cn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vi{constructor(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";Je(this,"storageService",void 0),Je(this,"root",void 0),this.storageService=e,this.root=r}getLayouts(){var e=this;return Ze(function*(){var r=yield e.storageService.listItems(e.root,"*.json");return r.map(n=>n.basename)})()}getLayout(e){var r=this;return Ze(function*(){var n=yield r.storageService.loadFile("".concat(r.root,"/").concat(e)),i=yield n.text();return JSON.parse(i)})()}}function Mn(t){return t.version===2}function Dn(t){return Array.isArray(t)}function Xe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Tn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Xe(o,n,i,s,a,"next",u)}function a(u){Xe(o,n,i,s,a,"throw",u)}s(void 0)})}}var Z=A.module("UserLayoutUtils"),_n={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:ye.COMPONENT,title:ye.TITLE,isClosable:!1},{type:"react-component",component:we.COMPONENT,title:we.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:Pe.COMPONENT,title:Pe.TITLE,isClosable:!1},{type:"react-component",component:Se.COMPONENT,title:Se.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},jn={layoutConfig:[],links:[],filterSets:[],version:2};function st(t){if(Mn(t))return t;if(Dn(t)){var e=t;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(t))}function Rn(t){return de.apply(this,arguments)}function de(){return de=Tn(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;try{var r=yield t.getLayouts();if(r.length>0)try{var n=yield t.getLayout(r[0]);return st(n)}catch(i){Z.error("Unable to load layout",r[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?_n:jn}),de.apply(this,arguments)}function In(t){var{filterSets:e,layoutConfig:r,links:n,pluginDataMap:i}=t,o={filterSets:e,layoutConfig:r,links:n,pluginDataMap:i,version:2};return o}const Ln={exportLayout:In,getDefaultLayout:Rn,normalizeLayout:st};function Qe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function J(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Qe(o,n,i,s,a,"next",u)}function a(u){Qe(o,n,i,s,a,"throw",u)}s(void 0)})}}function ut(t,e,r){return e=Nn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nn(t){var e=An(t,"string");return typeof e=="symbol"?e:String(e)}function An(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $n=A.module("LocalWorkspaceStorage");class O{static getBooleanServerConfig(e,r){var n,i;if((e==null||(n=e.get(r))===null||n===void 0?void 0:n.toLowerCase())==="true")return!0;if((e==null||(i=e.get(r))===null||i===void 0?void 0:i.toLowerCase())==="false")return!1}static makeDefaultWorkspaceSettings(e){for(var r={defaultDateTimeFormat:Oe.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:Oe.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:Gt.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Ht.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,showExtraGroupColumn:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0,gridDensity:"regular"},n={defaultDateTimeFormat:e==null?void 0:e.get("dateTimeFormat"),formatter:[],timeZone:e==null?void 0:e.get("timeZone"),showTimeZone:O.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:O.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:O.getBooleanServerConfig(e,"disableMoveConfirmation"),defaultDecimalFormatOptions:(e==null?void 0:e.get("decimalFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("decimalFormat")}:void 0,defaultIntegerFormatOptions:(e==null?void 0:e.get("integerFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("integerFormat")}:void 0,truncateNumbersWithPound:O.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:O.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:O.getBooleanServerConfig(e,"showNullStrings"),showExtraGroupColumn:O.getBooleanServerConfig(e,"showExtraGroupColumn"),defaultNotebookSettings:(e==null?void 0:e.get("isMinimapEnabled"))!==void 0?{isMinimapEnabled:O.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:O.getBooleanServerConfig(e,"web.webgl"),webglEditable:O.getBooleanServerConfig(e,"web.webgl.editable")},i=Object.keys(n),o=0;o<i.length;o+=1){var s=i[o];n[s]!==void 0&&(r[s]=n[s])}return r}static makeWorkspaceData(e,r){return J(function*(){var{filterSets:n,links:i,layoutConfig:o,pluginDataMap:s={}}=yield Ln.getDefaultLayout(e,r==null?void 0:r.isConsoleAvailable);return{settings:{},layoutConfig:o,closed:[{}],links:i,filterSets:n,pluginDataMap:s}})()}static makeDefaultWorkspace(e,r){return J(function*(){return{data:yield O.makeWorkspaceData(e,r)}})()}constructor(e){ut(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var r=this;return J(function*(){try{var n,i=JSON.parse((n=localStorage.getItem(O.STORAGE_KEY))!==null&&n!==void 0?n:"");return i}catch{return $n.info("Unable to load workspace data, initializing to default data"),O.makeDefaultWorkspace(r.layoutStorage,e)}})()}save(e){return J(function*(){return localStorage.setItem(O.STORAGE_KEY,JSON.stringify(e)),e})()}}ut(O,"STORAGE_KEY","deephaven.WorkspaceStorage");export{Mn as $,di as A,Jn as B,zn as C,ot as D,Hr as E,$r as F,vi as G,fr as H,Vn as I,Ur as J,tn as K,Gn as L,ve as M,qn as N,cn as O,or as P,oi as Q,ai as R,Lr as S,Wn as T,Ln as U,ui as V,fn as W,si as X,hn as Y,li as Z,H as _,Ar as a,Dn as a0,_n as a1,jn as a2,st as a3,Rn as a4,In as a5,Hn as b,fi as c,ci as d,hi as e,ri as f,dn as g,ni as h,pe as i,O as j,tt as k,ii as l,Fr as m,Yn as n,it as o,Nr as p,Zn as q,Gr as r,rn as s,ei as t,Rr as u,ti as v,zr as w,Kr as x,Xn as y,Qn as z};
2
- //# sourceMappingURL=LocalWorkspaceStorage-CFBIVjrj.js.map
1
+ import{r as c,J as d,bf as Ve,a9 as vt,M as I,V as K,bg as pt,L as mt,a2 as k,bh as gt,N as ie,bi as bt,bj as yt,aq as wt,I as fe,bk as et,a5 as Pt,a0 as St}from"./vendor-CohWXWuY.js";import{G as Ot,v as N,P as W,aK as Et,B as oe,ak as xt,u as Ct,aB as X,b6 as Mt,bV as Dt,cw as Tt,bY as _t,b_ as jt,cx as Rt,a9 as It,Z as Lt,Y as Nt,cl as At,cn as be,am as $t,cu as Ft,b5 as Kt,a6 as Ut,cy as L,cv as kt,cz as Bt,cA as Wt,cB as ye,cC as we,cD as Pe,cE as Se,b as Oe,a as Gt,I as Ht}from"./ControlType-NUmGfTww.js";import{N as zt,r as qt,k as Ee}from"./IrisGridShortcuts-BwHkgvtW.js";import{u as Yt}from"./useMergeRef-CdbLELuv.js";import{L as A,U as Zt,j as Jt,an as Xt,ao as Qt,J as he}from"./index-By1dHjp4.js";function tt(t,e){c.useEffect(()=>{if(t!=null){var r=new window.ResizeObserver(e);return r.observe(t),()=>{t!=null&&r.unobserve(t)}}},[t,e])}function Wn(){var{selectedThemeKey:t,setSelectedThemeKey:e,themes:r}=Ot(),n=c.useCallback(i=>{e(i)},[e]);return d.jsx(Ve,{label:"Pick a color scheme",items:r,selectedKey:t,onSelectionChange:n,children:i=>d.jsx(vt,{children:i.name},i.themeKey)})}function Gn(t){var{className:e,style:r}=t;return d.jsx("div",{className:I("dh-logo",e),style:r})}var Vt=["UNSAFE_className"],er=["defaultSelectedKey","disabledKeys","selectedKey","ref"];function xe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xe(Object(r),!0).forEach(function(n){tr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function tr(t,e,r){return e=rr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rr(t){var e=nr(t,"string");return typeof e=="symbol"?e:String(e)}function nr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Me(t,e){if(t==null)return{};var r=ir(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ir(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var or=K.forwardRef(function(e,r){var{UNSAFE_className:n}=e,i=Me(e,Vt),o=zt(i),{defaultSelectedKey:s,disabledKeys:a,selectedKey:u,ref:l}=o,g=Me(o,er),f=Yt(r,l);return d.jsx(Ve,Ce(Ce({},g),{},{ref:f,UNSAFE_className:I("dh-picker",n),defaultSelectedKey:s,disabledKeys:a,selectedKey:u}))});or.displayName="Picker";var ar=["color","UNSAFE_style"];function De(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?De(Object(r),!0).forEach(function(n){sr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sr(t,e,r){return e=ur(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ur(t){var e=lr(t,"string");return typeof e=="symbol"?e:String(e)}function lr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cr(t,e){if(t==null)return{};var r=dr(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function dr(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var fr=c.forwardRef((t,e)=>{var{color:r,UNSAFE_style:n}=t,i=cr(t,ar),o=c.useMemo(()=>Y(Y({},n),{},{color:qt(r)}),[r,n]);return d.jsx(pt,Y(Y({},i),{},{ref:e,UNSAFE_style:o}))});fr.displayName="Heading";function Te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function hr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Te(Object(r),!0).forEach(function(n){R(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function R(t,e,r){return e=vr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t){var e=pr(t,"string");return typeof e=="symbol"?e:String(e)}function pr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _e=A.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=K.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=K.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:r}=this.props;r(this)})}componentDidUpdate(e,r){var{actions:n}=this.props,{activeSubMenu:i}=this.state;if(i!==r.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:r}=this.state;return r}return this.getMouseIndex()}setKeyboardIndex(e){var{options:r}=this.props;r.separateKeyboardMouse!==void 0&&r.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,r=e.initialKeyboardIndex;r===void 0&&(r=-1);for(var{actions:n}=this.props,i=N.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:r,activeSubMenu:null,menuItems:N.sortActions(o)})}initMenuPromise(e){var r=W.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(r)})),r.then(n=>{this.setState(i=>{var o=i.pendingItems.indexOf(r);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{menuItems:N.sortActions(i.menuItems.concat(n)),pendingItems:s}}return null})},n=>{W.isCanceled(n)||(this.setState(i=>{var o=i.pendingItems.indexOf(r);if(o>=0){var s=i.pendingItems.slice();return s.splice(o,1),{pendingItems:s}}return null}),_e.error(n))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(r=>r.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,r,n,i,{options:o,updatePosition:s,subMenuParentWidth:a,subMenuParentHeight:u,top:l,left:g}=this.props;if(!(!this.container.current||o.doNotVerifyPosition!=null&&o.doNotVerifyPosition)){var{top:f,left:m}=this.initialPosition,{width:y,height:b}=(e=(r=this.container.current)===null||r===void 0?void 0:r.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},x=((n=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&n!==void 0?n:0)>window.innerHeight;b===0||y===0||(f+b>window.innerHeight&&(f-b-u>0?f-=b-u:f=window.innerHeight-b),m+y>window.innerWidth&&(m=m-y-a),(g!==m||l!==f)&&(this.setState({hasOverflow:x}),s(f,m)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){_e.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var r=e.relatedTarget,n=!1;r&&!n;)n=r.hasAttribute("data-dh-context-menu"),r=r.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){var{left:r}=this.props;return e==="Escape"||r<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:r}=this.state,n=this.getKeyboardIndex(),i=n,o=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<r.length&&this.handleMenuItemClick(r[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=r.length?o=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=N.getNextMenuItem(i,-1,r):(e.key==="ArrowDown"||e.key==="Tab")&&(i=N.getNextMenuItem(i,1,r)),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:r,activeSubMenu:n}=this.state,i=r[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:r,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,r){r.preventDefault(),r.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(r.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,r){r.metaKey||this.handleMenuItemClick(e,r)}handleMenuItemMouseMove(e){var{menuItems:r}=this.state,n=r.indexOf(e);this.setMouseIndex(n),n>=0&&n<r.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:r,left:n}=this.props,{activeSubMenu:i,hasOverflow:o,keyboardIndex:s,menuItems:a,mouseIndex:u,pendingItems:l,subMenuTop:g,subMenuLeft:f,subMenuParentWidth:m,subMenuParentHeight:y}=this.state,b=0;b<a.length;b+=1){var x=a[b];b>0&&x.group!==a[b-1].group&&e.push(d.jsx("hr",{},"".concat(b,".separator")));var p=d.jsx(Et,{ref:i===b?this.activeSubMenuRef:null,isKeyboardSelected:s===b,isMouseSelected:u===b,menuItem:x,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},b);e.push(p)}var S=null;l.length>0&&(S=d.jsx("div",{className:"loading",children:d.jsx(Zt,{className:"loading-spinner-vertical-align"})}));var{menuStyle:U,"data-testid":z}=this.props,C=i!==null&&g!==null&&f!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:I({"has-overflow":o},"context-menu-container"),style:hr({top:r,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,S]}),C&&i!==null&&g!==null&&f!==null&&d.jsx(G,{actions:a[i].actions||[],closeMenu:this.handleCloseSubMenu,top:g,left:f,updatePosition:(E,_)=>{this.setState({subMenuTop:E,subMenuLeft:_})},subMenuParentWidth:m,subMenuParentHeight:y},"sub-".concat(i))]})}}R(G,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function je(t,e,r){return e=mr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mr(t){var e=gr(t,"string");return typeof e=="symbol"?e:String(e)}function gr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class br extends c.Component{constructor(e){super(e),je(this,"container",void 0),je(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=K.createRef(),this.openMenu=K.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 r=this.container.current.getBoundingClientRect(),n=e.clientY-r.top,i=e.clientX-r.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==null||a.dispatchEvent(u)});return}if(N.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var s=N.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":r}=this.props,{actions:n,top:i,left:o}=this.state;return n&&(e=d.jsx(G,{ref:this.openMenu,actions:n,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(s,a)=>{this.setState({top:s,left:a})},"data-testid":r})),d.jsx("div",{className:I("context-menu-root",{active:n}),ref:this.container,children:e})}}const Hn=br;function rt(t,e,r){return e=yr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yr(t){var e=wr(t,"string");return typeof e=="symbol"?e:String(e)}function wr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class T extends c.Component{static handleEnter(e){var r=e;r.style.height="0"}static handleEntering(e){var r=e;r.style.height="".concat(T.getHeight(r),"px")}static handleExiting(e){var r=e;r.style.height="0"}static handleExit(e){var r=e;r.style.height="".concat(T.getHeight(r),"px")}static getHeight(e){var r=e.scrollWidth-e.clientWidth;return e.scrollHeight-r}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var r=e;r.style.height="";var{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){var i=r.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:r,in:n,"data-testid":i}=this.props;return d.jsx(mt,{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:I({collapse:o==="exited"},r),"data-testid":i,children:e})})}}rt(T,"propTypes",{className:k.string,in:k.bool.isRequired,children:k.node.isRequired,autoFocusOnShow:k.bool,"data-testid":k.string});rt(T,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const zn=T;function Re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Re(Object(r),!0).forEach(function(n){Pr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pr(t,e,r){return e=Sr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sr(t){var e=Or(t,"string");return typeof e=="symbol"?e:String(e)}function Or(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var nt=c.memo(t=>{var{tab:e,onClose:r,onSelect:n,isActive:i,activeRef:o,index:s,isDraggable:a,contextActions:u}=t,{key:l,isClosable:g=r!=null,title:f,icon:m}=e,y;return m!=null&&(y=K.isValidElement(m)?m:d.jsx(ie,{icon:m})),d.jsx(gt,{draggableId:l,index:s,isDragDisabled:!a,children:(b,x)=>d.jsxs("div",{className:"context-menu-wrapper",ref:i?o:null,children:[d.jsxs("div",te(te(te({ref:b.innerRef},b.draggableProps),b.dragHandleProps),{},{className:I("btn btn-link btn-nav-tab",{active:i},{dragging:x.isDragging}),"data-testid":"btn-nav-tab-".concat(f),role:"tab",tabIndex:0,onAuxClick:p=>{g&&p.button===1&&p.buttons===0&&(r==null||r(l))},onClick:p=>{if(g&&p.button===1&&p.buttons===0){r==null||r(l);return}p.button===0&&p.buttons===0&&(p.target.focus(),n(l))},onKeyPress:p=>{p.key==="Enter"&&n(l)},children:[y,f,g&&d.jsx(oe,{kind:"ghost",className:"btn-nav-tab-close",onClick:p=>{r==null||r(l),p.stopPropagation(),p.preventDefault()},icon:Jt,tooltip:"Close"})]})),d.jsx(xt,{actions:u})]})},l)});nt.displayName="NavTab";function Ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Le(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ie(Object(r),!0).forEach(function(n){Er(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Er(t,e,r){return e=xr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xr(t){var e=Cr(t,"string");return typeof e=="symbol"?e:String(e)}function Cr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mr=500,Dr=.01,Tr=5e-4;function Ne(t){return t.scrollLeft===0}function Ae(t){return t.scrollLeft+t.clientWidth===t.scrollWidth||t.scrollWidth===0}function _r(t,e,r){var{isClosable:n=!1,key:i}=t,o=[];if(n&&r!=null){o.push({title:"Close",order:10,group:20,action:()=>{r(i)}});for(var s=!0,a=e.length-1;a>0&&e[a].key!==t.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&&r(e[u].key)},disabled:s}),o.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(u=>{u.isClosable===!0&&r(u.key)})}})}return o}function qn(t){var{activeKey:e,tabs:r,onSelect:n,onReorder:i,onClose:o,makeContextActions:s}=t,a=c.useRef(),[u,l]=c.useState(!0),[g,f]=c.useState(!0),[m,y]=c.useState(!0),b=c.useCallback(()=>{a.current!=null&&(a.current.clientWidth<a.current.scrollWidth&&r.length>0?l(!0):l(!1),f(Ne(a.current)),y(Ae(a.current)))},[r]);tt(a.current,b);var x=c.useCallback(h=>{Ee.stopDragging(),h.destination&&(i==null||i(h.source.index,h.destination.index))},[i]),p=c.useCallback(()=>{if(a.current!=null){var h=Ne(a.current);h!==g&&f(h);var v=Ae(a.current);v!==m&&y(v)}},[g,m]),S=c.useRef({cancelClick:!1}),U=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=h.length-1;v>=0;v-=1){var w=h[v];if(w.offsetLeft<a.current.scrollLeft-5){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),z=c.useCallback(()=>{if(!(a.current==null||S.current.cancelClick))for(var{children:h}=a.current,v=0;v<h.length;v+=1){var w=h[v];if(w.offsetLeft+5>a.current.scrollLeft+a.current.offsetWidth){w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),C=c.useCallback(function(h,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=arguments.length>3?arguments[3]:void 0,M=a.current;M!=null&&(S.current.cancelClick=!0,h==="left"?M.scrollLeft=v-w:h==="right"&&(M.scrollLeft=v+w),S.current.rAF=requestAnimationFrame(q=>{var me=P??q,ge=q-me,ee=Dr*ge+.5*Tr*ge**2;ee=Math.min(ee,M.scrollWidth),C(h,v,ee,me)}))},[]),E=c.useCallback(()=>{var{holdTimer:h,rAF:v}=S.current;h!=null&&(clearTimeout(h),S.current.holdTimer=void 0),v!=null&&(cancelAnimationFrame(v),S.current.rAF=void 0),window.removeEventListener("mouseup",E)},[]);c.useEffect(()=>()=>window.removeEventListener("mouseup",E),[E]);var _=c.useCallback(h=>{a.current!=null&&(S.current.holdTimer=window.setTimeout(C,Mr,h,a.current.scrollLeft)),S.current.cancelClick=!1,window.addEventListener("mouseup",E)},[E,C]),lt=c.useCallback(()=>{_("left")},[_]),ct=c.useCallback(()=>{_("right")},[_]);c.useEffect(function(){var v,w=P=>{P.stopPropagation(),P.preventDefault();var M=P.currentTarget,q=Math.abs(P.deltaY)>Math.abs(P.deltaX)?P.deltaY:P.deltaX;M.scrollLeft+=wt(q,-30,30)};return(v=a.current)===null||v===void 0||v.addEventListener("wheel",w),()=>{var P;(P=a.current)===null||P===void 0||P.removeEventListener("wheel",w)}},[]);var dt=c.useMemo(()=>{var h=new Map;return r.forEach(v=>{var{key:w}=v,P=[()=>_r(v,r,o),()=>{var M;return(M=s==null?void 0:s(v))!==null&&M!==void 0?M:[]}];h.set(w,P)}),h},[s,r,o]),V=c.useRef(null),ft=r.find(h=>h.key===e),ht=r.map((h,v)=>{var{key:w}=h,P=h===ft;return d.jsx(nt,{tab:h,index:v,isActive:P,activeRef:V,onSelect:n,onClose:o,isDraggable:i!=null,contextActions:dt.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:Xt,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:U,onMouseDown:lt,disabled:g}),d.jsx(bt,{onDragStart:Ee.startDragging,onDragEnd:x,children:d.jsx(yt,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(h,v)=>d.jsxs("div",Le(Le({ref:w=>{w!=null&&(a.current=w,h.innerRef(w))}},h.droppableProps),{},{className:I("nav nav-tabs",{dragging:v.draggingFromThisWith}),role:"tablist",onScroll:p,children:[ht,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:ct,disabled:m})]})}function jr(t,e){var r=Ct(),n=c.useMemo(()=>new r.CoreClient(t,e),[r,t,e]);return c.useEffect(()=>()=>{n.disconnect()},[n]),n}var it=c.createContext(null);function Yn(t){var{serverUrl:e,options:r,children:n}=t,i=jr(e,r);return d.jsx(it.Provider,{value:i,children:n})}function Rr(){return X(it,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}function $e(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Ir(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){$e(o,n,i,s,a,"next",u)}function a(u){$e(o,n,i,s,a,"throw",u)}s(void 0)})}}var re=A.module("MessageUtils"),Zn="io.deephaven.message.LoginOptions.request",Lr="io.deephaven.message.SessionDetails.request",Jn="io.deephaven.broadcast",Nr="io.deephaven.broadcast.Login",Ar="io.deephaven.broadcast.Logout";function ot(t){var e=t;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Xn(t){return ot(t)&&t.message===Nr}function Qn(t){return ot(t)&&t.message===Ar}function $r(t){var e=t;return e!=null&&typeof e.id=="string"}function Fr(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe(),r=arguments.length>2?arguments[2]:void 0;return{message:t,id:e,payload:r}}function Vn(t,e){return{id:t,payload:e}}function Kr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Ur(t){return ae.apply(this,arguments)}function ae(){return ae=Ir(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,r=Kr();if(r==null)throw new Error("window parent is null, unable to send request.");return new Promise((n,i)=>{var o,s=fe(),a=u=>{var{data:l}=u;if(!$r(l)){re.debug("Ignoring non-deephaven response",l);return}if(re.debug("Received message",l),(l==null?void 0: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 Mt("Request timed out"))},e),r.postMessage(Fr(t,s),"*")})}),ae.apply(this,arguments)}function kr(t,e,r){return e=Br(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Br(t){var e=Wr(t,"string");return typeof e=="symbol"?e:String(e)}function Wr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Gr extends Error{constructor(){super(...arguments),kr(this,"isNoConsolesError",!0)}}function Hr(t){return t.isNoConsolesError}function Fe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Q(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Fe(o,n,i,s,a,"next",u)}function a(u){Fe(o,n,i,s,a,"throw",u)}s(void 0)})}}var F=A.module("SessionUtils");function ei(t,e){return F.info("Starting connection to '".concat(e,"'...")),new t.IdeConnection(e)}function zr(t,e,r){return se.apply(this,arguments)}function se(){return se=Q(function*(t,e,r){F.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new Gr("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:r,dh:t}}),se.apply(this,arguments)}function ti(t,e,r){return F.info("createCoreClient",e),new t.CoreClient(e,r)}function qr(t){return t!=null&&typeof t=="object"}function Yr(){return ue.apply(this,arguments)}function ue(){return ue=Q(function*(){var t=yield Ur(Lr);if(!qr(t))throw new Error("Unexpected session details response: ".concat(t));return t}),ue.apply(this,arguments)}function ri(){return le.apply(this,arguments)}function le(){return le=Q(function*(){var t=new URLSearchParams(window.location.search);switch(t.get("authProvider")){case"parent":return Yr()}return{}}),le.apply(this,arguments)}function ni(t,e,r){return ce.apply(this,arguments)}function ce(){return ce=Q(function*(t,e,r){var n;try{n=yield zr(t,e,r)}catch(i){if(!Hr(i))throw i}return n}),ce.apply(this,arguments)}function Ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ke(Object(r),!0).forEach(function(n){Jr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Jr(t,e,r){return e=Xr(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xr(t){var e=Qr(t,"string");return typeof e=="symbol"?e:String(e)}function Qr(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Vr=100,ne=()=>{},en=Object.freeze({});function tn(t){var{id:e="default",children:r,emptyDashboard:n,layoutConfig:i,layoutSettings:o=en,onLayoutConfigChange:s=ne,onGoldenLayoutChange:a=ne,onLayoutInitialized:u=ne,fallbackComponent:l=Rt,hydrate:g,dehydrate:f,panelWrapper:m}=t,y=c.useRef(null),[b,x]=c.useState(!1),[p,S]=c.useState();c.useEffect(function(){if(!y.current){S(void 0);return}var C=Zr({},Dt.makeDefaultLayout());C.settings===void 0&&(C.settings={}),Object.assign(C.settings,o),C.content=[];var E=new Tt(C,y.current),_=()=>{E.off("initialised",_),x(!0)};return E.on("initialised",_),l!=null&&E.setFallbackComponent(l),E.init(),S(E),a(E),()=>{E.destroy()}},[o,l,a,x,S]);var U=c.useMemo(()=>et(()=>{p!=null&&p.isInitialised&&(p==null||p.updateSize())},Vr),[p]);return tt(y.current,U),d.jsxs("div",{className:"dashboard-container w-100 h-100",children:[d.jsx("div",{className:"w-100 h-100",ref:y}),b&&p&&d.jsx(_t.Provider,{value:p,children:d.jsx(jt,{emptyDashboard:n,id:e,layout:p,layoutConfig:i,onLayoutChange:s,onLayoutInitialized:u,hydrate:g,dehydrate:f,panelWrapper:m,children:r})})]})}var ve="CREATE_DASHBOARD";function rn(t,e){try{t.off(ve,e)}catch{}}function ii(t,e){return t.on(ve,e),()=>rn(t,e)}function oi(t,e){t.emit(ve,e)}var nn=["id","isActive","plugins"];function Ue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ke(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ue(Object(r),!0).forEach(function(n){on(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function on(t,e,r){return e=an(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function an(t){var e=sn(t,"string");return typeof e=="symbol"?e:String(e)}function sn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function un(t,e){if(t==null)return{};var r=ln(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ln(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function cn(t){var{id:e,isActive:r,plugins:n}=t,i=un(t,nn),[o,s]=c.useState(r),a=Pt(),u=c.useCallback(l=>{a(e===It?Lt({layoutConfig:l}):Nt(e,{layoutConfig:l}))},[e,a]);return!o&&r&&s(!0),o?d.jsx(tn,ke(ke({id:e,onLayoutConfigChange:u},i),{},{children:n})):d.jsx(he,{})}function dn(t){var e=[...t.entries()].filter(r=>{var[,n]=r;return At(n)||be(n)});return e.map(r=>{var[n,i]=r;if(be(i)){var{DashboardPlugin:o}=i;return d.jsx(o,{},n)}var{component:s}=i;return d.jsx(s,{},n)})}function ai(){var t=$t(),e=c.useMemo(()=>dn(t),[t]);return e}var si=c.createContext({}),ui=c.createContext({}),fn=c.createContext(null),hn=c.createContext(null);function Be(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Be(o,n,i,s,a,"next",u)}function a(u){Be(o,n,i,s,a,"throw",u)}s(void 0)})}}var at=c.createContext(null);function li(t){var{children:e}=t,r=Rr(),[n,i]=c.useState(),[o,s]=c.useState();c.useEffect(function(){var l=!1;function g(){return f.apply(this,arguments)}function f(){return f=vn(function*(){try{var m=yield r.getServerConfigValues();l||i(new Map(m))}catch(y){l||s(y)}}),f.apply(this,arguments)}return g(),()=>{l=!0}},[r]);var a=n==null;return a||o!=null?d.jsx(he,{isLoading:a&&o==null,errorMessage:Ft(o)}):d.jsx(at.Provider,{value:n,children:e})}function ci(){return X(at,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function We(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function pn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);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 Ge(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function He(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ge(Object(r),!0).forEach(function(n){mn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mn(t,e,r){return e=gn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gn(t){var e=bn(t,"string");return typeof e=="symbol"?e:String(e)}function bn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function di(t){var{dashboards:e,activeDashboard:r,onLayoutInitialized:n,onGoldenLayoutChange:i,plugins:o,emptyDashboard:s=d.jsx(he,{})}=t,a=Kt(),u=c.useCallback((l,g)=>{var{metadata:f}=l;try{if(f!=null)return He(He({fetch:function(){var m=pn(function*(){return a(f)});function y(){return m.apply(this,arguments)}return y}()},l),{},{localDashboardId:g})}catch{}return Ut.hydrate(l,g)},[a]);return d.jsx("div",{className:"tab-content",children:e.map(l=>d.jsx("div",{className:I("tab-pane",{active:l.id===r}),children:d.jsx(cn,{id:l.id,isActive:l.id===r,emptyDashboard:s,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:n,onGoldenLayoutChange:i,hydrate:u,plugins:o},l.key)},l.id))})}function fi(){return X(hn,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function hi(){return X(fn,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}function ze(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function yn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);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 D(t,e,r){return e=wn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wn(t){var e=Pn(t,"string");return typeof e=="symbol"?e:String(e)}function Pn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var B=A.module("GrpcFileStorageTable");class H{constructor(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;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=r,this.root=n,n===r&&(this.doRefresh=St(this.doRefresh.bind(this),H.REFRESH_DEBOUNCE))}removeBaseRoot(e){return L.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,r){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(r){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==null||a.setExpanded(o,r)}}else if(this.childTables.has(i))if(o){var u=this.childTables.get(i);u==null||u.setExpanded(o,r)}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(r=>r!==e)}}doRefresh(e){B.debug2("doRefresh",this.root),e(this.fetchData())}refresh(){var e;B.debug2("refresh",this.root),(e=this.viewportUpdatePromise)===null||e===void 0||e.cancel();var r=new Promise(i=>{this.doRefresh(i)}),n=W.makeCancelable(r.then(i=>{if(this.viewportUpdatePromise!==n)throw new kt;return this.currentViewportData=i,this.sendUpdate(),i}));n.catch(i=>{W.isCanceled(i)||B.error("Error updating viewport",i)}),this.viewportUpdatePromise=n}refreshInternal(){try{this.refresh()}catch(e){W.isCanceled(e)||B.error("Unable to refresh data",e)}}fetchData(){var e=this;return yn(function*(){var{currentViewport:r}=e;if(!r)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,m)=>f.type!==m.type?f.type==="directory"?-1:1:f.basename.localeCompare(m.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:r.bottom-o});var g=yield l.getViewportData();i.splice(o+1,0,...g.items)}}}return e.currentSize=i.length,B.debug2(e.root,"items",i,r),i=i.slice(r.top,r.bottom),{items:i,offset:r.top}})()}sendUpdate(){for(var e,{listeners:r}=this,n=(e=this.currentViewportData)!==null&&e!==void 0?e:{items:[],offset:0},i=0;i<r.length;i+=1)r[i](n)}}D(H,"REFRESH_DEBOUNCE",50);function qe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function j(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){qe(o,n,i,s,a,"next",u)}function a(u){qe(o,n,i,s,a,"throw",u)}s(void 0)})}}function $(t,e,r){return e=Sn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sn(t){var e=On(t,"string");return typeof e=="symbol"?e:String(e)}function On(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var En=A.module("GrpcFileStorage");class pe{constructor(e,r){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",et(()=>{this.tables.forEach(i=>i.refresh())},pe.REFRESH_THROTTLE)),this.dh=e,this.storageService=r,this.root=n}removeRoot(e){return L.removeRoot(this.root,e)}addRoot(e){return L.addRoot(this.root,e)}createDirectory(e){var r=this;return j(function*(){return yield r.storageService.createDirectory(r.addRoot(e)),r.refreshTables(),{type:"directory",id:e,filename:e,basename:L.getBaseName(e)}})()}getTable(){var e=this;return j(function*(){var r=new H(e.storageService,e.root);return e.tables.push(r),r})()}saveFile(e){var r=this;return j(function*(){var n=r.dh.storage.FileContents.text(e.content);return yield r.storageService.saveFile(r.addRoot(e.filename),n,!0),r.refreshTables(),e})()}loadFile(e){var r=this;return j(function*(){var n=yield r.storageService.loadFile(r.addRoot(e)),i=yield n.text();return{filename:e,basename:L.getBaseName(e),content:i}})()}copyFile(e,r){var n=this;return j(function*(){var i=yield n.storageService.loadFile(n.addRoot(e));yield n.storageService.saveFile(n.addRoot(r),i,!1),n.refreshTables()})()}deleteFile(e){var r=this;return j(function*(){yield r.storageService.deleteItem(r.addRoot(e)),r.refreshTables()})()}moveFile(e,r){var n=this;return j(function*(){yield n.storageService.moveItem(n.addRoot(e),n.addRoot(r)),n.refreshTables()})()}info(e){var r=this;return j(function*(){var n=yield r.storageService.listItems(r.addRoot(L.getPath(e)),L.getBaseName(e));if(n.length===0)throw new Bt;if(n.length>1)throw En.error("More than one matching file found, should never happen.",n),new Error("More than one matching file found");var i=n[0];if(!Wt(i.type))throw new Error("Unexpected file type: ".concat(i.type));return{filename:r.removeRoot(i.filename),basename:i.basename,id:r.removeRoot(i.filename),type:i.type}})()}}$(pe,"REFRESH_THROTTLE",150);function Ye(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Ze(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);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)})}}function Je(t,e,r){return e=xn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xn(t){var e=Cn(t,"string");return typeof e=="symbol"?e:String(e)}function Cn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vi{constructor(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";Je(this,"storageService",void 0),Je(this,"root",void 0),this.storageService=e,this.root=r}getLayouts(){var e=this;return Ze(function*(){var r=yield e.storageService.listItems(e.root,"*.json");return r.map(n=>n.basename)})()}getLayout(e){var r=this;return Ze(function*(){var n=yield r.storageService.loadFile("".concat(r.root,"/").concat(e)),i=yield n.text();return JSON.parse(i)})()}}function Mn(t){return t.version===2}function Dn(t){return Array.isArray(t)}function Xe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Tn(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Xe(o,n,i,s,a,"next",u)}function a(u){Xe(o,n,i,s,a,"throw",u)}s(void 0)})}}var Z=A.module("UserLayoutUtils"),_n={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:ye.COMPONENT,title:ye.TITLE,isClosable:!1},{type:"react-component",component:we.COMPONENT,title:we.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:Pe.COMPONENT,title:Pe.TITLE,isClosable:!1},{type:"react-component",component:Se.COMPONENT,title:Se.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},jn={layoutConfig:[],links:[],filterSets:[],version:2};function st(t){if(Mn(t))return t;if(Dn(t)){var e=t;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(t))}function Rn(t){return de.apply(this,arguments)}function de(){return de=Tn(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;try{var r=yield t.getLayouts();if(r.length>0)try{var n=yield t.getLayout(r[0]);return st(n)}catch(i){Z.error("Unable to load layout",r[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?_n:jn}),de.apply(this,arguments)}function In(t){var{filterSets:e,layoutConfig:r,links:n,pluginDataMap:i}=t,o={filterSets:e,layoutConfig:r,links:n,pluginDataMap:i,version:2};return o}const Ln={exportLayout:In,getDefaultLayout:Rn,normalizeLayout:st};function Qe(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function J(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Qe(o,n,i,s,a,"next",u)}function a(u){Qe(o,n,i,s,a,"throw",u)}s(void 0)})}}function ut(t,e,r){return e=Nn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nn(t){var e=An(t,"string");return typeof e=="symbol"?e:String(e)}function An(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $n=A.module("LocalWorkspaceStorage");class O{static getBooleanServerConfig(e,r){var n,i;if((e==null||(n=e.get(r))===null||n===void 0?void 0:n.toLowerCase())==="true")return!0;if((e==null||(i=e.get(r))===null||i===void 0?void 0:i.toLowerCase())==="false")return!1}static makeDefaultWorkspaceSettings(e){for(var r={defaultDateTimeFormat:Oe.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:Oe.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:Gt.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Ht.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,showExtraGroupColumn:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0,gridDensity:"regular"},n={defaultDateTimeFormat:e==null?void 0:e.get("dateTimeFormat"),formatter:[],timeZone:e==null?void 0:e.get("timeZone"),showTimeZone:O.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:O.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:O.getBooleanServerConfig(e,"disableMoveConfirmation"),defaultDecimalFormatOptions:(e==null?void 0:e.get("decimalFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("decimalFormat")}:void 0,defaultIntegerFormatOptions:(e==null?void 0:e.get("integerFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("integerFormat")}:void 0,truncateNumbersWithPound:O.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:O.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:O.getBooleanServerConfig(e,"showNullStrings"),showExtraGroupColumn:O.getBooleanServerConfig(e,"showExtraGroupColumn"),defaultNotebookSettings:(e==null?void 0:e.get("isMinimapEnabled"))!==void 0?{isMinimapEnabled:O.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:O.getBooleanServerConfig(e,"web.webgl"),webglEditable:O.getBooleanServerConfig(e,"web.webgl.editable")},i=Object.keys(n),o=0;o<i.length;o+=1){var s=i[o];n[s]!==void 0&&(r[s]=n[s])}return r}static makeWorkspaceData(e,r){return J(function*(){var{filterSets:n,links:i,layoutConfig:o,pluginDataMap:s={}}=yield Ln.getDefaultLayout(e,r==null?void 0:r.isConsoleAvailable);return{settings:{},layoutConfig:o,closed:[{}],links:i,filterSets:n,pluginDataMap:s}})()}static makeDefaultWorkspace(e,r){return J(function*(){return{data:yield O.makeWorkspaceData(e,r)}})()}constructor(e){ut(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var r=this;return J(function*(){try{var n,i=JSON.parse((n=localStorage.getItem(O.STORAGE_KEY))!==null&&n!==void 0?n:"");return i}catch{return $n.info("Unable to load workspace data, initializing to default data"),O.makeDefaultWorkspace(r.layoutStorage,e)}})()}save(e){return J(function*(){return localStorage.setItem(O.STORAGE_KEY,JSON.stringify(e)),e})()}}ut(O,"STORAGE_KEY","deephaven.WorkspaceStorage");export{Mn as $,di as A,Jn as B,zn as C,ot as D,Hr as E,$r as F,vi as G,fr as H,Vn as I,Ur as J,tn as K,Gn as L,ve as M,qn as N,cn as O,or as P,oi as Q,ai as R,Lr as S,Wn as T,Ln as U,ui as V,fn as W,si as X,hn as Y,li as Z,H as _,Ar as a,Dn as a0,_n as a1,jn as a2,st as a3,Rn as a4,In as a5,Hn as b,fi as c,ci as d,hi as e,ri as f,dn as g,ni as h,pe as i,O as j,tt as k,ii as l,Fr as m,Yn as n,it as o,Nr as p,Zn as q,Gr as r,rn as s,ei as t,Rr as u,ti as v,zr as w,Kr as x,Xn as y,Qn as z};
2
+ //# sourceMappingURL=LocalWorkspaceStorage-h3-A9jVy.js.map