@deephaven/code-studio 1.25.0 → 1.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{AppRoot-DtgU9S6w.js → AppRoot-C7_ceaOH.js} +7 -7
- package/build/assets/{AppRoot-DtgU9S6w.js.map → AppRoot-C7_ceaOH.js.map} +1 -1
- package/build/assets/Chart-C5VfXR8_.js +3 -0
- package/build/assets/Chart-C5VfXR8_.js.map +1 -0
- package/build/assets/{ControlType-BF6z_P8r.js → ControlType-DwvZrAze.js} +4 -4
- package/build/assets/{ControlType-BF6z_P8r.js.map → ControlType-DwvZrAze.js.map} +1 -1
- package/build/assets/{FormatterUtils-DaRzdlBV.js → FormatterUtils-DC0RNVpr.js} +2 -2
- package/build/assets/{FormatterUtils-DaRzdlBV.js.map → FormatterUtils-DC0RNVpr.js.map} +1 -1
- package/build/assets/{Grid-CHE58QlW.js → Grid-CWkUIF_E.js} +2 -2
- package/build/assets/{Grid-CHE58QlW.js.map → Grid-CWkUIF_E.js.map} +1 -1
- package/build/assets/{IrisGrid-DAGrSu_b.js → IrisGrid-DdR3tLY1.js} +2 -2
- package/build/assets/{IrisGrid-DAGrSu_b.js.map → IrisGrid-DdR3tLY1.js.map} +1 -1
- package/build/assets/{IrisGridModel-B5RDaEyK.js → IrisGridModel-Cyc0Q4ng.js} +4 -4
- package/build/assets/IrisGridModel-Cyc0Q4ng.js.map +1 -0
- package/build/assets/{IrisGridShortcuts-DPT2MWqR.js → IrisGridShortcuts-DSMTfByt.js} +2 -2
- package/build/assets/{IrisGridShortcuts-DPT2MWqR.js.map → IrisGridShortcuts-DSMTfByt.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-BuDLzqZU.js → LocalWorkspaceStorage-DF2ghZ43.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-BuDLzqZU.js.map → LocalWorkspaceStorage-DF2ghZ43.js.map} +1 -1
- package/build/assets/{MarkdownEditor-DNHlrUbB.js → MarkdownEditor-B1YVaxYr.js} +2 -2
- package/build/assets/{MarkdownEditor-DNHlrUbB.js.map → MarkdownEditor-B1YVaxYr.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-iMR2NeGd.js → MarkdownNotebook-BOJH8So0.js} +2 -2
- package/build/assets/{MarkdownNotebook-iMR2NeGd.js.map → MarkdownNotebook-BOJH8So0.js.map} +1 -1
- package/build/assets/{MissingPartitionError-Dn6pH0MY.js → MissingPartitionError-BqY51H8b.js} +2 -2
- package/build/assets/{MissingPartitionError-Dn6pH0MY.js.map → MissingPartitionError-BqY51H8b.js.map} +1 -1
- package/build/assets/{MockChartModel-Bkg1e6Ga.js → MockChartModel-BGoDRppU.js} +2 -2
- package/build/assets/{MockChartModel-Bkg1e6Ga.js.map → MockChartModel-BGoDRppU.js.map} +1 -1
- package/build/assets/{PasteKeyHandler-BSnDQVgb.js → PasteKeyHandler-DF6_Ol5C.js} +2 -2
- package/build/assets/{PasteKeyHandler-BSnDQVgb.js.map → PasteKeyHandler-DF6_Ol5C.js.map} +1 -1
- package/build/assets/{Picker-B-hqvbWn.js → Picker-O4CMdwJU.js} +16 -16
- package/build/assets/{Picker-B-hqvbWn.js.map → Picker-O4CMdwJU.js.map} +1 -1
- package/build/assets/{StyleGuideRoot-BPXTRoo8.js → StyleGuideRoot-D77v0Kmj.js} +2 -2
- package/build/assets/{StyleGuideRoot-BPXTRoo8.js.map → StyleGuideRoot-D77v0Kmj.js.map} +1 -1
- package/build/assets/index-C2B4ThiN.js +27 -0
- package/build/assets/index-C2B4ThiN.js.map +1 -0
- package/build/assets/{index-tBlevD2r.js → index-CAE9FxAy.js} +2 -2
- package/build/assets/{index-tBlevD2r.js.map → index-CAE9FxAy.js.map} +1 -1
- package/build/assets/{index-BiIsbkVm.js → index-_3NUdQ8j.js} +3 -3
- package/build/assets/{index-BiIsbkVm.js.map → index-_3NUdQ8j.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +11 -11
- package/build/assets/Chart-D6UaIH7W.js +0 -3
- package/build/assets/Chart-D6UaIH7W.js.map +0 -1
- package/build/assets/IrisGridModel-B5RDaEyK.js.map +0 -1
- package/build/assets/index-xPESISXj.js +0 -27
- package/build/assets/index-xPESISXj.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{I as u,r as B,U as R,bJ as O,ad as _}from"./vendor-CLIsHur_.js";import{L as U,bU as A,cd as W,ce as z}from"./index-_3NUdQ8j.js";import{c as V}from"./Plotly-ef0IRrqv.js";import{C as m,a as L}from"./IrisGridModel-Cyc0Q4ng.js";import{V as $,B as F,bM as G,ae as K,F as H,bh as Y}from"./ControlType-DwvZrAze.js";import{D as Z}from"./DownsamplingError--AAvWHv_.js";import{m as q}from"./useMergeRef-BO8MVMb8.js";import{F as S}from"./FormatterUtils-DC0RNVpr.js";import{P as J}from"./plotly-2vlwy6OF.js";import"./helpers-BosuxZz1.js";import"./monaco-DaE0jI-i.js";function T(r){var e=r.errorMessage,t=r.onDiscard,i=r.onConfirm,o=r.onCancel,n=r["data-testid"],s=n!=null?"".concat(n,"-message"):void 0;return u.jsx("div",{className:"chart-panel-overlay chart-error-overlay",children:u.jsxs("div",{className:"chart-panel-overlay-content chart-error-overlay-content",children:[u.jsxs("div",{className:"info-message","data-testid":s,children:[e,u.jsx($,{copy:e,UNSAFE_style:{margin:"0"},isQuiet:!0})]}),u.jsxs("div",{children:[o&&u.jsx(F,{onClick:o,kind:"secondary",children:"Cancel"}),t&&u.jsx(F,{onClick:t,kind:"secondary",children:"Dismiss"}),i&&u.jsx(F,{onClick:i,kind:"primary",children:"Continue"})]})]})})}function j(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,i)}return t}function b(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?j(Object(t),!0).forEach(function(i){d(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function I(r,e){return te(r)||ee(r,e)||X(r,e)||Q()}function Q(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X(r,e){if(r){if(typeof r=="string")return M(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?M(r,e):void 0}}function M(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=Array(e);t<e;t++)i[t]=r[t];return i}function ee(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,o,n,s,a=[],l=!0,h=!1;try{if(n=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(i=n.call(t)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(c){h=!0,o=c}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(h)throw o}}return a}}function te(r){if(Array.isArray(r))return r}function d(r,e,t){return(e=ie(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ie(r){var e=re(r,"string");return typeof e=="symbol"?e:e+""}function re(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var f=U.module("Chart");class y extends B.Component{static convertIcon(e){var t=I(e.icon,5),i=t[0],o=t[4],n="".concat(o);return{width:i,path:n,ascent:i,descent:0,transform:"matrix(1, 0, 0, 1, 0, 0)"}}static downsampleButtonTitle(e,t){return e?"Downsampling in progress...":t?"Downsampling disabled, click to enable":"Downsampling enabled, click to disable"}static downsampleButtonAttr(e,t){return e?"animation-spin":t?void 0:"fill-active"}constructor(e){super(e),d(this,"currentSeries",void 0),d(this,"PlotComponent",void 0),d(this,"plot",void 0),d(this,"plotWrapper",void 0),d(this,"plotWrapperMerged",void 0),d(this,"columnFormats",void 0),d(this,"dateTimeFormatterOptions",void 0),d(this,"decimalFormatOptions",void 0),d(this,"integerFormatOptions",void 0),d(this,"webgl",void 0),d(this,"plotElement",null),d(this,"rect",void 0),d(this,"ranges",void 0),d(this,"isSubscribed",void 0),d(this,"isLoadedFired",void 0),d(this,"resizeObserver",void 0),d(this,"getCachedConfig",_((t,i,o,n,s,a,l)=>{var h=[],c=!!t;c&&h.push({name:"Downsampling failed: ".concat(t),title:"Downsampling failed",click:()=>{this.toggleErrorMessage("".concat(t))},icon:y.convertIcon(A),attr:"fill-warning"});var g=!!a;if(g&&h.push({name:"Error: ".concat(a),title:"Error",click:()=>{this.toggleErrorMessage("".concat(a))},icon:y.convertIcon(A),attr:"fill-warning"}),i||o||n||c){var D=y.downsampleButtonTitle(o,n),w=y.downsampleButtonAttr(o,n),C=o?W:z;h.push({name:D,title:"Downsampling status",icon:y.convertIcon(C),click:this.handleDownsampleClick,attr:w})}var v=s.some(k=>{var P=k.type;return P!=null&&!P.includes("3d")}),p=s.some(k=>{var P=k.type;return P!=null&&P.includes("3d")}),E=["zoom2d","pan2d",...l&&v?["select2d","lasso2d"]:[]],N=[...v?["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]:[],...p?["orbitRotation","tableRotation","resetCameraDefault3d"]:[]],x=o||c||g;return{displaylogo:!1,responsive:!0,displayModeBar:x?!0:"hover",modeBarButtons:[h,["toImage"],E,N]}})),K(this),this.PlotComponent=V(e.Plotly),this.plot=R.createRef(),this.plotWrapper=R.createRef(),this.plotWrapperMerged=q(this.plotWrapper,e.containerRef),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={data:null,downsamplingError:null,isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,error:null,shownError:null,layout:{datarevision:0},revision:0,shownBlocker:null}}componentDidMount(){this.updateDimensions(),this.updateModelDimensions(),this.initData(),this.initFormatter();var e=this.props,t=e.isActive,i=e.model;t&&this.subscribe(i),this.plotWrapper.current!=null&&this.resizeObserver.observe(this.plotWrapper.current),this.handleThemeChange()}componentDidUpdate(e){var t=this.props,i=t.isActive,o=t.model,n=t.settings,s=t.theme,a=t.onPlotElementChange;if(this.updateFormatterSettings(n),o!==e.model){var l;(l=e.onPlotElementChange)===null||l===void 0||l.call(e,null),this.unsubscribe(e.model),a==null||a(this.plotElement),this.subscribe(o)}i!==e.isActive&&(i?(this.updateDimensions(),this.subscribe(o)):this.unsubscribe(o)),s!==e.theme&&this.handleThemeChange()}componentWillUnmount(){var e=this.props.model;this.unsubscribe(e),this.resizeObserver.disconnect()}getPlotRect(){var e,t;return(e=(t=this.plotWrapper.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:null}initData(){var e=this.props.model;this.setState(t=>{var i=t.layout;return{data:e.getData(),layout:b(b({},i),e.getLayout())}})}subscribe(e){if(!this.isSubscribed){if(!this.rect||this.rect.width===0||this.rect.height===0){f.debug2("Delaying subscription until model dimensions are set");return}e.subscribe(this.handleModelEvent),this.isSubscribed=!0}}unsubscribe(e){this.isSubscribed&&(e.unsubscribe(this.handleModelEvent),this.isSubscribed=!1)}handleAfterPlot(){this.plot.current!=null}handlePlotInitialized(e,t){this.plotElement=t;var i=this.props.onPlotElementChange;i==null||i(t)}handlePlotPurge(){this.plotElement=null;var e=this.props.onPlotElementChange;e==null||e(null)}handleDownsampleClick(){this.setState(e=>{var t=e.isDownsamplingDisabled;return{downsamplingError:null,isDownsampleInProgress:!1,isDownsampleFinished:!1,isDownsamplingDisabled:!t}},()=>{var e=this.props.model,t=this.state.isDownsamplingDisabled;e.setDownsamplingDisabled(t)})}handleErrorClose(){this.setState({shownError:null})}handleDownsampleErrorClose(){this.setState({downsamplingError:null})}handleModelEvent(e){var t=e.type,i=e.detail;switch(f.debug2("Received data update",t,i),t){case m.EVENT_UPDATED:{this.currentSeries+=1,this.setState(v=>{var p=v.layout,E=v.revision;return typeof p.datarevision=="number"&&(p.datarevision+=1),{data:i,layout:p,revision:E+1}});var o=this.props.onUpdate;o({isLoading:!this.isLoadedFired});break}case m.EVENT_LOADFINISHED:{var n=this.props.onUpdate;this.isLoadedFired=!0,n({isLoading:!1});break}case m.EVENT_DISCONNECT:{var s=this.props.onDisconnect;s();break}case m.EVENT_RECONNECT:{var a=this.props.onReconnect;a();break}case m.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case m.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case m.EVENT_DOWNSAMPLENEEDED:case m.EVENT_DOWNSAMPLEFAILED:{var l,h=(l=i.message)!==null&&l!==void 0?l:i;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:h});var c=this.props.onError;c(new Z(h==null?void 0:"".concat(h)));break}case m.EVENT_ERROR:{var g="".concat(i);this.setState({error:g});var D=this.props.onError;D(new Error(g));break}case m.EVENT_BLOCKER:{var w="".concat(i);this.setState({shownBlocker:w});break}case m.EVENT_BLOCKER_CLEAR:{this.setState({shownBlocker:null});break}case m.EVENT_LAYOUT_UPDATED:{var C=i;this.setState(v=>{var p=v.layout,E=v.revision;return{layout:b(b({},p),C),revision:E+1}});break}default:f.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var t=e.layout,i=L.getLayoutRanges(t),o=!O(i,this.ranges);o&&(this.ranges=i,this.updateModelDimensions(!0))}handleRelayout(e){if(f.debug("handleRelayout",e),e.hiddenlabels!=null){var t=this.props.onSettingsChanged,i=[...e.hiddenlabels];t({hiddenSeries:i})}this.updateModelDimensions();var o=this.props.onPlotlyRelayout;o==null||o(e)}handleClick(e){var t=this.props.onPlotlyClick;t==null||t(e)}handleDoubleClick(){var e=this.props.onPlotlyDoubleClick;e==null||e()}handleSelected(e){var t=this.props.onPlotlySelected;t==null||t(e)}handleDeselect(){var e=this.props.onPlotlyDeselect;e==null||e()}handleClickAnnotation(e){var t=this.props.onPlotlyClickAnnotation;t==null||t(e)}handleLegendClick(e){var t,i=this.props.onPlotlyLegendClick;return(t=i==null?void 0:i(e))!==null&&t!==void 0?t:!0}handleLegendDoubleClick(e){var t,i=this.props.onPlotlyLegendDoubleClick;return(t=i==null?void 0:i(e))!==null&&t!==void 0?t:!0}handleWebGlContextLost(){var e=this.props.onPlotlyWebGlContextLost;e==null||e()}handleResize(){this.updateDimensions()}handleRestyle(e){var t=I(e,2),i=t[0],o=t[1];if(f.debug("handleRestyle",i,o),Object.keys(i).includes("visible")){var n=this.state.data,s=this.props.onSettingsChanged;if(n!=null){var a=n.reduce((l,h)=>{var c=h.name,g=h.visible;return c!=null&&g==="legendonly"?[...l,c]:l},[]);s({hiddenSeries:a})}}}handleThemeChange(){var e=this.props,t=e.theme,i=e.model,o=i.dh,n=new L(o);this.setState(s=>{var a=s.layout;return{layout:b(b({},a),{},{template:n.makeDefaultTemplate(t)})}})}toggleErrorMessage(e){this.setState(t=>{var i=t.shownError;return{shownError:i===e?null:e}})}updateModelDimensions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.getPlotRect();if(!t){f.warn("Unable to get plotting rect");return}var i=!this.rect||this.rect.width!==t.width||this.rect.height!==t.height;if(i||e){this.rect=t;var o=this.props,n=o.isActive,s=o.model;s.setDimensions(t),n&&this.subscribe(s)}}initFormatter(){var e=this.props.settings;this.updateFormatterSettings(e)}updateFormatterSettings(e){var t=S.getColumnFormats(e),i=S.getDateTimeFormatterOptions(e),o=e.defaultDecimalFormatOptions,n=o===void 0?{}:o,s=e.defaultIntegerFormatOptions,a=s===void 0?{}:s;(!O(this.columnFormats,t)||!O(this.dateTimeFormatterOptions,i)||!O(this.decimalFormatOptions,n)||!O(this.integerFormatOptions,a))&&(this.columnFormats=S.getColumnFormats(e),this.dateTimeFormatterOptions=i,this.decimalFormatOptions=n,this.integerFormatOptions=a,this.updateFormatter()),this.webgl!==e.webgl&&(this.webgl=e.webgl,this.updateRenderOptions())}updateFormatter(){var e=this.props.model,t=new H(e.dh,this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions);e.setFormatter(t)}updateRenderOptions(){var e=this.props.model,t={webgl:this.webgl};e.setRenderOptions(t)}updateDimensions(){var e=this.getPlotRect(),t=this.props.Plotly;this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&t.relayout(this.plot.current.el,{autosize:!0}).catch(i=>{f.debug("Unable to resize, promise rejected",i)})}render(){var e=this.PlotComponent,t=this.state,i=t.data,o=t.downsamplingError,n=t.isDownsampleFinished,s=t.isDownsampleInProgress,a=t.isDownsamplingDisabled,l=t.error,h=t.shownError,c=t.layout,g=t.revision,D=t.shownBlocker,w=this.props.model,C=this.getCachedConfig(o,n,s,a,i??[],l,w.hasSelectionCallbacks()),v=i!=null&&D==null,p=null;return D!=null?p=u.jsx(T,{errorMessage:"".concat(D),onConfirm:()=>{w.fireBlockerClear()}}):h!=null?p=u.jsx(T,{errorMessage:"".concat(o),onDiscard:()=>{this.handleDownsampleErrorClose()},onConfirm:()=>{this.handleDownsampleErrorClose(),this.handleDownsampleClick()}}):o!=null&&(p=u.jsx(T,{errorMessage:"".concat(o),onDiscard:()=>{this.handleDownsampleErrorClose()},onConfirm:()=>{this.handleDownsampleErrorClose(),this.handleDownsampleClick()}})),u.jsxs("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapperMerged,children:[v&&u.jsx(e,{ref:this.plot,data:i,layout:c,revision:g,config:C,onAfterPlot:this.handleAfterPlot,onError:f.error,onInitialized:this.handlePlotInitialized,onPurge:this.handlePlotPurge,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,onClick:this.handleClick,onDoubleClick:this.handleDoubleClick,onSelected:this.handleSelected,onDeselect:this.handleDeselect,onClickAnnotation:this.handleClickAnnotation,onLegendClick:this.handleLegendClick,onLegendDoubleClick:this.handleLegendDoubleClick,onWebGlContextLost:this.handleWebGlContextLost,style:{height:"100%",width:"100%"}}),p]})}}d(y,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Y.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[],webgl:!0},Plotly:J,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});function ve(r){var e=G();return u.jsx(y,b(b({},r),{},{theme:e}))}export{ve as default};
|
|
3
|
+
//# sourceMappingURL=Chart-C5VfXR8_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chart-C5VfXR8_.js","sources":["../../../chart/dist/ChartErrorOverlay.js","../../../chart/dist/Chart.js"],"sourcesContent":["import { CopyButton, Button } from '@deephaven/components';\nimport \"./ChartErrorOverlay.css\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction ChartErrorOverlay(_ref) {\n var errorMessage = _ref.errorMessage,\n onDiscard = _ref.onDiscard,\n onConfirm = _ref.onConfirm,\n onCancel = _ref.onCancel,\n dataTestId = _ref['data-testid'];\n var messageTestId = dataTestId != null ? \"\".concat(dataTestId, \"-message\") : undefined;\n return /*#__PURE__*/_jsx(\"div\", {\n className: \"chart-panel-overlay chart-error-overlay\",\n children: /*#__PURE__*/_jsxs(\"div\", {\n className: \"chart-panel-overlay-content chart-error-overlay-content\",\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: \"info-message\",\n \"data-testid\": messageTestId,\n children: [errorMessage, /*#__PURE__*/_jsx(CopyButton, {\n copy: errorMessage,\n UNSAFE_style: {\n margin: '0'\n },\n isQuiet: true\n })]\n }), /*#__PURE__*/_jsxs(\"div\", {\n children: [onCancel && /*#__PURE__*/_jsx(Button, {\n onClick: onCancel,\n kind: \"secondary\",\n children: \"Cancel\"\n }), onDiscard && /*#__PURE__*/_jsx(Button, {\n onClick: onDiscard,\n kind: \"secondary\",\n children: \"Dismiss\"\n }), onConfirm && /*#__PURE__*/_jsx(Button, {\n onClick: onConfirm,\n kind: \"primary\",\n children: \"Continue\"\n })]\n })]\n })\n });\n}\nexport default ChartErrorOverlay;\n//# sourceMappingURL=ChartErrorOverlay.js.map","function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport React, { Component } from 'react';\nimport deepEqual from 'fast-deep-equal';\nimport memoize from 'memoize-one';\nimport { vsLoading, dhGraphLineDown, dhWarningFilled } from '@deephaven/icons';\nimport { Formatter, FormatterUtils, DateUtils } from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { mergeRefs } from '@deephaven/react-hooks';\nimport { bindAllMethods } from '@deephaven/utils';\nimport createPlotlyComponent from \"./plotly/createPlotlyComponent.js\";\nimport Plotly from \"./plotly/Plotly.js\";\nimport ChartModel from \"./ChartModel.js\";\nimport ChartErrorOverlay from \"./ChartErrorOverlay.js\";\nimport ChartUtils from \"./ChartUtils.js\";\nimport \"./Chart.css\";\nimport DownsamplingError from \"./DownsamplingError.js\";\nimport useChartTheme from \"./useChartTheme.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nvar log = Log.module('Chart');\n\n// All of the ChartProps have default values except for model in the Chart\n// component, hence the Partial here.\n\nclass Chart extends Component {\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon) {\n var _faIcon$icon = _slicedToArray(faIcon.icon, 5),\n width = _faIcon$icon[0],\n path = _faIcon$icon[4];\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n var stringPath = \"\".concat(path);\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: \"matrix(1, 0, 0, 1, 0, 0)\"\n };\n }\n static downsampleButtonTitle(isDownsampleInProgress, isDownsamplingDisabled) {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n return isDownsamplingDisabled ? 'Downsampling disabled, click to enable' : 'Downsampling enabled, click to disable';\n }\n static downsampleButtonAttr(isDownsampleInProgress, isDownsamplingDisabled) {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n constructor(props) {\n super(props);\n _defineProperty(this, \"currentSeries\", void 0);\n _defineProperty(this, \"PlotComponent\", void 0);\n _defineProperty(this, \"plot\", void 0);\n _defineProperty(this, \"plotWrapper\", void 0);\n _defineProperty(this, \"plotWrapperMerged\", void 0);\n _defineProperty(this, \"columnFormats\", void 0);\n _defineProperty(this, \"dateTimeFormatterOptions\", void 0);\n _defineProperty(this, \"decimalFormatOptions\", void 0);\n _defineProperty(this, \"integerFormatOptions\", void 0);\n _defineProperty(this, \"webgl\", void 0);\n _defineProperty(this, \"plotElement\", null);\n _defineProperty(this, \"rect\", void 0);\n _defineProperty(this, \"ranges\", void 0);\n _defineProperty(this, \"isSubscribed\", void 0);\n _defineProperty(this, \"isLoadedFired\", void 0);\n // Listen for resizing of the element and update the canvas appropriately\n _defineProperty(this, \"resizeObserver\", void 0);\n _defineProperty(this, \"getCachedConfig\", memoize((downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, data, error, hasSelectionCallbacks) => {\n var customButtons = [];\n var hasDownsampleError = Boolean(downsamplingError);\n if (hasDownsampleError) {\n customButtons.push({\n name: \"Downsampling failed: \".concat(downsamplingError),\n title: 'Downsampling failed',\n click: () => {\n this.toggleErrorMessage(\"\".concat(downsamplingError));\n },\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning'\n });\n }\n var hasError = Boolean(error);\n if (hasError) {\n customButtons.push({\n name: \"Error: \".concat(error),\n title: \"Error\",\n click: () => {\n this.toggleErrorMessage(\"\".concat(error));\n },\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning'\n });\n }\n if (isDownsampleFinished || isDownsampleInProgress || isDownsamplingDisabled || hasDownsampleError) {\n var name = Chart.downsampleButtonTitle(isDownsampleInProgress, isDownsamplingDisabled);\n var attr = Chart.downsampleButtonAttr(isDownsampleInProgress, isDownsamplingDisabled);\n var icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n title: 'Downsampling status',\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr\n });\n }\n var has2D = data.some(_ref => {\n var type = _ref.type;\n return type != null && !type.includes('3d');\n });\n var has3D = data.some(_ref2 => {\n var type = _ref2.type;\n return type != null && type.includes('3d');\n });\n\n // zoom2d and pan2d work for both 2D and 3D charts\n var interactionButtons = ['zoom2d', 'pan2d', ...(hasSelectionCallbacks && has2D ? ['select2d', 'lasso2d'] : [])];\n var dimensionButtons = [...(has2D ? ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'] : []), ...(has3D ? ['orbitRotation', 'tableRotation', 'resetCameraDefault3d'] : [])];\n\n // Display the mode bar persistently if there's an error or downsampling so user can see progress\n // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249\n var alwaysShowModeBar =\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n isDownsampleInProgress || hasDownsampleError || hasError;\n return {\n displaylogo: false,\n // scales the plot to the container size\n // https://github.com/plotly/react-plotly.js/issues/102\n responsive: true,\n displayModeBar: alwaysShowModeBar ? true : 'hover',\n // Each array gets grouped together in the mode bar\n modeBarButtons: [customButtons, ['toImage'], interactionButtons, dimensionButtons]\n };\n }));\n bindAllMethods(this);\n this.PlotComponent = createPlotlyComponent(props.Plotly);\n this.plot = /*#__PURE__*/React.createRef();\n this.plotWrapper = /*#__PURE__*/React.createRef();\n this.plotWrapperMerged = mergeRefs(this.plotWrapper, props.containerRef);\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n this.resizeObserver = new window.ResizeObserver(this.handleResize);\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n error: null,\n shownError: null,\n layout: {\n datarevision: 0\n },\n revision: 0,\n shownBlocker: null\n };\n }\n componentDidMount() {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n this.initData();\n this.initFormatter();\n var _this$props = this.props,\n isActive = _this$props.isActive,\n model = _this$props.model;\n if (isActive) {\n this.subscribe(model);\n }\n if (this.plotWrapper.current != null) {\n this.resizeObserver.observe(this.plotWrapper.current);\n }\n this.handleThemeChange();\n }\n componentDidUpdate(prevProps) {\n var _this$props2 = this.props,\n isActive = _this$props2.isActive,\n model = _this$props2.model,\n settings = _this$props2.settings,\n theme = _this$props2.theme,\n onPlotElementChange = _this$props2.onPlotElementChange;\n this.updateFormatterSettings(settings);\n if (model !== prevProps.model) {\n var _prevProps$onPlotElem;\n (_prevProps$onPlotElem = prevProps.onPlotElementChange) === null || _prevProps$onPlotElem === void 0 || _prevProps$onPlotElem.call(prevProps, null);\n this.unsubscribe(prevProps.model);\n onPlotElementChange === null || onPlotElementChange === void 0 || onPlotElementChange(this.plotElement);\n this.subscribe(model);\n }\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.updateDimensions();\n this.subscribe(model);\n } else {\n this.unsubscribe(model);\n }\n }\n if (theme !== prevProps.theme) {\n this.handleThemeChange();\n }\n }\n componentWillUnmount() {\n var model = this.props.model;\n this.unsubscribe(model);\n this.resizeObserver.disconnect();\n }\n getPlotRect() {\n var _this$plotWrapper$cur, _this$plotWrapper$cur2;\n return (_this$plotWrapper$cur = (_this$plotWrapper$cur2 = this.plotWrapper.current) === null || _this$plotWrapper$cur2 === void 0 ? void 0 : _this$plotWrapper$cur2.getBoundingClientRect()) !== null && _this$plotWrapper$cur !== void 0 ? _this$plotWrapper$cur : null;\n }\n initData() {\n var model = this.props.model;\n this.setState(_ref3 => {\n var layout = _ref3.layout;\n return {\n data: model.getData(),\n layout: _objectSpread(_objectSpread({}, layout), model.getLayout())\n };\n });\n }\n subscribe(model) {\n if (this.isSubscribed) {\n return;\n }\n if (!this.rect || this.rect.width === 0 || this.rect.height === 0) {\n log.debug2('Delaying subscription until model dimensions are set');\n return;\n }\n model.subscribe(this.handleModelEvent);\n this.isSubscribed = true;\n }\n unsubscribe(model) {\n if (!this.isSubscribed) {\n return;\n }\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n handleAfterPlot() {\n if (this.plot.current != null) {\n // TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly\n }\n }\n handlePlotInitialized(_figure, graphDiv) {\n // Provide the actual Plotly graph div to consumers so they can attach\n // imperative event listeners (needed for some events that Plotly doesn't\n // support in react-plotly.js)\n this.plotElement = graphDiv;\n var onPlotElementChange = this.props.onPlotElementChange;\n onPlotElementChange === null || onPlotElementChange === void 0 || onPlotElementChange(graphDiv);\n }\n handlePlotPurge() {\n this.plotElement = null;\n var onPlotElementChange = this.props.onPlotElementChange;\n onPlotElementChange === null || onPlotElementChange === void 0 || onPlotElementChange(null);\n }\n handleDownsampleClick() {\n this.setState(_ref4 => {\n var isDownsamplingDisabled = _ref4.isDownsamplingDisabled;\n return {\n downsamplingError: null,\n isDownsampleInProgress: false,\n isDownsampleFinished: false,\n isDownsamplingDisabled: !isDownsamplingDisabled\n };\n }, () => {\n var model = this.props.model;\n var isDownsamplingDisabled = this.state.isDownsamplingDisabled;\n model.setDownsamplingDisabled(isDownsamplingDisabled);\n });\n }\n handleErrorClose() {\n this.setState({\n shownError: null\n });\n }\n handleDownsampleErrorClose() {\n this.setState({\n downsamplingError: null\n });\n }\n handleModelEvent(event) {\n var type = event.type,\n detail = event.detail;\n log.debug2('Received data update', type, detail);\n switch (type) {\n case ChartModel.EVENT_UPDATED:\n {\n this.currentSeries += 1;\n this.setState(state => {\n var layout = state.layout,\n revision = state.revision;\n if (typeof layout.datarevision === 'number') {\n layout.datarevision += 1;\n }\n return {\n data: detail,\n layout,\n revision: revision + 1\n };\n });\n var onUpdate = this.props.onUpdate;\n onUpdate({\n isLoading: !this.isLoadedFired\n });\n break;\n }\n case ChartModel.EVENT_LOADFINISHED:\n {\n var _onUpdate = this.props.onUpdate;\n this.isLoadedFired = true;\n _onUpdate({\n isLoading: false\n });\n break;\n }\n case ChartModel.EVENT_DISCONNECT:\n {\n var onDisconnect = this.props.onDisconnect;\n onDisconnect();\n break;\n }\n case ChartModel.EVENT_RECONNECT:\n {\n var onReconnect = this.props.onReconnect;\n onReconnect();\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLESTARTED:\n {\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: true,\n downsamplingError: null\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLEFINISHED:\n {\n this.setState({\n isDownsampleFinished: true,\n isDownsampleInProgress: false,\n downsamplingError: null\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLENEEDED:\n case ChartModel.EVENT_DOWNSAMPLEFAILED:\n {\n var _message;\n var downsamplingError = (_message = detail.message) !== null && _message !== void 0 ? _message : detail;\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n downsamplingError\n });\n var onError = this.props.onError;\n onError(new DownsamplingError(downsamplingError == null ? undefined : \"\".concat(downsamplingError)));\n break;\n }\n case ChartModel.EVENT_ERROR:\n {\n var error = \"\".concat(detail);\n this.setState({\n error\n });\n var _onError = this.props.onError;\n _onError(new Error(error));\n break;\n }\n case ChartModel.EVENT_BLOCKER:\n {\n var blocker = \"\".concat(detail);\n this.setState({\n shownBlocker: blocker\n });\n break;\n }\n case ChartModel.EVENT_BLOCKER_CLEAR:\n {\n this.setState({\n shownBlocker: null\n });\n break;\n }\n case ChartModel.EVENT_LAYOUT_UPDATED:\n {\n var newLayout = detail;\n this.setState(_ref5 => {\n var layout = _ref5.layout,\n revision = _ref5.revision;\n return {\n layout: _objectSpread(_objectSpread({}, layout), newLayout),\n revision: revision + 1\n };\n });\n break;\n }\n default:\n log.debug('Unknown event type', type, event);\n }\n }\n handlePlotUpdate(figure) {\n // User could have modified zoom/pan here, update the model dimensions\n // We don't need to update the datarevision, as we don't have any data changes\n // until an update comes back from the server anyway\n var layout = figure.layout;\n var ranges = ChartUtils.getLayoutRanges(layout);\n var isRangesChanged = !deepEqual(ranges, this.ranges);\n if (isRangesChanged) {\n this.ranges = ranges;\n this.updateModelDimensions(true);\n }\n }\n handleRelayout(changes) {\n log.debug('handleRelayout', changes);\n if (changes.hiddenlabels != null) {\n var onSettingsChanged = this.props.onSettingsChanged;\n // Pie charts store series visibility in layout.hiddenlabels and trigger relayout on changes\n // Series visibility for other types of charts is handled in handleRestyle\n var hiddenSeries = [...changes.hiddenlabels];\n onSettingsChanged({\n hiddenSeries\n });\n }\n this.updateModelDimensions();\n var onPlotlyRelayout = this.props.onPlotlyRelayout;\n onPlotlyRelayout === null || onPlotlyRelayout === void 0 || onPlotlyRelayout(changes);\n }\n handleClick(data) {\n var onPlotlyClick = this.props.onPlotlyClick;\n onPlotlyClick === null || onPlotlyClick === void 0 || onPlotlyClick(data);\n }\n handleDoubleClick() {\n var onPlotlyDoubleClick = this.props.onPlotlyDoubleClick;\n onPlotlyDoubleClick === null || onPlotlyDoubleClick === void 0 || onPlotlyDoubleClick();\n }\n handleSelected(data) {\n var onPlotlySelected = this.props.onPlotlySelected;\n onPlotlySelected === null || onPlotlySelected === void 0 || onPlotlySelected(data);\n }\n handleDeselect() {\n var onPlotlyDeselect = this.props.onPlotlyDeselect;\n onPlotlyDeselect === null || onPlotlyDeselect === void 0 || onPlotlyDeselect();\n }\n handleClickAnnotation(data) {\n var onPlotlyClickAnnotation = this.props.onPlotlyClickAnnotation;\n onPlotlyClickAnnotation === null || onPlotlyClickAnnotation === void 0 || onPlotlyClickAnnotation(data);\n }\n handleLegendClick(data) {\n var _onPlotlyLegendClick;\n var onPlotlyLegendClick = this.props.onPlotlyLegendClick;\n return (_onPlotlyLegendClick = onPlotlyLegendClick === null || onPlotlyLegendClick === void 0 ? void 0 : onPlotlyLegendClick(data)) !== null && _onPlotlyLegendClick !== void 0 ? _onPlotlyLegendClick : true;\n }\n handleLegendDoubleClick(data) {\n var _onPlotlyLegendDouble;\n var onPlotlyLegendDoubleClick = this.props.onPlotlyLegendDoubleClick;\n return (_onPlotlyLegendDouble = onPlotlyLegendDoubleClick === null || onPlotlyLegendDoubleClick === void 0 ? void 0 : onPlotlyLegendDoubleClick(data)) !== null && _onPlotlyLegendDouble !== void 0 ? _onPlotlyLegendDouble : true;\n }\n handleWebGlContextLost() {\n var onPlotlyWebGlContextLost = this.props.onPlotlyWebGlContextLost;\n onPlotlyWebGlContextLost === null || onPlotlyWebGlContextLost === void 0 || onPlotlyWebGlContextLost();\n }\n handleResize() {\n this.updateDimensions();\n }\n handleRestyle(_ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n changes = _ref7[0],\n seriesIndexes = _ref7[1];\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n var data = this.state.data;\n var onSettingsChanged = this.props.onSettingsChanged;\n if (data != null) {\n var hiddenSeries = data.reduce((acc, _ref8) => {\n var name = _ref8.name,\n visible = _ref8.visible;\n return name != null && visible === 'legendonly' ? [...acc, name] : acc;\n }, []);\n onSettingsChanged({\n hiddenSeries\n });\n }\n }\n }\n handleThemeChange() {\n var _this$props3 = this.props,\n theme = _this$props3.theme,\n model = _this$props3.model;\n var dh = model.dh;\n var chartUtils = new ChartUtils(dh);\n this.setState(_ref9 => {\n var layout = _ref9.layout;\n return {\n layout: _objectSpread(_objectSpread({}, layout), {}, {\n template: chartUtils.makeDefaultTemplate(theme)\n })\n };\n });\n }\n\n /**\n * Toggle the error message. If it is already being displayed, then hide it.\n */\n toggleErrorMessage(error) {\n this.setState(_ref0 => {\n var shownError = _ref0.shownError;\n return {\n shownError: shownError === error ? null : error\n };\n });\n }\n\n /**\n * Update the models dimensions and ranges.\n * Note that this will update it all whether the plot size changes OR the range\n * the user is looking at has changed (eg. panning/zooming).\n * Could update each independently, but doing them at the same time keeps the\n * ChartModel API a bit cleaner.\n * @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var rect = this.getPlotRect();\n if (!rect) {\n log.warn('Unable to get plotting rect');\n return;\n }\n var isRectChanged = !this.rect || this.rect.width !== rect.width || this.rect.height !== rect.height;\n if (isRectChanged || force) {\n this.rect = rect;\n var _this$props4 = this.props,\n isActive = _this$props4.isActive,\n model = _this$props4.model;\n model.setDimensions(rect);\n // We may need to resubscribe if dimensions were too small before\n if (isActive) {\n this.subscribe(model);\n }\n }\n }\n initFormatter() {\n var settings = this.props.settings;\n this.updateFormatterSettings(settings);\n }\n updateFormatterSettings(settings) {\n var columnFormats = FormatterUtils.getColumnFormats(settings);\n var dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(settings);\n var _settings$defaultDeci = settings.defaultDecimalFormatOptions,\n defaultDecimalFormatOptions = _settings$defaultDeci === void 0 ? {} : _settings$defaultDeci,\n _settings$defaultInte = settings.defaultIntegerFormatOptions,\n defaultIntegerFormatOptions = _settings$defaultInte === void 0 ? {} : _settings$defaultInte;\n if (!deepEqual(this.columnFormats, columnFormats) || !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) || !deepEqual(this.decimalFormatOptions, defaultDecimalFormatOptions) || !deepEqual(this.integerFormatOptions, defaultIntegerFormatOptions)) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = defaultDecimalFormatOptions;\n this.integerFormatOptions = defaultIntegerFormatOptions;\n this.updateFormatter();\n }\n if (this.webgl !== settings.webgl) {\n this.webgl = settings.webgl;\n this.updateRenderOptions();\n }\n }\n updateFormatter() {\n var model = this.props.model;\n var formatter = new Formatter(model.dh, this.columnFormats, this.dateTimeFormatterOptions, this.decimalFormatOptions, this.integerFormatOptions);\n model.setFormatter(formatter);\n }\n updateRenderOptions() {\n var model = this.props.model;\n var renderOptions = {\n webgl: this.webgl\n };\n model.setRenderOptions(renderOptions);\n }\n updateDimensions() {\n var rect = this.getPlotRect();\n var PlotlyProp = this.props.Plotly;\n if (this.plot.current != null && rect != null && rect.width > 0 && rect.height > 0) {\n // Call relayout to resize avoiding the debouncing plotly does\n // https://github.com/plotly/plotly.js/issues/2769#issuecomment-402099552\n PlotlyProp.relayout(this.plot.current.el, {\n autosize: true\n }).catch(e => {\n log.debug('Unable to resize, promise rejected', e);\n });\n }\n }\n render() {\n var PlotComponent = this.PlotComponent;\n var _this$state = this.state,\n data = _this$state.data,\n downsamplingError = _this$state.downsamplingError,\n isDownsampleFinished = _this$state.isDownsampleFinished,\n isDownsampleInProgress = _this$state.isDownsampleInProgress,\n isDownsamplingDisabled = _this$state.isDownsamplingDisabled,\n error = _this$state.error,\n shownError = _this$state.shownError,\n layout = _this$state.layout,\n revision = _this$state.revision,\n shownBlocker = _this$state.shownBlocker;\n var model = this.props.model;\n var config = this.getCachedConfig(downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, data !== null && data !== void 0 ? data : [], error, model.hasSelectionCallbacks());\n var isPlotShown = data != null && shownBlocker == null;\n var errorOverlay = null;\n if (shownBlocker != null) {\n errorOverlay = /*#__PURE__*/_jsx(ChartErrorOverlay, {\n errorMessage: \"\".concat(shownBlocker),\n onConfirm: () => {\n model.fireBlockerClear();\n }\n });\n } else if (shownError != null) {\n errorOverlay = /*#__PURE__*/_jsx(ChartErrorOverlay, {\n errorMessage: \"\".concat(downsamplingError),\n onDiscard: () => {\n this.handleDownsampleErrorClose();\n },\n onConfirm: () => {\n this.handleDownsampleErrorClose();\n this.handleDownsampleClick();\n }\n });\n } else if (downsamplingError != null) {\n errorOverlay = /*#__PURE__*/_jsx(ChartErrorOverlay, {\n errorMessage: \"\".concat(downsamplingError),\n onDiscard: () => {\n this.handleDownsampleErrorClose();\n },\n onConfirm: () => {\n this.handleDownsampleErrorClose();\n this.handleDownsampleClick();\n }\n });\n }\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"h-100 w-100 chart-wrapper\",\n ref: this.plotWrapperMerged,\n children: [isPlotShown && /*#__PURE__*/_jsx(PlotComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n , {\n ref: this.plot,\n data: data,\n layout: layout,\n revision: revision,\n config: config,\n onAfterPlot: this.handleAfterPlot,\n onError: log.error,\n onInitialized: this.handlePlotInitialized,\n onPurge: this.handlePlotPurge,\n onRelayout: this.handleRelayout,\n onUpdate: this.handlePlotUpdate,\n onRestyle: this.handleRestyle,\n onClick: this.handleClick,\n onDoubleClick: this.handleDoubleClick,\n onSelected: this.handleSelected,\n onDeselect: this.handleDeselect,\n onClickAnnotation: this.handleClickAnnotation,\n onLegendClick: this.handleLegendClick,\n onLegendDoubleClick: this.handleLegendDoubleClick,\n onWebGlContextLost: this.handleWebGlContextLost,\n style: {\n height: '100%',\n width: '100%'\n }\n }), errorOverlay]\n });\n }\n}\n_defineProperty(Chart, \"defaultProps\", {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n webgl: true\n },\n Plotly,\n onDisconnect: () => undefined,\n onReconnect: () => undefined,\n onUpdate: () => undefined,\n onError: () => undefined,\n onSettingsChanged: () => undefined\n});\nexport default function ChartContainer(props) {\n var chartTheme = useChartTheme();\n // eslint-disable-next-line react/jsx-props-no-spreading\n return /*#__PURE__*/_jsx(Chart, _objectSpread(_objectSpread({}, props), {}, {\n theme: chartTheme\n }));\n}\n//# sourceMappingURL=Chart.js.map"],"names":["ChartErrorOverlay","_ref","errorMessage","onDiscard","onConfirm","onCancel","dataTestId","messageTestId","_jsx","_jsxs","CopyButton","Button","ownKeys","e","r","o","_objectSpread","_defineProperty","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","a","_arrayLikeToArray","n","l","i","u","f","_toPropertyKey","t","_toPrimitive","log","Log","Chart","Component","faIcon","_faIcon$icon","width","path","stringPath","isDownsampleInProgress","isDownsamplingDisabled","props","memoize","downsamplingError","isDownsampleFinished","data","error","hasSelectionCallbacks","customButtons","hasDownsampleError","dhWarningFilled","hasError","name","attr","icon","vsLoading","dhGraphLineDown","has2D","type","has3D","_ref2","interactionButtons","dimensionButtons","alwaysShowModeBar","bindAllMethods","createPlotlyComponent","React","mergeRefs","_this$props","isActive","model","prevProps","_this$props2","settings","theme","onPlotElementChange","_prevProps$onPlotElem","_this$plotWrapper$cur","_this$plotWrapper$cur2","_ref3","layout","_figure","graphDiv","_ref4","event","detail","ChartModel","state","revision","onUpdate","_onUpdate","onDisconnect","onReconnect","_message","onError","DownsamplingError","_onError","blocker","newLayout","_ref5","figure","ranges","ChartUtils","isRangesChanged","deepEqual","changes","onSettingsChanged","hiddenSeries","onPlotlyRelayout","onPlotlyClick","onPlotlyDoubleClick","onPlotlySelected","onPlotlyDeselect","onPlotlyClickAnnotation","_onPlotlyLegendClick","onPlotlyLegendClick","_onPlotlyLegendDouble","onPlotlyLegendDoubleClick","onPlotlyWebGlContextLost","_ref6","_ref7","seriesIndexes","acc","_ref8","visible","_this$props3","dh","chartUtils","_ref9","_ref0","shownError","force","rect","isRectChanged","_this$props4","columnFormats","FormatterUtils","dateTimeFormatterOptions","_settings$defaultDeci","defaultDecimalFormatOptions","_settings$defaultInte","defaultIntegerFormatOptions","formatter","Formatter","renderOptions","PlotlyProp","PlotComponent","_this$state","shownBlocker","config","isPlotShown","errorOverlay","DateUtils","Plotly","ChartContainer","chartTheme","useChartTheme"],"mappings":"kjBAGA,SAASA,EAAkBC,EAAM,CAC/B,IAAIC,EAAeD,EAAK,aACtBE,EAAYF,EAAK,UACjBG,EAAYH,EAAK,UACjBI,EAAWJ,EAAK,SAChBK,EAAaL,EAAK,aAAa,EAC7BM,EAAgBD,GAAc,KAAO,GAAG,OAAOA,EAAY,UAAU,EAAI,OAC7E,OAAoBE,EAAAA,IAAK,MAAO,CAC9B,UAAW,0CACX,SAAuBC,EAAAA,KAAM,MAAO,CAClC,UAAW,0DACX,SAAU,CAAcA,EAAAA,KAAM,MAAO,CACnC,UAAW,eACX,cAAeF,EACf,SAAU,CAACL,EAA2BM,EAAAA,IAAKE,EAAY,CACrD,KAAMR,EACN,aAAc,CACZ,OAAQ,GACpB,EACU,QAAS,EACnB,CAAS,CAAC,CACV,CAAO,EAAgBO,EAAAA,KAAM,MAAO,CAC5B,SAAU,CAACJ,GAAyBG,EAAAA,IAAKG,EAAQ,CAC/C,QAASN,EACT,KAAM,YACN,SAAU,QACpB,CAAS,EAAGF,GAA0BK,EAAAA,IAAKG,EAAQ,CACzC,QAASR,EACT,K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EAAAA,KAAM,MAAO,CAC/B,UAAW,4BACX,IAAK,KAAK,kBACV,SAAU,CAACgJ,GAA4BjJ,MAAK6I,EAG1C,CACA,IAAK,KAAK,KACV,KAAMrG,EACN,OAAQmC,EACR,SAAUQ,EACV,OAAQ6D,EACR,YAAa,KAAK,gBAClB,QAASvH,EAAI,MACb,cAAe,KAAK,sBACpB,QAAS,KAAK,gBACd,WAAY,KAAK,eACjB,SAAU,KAAK,iBACf,UAAW,KAAK,cAChB,QAAS,KAAK,YACd,cAAe,KAAK,kBACpB,WAAY,KAAK,eACjB,WAAY,KAAK,eACjB,kBAAmB,KAAK,sBACxB,cAAe,KAAK,kBACpB,oBAAqB,KAAK,wBAC1B,mBAAoB,KAAK,uBACzB,MAAO,CACL,OAAQ,OACR,MAAO,MACjB,CACA,CAAO,EAAGyH,CAAY,CACtB,CAAK,CACH,CACF,CACAzI,EAAgBkB,EAAO,eAAgB,CACrC,SAAU,GACV,SAAU,CACR,SAAU,mBACV,sBAAuBwH,EAAU,iBACjC,aAAc,GACd,eAAgB,GAChB,UAAW,CAAA,EACX,MAAO,EACX,EACE,OAAAC,EACA,aAAc,IAAA,GACd,YAAa,IAAA,GACb,SAAU,IAAA,GACV,QAAS,IAAA,GACT,kBAAmB,IAAA,EACrB,CAAC,EACc,SAASC,GAAejH,EAAO,CAC5C,IAAIkH,EAAaC,EAAa,EAE9B,OAAoBvJ,EAAAA,IAAK2B,EAAOnB,EAAcA,EAAc,GAAI4B,CAAK,EAAG,GAAI,CAC1E,MAAOkH,CACX,CAAG,CAAC,CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-DMjw9GWc.js","./Plotly-ef0IRrqv.js","./plotly-2vlwy6OF.js","./helpers-BosuxZz1.js","./vendor-CLIsHur_.js","./vendor-V6ynCsSj.css","./MarkdownNotebook-
|
|
2
|
-
import{r as f,a0 as Nn,bG as li,I as c,bL as Vd,U,K as q,bM as Dl,ac as Fi,L as Ml,R as ui,bN as Kd,bO as zd,M as Ce,H as Nt,bP as Gd,a8 as qd,a9 as Xd,G as kl,a1 as zn,bQ as Zd,bR as Yd,aw as jo,bS as Qd,bT as Jd,bJ as br,bU as ec,a6 as tc,a5 as nc,bF as Lo,bV as rc,bW as ic,ad as fn,bX as fr,bY as A,bZ as Fo,bK as Te,a3 as ao,af as Al,b_ as oc,_ as ir}from"./vendor-CLIsHur_.js";import{aB as Nl,L as z,aZ as jl,W as Ll,ai as ac,aj as sc,ah as lc,ar as uc,ad as dc,$ as cc,aw as hc,M as Fl,b as Rl,c as $l,aK as mc,a_ as fc,a$ as Hl,b0 as Bl,b1 as vc,b2 as pc,N as jn,aA as gc,e as W,b3 as bc,b4 as yc,b5 as Sc,b6 as Cc,b7 as wc,b8 as _c,b9 as Ec,ba as Pc,bb as Tc,bc as Oc,bd as Ic,E as Wl,aY as xc,aV as Ul,aW as Dc,a3 as Vl,k as Mc,d as Ri,be as kc,bf as Ac,au as Kl,bg as Ro,bh as Nc,bi as jc,bj as Lc,bk as Fc,f as zl,aO as Gl,bl as ql,bm as Yn,aU as Rc,bn as $c,H as $o,bo as $i,q as Ho,bp as Xl,bq as Hc,K as Bc,ak as Wc,br as Uc,C as Vc,al as Kc,bs as zc,bt as Gc,bu as qc,bv as Xc,bw as Zc,bx as Yc,by as Bo,aQ as Wo,bz as Qc,bA as Jc}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-DMjw9GWc.js","./Plotly-ef0IRrqv.js","./plotly-2vlwy6OF.js","./helpers-BosuxZz1.js","./vendor-CLIsHur_.js","./vendor-V6ynCsSj.css","./MarkdownNotebook-BOJH8So0.js","./index-_3NUdQ8j.js","./monaco-DaE0jI-i.js","./monaco-CgHo24-M.css","./index-CwMW8ik0.css","./mathjax-BIbpo3Gc.js","./MarkdownNotebook-CmpkKxys.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as f,a0 as Nn,bG as li,I as c,bL as Vd,U,K as q,bM as Dl,ac as Fi,L as Ml,R as ui,bN as Kd,bO as zd,M as Ce,H as Nt,bP as Gd,a8 as qd,a9 as Xd,G as kl,a1 as zn,bQ as Zd,bR as Yd,aw as jo,bS as Qd,bT as Jd,bJ as br,bU as ec,a6 as tc,a5 as nc,bF as Lo,bV as rc,bW as ic,ad as fn,bX as fr,bY as A,bZ as Fo,bK as Te,a3 as ao,af as Al,b_ as oc,_ as ir}from"./vendor-CLIsHur_.js";import{aB as Nl,L as z,aZ as jl,W as Ll,ai as ac,aj as sc,ah as lc,ar as uc,ad as dc,$ as cc,aw as hc,M as Fl,b as Rl,c as $l,aK as mc,a_ as fc,a$ as Hl,b0 as Bl,b1 as vc,b2 as pc,N as jn,aA as gc,e as W,b3 as bc,b4 as yc,b5 as Sc,b6 as Cc,b7 as wc,b8 as _c,b9 as Ec,ba as Pc,bb as Tc,bc as Oc,bd as Ic,E as Wl,aY as xc,aV as Ul,aW as Dc,a3 as Vl,k as Mc,d as Ri,be as kc,bf as Ac,au as Kl,bg as Ro,bh as Nc,bi as jc,bj as Lc,bk as Fc,f as zl,aO as Gl,bl as ql,bm as Yn,aU as Rc,bn as $c,H as $o,bo as $i,q as Ho,bp as Xl,bq as Hc,K as Bc,ak as Wc,br as Uc,C as Vc,al as Kc,bs as zc,bt as Gc,bu as qc,bv as Xc,bw as Zc,bx as Yc,by as Bo,aQ as Wo,bz as Qc,bA as Jc}from"./index-_3NUdQ8j.js";import{e as He,M as eh,b as Uo,l as vt,R as Zl,K as ft,c as vn,d as Vo,U as th,_ as Yl}from"./monaco-DaE0jI-i.js";var Ql=Object.freeze([]),Bw=new Map,Jl=()=>{};function Ww(n){return Array.isArray(n)?n:[n]}function _i(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function nh(n,e,t){return(e=rh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rh(n){var e=ih(n,"string");return typeof e=="symbol"?e:e+""}function ih(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ko extends Error{constructor(){super(...arguments),nh(this,"isCanceled",!0)}}function oh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=ah(n,e);t.forEach(r=>{n[r]=n[r].bind(n)})}function ah(n,e){for(var t=new Set,r=n,i=0;r!=null&&r!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(r)){var a;o!=="constructor"&&typeof((a=Object.getOwnPropertyDescriptor(r,o))===null||a===void 0?void 0:a.value)=="function"&&t.add(o)}r=Object.getPrototypeOf(r),i+=1}return[...t.keys()]}function sh(n,e,t){return(e=lh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lh(n){var e=uh(n,"string");return typeof e=="symbol"?e:e+""}function uh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dh extends Error{constructor(){super(...arguments),sh(this,"isClipboardPermissionsDeniedError",!0)}}function ch(n,e,t){return(e=hh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hh(n){var e=mh(n,"string");return typeof e=="symbol"?e:e+""}function mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ei extends Error{constructor(){super(...arguments),ch(this,"isClipboardUnavailableError",!0)}}function fh(n,e,t){return(e=vh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vh(n){var e=ph(n,"string");return typeof e=="symbol"?e:e+""}function ph(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class eu extends Error{constructor(){super(...arguments),fh(this,"isPermissionUnsupported",!0)}}function zo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function gh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){zo(o,r,i,a,s,"next",l)}function s(l){zo(o,r,i,a,s,"throw",l)}a(void 0)})}}function Go(n){return Hi.apply(this,arguments)}function Hi(){return Hi=gh(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new eu:t}}),Hi.apply(this,arguments)}function qo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function tu(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){qo(o,r,i,a,s,"next",l)}function s(l){qo(o,r,i,a,s,"throw",l)}a(void 0)})}}function nu(n){return Bi.apply(this,arguments)}function Bi(){return Bi=tu(function*(n){var e=navigator,t=e.clipboard;if(t!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}bh(n)}),Bi.apply(this,arguments)}function bh(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Uw(){return Wi.apply(this,arguments)}function Wi(){return Wi=tu(function*(){try{var n=navigator,e=n.clipboard;if(e===void 0)throw new Ei;var t=yield Go("clipboard-read");if(t==="granted"){var r=yield e.readText();return r}if(t==="prompt"){try{yield e.readText()}catch{}if(t=yield Go("clipboard-read"),t==="granted"){var i=yield e.readText();return i}}if(t==="prompt"||t==="denied")throw new dh}catch(o){throw o instanceof eu?new Ei:o}throw new Ei}),Wi.apply(this,arguments)}var or;function Ln(n,e,t){return(e=yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yh(n){var e=Sh(n,"string");return typeof e=="symbol"?e:e+""}function Sh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ch="table_",ru="column_",wh=new Set(["in","not","i","ii","k"]),_h=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),Eh=/[^a-zA-Z0-9_$\-+@]/g,Ph=/[^A-Za-z0-9_$]/g,Th=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,Oh=/[^a-zA-Z0-9_]/g;function Ih(n){return n.replace(/[ -]/g,"_")}function xh(n){return n.replace(/\s/g,"_")}class Ft{}or=Ft;Ln(Ft,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(wh.has(a)||_h.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});Ln(Ft,"legalizeTableName",n=>or.legalize(n,xh,Ch,Eh,!1,0));Ln(Ft,"makeVariableName",n=>or.legalizeTableName(n).replace(Oh,"_"));Ln(Ft,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=or.legalizeColumnName(t,r);e.includes(i)&&(i=ru+r),e.push(i)}),e});Ln(Ft,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return or.legalize(n,Ih,ru,Ph,!0,e)});Ln(Ft,"isValidTableName",n=>Th.test(n));Ln(Ft,"isValidColumnName",n=>or.legalizeColumnName(n)===n);class iu extends CustomEvent{constructor(e,t){super(e,t)}}class je{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{r?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{r=!0,o(new Ko),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof Ko}static isTimedOut(e){return e instanceof Nl}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function Xo(n,e,t){return(e=Dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dh(n){var e=Mh(n,"string");return typeof e=="symbol"?e:e+""}function Mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wr{constructor(){Xo(this,"pending",[]),Xo(this,"resolved",[])}add(e,t){var r=je.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function Vw(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function Zo(n,e){return jh(n)||Nh(n,e)||Ah(n,e)||kh()}function kh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ah(n,e){if(n){if(typeof n=="string")return Yo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Yo(n,e):void 0}}function Yo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Nh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function jh(n){if(Array.isArray(n))return n}class Pt{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!Pt.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var r=Zo(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],d=l[1];if(u<=i&&o<=d)return a;i<=d&&u<=o&&(i=Math.min(i,u),o=Math.max(o,d),a.splice(s,1))}return a.push([i,o]),a}static deselectRange(e,t){for(var r=Zo(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],d=l[1];if(!(o<u||d<i))if(u<i&&o<d){a[s]=[u,i-1],a.splice(s+1,0,[o+1,d]);break}else i<=u&&d<=o?a.splice(s,1):u<i?a[s]=[u,i-1]:a[s]=[o+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*Kw(n,e){for(var t=n;t<=e;++t)yield t}var zw=" ";class ou{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}var _r;function gn(n,e,t){return(e=Lh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lh(n){var e=Fh(n,"string");return typeof e=="symbol"?e:e+""}function Fh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rt{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(rt.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}static formatDuration(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return t>0?"".concat(t,"h ").concat(r,"m ").concat(i,"s"):r>0?"".concat(r,"m ").concat(i.toFixed(1),"s"):"".concat(i.toFixed(2),"s")}static formatConvertedDuration(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ms";if(e==null||t===""||t===0||t==null)return null;var i=1,o=null,a=null;if(r==="ms")i=1e3,o=new Date(e).valueOf(),a=new Date(t).valueOf();else if(r==="ns")i=1e9,o=Number(e),a=Number(t);else return null;var s=(a-o)/i;return this.formatDuration(s)}}_r=rt;gn(rt,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");gn(rt,"MILLIS_PER_SECOND",1e3);gn(rt,"NANOS_PER_SECOND",1e9);gn(rt,"NANOS_PER_MIN",60*_r.NANOS_PER_SECOND);gn(rt,"NANOS_PER_HOUR",60*_r.NANOS_PER_MIN);gn(rt,"MILLIS_PER_MIN",60*_r.MILLIS_PER_SECOND);gn(rt,"MILLIS_PER_HOUR",60*_r.MILLIS_PER_MIN);gn(rt,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));function Rh(n,e,t){return(e=$h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $h(n){var e=Hh(n,"string");return typeof e=="symbol"?e:e+""}function Hh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vr extends Error{constructor(){super(...arguments),Rh(this,"isInvalid",!0)}}function au(){var n=f.useRef(!1);return f.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Qo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Bh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Qo(o,r,i,a,s,"next",l)}function s(l){Qo(o,r,i,a,s,"throw",l)}a(void 0)})}}var Wh=z.module("useAsyncInterval");function Uh(n,e){var t=au(),r=f.useRef(0),i=f.useRef(0),o=f.useRef(null),a=f.useCallback(Bh(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(h){Wh.error("A tick error occurred:",h)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),d=Math.max(0,e-u);r.current=window.setTimeout(a,d)}}),[n,t,e]);f.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function Er(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=f.useContext(n);if(t==null)throw new Error(e);return t}function Vh(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.leading,i=r===void 0?!1:r,o=t.trailing,a=o===void 0?!0:o,s=t.maxWait,l=f.useMemo(()=>Nn(n,e,s!=null?{leading:i,trailing:a,maxWait:s}:{leading:i,trailing:a}),[n,e,i,a,s]);return f.useEffect(()=>()=>l.cancel(),[l]),l}function Kh(n){var e=f.useRef();return f.useEffect(function(){e.current=n}),e.current}function zh(n,e,t){var r=f.useRef(t),i=f.useRef(n);i.current=n;var o=f.useMemo(()=>li(function(){return i.current(...arguments)},e,r.current),[e]);return f.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function su(n){var e=f.useRef(null);return f.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Gh(n,e){return Yh(n)||Zh(n,e)||Xh(n,e)||qh()}function qh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xh(n,e){if(n){if(typeof n=="string")return Jo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Jo(n,e):void 0}}function Jo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Zh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Yh(n){if(Array.isArray(n))return n}var Qh=3500,Jh=z.module("useCopyToClipboard");function em(){var n=f.useState(!1),e=Gh(n,2),t=e[0],r=e[1],i=f.useRef(null),o=f.useCallback(a=>{nu(a).then(()=>{r(!0)}).catch(s=>Jh.error("Unable to copy ".concat(a),`
|
|
5
5
|
`,s))},[]);return f.useEffect(()=>(i.current&&clearTimeout(i.current),t&&(i.current=setTimeout(()=>{r(!1)},Qh)),()=>{i.current&&clearTimeout(i.current)}),[t]),[t,o]}var tm=["gray-50","gray-75","gray-100","gray-200","gray-300","gray-400","gray-500","gray-600","gray-700","gray-800","gray-900","red-100","red-200","red-300","red-400","red-500","red-600","red-700","red-800","red-900","red-1000","red-1100","red-1200","red-1300","red-1400","orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100","orange-1200","orange-1300","orange-1400","yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900","yellow-1000","yellow-1100","yellow-1200","yellow-1300","yellow-1400","chartreuse-100","chartreuse-200","chartreuse-300","chartreuse-400","chartreuse-500","chartreuse-600","chartreuse-700","chartreuse-800","chartreuse-900","chartreuse-1000","chartreuse-1100","chartreuse-1200","chartreuse-1300","chartreuse-1400","celery-100","celery-200","celery-300","celery-400","celery-500","celery-600","celery-700","celery-800","celery-900","celery-1000","celery-1100","celery-1200","celery-1300","celery-1400","green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900","green-1000","green-1100","green-1200","green-1300","green-1400","seafoam-100","seafoam-200","seafoam-300","seafoam-400","seafoam-500","seafoam-600","seafoam-700","seafoam-800","seafoam-900","seafoam-1000","seafoam-1100","seafoam-1200","seafoam-1300","seafoam-1400","cyan-100","cyan-200","cyan-300","cyan-400","cyan-500","cyan-600","cyan-700","cyan-800","cyan-900","cyan-1000","cyan-1100","cyan-1200","cyan-1300","cyan-1400","blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900","blue-1000","blue-1100","blue-1200","blue-1300","blue-1400","indigo-100","indigo-200","indigo-300","indigo-400","indigo-500","indigo-600","indigo-700","indigo-800","indigo-900","indigo-1000","indigo-1100","indigo-1200","indigo-1300","indigo-1400","purple-100","purple-200","purple-300","purple-400","purple-500","purple-600","purple-700","purple-800","purple-900","purple-1000","purple-1100","purple-1200","purple-1300","purple-1400","fuchsia-100","fuchsia-200","fuchsia-300","fuchsia-400","fuchsia-500","fuchsia-600","fuchsia-700","fuchsia-800","fuchsia-900","fuchsia-1000","fuchsia-1100","fuchsia-1200","fuchsia-1300","fuchsia-1400","magenta-100","magenta-200","magenta-300","magenta-400","magenta-500","magenta-600","magenta-700","magenta-800","magenta-900","magenta-1000","magenta-1100","magenta-1200","magenta-1300","magenta-1400","negative","notice","positive","info","accent","accent-100","accent-200","accent-300","accent-400","accent-500","accent-600","accent-700","accent-800","accent-900","accent-1000","accent-1100","accent-1200","accent-1300","accent-1400","bg","content-bg","subdued-content-bg","surface-bg","fg"];function nm(n){return typeof n=="string"&&tm.includes(n)}function lu(n){return n!=null&&nm(n)?"var(--dh-color-".concat(n,")"):n}var rm=["color","UNSAFE_style"];function ea(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function jr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(t),!0).forEach(function(r){im(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function im(n,e,t){return(e=om(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function om(n){var e=am(n,"string");return typeof e=="symbol"?e:e+""}function am(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function sm(n,e){if(n==null)return{};var t,r,i=lm(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function lm(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var uu=f.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=sm(n,rm),o=f.useMemo(()=>jr(jr({},r),{},{color:lu(t)}),[t,r]);return c.jsx(Vd,jr(jr({},i),{},{ref:e,UNSAFE_style:o}))});uu.displayName="Text";function ta(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ta(Object(t),!0).forEach(function(r){Gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ta(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Gn(n,e,t){return(e=um(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function um(n){var e=dm(n,"string");return typeof e=="symbol"?e:e+""}function dm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var na="popper",cm="popper-container",hm={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=Dl.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class di extends f.Component{constructor(e){super(e),Gn(this,"element",void 0),Gn(this,"container",void 0),Gn(this,"nodeRef",U.createRef()),Gn(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.updateContainerClassName(e.containerClassName,e.isMaximized),this.container=U.createRef(),this.rAF=0;var t=this.props.isShown;this.state={show:t,popper:null}}componentDidUpdate(e){var t=this.props,r=t.isShown,i=t.containerClassName,o=t.isMaximized,a=this.state.popper;(e.containerClassName!==i||e.isMaximized!==o)&&this.updateContainerClassName(i,o),e.isShown!==r&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r?this.show():this.hide()})),a&&a.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}updateContainerClassName(e,t){this.element.className=q(cm,e,{maximized:t})}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,r=this.state.popper,i=this.props,o=i.closeOnBlur,a=i.referenceObject;if(!r&&this.container.current!==null){var s=this.props,l=s.options,u=s.keepInParent,d=u?hm:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},h=nn(nn(nn({},d),l),{},{modifiers:nn(nn(nn({},d.modifiers),l.modifiers),{},{preventOverflow:nn(nn({},(e=d.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=l.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var m=this.getVisibleElement(this.container.current);m==null&&(m=this.container.current);var v=new Dl(a||m,this.element,h);v.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(o){var p=this.element.querySelector(".".concat(na));p instanceof HTMLElement&&!p.contains(document.activeElement)&&p.focus()}}),Fi.flushSync(()=>{this.setState({popper:v})})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var t=this.state.popper;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),Fi.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var e=this.state.popper;e&&e.scheduleUpdate()}handleBlur(e){var t=this.props,r=t.closeOnBlur,i=t.onBlur;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(i==null||i(e),r&&this.hide()))}handleEnter(){var e=this.props.onEntered;e()}handleExit(){var e=this.props.onExited,t=this.state.show;t||this.destroyPopper(),e()}renderContent(){var e=this.props,t=e.className,r=e.children,i=e.timeout,o=e.interactive,a=e.closeOnBlur,s=this.state.show;return c.jsx(jl,{isPortal:!0,children:c.jsx(Ml,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:c.jsx("div",{ref:this.nodeRef,onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:q(na,{interactive:o},t),onBlur:this.handleBlur,tabIndex:a?-1:void 0,role:"presentation",children:c.jsxs("div",{className:"popper-content",children:[r,c.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var e=this.state.popper,t=this.props["data-testid"];return c.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&ui.createPortal(this.renderContent(),this.element)})}}Gn(di,"defaultProps",{options:{},className:"",containerClassName:"",isMaximized:!1,timeout:Ll.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,referenceObject:null,"data-testid":void 0});var Ui;function ra(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(t),!0).forEach(function(r){Ot(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ra(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ot(n,e,t){return(e=fm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fm(n){var e=vm(n,"string");return typeof e=="symbol"?e:e+""}function vm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var pm=z.module("Tooltip");class be extends f.Component{static handleHidden(){be.shownTooltipCount-=1,be.shownTooltipCount===0&&(be.lastHiddenTime=Date.now())}static handleShown(){be.shownTooltipCount+=1}constructor(e){super(e),Ot(this,"container",void 0),Ot(this,"popper",void 0),Ot(this,"parent",void 0),Ot(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=U.createRef(),this.popper=U.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var e=this.props.timeout;e===0&&this.show()}componentDidUpdate(e,t){var r=t.isShown,i=this.state.isShown;i!==r&&(i?be.handleShown():be.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var e=this.state.isShown;e&&be.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){pm.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var e=this.state.isShown;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var e=this.state.isShown;this.stopTimer();var t=this.props.interactive;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,i=this.state.isShown;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var e=this.props,t=e.timeout,r=e.reshowTimeout,i=t;(be.shownTooltipCount>0||Date.now()-be.lastHiddenTime<be.triggerReshowThreshold)&&(i=r),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var e=this.state.isShown;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),Fi.flushSync(()=>{this.setState({isShown:!0})});var r=this.props.interactive;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var e=this.props.onExited;e()}stopShowingTooltip(){var e=this.state.isShown;this.stopTimer(),e&&this.hide()}render(){var e=this.props,t=e.interactive,r=e.children,i=e.referenceObject,o=e.popperClassName,a=e["data-testid"],s=e.onEntered,l=this.state.isShown,u=this.props.options;return u=mm({placement:"bottom"},u),c.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:c.jsx(di,{className:q(o,"popper-tooltip"),options:u,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:t,referenceObject:i,children:c.jsxs("div",{className:"tooltip-content",children:[" ",l&&r]})})})}}Ui=be;Ot(be,"defaultTimeout",500);Ot(be,"defaultReshowTimeout",100);Ot(be,"triggerReshowThreshold",300);Ot(be,"shownTooltipCount",0);Ot(be,"lastHiddenTime",Date.now());Ot(be,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:Ui.defaultReshowTimeout,timeout:Ui.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});function ia(n,e){return Sm(n)||ym(n,e)||bm(n,e)||gm()}function gm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -47,6 +47,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
47
47
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F0(n,e){if(n){if(typeof n=="string")return sl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?sl(n,e):void 0}}function sl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function R0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function $0(n){if(Array.isArray(n))return n}var Ye=z.module("FileList"),H0=500,ll="item-list-scroll-pane";function B0(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.table,i=n.onFocusChange,o=i===void 0?()=>{}:i,a=n.onMove,s=n.onSelect,l=n.onSelectionChange,u=l===void 0?()=>{}:l,d=n.renderItem,h=d===void 0?oo:d,m=n.rowHeight,v=m===void 0?Ao:m,p=n.overscanCount,g=p===void 0?xt.DEFAULT_OVERSCAN:p,b=f.useState(()=>({items:[],offset:0,itemCount:0})),y=_n(b,2),S=y[0],E=y[1],T=f.useState({top:0,bottom:0}),O=_n(T,2),L=O[0],G=O[1],$=f.useState(),M=_n($,2),j=M[0],H=M[1],ee=f.useState(),F=_n(ee,2),X=F[0],ie=F[1],oe=f.useState(),ge=_n(oe,2),we=ge[0],_e=ge[1],Se=f.useState([]),de=_n(Se,2),te=de[0],Y=de[1],ce=f.useRef(),w=f.useRef(null),P=f.useRef(null),_=f.useCallback(N=>{if(N.length===0||S==null)return[];for(var re=[],fe=0;fe<N.length;fe+=1)for(var Xe=N[fe],Ze=Xe[0];Ze<=Xe[1];Ze+=1)Ze>=S.offset&&Ze<S.offset+S.items.length&&re.push(S.items[Ze-S.offset]);return re},[S]),B=f.useCallback(N=>{var re=_([[N,N]]);if(re.length>0)return re[0]},[_]),se=f.useCallback(()=>{var N=Pt.count(te);if(N===0)return null;if(N===1){var re=te[0][0],fe=B(re);if(fe!=null)return fe.filename}return"".concat(N," items")},[B,te]),ot=f.useCallback(N=>{if(!(!X||!j)){Ye.debug("dropItems",X,"to",N);try{var re=ol(X,j),fe=re.files,Xe=re.targetPath;if(a==null||a(fe,Xe),N!=null){var Ze;Y([[N,N]]),(Ze=w.current)===null||Ze===void 0||Ze.focusItem(N)}}catch(Cn){Ye.error("Unable to complete move",Cn)}}},[X,j,a]),gt=f.useCallback((N,re)=>{var fe=S.items[N-S.offset];fe!==void 0&&(Ye.debug("handleItemClick",fe),s(fe,re),It(fe)&&(r==null||r.setExpanded(fe.filename,!fe.isExpanded)))},[S,s,r]),Qt=f.useCallback((N,re)=>{var fe,Xe;Ye.debug2("handleItemDragStart",N,te);var Ze=te;Pt.isSelected(te,N)||(Ze=[[N,N]],Y(Ze)),ie(_(Ze)),(fe=w.current)===null||fe===void 0||fe.resetMouseState();var Cn=document.createElement("div"),wi=document.createElement("div");wi.className="dnd-placeholder-content",wi.innerText=(Xe=se())!==null&&Xe!==void 0?Xe:"",Cn.appendChild(wi),Cn.className="file-list-dnd-placeholder",document.body.appendChild(Cn),re.dataTransfer.setDragImage(Cn,0,0),re.dataTransfer.effectAllowed="move",_e(Cn)},[se,_,te]),wt=f.useCallback((N,re)=>{re.preventDefault(),Ye.debug2("handleItemDragOver",re),H(B(N))},[B]),K=f.useCallback((N,re)=>{Ye.debug("handleItemDragEnd",N),we==null||we.remove(),ie(void 0),H(void 0),_e(void 0)},[we]),ne=f.useCallback((N,re)=>{ot(N)},[ot]),me=f.useCallback(()=>{Ye.debug2("handleItemDragExit"),H(void 0)},[]),Hn=f.useCallback(N=>{N.target instanceof Element&&N.target.classList.contains(ll)&&(N.preventDefault(),Ye.debug2("handleListDragOver",N),H({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),Jt=f.useCallback(N=>{N.target instanceof Element&&N.target.classList.contains(ll)&&(Ye.debug("handleListDrop"),ot())},[ot]),en=f.useCallback(function(N){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ye.debug2("handleSelectionChange",N),re===!0||N!==te){Y(N);var fe=_(N);u(fe)}},[_,u,te]),Rt=f.useCallback(N=>{if(Ye.debug2("handleFocusChange",N),N!=null){var re=_([[N,N]]),fe=_n(re,1),Xe=fe[0];o(Xe)}else o();ce.current=N},[_,o]),tn=f.useCallback((N,re)=>{Ye.debug("handleViewportChange",N,re),(N!==L.top||re!==L.bottom)&&G({top:N,bottom:re})},[L]),Ar=f.useMemo(()=>{if(!X||!j)return!1;try{return ol(X,j),Ye.debug("handleValidateDropTarget true"),!0}catch{return Ye.debug("handleValidateDropTarget false"),!1}},[X,j]),$t=n.focusedPath;f.useEffect(()=>{$t!==void 0&&($t==="/"?r.collapseAll():(r.setExpanded($t,!1),r.setExpanded($t,!0)))},[r,$t]),f.useEffect(function(){Ye.debug("updating table viewport",L),r==null||r.setViewport({top:Math.max(0,L.top-g),bottom:L.bottom+g})},[g,r,L]),f.useEffect(function(){var re=r.onUpdate(fe=>{E({items:fe.items.map(Xe=>qr(qr({},Xe),{},{itemName:Xe.basename})),offset:fe.offset,itemCount:r.size})});return()=>{re()}},[r]),f.useEffect(function(){ce.current!=null&&Rt(ce.current),te.length>0&&en(te,!0)},[S,Rt,en,te]),f.useEffect(function(){if(j!=null&&It(j)&&j.filename!=="/"){var re=setTimeout(()=>{j.isExpanded||r==null||r.setExpanded(j.filename,!0)},H0);return()=>clearTimeout(re)}},[j,r]);var Nr=f.useCallback(N=>h(qr(qr({},N),{},{isDragInProgress:X!=null,dropTargetItem:j,draggedItems:X,isDropTargetValid:Ar,onDragStart:Qt,onDragEnd:K,onDragOver:wt,onDragExit:me,onDrop:ne})),[K,me,wt,Qt,ne,X,j,Ar,h]);return c.jsx("div",{ref:P,className:q("file-list",{"is-dragging":X!=null}),onDragOver:Hn,onDrop:Jt,children:c.jsx(xt,{ref:w,items:S.items,itemCount:S.itemCount,offset:S.offset,onFocusChange:Rt,onSelect:gt,onSelectionChange:en,onViewportChange:tn,selectedRanges:te,renderItem:Nr,rowHeight:v,isMultiSelect:t,isDragSelect:!1,isDeselectOnClick:!1})})}var W0={DELETE:pe.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[D.DELETE],macShortcut:[k.CMD,D.BACKSPACE]}),RENAME:pe.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[D.ENTER],macShortcut:[D.ENTER]})};const ul={FILE_EXPLORER:W0};function Ni(n,e){return z0(n)||K0(n,e)||V0(n,e)||U0()}function U0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
48
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V0(n,e){if(n){if(typeof n=="string")return dl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?dl(n,e):void 0}}function dl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function K0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function z0(n){if(Array.isArray(n))return n}var cl=z.module("FileListItemEditor"),G0=()=>Promise.resolve();function q0(n){var e=n.item,t=n.onCancel,r=n.onSubmit,i=n.validate,o=i===void 0?G0:i,a=f.useRef(null),s=f.useState(e.basename),l=Ni(s,2),u=l[0],d=l[1],h=f.useState(),m=Ni(h,2),v=m[0],p=m[1],g=f.useState(Promise.resolve()),b=Ni(g,2),y=b[0],S=b[1],E=f.useCallback(()=>{var M;(M=a.current)===null||M===void 0||M.focus()},[a]),T=f.useCallback(M=>M.stopPropagation(),[]),O=f.useCallback(()=>{y.then(()=>{r(u)}).catch(M=>cl.info("Unable to validate name",M))},[r,u,y]);f.useEffect(function(){var j=je.makeCancelable(o(u));return j.then(()=>p(void 0)).catch(H=>{je.isCanceled(H)||p(H)}),S(j),()=>j.cancel()},[o,u]),f.useEffect(function(){E()},[E]);var L=f.useCallback(()=>{cl.debug2("handleBlur"),O()},[O]),G=f.useCallback(M=>{var j=M.target.value;d(j)},[]),$=f.useCallback(M=>{M.stopPropagation();var j=M.key;switch(j){case"Enter":{O();break}case"Escape":{t();break}}},[t,O]);return c.jsxs("div",{className:"file-list-item-editor",children:[c.jsx("input",{type:"text",className:q("form-control file-list-item-editor-input",{"is-invalid":v}),value:u,ref:a,onBlur:L,onKeyDown:$,onChange:G,onClick:T,onDoubleClick:T,onMouseDown:T}),v&&c.jsx("div",{className:"invalid-feedback",children:"".concat(v)})]})}function hl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ji(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hl(Object(t),!0).forEach(function(r){X0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hl(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function X0(n,e,t){return(e=Z0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Z0(n){var e=Y0(n,"string");return typeof e=="symbol"?e:e+""}function Y0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Li(n,e){return tw(n)||ew(n,e)||J0(n,e)||Q0()}function Q0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
49
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J0(n,e){if(n){if(typeof n=="string")return ml(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ml(n,e):void 0}}function ml(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function ew(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function tw(n){if(Array.isArray(n))return n}function Wd(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.focusedPath,i=n.showContextMenu,o=i===void 0?!1:i,a=n.onCreateFile,s=n.onCreateFolder,l=n.onCopy,u=n.onDelete,d=n.onMove,h=n.onRename,m=n.onSelect,v=n.onSelectionChange,p=n.table,g=n.rowHeight,b=g===void 0?Ao:g,y=n.validateRename,S=y===void 0?()=>Promise.resolve():y,E=f.useState(),T=Li(E,2),O=T[0],L=T[1],G=f.useState([]),$=Li(G,2),M=$[0],j=$[1],H=f.useState(),ee=Li(H,2),F=ee[0],X=ee[1],ie=f.useCallback(_=>{j(_),v==null||v(_)},[v]),oe=f.useCallback(_=>{X(_)},[]),ge=f.useCallback(()=>{F&&(l==null||l(F))},[F,l]),we=f.useCallback(()=>{M.length>0&&(u==null||u(M))},[u,M]),_e=f.useCallback(()=>{a==null||a()},[a]),Se=f.useCallback(()=>{F&&(s==null||s(R.getPath(F.filename)))},[F,s]),de=f.useCallback(()=>{F&&L(F)},[F]),te=f.useCallback(()=>{L(void 0)},[]),Y=f.useCallback(_=>{O&&(h==null||h(O,_),L(void 0))},[h,O]),ce=f.useMemo(()=>{if(O)return[];var _=[];return a&&_.push({title:"New File",description:"Create new file",action:_e,group:Z.groups.medium}),s&&_.push({title:"New Folder",description:"Create new folder",action:Se,group:Z.groups.medium}),l&&_.push({title:"Copy File",description:"Copy the selected file",action:ge,group:Z.groups.low,disabled:F==null||It(F)}),u&&M.length>0&&_.push({title:"Delete",description:"Delete",shortcut:ul.FILE_EXPLORER.DELETE,action:we,group:Z.groups.low}),h&&_.push({title:"Rename",description:"Rename",shortcut:ul.FILE_EXPLORER.RENAME,action:de,group:Z.groups.low,disabled:F==null}),_},[ge,we,_e,Se,de,F,l,a,s,u,h,M,O]),w=f.useCallback(_=>(W(O),S(O,_)),[O,S]),P=f.useCallback(_=>{var B=_.item;return O&&O.filename===B.filename?c.jsx(oo,ji(ji({},_),{},{children:c.jsx(q0,{item:B,validate:w,onSubmit:Y,onCancel:te})})):c.jsx(oo,ji({},_))},[te,Y,O,w]);return c.jsxs("div",{className:"file-list-container",children:[p!=null&&c.jsx(B0,{onMove:d,onSelect:m,onSelectionChange:ie,onFocusChange:oe,renderItem:P,rowHeight:b,table:p,isMultiSelect:t,focusedPath:r}),o&&c.jsx(Z,{actions:ce})]})}Wd.displayName="FileListContainer";function fl(n,e,t){return(e=nw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nw(n){var e=rw(n,"string");return typeof e=="symbol"?e:e+""}function rw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qr extends vr{constructor(e){super("Name already exists"),fl(this,"isExistingFile",!0),fl(this,"info",void 0),this.info=e}}function vl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function pl(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){vl(o,r,i,a,s,"next",l)}function s(l){vl(o,r,i,a,s,"throw",l)}a(void 0)})}}function gl(n,e){return sw(n)||aw(n,e)||ow(n,e)||iw()}function iw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
50
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ow(n,e){if(n){if(typeof n=="string")return bl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bl(n,e):void 0}}function bl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function aw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function sw(n){if(Array.isArray(n))return n}var kt=z.module("FileExplorer");function No(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,d=u===void 0?()=>{}:u,h=n.onCreateFile,m=h===void 0?()=>{}:h,v=n.onCreateFolder,p=v===void 0?()=>{}:v,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,S=y===void 0?Ao:y,E=f.useState([]),T=gl(E,2),O=T[0],L=T[1],G=f.useState(),$=gl(G,2),M=$[0],j=$[1];f.useEffect(function(){var ce;function w(){return P.apply(this,arguments)}function P(){return P=pl(function*(){kt.debug("initTable"),ce=je.makeCancelable(e.getTable(),_=>_.close());try{j(yield ce)}catch(_){je.isCanceled(_)||kt.error("Unable to initialize table",_)}}),P.apply(this,arguments)}return w(),()=>{ce.cancel()}},[e]);var H=f.useCallback(Y=>{je.isCanceled(Y)||kt.error(Y)},[]),ee=f.useCallback(()=>{kt.debug("handleCreateFile"),m()},[m]),F=f.useCallback(()=>{kt.debug("handleCreateFolder"),p()},[p]),X=f.useCallback(Y=>{kt.debug("handleCopyFile",Y.filename),a(Y)},[a]),ie=f.useCallback(Y=>{kt.debug("handleDelete, pending confirmation",Y),L(Y)},[]),oe=f.useCallback(()=>{kt.debug("handleDeleteConfirm",O),O.forEach(Y=>e.deleteFile(It(Y)?R.makePath(Y.filename):Y.filename)),l(O),L([])},[O,l,e]),ge=f.useCallback(()=>{kt.debug("handleDeleteCancel"),L([])},[]),we=f.useCallback((Y,ce)=>{var w=R.reducePaths(Y.map(P=>It(P)?R.makePath(P.filename):P.filename));w.forEach(P=>{var _=R.isPath(P)?"".concat(ce).concat(R.getBaseName(P.substring(0,P.length-1)),"/"):"".concat(ce).concat(R.getBaseName(P));e.moveFile(P,_).then(()=>{d(P,_)}).catch(H)})},[H,d,e]),_e=f.useCallback((Y,ce)=>{var w=Y.filename,P=It(Y);P&&!w.endsWith("/")&&(w="".concat(w,"/"));var _="".concat(R.getParent(w)).concat(ce);P&&!_.endsWith("/")&&(_="".concat(_,"/")),kt.debug2("handleRename",w,_),e.moveFile(w,_).catch(H),d(w,_)},[H,d,e]),Se=f.useCallback(function(){var Y=pl(function*(ce,w){if(w!==ce.basename){R.validateName(w);var P="".concat(R.getPath(ce.filename)).concat(w);try{var _=yield e.info(P);throw new Qr(_)}catch(B){if(!(B instanceof ko))throw B}}});return function(ce,w){return Y.apply(this,arguments)}}(),[e]),de=O.length>0,te=f.useMemo(()=>O.length===1?'Are you sure you want to delete "'.concat(O[0].filename,'"?'):"Are you sure you want to delete the selected files?",[O]);return c.jsxs("div",{className:"file-explorer",children:[M&&c.jsx(Wd,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:X,onCreateFolder:F,onCreateFile:ee,onMove:we,onDelete:ie,onRename:_e,onSelect:g,onSelectionChange:b,rowHeight:S,table:M,validateRename:Se}),c.jsx(yr,{isOpen:de,headerText:te,bodyText:"You cannot undo this action.",onCancel:ge,onConfirm:oe,confirmButtonText:"Delete"})]})}No.displayName="FileExplorer";function yl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function lw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){yl(o,r,i,a,s,"next",l)}function s(l){yl(o,r,i,a,s,"throw",l)}a(void 0)})}}function xn(n,e,t){return(e=uw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uw(n){var e=dw(n,"string");return typeof e=="symbol"?e:e+""}function dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var En=z.module("NewItemModal");class An extends f.PureComponent{static getValidationMessage(e){return e instanceof Qr&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){je.isCanceled(e)||En.error(e)}constructor(e){super(e),xn(this,"inputRef",U.createRef()),xn(this,"cancelableValidatePromise",void 0),xn(this,"cancelableExistingItemPromise",void 0),xn(this,"pending",new wr),xn(this,"pathMap",new Map),xn(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:R.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:R.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.setState({path:r,value:R.getBaseName(t),validationError:void 0,prevExtension:R.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=je.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return lw(function*(){R.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new Qr(u)}catch(d){if(!(d instanceof ko))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(An.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(En.debug("handleSelect",e),e.type==="directory")this.setState({path:R.makePath(e.filename)});else{var t=e.basename,r=R.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof vr))throw e;En.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;En.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){En.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=R.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){En.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;En.debug("submitModal",r,i);var u=R.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(d=>{var h=this.props.onSubmit;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof Qr&&l!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw je.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(An.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),c.jsxs(U.Fragment,{children:[c.jsx(ae,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?c.jsx(Ce,{icon:Zc,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,d=l.path,h=l.showExtensionChangeModal,m=l.showOverwriteModal,v=l.validationError,p=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",S=R.fileExtensionToString(g),E=R.fileExtensionToString(b),T=y?"Create":"Save",O=y?"New folder name":"Save file as";return c.jsxs(c.Fragment,{children:[c.jsxs(Fl,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[c.jsx(Rl,{toggle:i,children:a}),c.jsx($l,{children:c.jsx("form",{children:c.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[c.jsxs("div",{className:"flex-grow-0 mb-4",children:[c.jsx("label",{htmlFor:"file-name-input",children:O}),c.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:q("form-control",{"is-invalid":v}),value:p,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),v&&c.jsx("div",{className:"invalid-feedback",children:An.getValidationMessage(v)})]}),c.jsxs("div",{className:"flex-grow-0",children:[c.jsx("label",{children:"Directory: /"}),this.renderPathButtons(d)]}),c.jsx("div",{className:"flex-grow-1 file-explorer-container",children:c.jsx(No,{onSelect:this.handleSelect,storage:t,focusedPath:d})})]})})}),c.jsxs(hu,{children:[c.jsx(ae,{kind:"secondary",onClick:i,children:"Cancel"}),c.jsx(ae,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:T})]})]}),c.jsx(yr,{isOpen:m,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),c.jsx(yr,{isOpen:h,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(S,'" to "').concat(E,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(S,'"'),confirmButtonText:'Use "'.concat(E,'"')})]})}}xn(An,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function cw(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return c.jsxs("div",{className:"file-explorer-toolbar",children:[c.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[c.jsx(ae,{kind:"ghost",icon:Xl,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),c.jsx(ae,{kind:"ghost",icon:Yc,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&c.jsx("div",{className:"file-explorer-toolbar-search",children:c.jsx(Cu,{value:o,onChange:r,placeholder:"Search by name"})})]})}function Sl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function hw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Sl(o,r,i,a,s,"next",l)}function s(l){Sl(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ud(n,e,t){return(e=mw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mw(n){var e=fw(n,"string");return typeof e=="symbol"?e:e+""}function fw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pn=z.module("FileExplorerPanel"),vw=(n,e)=>{var t=Au(n),r=Dr(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},pw=ir(vw,null,null,{forwardRef:!0});function gw(n){var e=n;return e!=null&&typeof e.button=="number"}class rr extends U.Component{static handleError(e){Pn.error(e)}static isFocusEvent(e){return gw(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Pn.debug("handleCreateFile",r,i,o),e.emit(J.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Pn.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Pn.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(rr.handleError)}handleCopyFile(e){var t=this;return hw(function*(){var r=t.props.fileStorage;if(It(e)){Pn.error("Invalid item in handleCopyItem",e);return}var i=yield R.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit(J.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=R.makePath(e[0].filename):t=R.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Pn.debug("fileSelect",e),e.type!=="directory"){var r=rr.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit(J.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Pn.debug("handleRename",e,t),r.emit(J.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return c.jsxs(xr,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[c.jsx(cw,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&c.jsx(No,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),c.jsx(An,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}Ud(rr,"COMPONENT","FileExplorerPanel");Ud(rr,"TITLE","File Explorer");var bw=pw(rr);function Cr(n,e,t){return(e=yw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yw(n){var e=Sw(n,"string");return typeof e=="symbol"?e:e+""}function Sw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Cl=z.module("LogPanel");class yi extends f.PureComponent{constructor(e){super(e),Cr(this,"isBottomVisible",void 0),Cr(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var t=this.props.session;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){var t=e.session;Cl.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){Cl.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return c.jsxs(xr,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&c.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&c.jsx(xe,{session:i,ref:o=>{this.logView=o}})]})}}Cr(yi,"defaultProps",{session:null});Cr(yi,"COMPONENT","LogPanel");Cr(yi,"TITLE","Log");var Cw=(n,e)=>{var t;return{session:(t=Dr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},ww=ir(Cw,null,null,{forwardRef:!0})(yi);function wl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Xr(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){wl(o,r,i,a,s,"next",l)}function s(l){wl(o,r,i,a,s,"throw",l)}a(void 0)})}}function _l(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_l(Object(t),!0).forEach(function(r){Ke(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_l(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ke(n,e,t){return(e=_w(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _w(n){var e=Ew(n,"string");return typeof e=="symbol"?e:e+""}function Ew(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pw=f.lazy(()=>Yl(()=>import("./MarkdownNotebook-iMR2NeGd.js"),__vite__mapDeps([6,4,3,5,7,8,9,10,11,12]),import.meta.url)),ve=z.module("NotebookPanel"),El=400;class Re extends f.Component{static handleError(e){je.isCanceled(e)||ve.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Re.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Re.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=R.getExtension(e).toLowerCase();switch(t){case"py":case"python":return"python";case"groovy":return"groovy";case"scala":return"scala";default:return null}}constructor(e){super(e),Ke(this,"pending",void 0),Ke(this,"debouncedSavePanelState",void 0),Ke(this,"debouncedLoad",void 0),Ke(this,"notebook",void 0),Ke(this,"tabTitleElement",void 0),Ke(this,"tabInitOnce",void 0),Ke(this,"editor",void 0),Ke(this,"getSettings",fn((g,b)=>ut(ut({},g),{},{minimap:{enabled:b}}))),Ke(this,"getOverflowActions",fn((g,b,y,S,E)=>{var T=[{title:"Run",icon:$i,action:this.handleRunAll,disabled:S,shortcut:Fe.NOTEBOOK.RUN,group:Z.groups.high,order:1},{title:"Run Selected",icon:Bo,action:this.handleRunSelected,disabled:S,shortcut:Fe.NOTEBOOK.RUN_SELECTED,group:Z.groups.high,order:2},{title:"Save",icon:Wo,action:this.handleSave,disabled:E,shortcut:Gt.SAVE,group:Z.groups.high,order:3},{title:"Find",icon:Qc,action:this.handleFind,group:Z.groups.high,shortcut:Fe.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:Hl,action:this.handleCopy,group:Z.groups.medium,order:20},{title:"Rename File",icon:Jc,action:this.handleShowRename,group:Z.groups.medium,order:30},{title:"Delete File",icon:zl,action:this.handleDelete,group:Z.groups.medium,order:40},{title:"Show Minimap",icon:g?Yn:void 0,action:this.handleMinimapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:b?Yn:void 0,action:this.handleWordWrapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.WORDWRAP,order:30}];return this.canFormat()&&(T.push({title:"Format Document",action:this.handleFormat,group:Z.groups.low,order:10}),T.push({title:"Format on Save",icon:y?Yn:void 0,action:this.handleFormatOnSaveChange,group:Z.groups.low,order:15})),T})),this.handleCloseCancel=this.handleCloseCancel.bind(this),this.handleCloseDiscard=this.handleCloseDiscard.bind(this),this.handleCloseSave=this.handleCloseSave.bind(this),this.handleCopy=this.handleCopy.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleDeleteConfirm=this.handleDeleteConfirm.bind(this),this.handleDeleteCancel=this.handleDeleteCancel.bind(this),this.handleEditorInitialized=this.handleEditorInitialized.bind(this),this.handleEditorWillDestroy=this.handleEditorWillDestroy.bind(this),this.handleEditorChange=this.handleEditorChange.bind(this),this.handleFind=this.handleFind.bind(this),this.handleMinimapChange=this.handleMinimapChange.bind(this),this.handleWordWrapChange=this.handleWordWrapChange.bind(this),this.handleFormatOnSaveChange=this.handleFormatOnSaveChange.bind(this),this.handleLinkClick=this.handleLinkClick.bind(this),this.handleLoadSuccess=this.handleLoadSuccess.bind(this),this.handleLoadError=this.handleLoadError.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.handleRenameFile=this.handleRenameFile.bind(this),this.handleResize=this.handleResize.bind(this),this.handleRunCommand=this.handleRunCommand.bind(this),this.handleRunAll=this.handleRunAll.bind(this),this.handleRunSelected=this.handleRunSelected.bind(this),this.handleSave=this.handleSave.bind(this),this.handleSaveAsCancel=this.handleSaveAsCancel.bind(this),this.handleSaveAsSubmit=this.handleSaveAsSubmit.bind(this),this.handleSaveError=this.handleSaveError.bind(this),this.handleSaveSuccess=this.handleSaveSuccess.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleShowRename=this.handleShowRename.bind(this),this.handleTab=this.handleTab.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabClick=this.handleTabClick.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleTransformLinkUri=this.handleTransformLinkUri.bind(this),this.handleOverwrite=this.handleOverwrite.bind(this),this.handlePreviewPromotion=this.handlePreviewPromotion.bind(this),this.handleFormat=this.handleFormat.bind(this),this.canFormat=this.canFormat.bind(this),this.getDropdownOverflowActions=this.getDropdownOverflowActions.bind(this),this.pending=new wr,this.debouncedSavePanelState=Nn(this.savePanelState.bind(this),El),this.debouncedLoad=Nn(this.load.bind(this),El),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var t=e.isDashboardActive,r=e.session,i=e.sessionLanguage,o=e.panelState,a={value:"",language:"",wordWrap:"off"},s=null,l=e.isPreview;if(o!=null){var u=o.fileMetadata;s=u===void 0?s:u;var d=o.isPreview;l=d===void 0?l:d;var h=o.settings;a=h===void 0?a:h}var m=s!=null&&R.hasPath(s.itemName),v=m===!0&&a.value!=null||!m&&a.value!=null&&a.value.length>0,p=v?1:0;this.state={error:void 0,isDashboardActive:t,isLoading:!0,isLoaded:!1,isPreview:l,savedChangeCount:0,changeCount:p,fileMetadata:s,settings:a,session:r,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:"",formatOnSave:!1},ve.debug("constructor",e,this.state)}componentDidMount(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=t.tab;i!=null&&this.initTab(i),this.initNotebookContent(),r.on(J.RENAME_FILE,this.handleRenameFile),r.on(ue.DROPPED,this.handlePanelDropped),t.on(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var r=this.state,i=r.isPreview,o=r.settings,a=o.wordWrap,s=this.props.notebookSettings;i!==t.isPreview&&this.setPreviewStatus(),a!==t.settings.wordWrap&&(this.updateEditorWordWrap(),this.debouncedSavePanelState()),s.isMinimapEnabled!==e.notebookSettings.isMinimapEnabled&&this.updateEditorMinimap()}componentWillUnmount(){this.debouncedSavePanelState.flush(),this.pending.cancel();var e=this.props,t=e.glEventHub,r=e.glContainer,i=this.state,o=i.fileMetadata,a=i.isPreview;t.off(J.RENAME_FILE,this.handleRenameFile),t.off(ue.DROPPED,this.handlePanelDropped),r.off(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),t.emit(J.UNREGISTER_FILE,o,a)}initTab(e){this.tabInitOnce||(this.tabInitOnce=!0,this.initTabCloseOverride()),this.initTabClasses(e)}initTabCloseOverride(){var e=this.props.glContainer;e.beforeClose(t=>{if((t==null?void 0:t.force)===!0)return!0;var r=this.state,i=r.changeCount,o=r.savedChangeCount;return i!==o?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);W(t);var r=t.querySelector(".lm_title");this.tabTitleElement=r,r==null||r.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var e=this.state,t=e.changeCount,r=e.savedChangeCount,i=e.settings,o=i.value;if(t!==r&&this.notebook){var a=this.notebook.getValue();return a??o}return o}initNotebookContent(){var e=this.state,t=e.fileMetadata,r=e.settings,i=e.isPreview;if(t&&t.id){ve.debug("Init content from file"),this.registerFileMetadata(t,i),this.load();return}if(r.value!=null){ve.debug("Use content passed in the settings prop"),this.handleLoadSuccess();return}this.handleLoadError(new Error("Missing file metadata"))}closeFileTabById(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var r=this.props,i=r.glEventHub,o=r.metadata,a=o.id;i.emit(J.REGISTER_FILE,a,e,t)}renameTab(e,t){var r=this.props.glEventHub;r.emit(J.RENAME,e,t)}load(){var e=this.state,t=e.fileMetadata,r=e.settings;W(t);var i=t.id,o=this.props.fileStorage;this.pending.add(o.loadFile(i)).then(a=>{var s;ve.debug("Loaded file",a);var l=a.filename,u=this.state.itemName;if(l!==u){var d=this.props.metadata,h=d.id;this.renameTab(h,R.getBaseName(l))}var m=ut(ut({},r),{},{language:(s=Re.languageFromFileName(l))!==null&&s!==void 0?s:""});r.value==null&&(m.value=a.content),r.wordWrap===void 0&&(r.wordWrap="off"),this.setState({fileMetadata:{id:l,itemName:l},settings:m}),this.debouncedSavePanelState()}).then(this.handleLoadSuccess).catch(this.handleLoadError)}save(){var e=this.state.fileMetadata;if(e&&R.hasPath(e.itemName)){var t=this.getNotebookValue();return t!==void 0?(this.saveContent(e.itemName,t),!0):!1}return this.setState({showSaveAsModal:!0}),!1}saveContent(e,t){ve.debug("saveContent",e,t),this.updateSavedChangeCount();var r=this.props.fileStorage;this.pending.add(r.saveFile({filename:e,content:t,basename:e})).then(this.handleSaveSuccess).catch(this.handleSaveError)}updateSavedChangeCount(){this.setState(e=>{var t=e.changeCount;return{savedChangeCount:t}})}setPreviewStatus(){if(this.tabTitleElement){var e=this.state.isPreview;ve.debug("setPreviewStatus",this.tabTitleElement,e),e?this.tabTitleElement.classList.add("is-preview"):this.tabTitleElement.classList.remove("is-preview")}}handlePreviewPromotion(){this.removePreviewStatus()}savePanelState(){this.setState(e=>{var t=e.changeCount,r=e.savedChangeCount,i=e.fileMetadata,o=e.isPreview,a=e.settings,s=this.getNotebookValue(),l=t!==r?s:void 0,u=ut(ut({},a),{},{value:s}),d=ut(ut({},a),{},{value:l}),h={settings:d,fileMetadata:i,isPreview:o};return ve.debug("Saving panel state",h),{settings:u,panelState:h}})}handleCloseDiscard(){this.setState({showCloseModal:!1});var e=this.props.glContainer;e.close({force:!0})}handleCloseSave(){if(this.setState({showCloseModal:!1}),this.save()){var e=this.props.glContainer;e.close({force:!0})}}handleCloseCancel(){this.setState({showCloseModal:!1})}handleOverwrite(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glEventHub,o=t.session,a=e.state,s=a.fileMetadata,l=a.settings;W(s);var u=l.language,d=s.itemName,h=yield R.getUniqueCopyFileName(r,d);ve.debug("handleCopy",s,d,h),yield r.copyFile(d,h);var m={id:h,itemName:h},v={value:null,language:u};i.emit(J.SELECT_NOTEBOOK,o,u,v,m,!0)})()}handleDelete(){ve.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glContainer,o=t.glEventHub,a=e.state.fileMetadata;ve.debug("handleDeleteConfirm",a==null?void 0:a.itemName),e.setState({showDeleteModal:!1}),a&&(R.hasPath(a.itemName)&&(yield R.fileExists(r,a.itemName))?(o.emit(J.CLOSE_FILE,a,{force:!0}),r.deleteFile(a.itemName)):i.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){ve.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var r=t.changeCount,i=t.savedChangeCount,o=e.isUndoing,a=e.isRedoing;return o?{changeCount:r-1,savedChangeCount:i}:!a&&r<i?{changeCount:r+1,savedChangeCount:0}:{changeCount:r+1,savedChangeCount:i}}),this.debouncedSavePanelState()}handleFind(){this.notebook&&this.notebook.toggleFind()}updateEditorMinimap(){if(this.editor){var e=this.props.notebookSettings;this.editor.updateOptions({minimap:{enabled:e.isMinimapEnabled}})}}handleMinimapChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={isMinimapEnabled:!((e=r.isMinimapEnabled)!==null&&e!==void 0&&e)};i(o)}updateEditorWordWrap(){if(this.editor){var e=this.state.settings,t=e.wordWrap;this.editor.updateOptions({wordWrap:t})}}handleWordWrapChange(){this.editor&&this.setState(e=>{var t=e.settings,r=t.wordWrap==="on"?"off":"on";return{settings:ut(ut({},t),{},{wordWrap:r})}})}handleFormatOnSaveChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={formatOnSave:!((e=r.formatOnSave)!==null&&e!==void 0&&e)};i(o)}handleLinkClick(e){var t=this.props,r=t.notebooksUrl,i=t.session,o=t.sessionLanguage,a=e.currentTarget.href;if(!(!a||!a.startsWith(r))){e.stopPropagation(),e.preventDefault();var s="/".concat(a.substring(r.length)).replace(/%20/g," ");if(s==="/"){ve.debug("Ignoring invalid notebook link",s);return}ve.debug("Notebook link clicked, opening",s);var l=this.props.glEventHub,u={value:null,language:o},d={id:s,itemName:s};l.emit(J.SELECT_NOTEBOOK,i,o,u,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;je.isCanceled(t)||(je.isTimedOut(t)&&(t=new Error("File not found.")),ve.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){var e=this;return Xr(function*(){ve.debug("handleSave");var t=e.props.notebookSettings,r=t.formatOnSave,i=r===void 0?!1:r;i&&(yield e.handleFormat()),e.save()})()}handleSaveSuccess(e){var t,r=this.props.fileStorage,i={id:e.filename,itemName:e.filename},o=(t=Re.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var s=a.fileMetadata,l=ut(ut({},a.settings),{},{language:o});return ve.debug("handleSaveSuccess",i,s,l),s&&R.hasPath(s.itemName)&&s.itemName!==i.itemName&&(ve.debug("handleSaveSuccess deleting old file",s.itemName),r.deleteFile(s.itemName).catch(Re.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){je.isCanceled(e)||(this.setState({savedChangeCount:0}),ve.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r&&this.handleOverwrite(e),ve.debug("handleSaveAsSubmit",e);var i=this.state.fileMetadata;if(i){var o=i.itemName,a=(t=this.getNotebookValue())!==null&&t!==void 0?t:"";if(this.setState({showSaveAsModal:!1}),R.getBaseName(o)!==R.getBaseName(e)){var s=this.props.metadata,l=s.id;this.renameTab(l,R.getBaseName(e))}this.saveContent(e,a)}}canFormat(){var e;return((e=this.notebook)===null||e===void 0?void 0:e.editor)!=null?ye.canFormat(this.notebook.editor):!1}handleFormat(){var e=this;return Xr(function*(){var t;((t=e.notebook)===null||t===void 0?void 0:t.editor)!=null&&(yield ye.formatDocument(e.notebook.editor))})()}handleRenameFile(e,t,r){var i=this.state,o=i.fileMetadata,a=i.panelState,s=this.props.glContainer;if((o==null?void 0:o.itemName)==="/".concat(t)&&r&&JSON.stringify(a)!==JSON.stringify(r)){s.close();return}o&&o.id===e&&(this.setState({fileMetadata:{id:t,itemName:t}}),this.debouncedSavePanelState())}handleResize(){var e;(e=this.notebook)===null||e===void 0||e.updateDimensions()}handleRunCommand(e){this.runCommand(e)}handleRunAll(){var e;if(!this.notebook){ve.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){ve.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,sessionLanguage:r})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;ve.debug("handleShow"),(e=this.notebook)===null||e===void 0||e.updateDimensions()}handlePanelDropped(e){var t=this.props.metadata.id;e===t&&this.forceUpdate()}handleShowRename(){this.setState({showSaveAsModal:!0})}handleTab(e){ve.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];ve.debug("handleTabFocus",...t);var i=this.props.glContainer;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){ve.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){ve.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var t=this.props.notebooksUrl,r=this.state.fileMetadata;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=r==null?void 0:r.itemName;if(i===void 0)return e;i.charAt(0)==="/"&&(i=i.substring(1));var o=new URL(i,t);return new URL(e,o).href}focus(){requestAnimationFrame(()=>{this.notebook&&this.notebook.focus()})}createNotebook(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=this.props.glEventHub,o=this.state,a=o.session,s=o.sessionLanguage,l=o.settings,u=ut(ut({},l),{},{language:t,value:r}),d={id:null,itemName:e};ve.debug("handleCreateNotebook",a,s,u,d),i.emit(J.CREATE_NOTEBOOK,a,s,u,d)}runCommand(e){if(e===void 0||e===""){ve.debug("Ignoring empty command.");return}this.removePreviewStatus();var t=this.props.glEventHub;t.emit(nt.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var t=e.isPreview;if(t){var r=this.state.fileMetadata;return r&&this.registerFileMetadata(r,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e=this.props.notebookSettings,t=e.isMinimapEnabled,r=e.formatOnSave,i=this.state,o=i.settings,a=i.session,s=i.sessionLanguage,l=i.isLoaded,u=this.getSettings(o,t??!1),d=a!=null,h=s===u.language,m=!l||!d||!h,v=!l;return this.getOverflowActions(t??!1,u.wordWrap==="on",r??!1,m,v)}render(){var e,t,r,i=this.props,o=i.fileStorage,a=i.glContainer,s=i.glContainer.tab,l=i.glEventHub,u=i.notebookSettings,d=this.state,h=d.changeCount,m=d.savedChangeCount,v=d.error,p=d.isDashboardActive,g=d.isLoaded,b=d.isLoading,y=d.isPreview,S=d.fileMetadata,E=d.session,T=d.sessionLanguage,O=d.settings,L=d.showCloseModal,G=d.showDeleteModal,$=d.showSaveAsModal,M=p&&!a.isHidden&&!y,j=(e=S==null?void 0:S.itemName)!==null&&e!==void 0?e:Re.DEFAULT_NAME,H=j.endsWith(".md"),ee=(S==null?void 0:S.id)!=null,F=this.getSettings(O,(t=u.isMinimapEnabled)!==null&&t!==void 0?t:!1),X=E!=null,ie=T===F.language,oe=!g||!X||!ie,ge=!g,we=[{action:this.handleSave,shortcut:Gt.SAVE},{action:this.handleMinimapChange,shortcut:Fe.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Fe.NOTEBOOK.WORDWRAP}],_e=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run"),Se=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run Selected"),de=[{title:ee?"Rename":"Save As…",order:10,group:Z.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:Z.groups.high,order:20}],te=s==null?void 0:s.element.find(".lm_title_before").get(0);return c.jsxs(c.Fragment,{children:[te!=null&&ui.createPortal(c.jsx("span",{className:q(Re.UNSAVED_INDICATOR_CLASS_NAME,{[Re.UNSAVED_STATUS_CLASS_NAME]:h!==m})}),te),c.jsxs(xr,{className:"notebook-container",componentPanel:this,glContainer:a,glEventHub:l,onTab:this.handleTab,onResize:this.handleResize,onShow:this.handleShow,onTabClicked:this.handleTabClick,onTabFocus:this.handleTabFocus,onTabBlur:this.handleTabBlur,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,additionalActions:de,renderTabTooltip:()=>j,children:[!H&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"notebook-toolbar",children:[c.jsxs("div",{className:"notebook-toolbar-actions",children:[c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run",onClick:this.handleRunAll,disabled:oe,icon:c.jsx(Ce,{icon:$i,transform:"grow-4"}),tooltip:"Run ".concat(Fe.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),_e!=null&&c.jsx(be,{children:_e})]}),c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run-selected",onClick:this.handleRunSelected,disabled:oe,icon:c.jsx(Ce,{icon:Bo,transform:"grow-4"}),tooltip:"Run Selected ".concat(Fe.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),Se!=null&&c.jsx(be,{children:Se})]}),c.jsx(ae,{kind:"ghost",className:"btn-save",disabled:ge,onClick:this.handleSave,icon:Wo,tooltip:"Save ".concat(Gt.SAVE.getDisplayText()),"aria-label":"Save"})]}),c.jsx(ae,{kind:"ghost",className:"btn-overflow",disabled:ge,icon:ql,tooltip:"More Actions...",onClick:()=>{},children:c.jsx(Pr,{actions:this.getDropdownOverflowActions,popperOptions:Re.POPPER_OPTIONS})})]}),c.jsx(Yu,{isLoaded:g,isLoading:b,error:v,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:E,sessionLanguage:T,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:F,focusOnMount:M,ref:Y=>{this.notebook=Y}})]}),H&&c.jsx(f.Suspense,{fallback:c.jsx(jn,{"data-testid":"notebook-panel-loading"}),children:c.jsx(Pw,{content:(r=F.value)!==null&&r!==void 0?r:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),c.jsx(An,{isOpen:$,type:"file",defaultValue:j,title:ee?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:o}),c.jsx(yr,{isOpen:G,headerText:'Are you sure you want to delete "'.concat(j,'"?'),bodyText:"You cannot undo this action.",onCancel:this.handleDeleteCancel,onConfirm:this.handleDeleteConfirm,confirmButtonText:"Delete"}),c.jsx(yr,{isOpen:L,headerText:"Do you want to save the changes you made to ".concat(j,"?"),bodyText:"Your changes will be lost if you don't save them.",onCancel:this.handleCloseCancel,onDiscard:this.handleCloseDiscard,onConfirm:this.handleCloseSave,discardButtonText:"Discard Changes",confirmButtonText:"Save"}),c.jsx(Z,{actions:we})]})]})}}Ke(Re,"COMPONENT","NotebookPanel");Ke(Re,"POPPER_OPTIONS",{placement:"bottom-end"});Ke(Re,"DEFAULT_NAME","Untitled");Ke(Re,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ke(Re,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ke(Re,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,notebookSettings:{isMinimapEnabled:!0}});var Tw=(n,e)=>{var t=Au(n),r=ju(n),i=Dr(n,e.localDashboardId),o=i??{},a=o.session,s=o.config,l=s??{},u=l.type;return{fileStorage:t,notebookSettings:r,session:a,sessionLanguage:u}},Tn=ir(Tw,{updateNotebookSettings:Kv},null,{forwardRef:!0})(Re);function Ow(){var n=PS(ju),e=n.python,t=e===void 0?{}:e,r=t.linter,i=r===void 0?{}:r,o=i.isEnabled,a=o===void 0?!1:o,s=i.config;f.useEffect(function(){V.isRuffEnabled=a,V.setRuffSettings(s)},[a,s])}function Pl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pl(Object(t),!0).forEach(function(r){Iw(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pl(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Iw(n,e,t){return(e=xw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xw(n){var e=Dw(n,"string");return typeof e=="symbol"?e:e+""}function Dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ol(n,e){return Nw(n)||Aw(n,e)||kw(n,e)||Mw()}function Mw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
50
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ow(n,e){if(n){if(typeof n=="string")return bl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bl(n,e):void 0}}function bl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function aw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function sw(n){if(Array.isArray(n))return n}var kt=z.module("FileExplorer");function No(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,d=u===void 0?()=>{}:u,h=n.onCreateFile,m=h===void 0?()=>{}:h,v=n.onCreateFolder,p=v===void 0?()=>{}:v,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,S=y===void 0?Ao:y,E=f.useState([]),T=gl(E,2),O=T[0],L=T[1],G=f.useState(),$=gl(G,2),M=$[0],j=$[1];f.useEffect(function(){var ce;function w(){return P.apply(this,arguments)}function P(){return P=pl(function*(){kt.debug("initTable"),ce=je.makeCancelable(e.getTable(),_=>_.close());try{j(yield ce)}catch(_){je.isCanceled(_)||kt.error("Unable to initialize table",_)}}),P.apply(this,arguments)}return w(),()=>{ce.cancel()}},[e]);var H=f.useCallback(Y=>{je.isCanceled(Y)||kt.error(Y)},[]),ee=f.useCallback(()=>{kt.debug("handleCreateFile"),m()},[m]),F=f.useCallback(()=>{kt.debug("handleCreateFolder"),p()},[p]),X=f.useCallback(Y=>{kt.debug("handleCopyFile",Y.filename),a(Y)},[a]),ie=f.useCallback(Y=>{kt.debug("handleDelete, pending confirmation",Y),L(Y)},[]),oe=f.useCallback(()=>{kt.debug("handleDeleteConfirm",O),O.forEach(Y=>e.deleteFile(It(Y)?R.makePath(Y.filename):Y.filename)),l(O),L([])},[O,l,e]),ge=f.useCallback(()=>{kt.debug("handleDeleteCancel"),L([])},[]),we=f.useCallback((Y,ce)=>{var w=R.reducePaths(Y.map(P=>It(P)?R.makePath(P.filename):P.filename));w.forEach(P=>{var _=R.isPath(P)?"".concat(ce).concat(R.getBaseName(P.substring(0,P.length-1)),"/"):"".concat(ce).concat(R.getBaseName(P));e.moveFile(P,_).then(()=>{d(P,_)}).catch(H)})},[H,d,e]),_e=f.useCallback((Y,ce)=>{var w=Y.filename,P=It(Y);P&&!w.endsWith("/")&&(w="".concat(w,"/"));var _="".concat(R.getParent(w)).concat(ce);P&&!_.endsWith("/")&&(_="".concat(_,"/")),kt.debug2("handleRename",w,_),e.moveFile(w,_).catch(H),d(w,_)},[H,d,e]),Se=f.useCallback(function(){var Y=pl(function*(ce,w){if(w!==ce.basename){R.validateName(w);var P="".concat(R.getPath(ce.filename)).concat(w);try{var _=yield e.info(P);throw new Qr(_)}catch(B){if(!(B instanceof ko))throw B}}});return function(ce,w){return Y.apply(this,arguments)}}(),[e]),de=O.length>0,te=f.useMemo(()=>O.length===1?'Are you sure you want to delete "'.concat(O[0].filename,'"?'):"Are you sure you want to delete the selected files?",[O]);return c.jsxs("div",{className:"file-explorer",children:[M&&c.jsx(Wd,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:X,onCreateFolder:F,onCreateFile:ee,onMove:we,onDelete:ie,onRename:_e,onSelect:g,onSelectionChange:b,rowHeight:S,table:M,validateRename:Se}),c.jsx(yr,{isOpen:de,headerText:te,bodyText:"You cannot undo this action.",onCancel:ge,onConfirm:oe,confirmButtonText:"Delete"})]})}No.displayName="FileExplorer";function yl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function lw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){yl(o,r,i,a,s,"next",l)}function s(l){yl(o,r,i,a,s,"throw",l)}a(void 0)})}}function xn(n,e,t){return(e=uw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uw(n){var e=dw(n,"string");return typeof e=="symbol"?e:e+""}function dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var En=z.module("NewItemModal");class An extends f.PureComponent{static getValidationMessage(e){return e instanceof Qr&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){je.isCanceled(e)||En.error(e)}constructor(e){super(e),xn(this,"inputRef",U.createRef()),xn(this,"cancelableValidatePromise",void 0),xn(this,"cancelableExistingItemPromise",void 0),xn(this,"pending",new wr),xn(this,"pathMap",new Map),xn(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:R.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:R.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.setState({path:r,value:R.getBaseName(t),validationError:void 0,prevExtension:R.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=je.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return lw(function*(){R.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new Qr(u)}catch(d){if(!(d instanceof ko))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(An.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(En.debug("handleSelect",e),e.type==="directory")this.setState({path:R.makePath(e.filename)});else{var t=e.basename,r=R.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof vr))throw e;En.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;En.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){En.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=R.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){En.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;En.debug("submitModal",r,i);var u=R.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(d=>{var h=this.props.onSubmit;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof Qr&&l!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw je.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(An.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),c.jsxs(U.Fragment,{children:[c.jsx(ae,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?c.jsx(Ce,{icon:Zc,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,d=l.path,h=l.showExtensionChangeModal,m=l.showOverwriteModal,v=l.validationError,p=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",S=R.fileExtensionToString(g),E=R.fileExtensionToString(b),T=y?"Create":"Save",O=y?"New folder name":"Save file as";return c.jsxs(c.Fragment,{children:[c.jsxs(Fl,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[c.jsx(Rl,{toggle:i,children:a}),c.jsx($l,{children:c.jsx("form",{children:c.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[c.jsxs("div",{className:"flex-grow-0 mb-4",children:[c.jsx("label",{htmlFor:"file-name-input",children:O}),c.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:q("form-control",{"is-invalid":v}),value:p,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),v&&c.jsx("div",{className:"invalid-feedback",children:An.getValidationMessage(v)})]}),c.jsxs("div",{className:"flex-grow-0",children:[c.jsx("label",{children:"Directory: /"}),this.renderPathButtons(d)]}),c.jsx("div",{className:"flex-grow-1 file-explorer-container",children:c.jsx(No,{onSelect:this.handleSelect,storage:t,focusedPath:d})})]})})}),c.jsxs(hu,{children:[c.jsx(ae,{kind:"secondary",onClick:i,children:"Cancel"}),c.jsx(ae,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:T})]})]}),c.jsx(yr,{isOpen:m,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),c.jsx(yr,{isOpen:h,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(S,'" to "').concat(E,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(S,'"'),confirmButtonText:'Use "'.concat(E,'"')})]})}}xn(An,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function cw(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return c.jsxs("div",{className:"file-explorer-toolbar",children:[c.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[c.jsx(ae,{kind:"ghost",icon:Xl,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),c.jsx(ae,{kind:"ghost",icon:Yc,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&c.jsx("div",{className:"file-explorer-toolbar-search",children:c.jsx(Cu,{value:o,onChange:r,placeholder:"Search by name"})})]})}function Sl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function hw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Sl(o,r,i,a,s,"next",l)}function s(l){Sl(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ud(n,e,t){return(e=mw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mw(n){var e=fw(n,"string");return typeof e=="symbol"?e:e+""}function fw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pn=z.module("FileExplorerPanel"),vw=(n,e)=>{var t=Au(n),r=Dr(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},pw=ir(vw,null,null,{forwardRef:!0});function gw(n){var e=n;return e!=null&&typeof e.button=="number"}class rr extends U.Component{static handleError(e){Pn.error(e)}static isFocusEvent(e){return gw(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Pn.debug("handleCreateFile",r,i,o),e.emit(J.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Pn.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Pn.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(rr.handleError)}handleCopyFile(e){var t=this;return hw(function*(){var r=t.props.fileStorage;if(It(e)){Pn.error("Invalid item in handleCopyItem",e);return}var i=yield R.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit(J.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=R.makePath(e[0].filename):t=R.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Pn.debug("fileSelect",e),e.type!=="directory"){var r=rr.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit(J.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Pn.debug("handleRename",e,t),r.emit(J.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return c.jsxs(xr,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[c.jsx(cw,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&c.jsx(No,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),c.jsx(An,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}Ud(rr,"COMPONENT","FileExplorerPanel");Ud(rr,"TITLE","File Explorer");var bw=pw(rr);function Cr(n,e,t){return(e=yw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yw(n){var e=Sw(n,"string");return typeof e=="symbol"?e:e+""}function Sw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Cl=z.module("LogPanel");class yi extends f.PureComponent{constructor(e){super(e),Cr(this,"isBottomVisible",void 0),Cr(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var t=this.props.session;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){var t=e.session;Cl.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){Cl.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return c.jsxs(xr,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&c.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&c.jsx(xe,{session:i,ref:o=>{this.logView=o}})]})}}Cr(yi,"defaultProps",{session:null});Cr(yi,"COMPONENT","LogPanel");Cr(yi,"TITLE","Log");var Cw=(n,e)=>{var t;return{session:(t=Dr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},ww=ir(Cw,null,null,{forwardRef:!0})(yi);function wl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Xr(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){wl(o,r,i,a,s,"next",l)}function s(l){wl(o,r,i,a,s,"throw",l)}a(void 0)})}}function _l(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_l(Object(t),!0).forEach(function(r){Ke(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_l(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ke(n,e,t){return(e=_w(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _w(n){var e=Ew(n,"string");return typeof e=="symbol"?e:e+""}function Ew(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pw=f.lazy(()=>Yl(()=>import("./MarkdownNotebook-BOJH8So0.js"),__vite__mapDeps([6,4,3,5,7,8,9,10,11,12]),import.meta.url)),ve=z.module("NotebookPanel"),El=400;class Re extends f.Component{static handleError(e){je.isCanceled(e)||ve.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Re.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Re.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=R.getExtension(e).toLowerCase();switch(t){case"py":case"python":return"python";case"groovy":return"groovy";case"scala":return"scala";default:return null}}constructor(e){super(e),Ke(this,"pending",void 0),Ke(this,"debouncedSavePanelState",void 0),Ke(this,"debouncedLoad",void 0),Ke(this,"notebook",void 0),Ke(this,"tabTitleElement",void 0),Ke(this,"tabInitOnce",void 0),Ke(this,"editor",void 0),Ke(this,"getSettings",fn((g,b)=>ut(ut({},g),{},{minimap:{enabled:b}}))),Ke(this,"getOverflowActions",fn((g,b,y,S,E)=>{var T=[{title:"Run",icon:$i,action:this.handleRunAll,disabled:S,shortcut:Fe.NOTEBOOK.RUN,group:Z.groups.high,order:1},{title:"Run Selected",icon:Bo,action:this.handleRunSelected,disabled:S,shortcut:Fe.NOTEBOOK.RUN_SELECTED,group:Z.groups.high,order:2},{title:"Save",icon:Wo,action:this.handleSave,disabled:E,shortcut:Gt.SAVE,group:Z.groups.high,order:3},{title:"Find",icon:Qc,action:this.handleFind,group:Z.groups.high,shortcut:Fe.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:Hl,action:this.handleCopy,group:Z.groups.medium,order:20},{title:"Rename File",icon:Jc,action:this.handleShowRename,group:Z.groups.medium,order:30},{title:"Delete File",icon:zl,action:this.handleDelete,group:Z.groups.medium,order:40},{title:"Show Minimap",icon:g?Yn:void 0,action:this.handleMinimapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:b?Yn:void 0,action:this.handleWordWrapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.WORDWRAP,order:30}];return this.canFormat()&&(T.push({title:"Format Document",action:this.handleFormat,group:Z.groups.low,order:10}),T.push({title:"Format on Save",icon:y?Yn:void 0,action:this.handleFormatOnSaveChange,group:Z.groups.low,order:15})),T})),this.handleCloseCancel=this.handleCloseCancel.bind(this),this.handleCloseDiscard=this.handleCloseDiscard.bind(this),this.handleCloseSave=this.handleCloseSave.bind(this),this.handleCopy=this.handleCopy.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleDeleteConfirm=this.handleDeleteConfirm.bind(this),this.handleDeleteCancel=this.handleDeleteCancel.bind(this),this.handleEditorInitialized=this.handleEditorInitialized.bind(this),this.handleEditorWillDestroy=this.handleEditorWillDestroy.bind(this),this.handleEditorChange=this.handleEditorChange.bind(this),this.handleFind=this.handleFind.bind(this),this.handleMinimapChange=this.handleMinimapChange.bind(this),this.handleWordWrapChange=this.handleWordWrapChange.bind(this),this.handleFormatOnSaveChange=this.handleFormatOnSaveChange.bind(this),this.handleLinkClick=this.handleLinkClick.bind(this),this.handleLoadSuccess=this.handleLoadSuccess.bind(this),this.handleLoadError=this.handleLoadError.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.handleRenameFile=this.handleRenameFile.bind(this),this.handleResize=this.handleResize.bind(this),this.handleRunCommand=this.handleRunCommand.bind(this),this.handleRunAll=this.handleRunAll.bind(this),this.handleRunSelected=this.handleRunSelected.bind(this),this.handleSave=this.handleSave.bind(this),this.handleSaveAsCancel=this.handleSaveAsCancel.bind(this),this.handleSaveAsSubmit=this.handleSaveAsSubmit.bind(this),this.handleSaveError=this.handleSaveError.bind(this),this.handleSaveSuccess=this.handleSaveSuccess.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleShowRename=this.handleShowRename.bind(this),this.handleTab=this.handleTab.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabClick=this.handleTabClick.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleTransformLinkUri=this.handleTransformLinkUri.bind(this),this.handleOverwrite=this.handleOverwrite.bind(this),this.handlePreviewPromotion=this.handlePreviewPromotion.bind(this),this.handleFormat=this.handleFormat.bind(this),this.canFormat=this.canFormat.bind(this),this.getDropdownOverflowActions=this.getDropdownOverflowActions.bind(this),this.pending=new wr,this.debouncedSavePanelState=Nn(this.savePanelState.bind(this),El),this.debouncedLoad=Nn(this.load.bind(this),El),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var t=e.isDashboardActive,r=e.session,i=e.sessionLanguage,o=e.panelState,a={value:"",language:"",wordWrap:"off"},s=null,l=e.isPreview;if(o!=null){var u=o.fileMetadata;s=u===void 0?s:u;var d=o.isPreview;l=d===void 0?l:d;var h=o.settings;a=h===void 0?a:h}var m=s!=null&&R.hasPath(s.itemName),v=m===!0&&a.value!=null||!m&&a.value!=null&&a.value.length>0,p=v?1:0;this.state={error:void 0,isDashboardActive:t,isLoading:!0,isLoaded:!1,isPreview:l,savedChangeCount:0,changeCount:p,fileMetadata:s,settings:a,session:r,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:"",formatOnSave:!1},ve.debug("constructor",e,this.state)}componentDidMount(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=t.tab;i!=null&&this.initTab(i),this.initNotebookContent(),r.on(J.RENAME_FILE,this.handleRenameFile),r.on(ue.DROPPED,this.handlePanelDropped),t.on(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var r=this.state,i=r.isPreview,o=r.settings,a=o.wordWrap,s=this.props.notebookSettings;i!==t.isPreview&&this.setPreviewStatus(),a!==t.settings.wordWrap&&(this.updateEditorWordWrap(),this.debouncedSavePanelState()),s.isMinimapEnabled!==e.notebookSettings.isMinimapEnabled&&this.updateEditorMinimap()}componentWillUnmount(){this.debouncedSavePanelState.flush(),this.pending.cancel();var e=this.props,t=e.glEventHub,r=e.glContainer,i=this.state,o=i.fileMetadata,a=i.isPreview;t.off(J.RENAME_FILE,this.handleRenameFile),t.off(ue.DROPPED,this.handlePanelDropped),r.off(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),t.emit(J.UNREGISTER_FILE,o,a)}initTab(e){this.tabInitOnce||(this.tabInitOnce=!0,this.initTabCloseOverride()),this.initTabClasses(e)}initTabCloseOverride(){var e=this.props.glContainer;e.beforeClose(t=>{if((t==null?void 0:t.force)===!0)return!0;var r=this.state,i=r.changeCount,o=r.savedChangeCount;return i!==o?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);W(t);var r=t.querySelector(".lm_title");this.tabTitleElement=r,r==null||r.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var e=this.state,t=e.changeCount,r=e.savedChangeCount,i=e.settings,o=i.value;if(t!==r&&this.notebook){var a=this.notebook.getValue();return a??o}return o}initNotebookContent(){var e=this.state,t=e.fileMetadata,r=e.settings,i=e.isPreview;if(t&&t.id){ve.debug("Init content from file"),this.registerFileMetadata(t,i),this.load();return}if(r.value!=null){ve.debug("Use content passed in the settings prop"),this.handleLoadSuccess();return}this.handleLoadError(new Error("Missing file metadata"))}closeFileTabById(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var r=this.props,i=r.glEventHub,o=r.metadata,a=o.id;i.emit(J.REGISTER_FILE,a,e,t)}renameTab(e,t){var r=this.props.glEventHub;r.emit(J.RENAME,e,t)}load(){var e=this.state,t=e.fileMetadata,r=e.settings;W(t);var i=t.id,o=this.props.fileStorage;this.pending.add(o.loadFile(i)).then(a=>{var s;ve.debug("Loaded file",a);var l=a.filename,u=this.state.itemName;if(l!==u){var d=this.props.metadata,h=d.id;this.renameTab(h,R.getBaseName(l))}var m=ut(ut({},r),{},{language:(s=Re.languageFromFileName(l))!==null&&s!==void 0?s:""});r.value==null&&(m.value=a.content),r.wordWrap===void 0&&(r.wordWrap="off"),this.setState({fileMetadata:{id:l,itemName:l},settings:m}),this.debouncedSavePanelState()}).then(this.handleLoadSuccess).catch(this.handleLoadError)}save(){var e=this.state.fileMetadata;if(e&&R.hasPath(e.itemName)){var t=this.getNotebookValue();return t!==void 0?(this.saveContent(e.itemName,t),!0):!1}return this.setState({showSaveAsModal:!0}),!1}saveContent(e,t){ve.debug("saveContent",e,t),this.updateSavedChangeCount();var r=this.props.fileStorage;this.pending.add(r.saveFile({filename:e,content:t,basename:e})).then(this.handleSaveSuccess).catch(this.handleSaveError)}updateSavedChangeCount(){this.setState(e=>{var t=e.changeCount;return{savedChangeCount:t}})}setPreviewStatus(){if(this.tabTitleElement){var e=this.state.isPreview;ve.debug("setPreviewStatus",this.tabTitleElement,e),e?this.tabTitleElement.classList.add("is-preview"):this.tabTitleElement.classList.remove("is-preview")}}handlePreviewPromotion(){this.removePreviewStatus()}savePanelState(){this.setState(e=>{var t=e.changeCount,r=e.savedChangeCount,i=e.fileMetadata,o=e.isPreview,a=e.settings,s=this.getNotebookValue(),l=t!==r?s:void 0,u=ut(ut({},a),{},{value:s}),d=ut(ut({},a),{},{value:l}),h={settings:d,fileMetadata:i,isPreview:o};return ve.debug("Saving panel state",h),{settings:u,panelState:h}})}handleCloseDiscard(){this.setState({showCloseModal:!1});var e=this.props.glContainer;e.close({force:!0})}handleCloseSave(){if(this.setState({showCloseModal:!1}),this.save()){var e=this.props.glContainer;e.close({force:!0})}}handleCloseCancel(){this.setState({showCloseModal:!1})}handleOverwrite(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glEventHub,o=t.session,a=e.state,s=a.fileMetadata,l=a.settings;W(s);var u=l.language,d=s.itemName,h=yield R.getUniqueCopyFileName(r,d);ve.debug("handleCopy",s,d,h),yield r.copyFile(d,h);var m={id:h,itemName:h},v={value:null,language:u};i.emit(J.SELECT_NOTEBOOK,o,u,v,m,!0)})()}handleDelete(){ve.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glContainer,o=t.glEventHub,a=e.state.fileMetadata;ve.debug("handleDeleteConfirm",a==null?void 0:a.itemName),e.setState({showDeleteModal:!1}),a&&(R.hasPath(a.itemName)&&(yield R.fileExists(r,a.itemName))?(o.emit(J.CLOSE_FILE,a,{force:!0}),r.deleteFile(a.itemName)):i.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){ve.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var r=t.changeCount,i=t.savedChangeCount,o=e.isUndoing,a=e.isRedoing;return o?{changeCount:r-1,savedChangeCount:i}:!a&&r<i?{changeCount:r+1,savedChangeCount:0}:{changeCount:r+1,savedChangeCount:i}}),this.debouncedSavePanelState()}handleFind(){this.notebook&&this.notebook.toggleFind()}updateEditorMinimap(){if(this.editor){var e=this.props.notebookSettings;this.editor.updateOptions({minimap:{enabled:e.isMinimapEnabled}})}}handleMinimapChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={isMinimapEnabled:!((e=r.isMinimapEnabled)!==null&&e!==void 0&&e)};i(o)}updateEditorWordWrap(){if(this.editor){var e=this.state.settings,t=e.wordWrap;this.editor.updateOptions({wordWrap:t})}}handleWordWrapChange(){this.editor&&this.setState(e=>{var t=e.settings,r=t.wordWrap==="on"?"off":"on";return{settings:ut(ut({},t),{},{wordWrap:r})}})}handleFormatOnSaveChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={formatOnSave:!((e=r.formatOnSave)!==null&&e!==void 0&&e)};i(o)}handleLinkClick(e){var t=this.props,r=t.notebooksUrl,i=t.session,o=t.sessionLanguage,a=e.currentTarget.href;if(!(!a||!a.startsWith(r))){e.stopPropagation(),e.preventDefault();var s="/".concat(a.substring(r.length)).replace(/%20/g," ");if(s==="/"){ve.debug("Ignoring invalid notebook link",s);return}ve.debug("Notebook link clicked, opening",s);var l=this.props.glEventHub,u={value:null,language:o},d={id:s,itemName:s};l.emit(J.SELECT_NOTEBOOK,i,o,u,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;je.isCanceled(t)||(je.isTimedOut(t)&&(t=new Error("File not found.")),ve.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){var e=this;return Xr(function*(){ve.debug("handleSave");var t=e.props.notebookSettings,r=t.formatOnSave,i=r===void 0?!1:r;i&&(yield e.handleFormat()),e.save()})()}handleSaveSuccess(e){var t,r=this.props.fileStorage,i={id:e.filename,itemName:e.filename},o=(t=Re.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var s=a.fileMetadata,l=ut(ut({},a.settings),{},{language:o});return ve.debug("handleSaveSuccess",i,s,l),s&&R.hasPath(s.itemName)&&s.itemName!==i.itemName&&(ve.debug("handleSaveSuccess deleting old file",s.itemName),r.deleteFile(s.itemName).catch(Re.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){je.isCanceled(e)||(this.setState({savedChangeCount:0}),ve.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r&&this.handleOverwrite(e),ve.debug("handleSaveAsSubmit",e);var i=this.state.fileMetadata;if(i){var o=i.itemName,a=(t=this.getNotebookValue())!==null&&t!==void 0?t:"";if(this.setState({showSaveAsModal:!1}),R.getBaseName(o)!==R.getBaseName(e)){var s=this.props.metadata,l=s.id;this.renameTab(l,R.getBaseName(e))}this.saveContent(e,a)}}canFormat(){var e;return((e=this.notebook)===null||e===void 0?void 0:e.editor)!=null?ye.canFormat(this.notebook.editor):!1}handleFormat(){var e=this;return Xr(function*(){var t;((t=e.notebook)===null||t===void 0?void 0:t.editor)!=null&&(yield ye.formatDocument(e.notebook.editor))})()}handleRenameFile(e,t,r){var i=this.state,o=i.fileMetadata,a=i.panelState,s=this.props.glContainer;if((o==null?void 0:o.itemName)==="/".concat(t)&&r&&JSON.stringify(a)!==JSON.stringify(r)){s.close();return}o&&o.id===e&&(this.setState({fileMetadata:{id:t,itemName:t}}),this.debouncedSavePanelState())}handleResize(){var e;(e=this.notebook)===null||e===void 0||e.updateDimensions()}handleRunCommand(e){this.runCommand(e)}handleRunAll(){var e;if(!this.notebook){ve.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){ve.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,sessionLanguage:r})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;ve.debug("handleShow"),(e=this.notebook)===null||e===void 0||e.updateDimensions()}handlePanelDropped(e){var t=this.props.metadata.id;e===t&&this.forceUpdate()}handleShowRename(){this.setState({showSaveAsModal:!0})}handleTab(e){ve.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];ve.debug("handleTabFocus",...t);var i=this.props.glContainer;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){ve.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){ve.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var t=this.props.notebooksUrl,r=this.state.fileMetadata;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=r==null?void 0:r.itemName;if(i===void 0)return e;i.charAt(0)==="/"&&(i=i.substring(1));var o=new URL(i,t);return new URL(e,o).href}focus(){requestAnimationFrame(()=>{this.notebook&&this.notebook.focus()})}createNotebook(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=this.props.glEventHub,o=this.state,a=o.session,s=o.sessionLanguage,l=o.settings,u=ut(ut({},l),{},{language:t,value:r}),d={id:null,itemName:e};ve.debug("handleCreateNotebook",a,s,u,d),i.emit(J.CREATE_NOTEBOOK,a,s,u,d)}runCommand(e){if(e===void 0||e===""){ve.debug("Ignoring empty command.");return}this.removePreviewStatus();var t=this.props.glEventHub;t.emit(nt.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var t=e.isPreview;if(t){var r=this.state.fileMetadata;return r&&this.registerFileMetadata(r,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e=this.props.notebookSettings,t=e.isMinimapEnabled,r=e.formatOnSave,i=this.state,o=i.settings,a=i.session,s=i.sessionLanguage,l=i.isLoaded,u=this.getSettings(o,t??!1),d=a!=null,h=s===u.language,m=!l||!d||!h,v=!l;return this.getOverflowActions(t??!1,u.wordWrap==="on",r??!1,m,v)}render(){var e,t,r,i=this.props,o=i.fileStorage,a=i.glContainer,s=i.glContainer.tab,l=i.glEventHub,u=i.notebookSettings,d=this.state,h=d.changeCount,m=d.savedChangeCount,v=d.error,p=d.isDashboardActive,g=d.isLoaded,b=d.isLoading,y=d.isPreview,S=d.fileMetadata,E=d.session,T=d.sessionLanguage,O=d.settings,L=d.showCloseModal,G=d.showDeleteModal,$=d.showSaveAsModal,M=p&&!a.isHidden&&!y,j=(e=S==null?void 0:S.itemName)!==null&&e!==void 0?e:Re.DEFAULT_NAME,H=j.endsWith(".md"),ee=(S==null?void 0:S.id)!=null,F=this.getSettings(O,(t=u.isMinimapEnabled)!==null&&t!==void 0?t:!1),X=E!=null,ie=T===F.language,oe=!g||!X||!ie,ge=!g,we=[{action:this.handleSave,shortcut:Gt.SAVE},{action:this.handleMinimapChange,shortcut:Fe.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Fe.NOTEBOOK.WORDWRAP}],_e=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run"),Se=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run Selected"),de=[{title:ee?"Rename":"Save As…",order:10,group:Z.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:Z.groups.high,order:20}],te=s==null?void 0:s.element.find(".lm_title_before").get(0);return c.jsxs(c.Fragment,{children:[te!=null&&ui.createPortal(c.jsx("span",{className:q(Re.UNSAVED_INDICATOR_CLASS_NAME,{[Re.UNSAVED_STATUS_CLASS_NAME]:h!==m})}),te),c.jsxs(xr,{className:"notebook-container",componentPanel:this,glContainer:a,glEventHub:l,onTab:this.handleTab,onResize:this.handleResize,onShow:this.handleShow,onTabClicked:this.handleTabClick,onTabFocus:this.handleTabFocus,onTabBlur:this.handleTabBlur,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,additionalActions:de,renderTabTooltip:()=>j,children:[!H&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"notebook-toolbar",children:[c.jsxs("div",{className:"notebook-toolbar-actions",children:[c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run",onClick:this.handleRunAll,disabled:oe,icon:c.jsx(Ce,{icon:$i,transform:"grow-4"}),tooltip:"Run ".concat(Fe.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),_e!=null&&c.jsx(be,{children:_e})]}),c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run-selected",onClick:this.handleRunSelected,disabled:oe,icon:c.jsx(Ce,{icon:Bo,transform:"grow-4"}),tooltip:"Run Selected ".concat(Fe.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),Se!=null&&c.jsx(be,{children:Se})]}),c.jsx(ae,{kind:"ghost",className:"btn-save",disabled:ge,onClick:this.handleSave,icon:Wo,tooltip:"Save ".concat(Gt.SAVE.getDisplayText()),"aria-label":"Save"})]}),c.jsx(ae,{kind:"ghost",className:"btn-overflow",disabled:ge,icon:ql,tooltip:"More Actions...",onClick:()=>{},children:c.jsx(Pr,{actions:this.getDropdownOverflowActions,popperOptions:Re.POPPER_OPTIONS})})]}),c.jsx(Yu,{isLoaded:g,isLoading:b,error:v,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:E,sessionLanguage:T,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:F,focusOnMount:M,ref:Y=>{this.notebook=Y}})]}),H&&c.jsx(f.Suspense,{fallback:c.jsx(jn,{"data-testid":"notebook-panel-loading"}),children:c.jsx(Pw,{content:(r=F.value)!==null&&r!==void 0?r:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),c.jsx(An,{isOpen:$,type:"file",defaultValue:j,title:ee?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:o}),c.jsx(yr,{isOpen:G,headerText:'Are you sure you want to delete "'.concat(j,'"?'),bodyText:"You cannot undo this action.",onCancel:this.handleDeleteCancel,onConfirm:this.handleDeleteConfirm,confirmButtonText:"Delete"}),c.jsx(yr,{isOpen:L,headerText:"Do you want to save the changes you made to ".concat(j,"?"),bodyText:"Your changes will be lost if you don't save them.",onCancel:this.handleCloseCancel,onDiscard:this.handleCloseDiscard,onConfirm:this.handleCloseSave,discardButtonText:"Discard Changes",confirmButtonText:"Save"}),c.jsx(Z,{actions:we})]})]})}}Ke(Re,"COMPONENT","NotebookPanel");Ke(Re,"POPPER_OPTIONS",{placement:"bottom-end"});Ke(Re,"DEFAULT_NAME","Untitled");Ke(Re,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ke(Re,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ke(Re,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,notebookSettings:{isMinimapEnabled:!0}});var Tw=(n,e)=>{var t=Au(n),r=ju(n),i=Dr(n,e.localDashboardId),o=i??{},a=o.session,s=o.config,l=s??{},u=l.type;return{fileStorage:t,notebookSettings:r,session:a,sessionLanguage:u}},Tn=ir(Tw,{updateNotebookSettings:Kv},null,{forwardRef:!0})(Re);function Ow(){var n=PS(ju),e=n.python,t=e===void 0?{}:e,r=t.linter,i=r===void 0?{}:r,o=i.isEnabled,a=o===void 0?!1:o,s=i.config;f.useEffect(function(){V.isRuffEnabled=a,V.setRuffSettings(s)},[a,s])}function Pl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pl(Object(t),!0).forEach(function(r){Iw(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pl(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Iw(n,e,t){return(e=xw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xw(n){var e=Dw(n,"string");return typeof e=="symbol"?e:e+""}function Dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ol(n,e){return Nw(n)||Aw(n,e)||kw(n,e)||Mw()}function Mw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
51
51
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kw(n,e){if(n){if(typeof n=="string")return Il(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Il(n,e):void 0}}function Il(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Aw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Nw(n){if(Array.isArray(n))return n}var Pe=z.module("ConsolePlugin");function xl(n){return n.notebook!==void 0}function jw(n){dS(n)}function UE(n){jw(n);var e=n.id,t=n.hydrateConsole,r=n.layout,i=n.panelManager,o=n.registerComponent,a=n.notebooksUrl,s=f.useRef(0),l=f.useState(new Map),u=Ol(l,2),d=u[0],h=u[1],m=f.useState(new Map),v=Ol(m,2),p=v[0],g=v[1];Ow();var b=ao(),y=f.useCallback(()=>i.getLastUsedPanelOfType(Ai),[i]),S=f.useCallback((w,P)=>{h(_=>new Map(_.set(w,P)))},[h]),E=f.useCallback(w=>{h(P=>(P.delete(w),new Map(P)))},[h]),T=f.useCallback((w,P)=>{g(_=>new Map(_.set(w,P)))},[g]),O=f.useCallback(w=>{g(P=>(P.delete(w),new Map(P)))},[g]),L=f.useCallback(function(w){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,B=w&&w.trim();if(!B)Pe.info("Ignoring empty code");else{var se=y();if(!se||!(se instanceof Ai.WrappedComponent)){Pe.error("Console panel not found");return}Pe.debug("Send command: ",w,P,_),se.addCommand(w,P,_)}},[y]),G=f.useCallback(w=>{b(qC(e,w))},[b,e]),$=f.useCallback(w=>{var P=w.language,_=P==="python"?"py":P,B=null;return _==null?(Pe.debug("No extension for language",P),B="Untitled-".concat(s.current)):B="Untitled-".concat(s.current,".").concat(_),s.current+=1,B},[]),M=f.useCallback(function(w){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,_=w.id;if(_!=null&&d.has(_))return d.get(_);if(_!=null&&p.has(_))return p.get(_);if(P)return Nt()},[d,p]),j=f.useCallback((w,P)=>{x.renameComponent(r.root,{id:w},P)},[r.root]),H=f.useCallback((w,P)=>{Pe.debug("Rename file panel",w,P);var _;if(d.has(w)&&(_=d.get(w),E(w),_!=null&&S(P,_)),p.has(w)&&(_=p.get(w),O(w),_!=null&&T(P,_)),_===void 0){Pe.debug2("File ".concat(w," isn't open, no need to rename the tab"));return}j(_,R.getBaseName(P))},[d,p,j,S,T,E,O]),ee=f.useCallback(w=>{var P=M(w,!1);if(P==null){Pe.error("Could not find panel id for file metadata",w);return}x.activateTab(r.root,{id:P})},[M,r.root]),F=f.useCallback((w,P,_)=>{if(Pe.debug("registerFilePanel",w,P,_),P==null||P.id==null){Pe.debug("Ignore empty file id",P);return}var B=P.id;if(_){T(B,w);return}if(d.has(B)){var se=d.get(B);if(w===se){Pe.debug("Update tab title for file ".concat(B));var ot=P.itemName;H(B,ot)}else Pe.error("File ".concat(B," already associated with a different tab ").concat(se));return}S(B,w),p.has(B)&&O(B)},[d,p,H,S,T,O]),X=f.useCallback((w,P)=>{if(Pe.debug("unregisterFileTab",w,P),w==null||w.id==null){Pe.debug("Ignore empty file id",w);return}var _=w.id;if(P){O(_);return}E(_)},[E,O]),ie=f.useCallback((w,P)=>{Pe.debug("closeFilePanel",w);var _=w.id;if(_==null){Pe.warn("File ID is null, ignore close event");return}var B=null,se=!1;if(d.has(_))B=d.get(_);else if(p.has(_))B=p.get(_),se=!0;else{Pe.debug("File ".concat(_," isn't open, ignore close event"));return}X(w,se),x.closeComponent(r.root,{id:B},P)},[r.root,d,p,X]),oe=f.useCallback(w=>{var P=w.itemName;return R.getBaseName(P)},[]),ge=f.useCallback(w=>{var P=w.id;return Pe.debug("fileIsOpen",w,P,d),P!=null&&d.has(P)},[d]),we=f.useCallback(w=>{var P=w.id;return Pe.debug("fileIsOpenAsPreview",w,P,p),P!=null&&p.has(P)},[p]),_e=f.useCallback(w=>{if(w!=null){var P=i.getOpenedPanelById(w);P&&xl(P)&&P.focus()}},[i]),Se=f.useCallback(w=>{var P=w.id,_=w.settings,B=w.fileMetadata,se=w.session,ot=w.sessionLanguage,gt=w.isPreview,Qt=gt===void 0?!1:gt,wt={settings:_,fileMetadata:B},K=oe(B);return{type:"react-component",component:Tn.COMPONENT,isFocusOnShow:!1,props:{localDashboardId:e,metadata:{id:P},session:se,sessionLanguage:ot,panelState:wt,isPreview:Qt,notebooksUrl:a},title:K,id:P}},[oe,e,a]),de=f.useCallback(function(w,P,_){var B=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{id:null,itemName:$(_)},se=M(B);if(ge(B)&&se!=null){Pe.debug("File is already open, focus panel"),ee(B),_e(se);return}if(se==null){Pe.error("Panel ID for file metadata is null");return}var ot=x.getStackForComponentTypes(r.root,[Tn.COMPONENT]),gt=Se({id:se,settings:_,fileMetadata:B,session:w,sessionLanguage:P});Pe.debug("createNotebook",gt,d),x.openComponentInStack(ot,gt)},[ge,_e,$,M,r.root,Se,d,ee]),te=f.useCallback(function(w,P,_,B){var se=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;Pe.debug("selectNotebook",B,se);var ot=ge(B),gt=we(B),Qt=[...p.values()],wt=Qt[0],K=!se,ne=K&&wt?wt:M(B);if(ne==null||ne==="")throw new Error("Unable to retrieve or create panelId for metadata: ".concat(JSON.stringify(B)));if(ot||gt)ee(B);else{var me=x.getStackForComponentTypes(r.root,[Tn.COMPONENT]),Hn=Se({id:ne,settings:_,fileMetadata:B,session:w,sessionLanguage:P,isPreview:K});x.openComponentInStack(me,Hn)}if(gt&&se){var Jt=B.id,en=x.getStackForConfig(r.root,{component:Tn.COMPONENT,id:ne}),Rt=x.getContentItemInStack(en,{component:Tn.COMPONENT,id:ne});Jt!=null&&Rt&&Ve(Rt)&&(Rt.container.emit(J.PROMOTE_FROM_PREVIEW),O(Jt),S(Jt,ne))}se&&_e(ne)},[ee,ge,we,_e,M,r.root,Se,p,O,S]),Y=f.useCallback(function(w,P){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},B=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,se=i.getLastUsedPanelOfType(Tn);se&&xl(se)?_!=null&&_.value!=null&&se.notebook!=null&&se.notebook.append(_.value):B&&de(w,P,_)},[de,i]),ce=f.useCallback((w,P)=>bS.hydrate(Tl(Tl({},w),{},{notebooksUrl:a}),P),[a]);return dr(o,Ai,t),dr(o,QC),dr(o,bw),dr(o,ww),dr(o,Tn,ce),Ue(r.eventHub,nt.SEND_COMMAND,L),Ue(r.eventHub,nt.SETTINGS_CHANGED,G),Ue(r.eventHub,J.CLOSE_FILE,ie),Ue(r.eventHub,J.CREATE_NOTEBOOK,de),Ue(r.eventHub,J.SELECT_NOTEBOOK,te),Ue(r.eventHub,J.RENAME,j),Ue(r.eventHub,J.RENAME_FILE,H),Ue(r.eventHub,J.SEND_TO_NOTEBOOK,Y),Ue(r.eventHub,J.REGISTER_FILE,F),Ue(r.eventHub,J.UNREGISTER_FILE,X),null}function Si(n,e,t){return(e=Lw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lw(n){var e=Fw(n,"string");return typeof e=="symbol"?e:e+""}function Fw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ci{}Si(Ci,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");Si(Ci,"INPUT_FILTER","ControlType.INPUT_FILTER");Si(Ci,"MARKDOWN","ControlType.MARKDOWN");Si(Ci,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");export{Vv as $,E_ as A,ae as B,vu as C,tt as D,P_ as E,Du as F,uu as G,cu as H,jt as I,du as J,D as K,Ge as L,ju as M,Kv as N,Sr as O,je as P,V as Q,qp as R,_u as S,I as T,Gt as U,bu as V,Ci as W,gE as X,Pr as Y,Fu as Z,ci as _,Tt as a,k as a$,bn as a0,nE as a1,Od as a2,A_ as a3,Nu as a4,c_ as a5,Dr as a6,PE as a7,$v as a8,qe as a9,I_ as aA,j_ as aB,M_ as aC,k_ as aD,TE as aE,OE as aF,O_ as aG,D_ as aH,Lu as aI,x_ as aJ,ye as aK,Kw as aL,Uh as aM,Er as aN,em as aO,Vh as aP,su as aQ,au as aR,Kh as aS,zh as aT,Pt as aU,xt as aV,tm as aW,fu as aX,Cu as aY,xf as aZ,hi as a_,aE as aa,TS as ab,T_ as ac,bS as ad,oh as ae,nu as af,J as ag,Lt as ah,W_ as ai,V_ as aj,z_ as ak,q_ as al,ue as am,hE as an,sE as ao,uE as ap,Tn as aq,iS as ar,Xf as as,Ql as at,di as au,UE as av,Z as aw,yr as ax,_0 as ay,N_ as az,Ft as b,ei as b$,hu as b0,Im as b1,so as b2,Gw as b3,Df as b4,lo as b5,Xw as b6,gu as b7,lu as b8,Eu as b9,u_ as bA,l_ as bB,Ou as bC,Tu as bD,Pu as bE,Zw as bF,Yw as bG,Qw as bH,vo as bI,L_ as bJ,Pb as bK,yb as bL,Tb as bM,mn as bN,Ru as bO,Je as bP,ri as bQ,nb as bR,Qu as bS,$u as bT,mp as bU,Uu as bV,rp as bW,er as bX,Hu as bY,tr as bZ,Lg as b_,pu as ba,nm as bb,Xm as bc,Jr as bd,Vf as be,Qf as bf,Jf as bg,De as bh,ov as bi,_v as bj,Q as bk,uv as bl,Be as bm,Jw as bn,Iu as bo,xu as bp,n_ as bq,o_ as br,e_ as bs,t_ as bt,r_ as bu,bv,a_ as bw,s_ as bx,Ev as by,Pv as bz,C as c,LE as c$,Vu as c0,Ab as c1,xe as c2,Gi as c3,Fe as c4,Yu as c5,qi as c6,Jl as c7,x as c8,dr as c9,uS as cA,oS as cB,sS as cC,aS as cD,lS as cE,H_ as cF,R_ as cG,wS as cH,Y_ as cI,Q_ as cJ,dE as cK,lE as cL,U_ as cM,G_ as cN,K_ as cO,X_ as cP,iE as cQ,cE as cR,Ue as cS,B_ as cT,qS as cU,NE as cV,jE as cW,Sn as cX,Ld as cY,BE as cZ,y0 as c_,$_ as ca,tE as cb,DC as cc,pC as cd,vC as ce,ki as cf,xd as cg,rE as ch,Z_ as ci,wd as cj,fS as ck,To as cl,Po as cm,Id as cn,HS as co,Ed as cp,Kr as cq,dS as cr,Sd as cs,bC as ct,gC as cu,js as cv,J_ as cw,eE as cx,Td as cy,Cd as cz,rt as d,qC as d$,FE as d0,RE as d1,b0 as d2,C0 as d3,w0 as d4,HE as d5,o0 as d6,r0 as d7,$d as d8,e0 as d9,bw as dA,iu as dB,Bw as dC,xr as dD,ou as dE,Mt as dF,DE as dG,CE as dH,wE as dI,Nd as dJ,SE as dK,_E as dL,wr as dM,bE as dN,kE as dO,yE as dP,It as dQ,ME as dR,xE as dS,IE as dT,jd as dU,nt as dV,vE as dW,mE as dX,EE as dY,$C as dZ,RC as d_,JC as da,n0 as db,t0 as dc,Hd as dd,ro as de,i0 as df,Rd as dg,Fd as dh,no as di,kr as dj,Js as dk,AE as dl,$E as dm,el as dn,Vw as dp,Ko as dq,fi as dr,rS as ds,oE as dt,R as du,ko as dv,WE as dw,Ai as dx,ww as dy,QC as dz,zv as e,Ow as e0,pE as e1,fE as e2,Ww as e3,zw as e4,Uw as e5,Ei as e6,dh as e7,_i as e8,i_ as e9,vr as ea,Rv as f,h_ as g,w_ as h,C_ as i,S_ as j,y_ as k,b_ as l,g_ as m,d_ as n,v_ as o,f_ as p,m_ as q,Ie as r,pe as s,be as t,qf as u,Me as v,__ as w,p_ as x,qw as y,PS as z};
|
|
52
|
-
//# sourceMappingURL=ControlType-
|
|
52
|
+
//# sourceMappingURL=ControlType-DwvZrAze.js.map
|