@deephaven/embed-grid 0.17.1-beta.4 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as M,z as y,R as Y,P as Ja,B as u,C as ot,D as $,E as T,F as Bo,G as ue,H as Tt,I as q,J as Fe,K as jt,L as ec,M as tc,N as zi,O as Ys,Q as nc,S as Wo,T as Qs,U as rt,V as Oo,W as Ne,X as Mr,Y as ct,Z as sc,_ as Ao,$ as Xs,a0 as yl}from"./vendor.f4457b06.js";import{e as pn,W as ic,l as ws,K as yt,a as Nr,b as qt}from"./monaco.11e0929b.js";import{P as Ai,b as oc,h as rc,p as lc,o as ac,s as cc,t as dc,c as Co}from"./plotly.b0044521.js";import"./helpers.162e09a8.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const hc="#1a171a",uc="#f0f0ee",mc="#fcd65b",pc="#9edc6f",gc="#76d9e4",fc="#aa9af4",Cc="#f37e3f",bc="#f95d84",wc="#4878ea",Sc="#5b5a5c",vc="#9edc6f",Tc="#fcd65b",Ec="#f37e3f",yc="#f95d84",Rc="#fcfcfa",Ic="#929192",Dc="#373438",Mc="#f0f0ee",Nc="#1a171a",Fc="#2d2a2e",xc="#1a171a",Oc="#f0f0ee",Ac="0.15s",kc={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:hc,white:uc,yellow:mc,green:pc,blue:gc,purple:fc,orange:Cc,red:bc,primary:wc,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:Sc,success:vc,info:Tc,warning:Ec,danger:yc,light:Rc,mid:Ic,dark:Dc,"text-muted":"#929192",interfacewhite:Mc,interfaceblack:Nc,interfacegray:Fc,"content-bg":"#2d2a2e",background:xc,foreground:Oc,transition:Ac},Rt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...kc});class fn extends y.exports.Component{constructor(t){super(t),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=Y.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",...i},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),t=new Ja(s||o,this.element,i),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:i,closeOnBlur:o}=this.props,{show:r}=this.state;return u(ot,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:$("popper",{interactive:i},t),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:T("div",{className:"popper-content",children:[n,u("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return u("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Bo.createPortal(this.renderContent(),this.element)})}}fn.propTypes={children:M.exports.node.isRequired,options:M.exports.shape({}),className:M.exports.string,timeout:M.exports.number,onEntered:M.exports.func,onExited:M.exports.func,isShown:M.exports.bool,closeOnBlur:M.exports.bool,interactive:M.exports.bool,referenceObject:M.exports.shape({}),"data-testid":M.exports.string};fn.defaultProps={options:{},className:"",timeout:Rt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const Lc=-1,Rl=0,Il=1,zo=2,Dl=3,Ml=4;Object.freeze({SILENT:Lc,ERROR:Rl,WARN:Il,INFO:zo,DEBUG:Dl,DEBUG2:Ml});const Ot=()=>{};class Fr{constructor(t,n){this.name=t,this.prefix=t?`[${t}]`:"",this.error=Ot,this.warn=Ot,this.log=Ot,this.info=Ot,this.debug=Ot,this.debug2=Ot,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=Rl?console.error.bind(console,this.prefix):Ot,this.warn=t>=Il?console.warn.bind(console,this.prefix):Ot,this.log=t>=zo?console.log.bind(console,this.prefix):Ot,this.info=this.log,this.debug=t>=Dl?console.debug.bind(console,this.prefix):Ot,this.debug2=t>=Ml?console.debug.bind(console,this.prefix):Ot}}class Pc extends Fr{constructor(t=zo){super(null,t),this.modules={}}module(t){return this.modules[t]||(this.modules[t]=new Fr(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),!this.modules)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const ne=new Pc,Hc=ne.module("Tooltip"),ft=class extends y.exports.Component{constructor(e){super(e),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=Y.createRef(),this.popper=Y.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){ft.shownTooltipCount-=1,ft.shownTooltipCount===0&&(ft.lastHiddenTime=Date.now())}static handleShown(){ft.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:s}=this.state;s!==n&&(s?ft.handleShown():ft.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&ft.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Hc.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(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:s}=this.state;if(!this.popper.current||!this.parent)return;const i=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(ft.shownTooltipCount>0||Date.now()-ft.lastHiddenTime<ft.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:i,"data-testid":o,onEntered:r}=this.props,{isShown:l}=this.state;return u("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u(fn,{className:$(i),options:n,ref:this.popper,onEntered:r,onExited:this.handleExited,interactive:e,referenceObject:s,children:T("div",{className:"tooltip-content",children:[" ",l&&t]})})})}};let me=ft;me.defaultTimeout=500;me.defaultReshowTimeout=100;me.triggerReshowThreshold=300;me.shownTooltipCount=0;me.lastHiddenTime=Date.now();me.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:ft.defaultReshowTimeout,timeout:ft.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0};const _c=100;var Nl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Nl||{});const Yn=class extends y.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((n,s)=>n.filter(i=>i.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Tt(this.updateInputValue,_c),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Y.createRef(),this.cbContainer=Y.createRef(),this.menuContainer=Y.createRef(),this.input=Y.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(s=>s.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:s}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,s)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){var o;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,i=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),i&&n){this.closeMenu();return}(o=this.popper.current)==null||o.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(i=this.input.current)==null||i.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let s=n;e===Yn.MENU_NAVIGATION_DIRECTION.UP?n>0?(s=(s-1)%t.length,this.setState({keyboardOptionIndex:s})):n===0&&(s=t.length-1,this.setState({keyboardOptionIndex:s})):e===Yn.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(s=(s+1)%t.length,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuBlur(e){var t;e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:$("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?u("div",{className:"no-match",children:e}):n.map((s,i)=>this.renderOption(s,i))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return u("button",{type:"button",className:$("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},s)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultTitle:i,spellCheck:o,"data-testid":r}=this.props,{title:l,menuIsOpen:a,popperOptions:c,invalid:d}=this.state;return T("div",{className:"aci-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:$("form-control",s,"aci-input",{"is-invalid":d&&!a}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r}),u(fn,{ref:this.popper,options:c,className:$("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let $o=Yn;$o.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({}),onChange:M.exports.func,inputPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultTitle:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,noMatchText:M.exports.string,"data-testid":M.exports.string};$o.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};$o.MENU_NAVIGATION_DIRECTION=Nl;M.exports.string.isRequired,M.exports.func.isRequired,M.exports.string,M.exports.string,M.exports.bool,M.exports.bool,M.exports.string,M.exports.string,M.exports.string;M.exports.node.isRequired,M.exports.string,M.exports.object,M.exports.string;const Vc=["primary","secondary","tertiary","success","danger","inline","ghost"],Uc=["group-end"];function Bc(e,t){switch(e){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return $("btn-link",{"btn-link-icon":t,"px-2":t})}}function Wc(e){switch(e){case"group-end":return $("pl-2","pr-3")}}const De=Y.forwardRef((e,t)=>{const{kind:n,variant:s,type:i,tooltip:o,icon:r,disabled:l,active:a,onClick:c,className:d,style:h,children:m,"data-testid":p}=e,f=Bc(n,r&&!m);let b;s&&(b=Wc(s));let C;r&&(C=Y.isValidElement(r)?r:u(q,{icon:r}));let w;o&&(w=typeof o=="string"?u(me,{children:o}):o);const S=T("button",{"data-testid":p,ref:t,type:i,className:$("btn",f,b,{active:a},d),onClick:c,style:h,disabled:l,children:[r&&C,m,o&&!l&&w]});return l?T("span",{className:"btn-disabled-wrapper",children:[S,o&&w]}):S});De.displayName="Button";De.propTypes={kind:M.exports.oneOf(Vc).isRequired,variant:M.exports.oneOf(Uc),type:M.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return!t&&n&&!s?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return!n&&!t?new Error("Icon is required if no children are provided"):!t&&!Y.isValidElement(n)&&!(n!=null&&n.iconName)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:M.exports.bool,active:M.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},children:M.exports.node,className:M.exports.string,style:M.exports.object,"data-testid":M.exports.string};De.defaultProps={type:"button",onClick:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const zc=({className:e="theme-bg-light",children:t,role:n="role",keyboard:s=!0,isOpen:i=!1,centered:o=!1,size:r,onOpened:l,onClosed:a,toggle:c,"data-testid":d})=>{const h=y.exports.useRef(),m=y.exports.useCallback(g=>{switch(g.key){case"Escape":c==null||c();break}},[c]);y.exports.useEffect(function(){if(i&&s)return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[m,i,s]),y.exports.useEffect(function(){i&&l&&l()},[l,i]),y.exports.useEffect(function(){!i&&a&&a()},[a,i]),i&&!h.current&&(h.current=document.createElement("div"),h.current.setAttribute("style","padding-right: 15px; display: block"),h.current.setAttribute("role","presentation"),document.body.appendChild(h.current));const p=()=>{h.current&&(document.body.removeChild(h.current),h.current=void 0)};return h.current?Bo.createPortal(T(Fe,{children:[u(ot,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearActive:"show",appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:$("modal-backdrop fade"),style:{zIndex:1050}})}),u(ot,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:"modal fade",onClick:c,role:"dialog",style:{display:"block"},children:u("div",{className:$(`modal-dialog ${e}`,{"modal-lg":r==="lg","modal-sm":r==="sm","modal-xl":r==="xl","modal-dialog-centered":o}),style:{zIndex:1040},children:u("div",{className:"modal-content",onClick:g=>g.stopPropagation(),role:"presentation","data-testid":d,children:t})})})})]}),h.current):u(Fe,{})},$c=({className:e="modal-body",style:t,children:n,"data-testid":s})=>u("div",{className:e,"data-testid":s,style:t,children:n}),Gc=({className:e,children:t,closeButton:n=!0,style:s,toggle:i,"data-testid":o})=>T("div",{className:`modal-header ${e}`,style:s,children:[u("h5",{className:"modal-title",children:t}),n&&u("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",onClick:i,children:u("span",{"aria-hidden":"true",children:"\xD7"})})]});M.exports.bool.isRequired,M.exports.string.isRequired,M.exports.oneOfType([M.exports.string,M.exports.func]).isRequired,M.exports.func,M.exports.func.isRequired,M.exports.func,M.exports.func,M.exports.string,M.exports.string,M.exports.string,M.exports.node,M.exports.string;const $i=Y.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,onClick:o,style:r,id:l}=e;return u("button",{ref:t,type:"button",className:$("btn",s),onClick:o,style:r,disabled:i,id:l,children:n})});$i.displayName="Button";$i.propTypes={children:M.exports.node,className:M.exports.string,disabled:M.exports.bool,onClick:M.exports.func,style:M.exports.shape({}),id:M.exports.string};$i.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function bo(e){return e.then!==void 0}const Dn=class{static disableAllActions(){Dn.actionsDisabled=!0}static enableAllActions(){Dn.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){return e.group!==t.group?(e.group||0)>(t.group||0)?1:-1:e.order!==t.order?(e.order||0)>(t.order||0)?1:-1:e.title!==t.title?(e.title||"")>(t.title||"")?1:-1:e!==t?e>t?1:-1:0}static sortActions(e){if(!e||!Array.isArray(e))return[];const t=e.slice();return t.sort(Dn.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Dn.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Dn.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(Dn.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{Dn.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const o=s[i];let r;typeof o=="function"?r=o():r=o,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(i=>i.title||i.then||i.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let i=1;i<n.length+1;i+=1){const o=(s+t*i+n.length)%n.length,r=n[o];if(!(r instanceof Promise)&&r.disabled!==!0)return o}return e}};let Se=Dn;Se.actionsDisabled=!1;const xr=ne.module("GlobalContextAction");class qc extends y.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(t){const n=t;n.contextActions||(n.contextActions=[]);const{action:s}=this.props;!s.title&&!s.menuElement||(n.contextActions||(n.contextActions=[]),n.contextActions.push(s),xr.debug("Received context menu event at global action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s,i;const{action:n}=this.props;if(!Se.actionsDisabled&&((s=n.shortcut)==null?void 0:s.matchesEvent(t))){xr.debug("Global hotkey matched!",t);const o=(i=n.action)==null?void 0:i.call(n,t);(o||o===void 0)&&(t.preventDefault(),t.stopPropagation())}}render(){return null}}class Kc extends y.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let i=0;i<t.length;i+=1){const o=t[i],{shortcut:r}=o;if(o.title||o.menuElement||r){const l=u(qc,{action:o,"data-testid":n},`${o.title}.${r==null?void 0:r.id}`);s.push(l)}}return s}}const bi=ne.module("ContextActions");class se extends y.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=Y.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,i){if(!t||!n||!s||!i)return;const o=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});o.contextActions=i,t.dispatchEvent(o)}static getDerivedStateFromProps(t){if(!t.actions||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(i=>!bo(i)&&typeof i!="function"&&i.isGlobal),s=t.actions.filter(i=>!bo(i)&&typeof i!="function"&&!i.isGlobal&&i.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let i=t.target;for(;i!=null;){const{classList:o}=i,r=n.find(l=>o.contains(l));if(r!==void 0){bi.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}i=i.parentElement}}if(Se.isContextActionEvent(t)||(t.contextActions=[]),!Se.isContextActionEvent(t))return;const{actions:s}=this.props;if(s){let i=s;Array.isArray(i)&&(i=i.filter(o=>bo(o)||typeof o=="function"||!o.isGlobal)),t.contextActions=t.contextActions.concat(i)}bi.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s,i;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o];if(!Se.actionsDisabled&&((s=r.shortcut)==null?void 0:s.matchesEvent(t))){bi.debug("Context hotkey matched!",t);const l=(i=r.action)==null?void 0:i.call(r,t);if(l||l===void 0){t.stopPropagation(),t.preventDefault();return}bi.debug2("Matched hotkey returned false, key event not consumed")}}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return u("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:u(Kc,{actions:n})})}}se.groups={default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100};var Xc={prefix:"vs",iconName:"arrow-left",icon:[512,512,[],"f000","m224 98.976 -160 160V281.6l160 160 22.624 -22.624 -132.672 -132.704H448v-32H113.92L246.656 121.6 224 98.976z"]},os={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},Yc={prefix:"vs",iconName:"chevron-down",icon:[512,512,[],"f000","m255.232 322.304 139.424 -139.424 19.84 19.776L265.088 352h-19.776L96 202.656l19.808 -19.776 139.424 139.424z"]},Qc={prefix:"vs",iconName:"chevron-left",icon:[512,512,[],"f000","m189.696 255.232 139.424 139.424 -19.776 19.84L160 265.088v-19.776L309.344 96l19.776 19.808 -139.424 139.424z"]},Fl={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},jc={prefix:"vs",iconName:"chevron-up",icon:[512,512,[],"f000","m256.768 189.696 -139.424 139.424 -19.84 -19.776L246.912 160h19.776L416 309.344l-19.808 19.776 -139.424 -139.424z"]},Go={prefix:"vs",iconName:"circle-large-filled",icon:[512,512,[],"f000","M256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568 229.024 229.024 0 0 1 -80.512 80.288 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32z"]},Zc={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},Or={prefix:"vs",iconName:"clippy",icon:[512,512,[],"f000","M224 447.744H128v-288h256v64h32v-80l-16 -16H352v-32h-32a64 64 0 0 0 -128 0H158.08v32H112l-16 16v320l16 16H224v-32zm0 -358.4a32 32 0 0 1 25.6 -25.6 32 32 0 0 1 18.56 1.92 30.08 30.08 0 0 1 14.4 11.52 32 32 0 1 1 -56 30.08 32 32 0 0 1 -2.56 -17.92zm226.56 302.72L416 426.944v-171.2h-32v170.88l-34.56 -34.56 -22.72 22.72 62.08 61.76h22.72l61.76 -61.76 -22.72 -22.72zm-189.44 -133.12h22.72l61.76 61.76 -22.72 22.72 -34.56 -34.56v170.88h-32v-171.2l-34.56 34.88 -22.72 -22.72 62.08 -61.76z"]},Gi={prefix:"vs",iconName:"close",icon:[512,512,[],"f000","m256 278.624 116.672 116.704 22.656 -22.624L278.624 256l116.704 -116.672 -22.624 -22.656L256 233.376 139.328 116.672l-22.624 22.656L233.376 256l-116.672 116.672 22.624 22.656L256 278.624z"]},Jc={prefix:"vs",iconName:"cloud-download",icon:[512,512,[],"f000","M382.624 192h1.6a95.68 95.68 0 0 1 67.712 28.128 96.096 96.096 0 0 1 0 135.744 95.68 95.68 0 0 1 -67.744 28.128v-32a64.064 64.064 0 0 0 0 -128h-29.248l-3.936 -27.424a79.68 79.68 0 0 0 -68.032 -67.904A79.296 79.296 0 0 0 199.392 176l-10.656 24.384 -25.888 -6.048A79.68 79.68 0 0 0 144.736 192c-21.184 0 -41.504 8.416 -56.448 23.424A80.096 80.096 0 0 0 144.736 352h15.936v32h-15.936a111.552 111.552 0 0 1 -84.096 -37.12 112.064 112.064 0 0 1 62.656 -184.96 110.784 110.784 0 0 1 46.976 1.28 111.552 111.552 0 0 1 117.024 -65.92A111.328 111.328 0 0 1 382.624 192zm-168 163.872 42.048 42.048V224h31.808v172.8l40.896 -40.928 22.624 22.624 -68.672 68.704h-22.656L192 378.528l22.624 -22.656z"]},xl={prefix:"vs",iconName:"copy",icon:[512,512,[],"f000","m128 128 32 -32h173.248L448 210.752V448l-32 32H160l-32 -32V128zm288 96 -96 -96H160v320h256V224zM96 32 64 64v320l32 32V64h205.248l-32 -32H96z"]},Ol={prefix:"vs",iconName:"edit",icon:[512,512,[],"f000","M423.36 32h-46.72L112.64 296l-5.12 7.04L32 434.88 77.12 480l131.84 -75.52 7.04 -5.12L480 135.36V88.64L423.36 32zM77.12 434.88l48.32 -96 46.4 46.4 -94.72 49.6zm122.56 -65.92L143.04 312.32l256 -256 56.64 56.64 -256 256z"]},Ar={prefix:"vs",iconName:"file-code",icon:[512,512,[],"f000","m338.24 36.48 104.96 105.6 4.8 11.52v310.4l-16 16h-352l-16 -16v-416l16 -16h247.04l11.2 4.48zM320 160h96l-96 -96v96zM96 64v384h320V192H304L288 176V64H96zm65.984 241.056 58.144 -58.496L197.44 224 128 293.728v22.624l69.472 69.568 22.624 -22.624 -58.112 -58.24zM281.6 246.848l22.4 -22.688 70.048 69.6v22.688L304 385.984l-22.56 -22.688 58.592 -58.24L281.6 246.848z"]},ed={prefix:"vs",iconName:"file-zip",icon:[512,512,[],"f000","M80 32h352l16 16v160l-4.8 11.2 -27.2 27.52v217.28l-16 16h-320l-16 -16v-416l16 -16zM192 64H160v64h32V64zm0 384h128V245.76l-27.2 -27.2L288 207.04V64H224v80l-16 16H192v32H160V160h-16L128 144V64H96v384h64v-32h32v32zm0 -64v32h32v-32H192zm0 -32v32H160v-32h32zm0 -32h32v32H192v-32zm0 -32v32H160V288h32zm0 -32h32v32H192V256zm0 -32v32H160V224h32zm0 0h32V192H192v32zm196.8 4.8 27.2 -27.52V64h-96v136.64l27.2 27.2 4.8 11.2V448h32V240l4.8 -11.2z"]},td={prefix:"vs",iconName:"files",icon:[512,512,[],"f000","M373.333 0h-192L149.333 32V128H53.333L21.333 160v321.493L53.333 512h257.493L341.333 481.493V384h100.267l27.733 -30.507V96L373.333 0zm0 45.227 50.773 50.773H373.333V45.227zm-64 434.773h-256v-320H149.333v193.493L181.333 384h128v96zm128 -128h-256v-320H341.333V128h96v224z"]},ki={prefix:"vs",iconName:"filter",icon:[512,512,[],"f000","M480 64v53.44l-160 152.288V448H192V269.728l-160 -152.32V64h448zM224 256v160h64V256l160 -152.32V96H64v7.68L224 256z"]},nd={prefix:"vs",iconName:"gear",icon:[512,512,[],"f000","M291.2 140.8 275.2 64H236.8l-16 76.8 -22.4 9.6 -64 -41.6 -28.8 25.6 41.6 64 -6.4 22.4 -76.8 16v38.4l76.8 16 9.6 25.6 -41.6 64 25.6 25.6 64 -41.6 25.6 9.6 12.8 73.6h38.4l16 -76.8 25.6 -9.6 64 41.6 25.6 -25.6 -41.6 -64 9.6 -25.6 73.6 -12.8V236.8l-76.8 -16 -9.6 -25.6 41.6 -64 -25.6 -25.6 -64 41.6 -22.4 -6.4zM300.8 32l16 76.8L384 67.2l64 64 -44.8 67.2 76.8 12.8v89.6l-76.8 16L448 384l-64 64 -67.2 -44.8 -16 76.8H211.2l-16 -76.8L128 444.8l-64 -64 44.8 -67.2L32 300.8V211.2l76.8 -16L67.2 128l64 -64 67.2 44.8 12.8 -76.8h89.6zm19.2 224c0 35.2 -28.8 64 -64 64s-64 -28.8 -64 -64 28.8 -64 64 -64 64 28.8 64 64zM256 288c19.2 0 32 -12.8 32 -32s-12.8 -32 -32 -32 -32 12.8 -32 32 12.8 32 32 32z"]},Al={prefix:"vs",iconName:"graph",icon:[512,512,[],"f000","M48 448H480v-32H64V0H32v432l16 16zM96 368v-256l16 -16h64l16 16v256l-16 16h-64l-16 -16zm64 -16V128H128v224h32zm192 -304v320l16 16h64l16 -16v-320l-16 -16h-64l-16 16zm64 16v288h-32V64h32zm-192 304v-192l16 -16h64l16 16v192l-16 16h-64l-16 -16zm64 -16V192H256v160h32z"]},qi={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},sd={prefix:"vs",iconName:"json",icon:[512,512,[],"f000","M192 95.488V64h-2.88c-10.016 0 -19.712 1.984 -29.088 5.92a74.56 74.56 0 0 0 -24.8 16.96 71.36 71.36 0 0 0 -15.776 24.096v0.032a113.344 113.344 0 0 0 -6.336 26.56v0.064a194.56 194.56 0 0 0 -0.768 27.616c0.384 9.28 0.576 18.56 0.576 27.808 0 6.496 -1.28 12.576 -3.744 18.304v0.032a48.128 48.128 0 0 1 -24.48 25.184 44.032 44.032 0 0 1 -17.856 3.68H64v31.488h2.88c6.24 0 12.16 1.28 17.792 3.872l0.032 0.032c5.696 2.496 10.528 5.888 14.56 10.176l0.064 0.064c4.16 4.16 7.456 9.12 9.824 14.88l0.032 0.064c2.496 5.76 3.744 11.776 3.744 18.112 0 9.28 -0.192 18.56 -0.576 27.808 -0.384 9.472 -0.128 18.72 0.768 27.84v0.032c1.056 9.056 3.168 17.856 6.304 26.368v0.032c3.392 8.736 8.672 16.768 15.808 24.096 7.136 7.36 15.424 13.024 24.8 16.96 9.376 3.936 19.072 5.92 29.12 5.92H192v-31.488h-2.88c-6.4 0 -12.384 -1.216 -18.016 -3.68a51.616 51.616 0 0 1 -14.624 -10.24 53.088 53.088 0 0 1 -9.888 -14.944c-2.368 -5.76 -3.52 -11.84 -3.52 -18.336 0 -7.296 0.096 -14.496 0.352 -21.504 0.256 -7.296 0.256 -14.4 0 -21.28a148.448 148.448 0 0 0 -1.76 -20.48 85.824 85.824 0 0 0 -5.376 -19.488A73.088 73.088 0 0 0 112.704 256a73.088 73.088 0 0 0 23.616 -30.56c2.56 -6.144 4.32 -12.576 5.376 -19.264 1.056 -6.72 1.632 -13.536 1.76 -20.48 0.256 -7.04 0.256 -14.144 0 -21.312 -0.256 -7.168 -0.384 -14.4 -0.384 -21.696a47.04 47.04 0 0 1 28.064 -43.328 42.56 42.56 0 0 1 18.016 -3.872H192zm128 321.024V448h2.88c10.016 0 19.712 -1.984 29.088 -5.92 9.376 -3.936 17.664 -9.6 24.8 -16.96 7.136 -7.36 12.416 -15.36 15.776 -24.096v-0.032c3.2 -8.512 5.28 -17.376 6.336 -26.56v-0.064c0.896 -8.96 1.152 -18.144 0.768 -27.616 -0.384 -9.28 -0.576 -18.56 -0.576 -27.808 0 -6.496 1.28 -12.576 3.744 -18.304v-0.032a48.064 48.064 0 0 1 24.48 -25.184 44.16 44.16 0 0 1 17.856 -3.68H448v-31.488h-2.88c-6.272 0 -12.192 -1.28 -17.824 -3.872l-0.032 -0.032a44.032 44.032 0 0 1 -14.56 -10.176l-0.064 -0.064a45.28 45.28 0 0 1 -9.824 -14.88v-0.064a44.96 44.96 0 0 1 -3.776 -18.112c0 -9.28 0.192 -18.56 0.576 -27.808a197.568 197.568 0 0 0 -0.768 -27.84v-0.032a113.184 113.184 0 0 0 -6.304 -26.368v-0.032a71.36 71.36 0 0 0 -15.808 -24.096 74.592 74.592 0 0 0 -24.8 -16.96 74.4 74.4 0 0 0 -29.12 -5.92H320v31.488h2.88c6.4 0 12.384 1.216 17.984 3.68 5.568 2.624 10.432 6.016 14.624 10.24 4.064 4.288 7.36 9.28 9.888 14.944 2.368 5.76 3.52 11.84 3.52 18.336 0 7.296 -0.096 14.464 -0.352 21.504 -0.256 7.296 -0.256 14.4 0 21.28 0.128 7.104 0.704 13.92 1.76 20.48 1.056 6.848 2.848 13.312 5.376 19.488a73.12 73.12 0 0 0 23.616 30.56 73.12 73.12 0 0 0 -23.616 30.56 86.048 86.048 0 0 0 -5.376 19.264c-1.056 6.72 -1.632 13.536 -1.76 20.48a292.8 292.8 0 0 0 0 21.312c0.256 7.168 0.384 14.4 0.384 21.696a47.072 47.072 0 0 1 -28.064 43.328 42.56 42.56 0 0 1 -18.016 3.872H320z"]},id={prefix:"vs",iconName:"kebab-vertical",icon:[512,512,[],"f000","M238.208 442.624a32 32 0 1 0 35.552 -53.216 32 32 0 0 0 -35.52 53.184zM256 288a32 32 0 1 1 0 -64 32 32 0 0 1 0 64zm0 -160a32 32 0 1 1 0 -64 32 32 0 0 1 0 64z"]},od={prefix:"vs",iconName:"link-external",icon:[512,512,[],"f000","M48 32H192v32H64v384h384v-128h32v144l-16 16h-416l-16 -16v-416l16 -16zm432 16V256h-32V86.624L231.776 302.88l-22.624 -22.656L425.376 64H256V32h208l16 16z"]},kl={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},rd={prefix:"vs",iconName:"list-ordered",icon:[512,512,[],"f000","M73.184 74.432 86.144 64h21.664v96h-22.656V89.344l-11.968 8.992v-23.904zM160 96h320v32H160V96zm0 128h320v32H160V224zm320 128H160v32h320v-32zM119.744 244.032l0.928 -1.248 2.08 -2.88a26.88 26.88 0 0 0 4.992 -16.224c0 -3.84 -0.64 -7.68 -1.824 -11.328a27.136 27.136 0 0 0 -15.744 -16.928 35.936 35.936 0 0 0 -14.464 -2.624 35.008 35.008 0 0 0 -14.656 2.784 27.744 27.744 0 0 0 -15.328 16.704A33.216 33.216 0 0 0 64 222.624v1.6h25.92v-1.6a9.6 9.6 0 0 1 1.472 -5.024 5.568 5.568 0 0 1 1.824 -1.728 6.08 6.08 0 0 1 5.504 0 6.016 6.016 0 0 1 1.792 1.92 7.68 7.68 0 0 1 0.992 2.592 14.24 14.24 0 0 1 -1.152 9.28 41.888 41.888 0 0 1 -3.84 5.824l-32 36.416 -0.384 0.416v17.28h63.616v-22.4h-28.8l20.8 -23.168zm-1.184 122.144c1.472 1.024 2.752 2.24 3.84 3.648a26.912 26.912 0 0 1 5.344 17.6c0 3.424 -0.544 6.816 -1.6 10.048a25.344 25.344 0 0 1 -15.584 16 41.216 41.216 0 0 1 -15.36 2.528c-3.68 0 -7.36 -0.512 -10.912 -1.568a30.08 30.08 0 0 1 -8.256 -3.936 24.032 24.032 0 0 1 -5.824 -5.664 34.016 34.016 0 0 1 -3.712 -6.4A33.216 33.216 0 0 1 64 386.496v-1.568h26.048v1.568c0 0.864 0.096 1.76 0.288 2.624a6.624 6.624 0 0 0 0.96 2.368 4.48 4.48 0 0 0 1.696 1.664 6.4 6.4 0 0 0 5.024 0.256 5.088 5.088 0 0 0 1.792 -1.248 7.04 7.04 0 0 0 1.344 -2.4 13.344 13.344 0 0 0 0.544 -4.032 15.456 15.456 0 0 0 -0.704 -5.216 6.4 6.4 0 0 0 -1.632 -2.56 4.416 4.416 0 0 0 -1.92 -0.928 17.184 17.184 0 0 0 -2.464 -0.224h-5.152v-20.64h5.376a7.712 7.712 0 0 0 2.208 -0.352 5.248 5.248 0 0 0 2.08 -1.088 5.6 5.6 0 0 0 1.536 -2.144 9.152 9.152 0 0 0 0.672 -3.872 8.96 8.96 0 0 0 -0.512 -3.2 5.312 5.312 0 0 0 -3.104 -3.168 6.4 6.4 0 0 0 -4.992 0.224 5.248 5.248 0 0 0 -1.76 1.696 11.008 11.008 0 0 0 -1.28 4.992v1.568H64v-1.568a31.584 31.584 0 0 1 5.76 -17.408 25.6 25.6 0 0 1 5.728 -5.952 27.84 27.84 0 0 1 8.384 -4.256c3.648 -1.152 7.488 -1.696 11.328 -1.632 3.712 -0.032 7.392 0.32 11.008 1.152 2.944 0.672 5.76 1.76 8.416 3.2a24.224 24.224 0 0 1 10.24 10.176 23.36 23.36 0 0 1 2.88 11.104 25.92 25.92 0 0 1 -5.344 16.896 17.984 17.984 0 0 1 -3.84 3.648z"]},Ll={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},ld={prefix:"vs",iconName:"lock",icon:[512,512,[],"f000","M416 224h-32V160a128 128 0 1 0 -256 0v64H96L64 256v192l32 32h320l32 -32V256l-32 -32zM160 160a96 96 0 1 1 192 0v64H160V160zm256 288H96V256h320v192z"]},ad={prefix:"vs",iconName:"menu",icon:[512,512,[],"f000","M512 160H0V128h512v32zm0 256H0v-32h512v32zm0 -128.256H0V256h512v31.744z"]},cd={prefix:"vs",iconName:"new-file",icon:[512,512,[],"f000","m304 35.2 108.8 112 3.2 12.8v64h-32V192H256V64H96v352h128v32H80l-16 -16v-384l16 -16h214.4l9.6 3.2zM288 64v96h92.8L288 64zm128 448h-32v-96H288v-32h96V288h32v96h96v32h-96v96z"]},Pl={prefix:"vs",iconName:"pass-filled",icon:[512,512,[],"f000","M256 480A224 224 0 1 0 256 32a224 224 0 0 0 0 448zm-32.64 -132.16h-22.72L128 275.2l22.72 -22.72 61.44 61.44 134.4 -134.72 22.72 22.72 -145.92 145.92z"]},Hl={prefix:"vs",iconName:"pass",icon:[512,512,[],"f000","M200.64 347.84h22.72l145.92 -145.92 -22.72 -22.72 -134.4 134.72 -61.44 -61.44L128 275.2l72.64 72.64zM275.2 32c51.2 3.2 99.2 28.8 134.4 64 41.6 44.8 64 99.2 64 163.2 0 51.2 -19.2 99.2 -51.2 140.8 -32 38.4 -76.8 67.2 -128 76.8 -51.2 9.6 -102.4 3.2 -147.2 -22.4 -44.8 -25.6 -80 -64 -99.2 -112C28.8 294.4 25.6 240 41.6 192c16 -51.2 44.8 -92.8 89.6 -121.6C172.8 41.6 224 28.8 275.2 32zm16 412.8c41.6 -9.6 80 -32 108.8 -67.2 25.6 -35.2 41.6 -76.8 38.4 -121.6 0 -51.2 -19.2 -102.4 -54.4 -137.6 -32 -32 -70.4 -51.2 -115.2 -54.4 -41.6 -3.2 -86.4 6.4 -121.6 32 -35.2 25.6 -60.8 60.8 -73.6 105.6 -12.8 41.6 -12.8 86.4 6.4 128 19.2 41.6 48 73.6 86.4 96 38.4 22.4 83.2 28.8 124.8 19.2z"]},dd={prefix:"vs",iconName:"play",icon:[512,512,[],"f000","M120.96 64 96 77.12v384l24.96 13.44 288 -192V256l-288 -192zM128 431.36V107.2l243.2 162.24L128 431.36z"]},hd={prefix:"vs",iconName:"preview",icon:[512,512,[],"f000","M64 64h384l32 32v320l-32 32H64l-32 -32V96l32 -32zm0 352h384V96H64v320zm352 -288H96v96h320V128zm-32 64H128V160h256v32zm-96 192h128V256H288v128zm32 -96h64v64h-64V288zM224 256H96v32h128V256zm-128 96h128v32H96v-32z"]},sn={prefix:"vs",iconName:"remove",icon:[512,512,[],"f000","M480 256H32V224h448v32z"]},ud={prefix:"vs",iconName:"reply",icon:[512,512,[],"f000","m201.792 68.672 -128.64 128.64v22.656l128.64 128.64 22.656 -22.624L121.824 223.36H182.08c90.016 0 147.36 19.36 182.56 55.328 35.264 36 51.68 92.064 51.68 173.472v11.2h32v-11.2c0 -84.672 -16.864 -151.04 -60.8 -195.872C343.52 211.36 275.744 191.36 182.08 191.36H124.384l100.064 -100.032 -22.656 -22.656z"]},md={prefix:"vs",iconName:"ruby",icon:[512,512,[],"f000","m32 230.08 212.48 212.48h23.04L480 230.08v-23.04l-106.24 -106.24 -11.52 -4.8H149.76l-11.52 4.8L32 207.04v23.04zm224 177.92L66.56 218.56 156.48 128h199.04l89.92 90.56L256 408zm0 -247.36h86.08l57.92 57.92 -144 140.8V160.64z"]},_l={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},pd={prefix:"vs",iconName:"split-horizontal",icon:[512,512,[],"f000","M448 32H96L64 64v352l32 32h352l32 -32V64l-32 -32zM256 416H96V64h160v352zm192 0H288V64h160v352z"]},gd={prefix:"vs",iconName:"symbol-operator",icon:[512,512,[],"f000","M91.936 35.2c10.72 4.352 19.264 12.736 23.84 23.36 2.304 5.44 3.488 11.264 3.424 17.184a42.88 42.88 0 0 1 -19.52 36.32 43.488 43.488 0 0 1 -24.096 7.136A43.36 43.36 0 0 1 32 75.584a43.36 43.36 0 0 1 26.56 -40.192A43.84 43.84 0 0 1 91.936 35.2zm-9.536 56.48a17.632 17.632 0 0 0 10.624 -16 17.536 17.536 0 1 0 -10.624 16zM205.76 35.488 35.52 205.76l21.952 21.984 170.24 -170.24 -21.952 -21.984zM368 288h32v80H480v32h-80V480h-32v-80H288v-32h80V288zm-183.424 16.8 22.624 22.624L150.624 384l56.576 56.576 -22.624 22.624L128 406.624l-56.576 56.576 -22.624 -22.624L105.376 384l-56.576 -56.576 22.624 -22.624L128 361.376l56.576 -56.576zm43.2 -134.24a43.296 43.296 0 0 0 -40.192 -26.56 43.36 43.36 0 0 0 -40.192 26.56 43.584 43.584 0 0 0 40.224 60.64A43.456 43.456 0 0 0 227.776 170.56zm-24.096 23.84a17.696 17.696 0 0 1 -9.248 9.28 17.504 17.504 0 0 1 -19.168 -3.744 16.928 16.928 0 0 1 -3.744 -5.536 17.408 17.408 0 0 1 22.912 -22.88 18.08 18.08 0 0 1 5.536 3.712 17.568 17.568 0 0 1 3.712 19.168zM448 96h-128v32h128V96z"]},kr={prefix:"vs",iconName:"terminal",icon:[512,512,[],"f000","M64 32 32 64v384L64 480h384l32 -32V64L448 32H64zM64 448V64h384v384H64zm120.661 -85.547 22.144 22.635 112.213 -111.851v-19.456l-112.213 -112.213 -22.08 22.613 97.92 100.309 -97.984 97.963z"]},fd={prefix:"vs",iconName:"tools",icon:[512,512,[],"f000","m472.736 111.52 -24.96 -5.888 -67.456 67.072 -38.208 -38.912 65.792 -69.024 -5.76 -25.344a141.44 141.44 0 0 0 -43.104 -7.296 116.48 116.48 0 0 0 -46.624 8.96 122.368 122.368 0 0 0 -37.952 26.88 119.552 119.552 0 0 0 -28 40.48 126.016 126.016 0 0 0 0 94.912 10730.912 10730.912 0 0 0 -197.536 199.488c-6.72 8.8 -9.92 19.776 -9.088 30.816a44.896 44.896 0 0 0 14.848 30.944c3.968 4.32 8.704 7.904 13.984 10.496 5.44 2.4 11.296 3.776 17.216 4.064 10.112 -0.192 19.808 -4.032 27.328 -10.784 49.536 -46.624 144.448 -142.4 198.368 -198.528 14.624 6.208 30.336 9.408 46.208 9.376a119.552 119.552 0 0 0 85.664 -36.256 124.32 124.32 0 0 0 35.552 -87.36 134.752 134.752 0 0 0 -6.272 -44.096zM93.856 445.696a9.92 9.92 0 0 1 -4.32 2.24 13.984 13.984 0 0 1 -4.768 0 11.072 11.072 0 0 1 -4.608 -1.824 10.752 10.752 0 0 1 -3.648 -3.52c-4.48 -4.576 -8.672 -13.28 -4.48 -18.176 43.84 -46.624 134.112 -137.76 190.56 -193.472 3.2 4.224 6.72 8.256 10.496 12.032 3.776 3.936 7.84 7.584 12.16 10.912 -54.592 56 -143.616 146.048 -191.36 191.808zm355.776 -290.08c0.064 24.48 -9.472 48 -26.624 65.536a91.552 91.552 0 0 1 -128.224 0 95.744 95.744 0 0 1 -20.32 -100.384A87.936 87.936 0 0 1 324.48 69.76a88.32 88.32 0 0 1 34.304 -6.848h8.128L308.768 122.848v22.272l60.64 60.352h21.12l59.104 -58.112v8.256zM103.68 214.016h48.992l22.56 22.944 21.696 -21.568 -21.28 -21.696V192.32l1.824 -52.768 -7.04 -13.984 -91.52 -60.224 -18.912 2.112 -26.592 27.168 -2.112 19.168 58.816 93.376 13.568 6.88zm-30.24 -116.224L147.488 146.56 146.24 182.496H111.808L64.064 106.912l9.376 -9.12zm227.36 222.72 21.568 -21.536 99.392 101.92a47.328 47.328 0 0 1 0 65.248 44.928 44.928 0 0 1 -49.568 10.08 41.92 41.92 0 0 1 -13.984 -10.08l-100.544 -102.496 21.728 -21.696 100.224 102.208a12.864 12.864 0 0 0 4.896 3.36 15.264 15.264 0 0 0 11.488 0 12.896 12.896 0 0 0 4.896 -3.36 13.952 13.952 0 0 0 3.2 -4.896 16.8 16.8 0 0 0 1.152 -5.888 17.504 17.504 0 0 0 -1.12 -5.888 13.952 13.952 0 0 0 -3.2 -4.896L300.8 320.512z"]},Ln={prefix:"vs",iconName:"trash",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64a32 32 0 0 1 32 -32h96a32 32 0 0 1 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm64 -256H160v224h32V160zm32 0h32v224H224V160zm64 0h32v224H288V160z"]},Nn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},Vl={prefix:"vs",iconName:"triangle-right",icon:[512,512,[],"f000","M177.92 448 160 434.784V76.576L177.28 64 352 244.064v26.464L177.92 448z"]},as={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},Cd={prefix:"dh",iconName:"arrow-to-bottom",icon:[512,512,[],"f000","m99.2 224 160 160h22.4l160 -160 -22.4 -22.4L288 332.8V64H256v268.8L124.8 201.6l-25.6 22.4zM96 416h352v32H96z"]},bd={prefix:"dh",iconName:"arrow-to-top",icon:[512,512,[],"f000","m444.8 288 -160 -160h-22.4l-160 160 22.4 22.4L256 179.2V448h32V179.2l131.2 131.2 25.6 -22.4zm3.2 -192H96V64h352v32z"]},wd={prefix:"dh",iconName:"check-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-188.8 284.8h-22.4L144 278.4l22.4 -22.4 60.8 60.8 134.4 -134.4 22.4 22.4 -147.2 144z"]},Sd={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},Lr={prefix:"dh",iconName:"eye-slash",icon:[512,512,[],"f000","M480 256c0 -32 -99.2 -160 -224 -160 -32 0 -64 9.6 -92.8 22.4L70.4 25.6 25.6 70.4 435.2 480l44.8 -44.8 -76.8 -76.8C451.2 320 480 272 480 256zM256 131.2c96 0 176 92.8 188.8 124.8 -6.4 16 -32 48 -67.2 76.8L316.8 272c3.2 -6.4 3.2 -9.6 3.2 -16 0 -35.2 -28.8 -64 -64 -64 -6.4 0 -9.6 0 -16 3.2L192 147.2c19.2 -9.6 41.6 -16 64 -16zm0 249.6C160 380.8 80 288 67.2 256c6.4 -9.6 19.2 -32 41.6 -54.4l-25.6 -25.6C51.2 208 32 243.2 32 256c0 32 99.2 160 224 160 19.2 0 38.4 -3.2 57.6 -9.6l-28.8 -28.8c-9.6 3.2 -19.2 3.2 -28.8 3.2z"]},ko={prefix:"dh",iconName:"eye",icon:[512,512,[],"f000","M256 96C131.2 96 32 224 32 256s99.2 160 224 160 224 -128 224 -160 -99.2 -160 -224 -160zm0 284.8C160 380.8 80 288 67.2 256 80 227.2 160 131.2 256 131.2S432 224 444.8 256c-12.8 28.8 -92.8 124.8 -188.8 124.8zM256 192c-35.2 0 -64 28.8 -64 64s28.8 64 64 64 64 -28.8 64 -64 -28.8 -64 -64 -64zm0 92.8c-16 0 -28.8 -12.8 -28.8 -28.8s12.8 -28.8 28.8 -28.8 28.8 12.8 28.8 28.8 -12.8 28.8 -28.8 28.8z"]},vd={prefix:"dh",iconName:"file-csv",icon:[512,512,[],"f000","m444.8 140.8 -105.6 -105.6 -12.8 -3.2H80l-16 16V224h32V64h192v112l16 16H416v32h32V153.6l-3.2 -12.8zM320 160V64l96 96h-96zM80 256l-16 16v192l16 16h352l16 -16v-192l-16 -16h-352zM416 416v32H96V288h320v128zm-217.6 -3.2c-6.4 3.2 -16 3.2 -25.6 3.2 -16 0 -25.6 -3.2 -35.2 -12.8 -9.6 -6.4 -12.8 -19.2 -12.8 -32 0 -16 3.2 -28.8 12.8 -38.4 9.6 -9.6 22.4 -12.8 38.4 -12.8 9.6 0 16 0 22.4 3.2v19.2c-6.4 -3.2 -12.8 -6.4 -22.4 -6.4 -9.6 0 -16 3.2 -22.4 9.6 -6.4 6.4 -9.6 12.8 -9.6 22.4 0 9.6 3.2 16 6.4 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16 -3.2 22.4 -6.4v19.2zm19.2 0v-22.4c3.2 3.2 9.6 6.4 12.8 6.4 3.2 3.2 9.6 3.2 12.8 3.2h6.4c3.2 0 3.2 0 6.4 -3.2l3.2 -3.2v-3.2c0 -3.2 0 -3.2 -3.2 -6.4 3.2 0 0 0 0 -3.2 -3.2 0 -3.2 -3.2 -6.4 -3.2s-6.4 -3.2 -9.6 -3.2c-6.4 -3.2 -12.8 -6.4 -16 -12.8 -3.2 -3.2 -6.4 -9.6 -6.4 -16s0 -9.6 3.2 -12.8c3.2 -3.2 3.2 -6.4 9.6 -9.6 3.2 0 6.4 -3.2 12.8 -3.2h25.6c3.2 0 6.4 0 9.6 3.2v19.2s-3.2 -3.2 -6.4 -3.2 -3.2 0 -6.4 -3.2h-19.2c-3.2 0 -3.2 0 -6.4 3.2l-3.2 3.2v6.4l3.2 3.2s3.2 3.2 6.4 3.2 3.2 3.2 6.4 3.2c3.2 3.2 6.4 3.2 9.6 6.4 3.2 3.2 6.4 3.2 6.4 6.4 3.2 3.2 3.2 6.4 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4 0 9.6 -3.2 12.8 -3.2 3.2 -3.2 6.4 -9.6 9.6 3.2 3.2 0 6.4 -3.2 6.4h-32c-3.2 0 -6.4 -3.2 -12.8 -3.2zm169.6 -92.8 -32 96h-25.6l-32 -96h22.4l19.2 67.2c0 3.2 3.2 6.4 3.2 9.6 0 -3.2 0 -6.4 3.2 -9.6l19.2 -67.2h22.4z"]},Td={prefix:"dh",iconName:"file-download",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm-134.4 182.4 76.8 76.8h22.4l76.8 -76.8 -25.6 -22.4L288 368V227.2H256v140.8L208 320l-22.4 22.4z"]},Ed={prefix:"dh",iconName:"file-spreadsheet",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm64 99.2 -19.2 -19.2H179.2l-19.2 19.2v137.6l19.2 19.2h185.6l19.2 -19.2V259.2zm-150.4 134.4H182.4v-48h51.2v48zm0 -115.2v48H182.4V278.4m115.2 115.2H246.4v-48h48v48zm0 -64H246.4V278.4h48v51.2zm64 64H310.4v-48h48v48zm-51.2 -64V278.4h48v48H310.4z"]},qo={prefix:"dh",iconName:"filter-filled",icon:[512,512,[],"f000","M480 64v54.4l-160 153.6V448H192V268.8L32 118.4V64h448z"]},yd={prefix:"dh",iconName:"freeze",icon:[512,512,[],"f000","m438.4 300.8 -19.2 -28.8 -60.8 35.2L272 256l86.4 -51.2 60.8 35.2 19.2 -28.8 -44.8 -25.6 48 -28.8 -16 -25.6 -48 28.8V108.8h-35.2v67.2L256 227.2V128l60.8 -35.2 -16 -28.8 -44.8 25.6V32H224v57.6L179.2 64l-16 28.8L224 128v99.2L137.6 176V108.8H102.4V160l-48 -28.8 -16 25.6 48 28.8 -44.8 25.6 19.2 28.8 60.8 -35.2L208 256 121.6 307.2 60.8 272l-19.2 28.8 44.8 25.6 -48 28.8 16 25.6 48 -28.8v51.2h35.2v-67.2L224 284.8V384l-60.8 35.2 16 28.8 44.8 -25.6V480h32v-57.6l44.8 25.6 16 -28.8L256 384V284.8l86.4 51.2v67.2h35.2V352l48 28.8 16 -25.6 -48 -28.8z"]},wo={prefix:"dh",iconName:"gear-filled",icon:[512,512,[],"f000","m480 211.2 -76.8 -12.8L448 131.2l-64 -64 -67.2 41.6L300.8 32H211.2l-12.8 76.8L131.2 64l-64 64 41.6 67.2 -76.8 16v89.6l76.8 12.8L64 380.8l64 64 67.2 -41.6 16 76.8h89.6l16 -76.8L384 448l64 -64 -44.8 -67.2 76.8 -16V211.2zM256 320c-38.4 0 -64 -25.6 -64 -64s25.6 -64 64 -64 64 25.6 64 64 -25.6 64 -64 64z"]},Rd={prefix:"dh",iconName:"graph-line-down",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm67.2 -291.2 -22.4 22.4 108.8 112 70.4 -64 108.8 124.8H320v32h112l16 -16V224h-32v70.4L288 150.4l-70.4 64z"]},Id={prefix:"dh",iconName:"graph-line-up",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm153.6 -150.4 70.4 64 128 -144V256h32V144l-16 -16H320v32h76.8L288 284.8l-70.4 -64 -108.8 112 22.4 22.4z"]},Ds={prefix:"dh",iconName:"new-circle-large-filled",icon:[512,512,[],"f000","M240 0C108.8 0 0 108.8 0 240S108.8 480 240 480 480 371.2 480 240 371.2 0 240 0zM352 256H256v96H224V256H128V224h96V128h32v96h96v32z"]},Dd={prefix:"dh",iconName:"pandas",icon:[512,512,[],"f000","M185.6 28.8h54.4v115.2H185.6V28.8zm0 240h54.4V384H185.6V268.8zm0 -89.6h54.4v54.4H185.6V179.2zM96 124.8h54.4V512H96V124.8zm176 240h54.4V480H272v-115.2zm0 -240h54.4v115.2H272V124.8zm0 150.4h54.4v54.4H272V275.2zM361.6 0H416v387.2h-54.4V0z"]},Md={prefix:"dh",iconName:"refresh",icon:[512,512,[],"f000","m313.6 73.6 -9.6 32c83.2 25.6 131.2 118.4 102.4 201.6 -19.2 64 -80 108.8 -150.4 108.8 -89.6 0 -160 -70.4 -160 -160 0 -51.2 22.4 -96 64 -128v64h32V80L176 64H64v32h86.4c-76.8 51.2 -108.8 150.4 -70.4 236.8C112 403.2 179.2 448 256 448c105.6 0 192 -86.4 192 -192 0 -83.2 -54.4 -156.8 -134.4 -182.4z"]},Nd={prefix:"dh",iconName:"remove-square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16zM352 256H128V224h224v32z"]},Ko={prefix:"dh",iconName:"sort-alpha-down",icon:[512,512,[],"f000","M236.8 368 156.8 448h-22.4l-80 -80 22.4 -22.4L128 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM371.2 224l-6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6s-3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 310.4h73.6V448H272v-32l73.6 -89.6H275.2V288h128v32l-70.4 89.6z"]},Xo={prefix:"dh",iconName:"sort-alpha-up",icon:[512,512,[],"f000","M51.2 144 131.2 64h22.4l80 80 -22.4 22.4L160 115.2V448H128V115.2L76.8 166.4l-25.6 -22.4zm320 304 -6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6 0 6.4 -3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 -137.6h73.6V224H272V192l73.6 -89.6H275.2V64h128v32l-70.4 89.6z"]},Pr={prefix:"dh",iconName:"sort-amount-down",icon:[512,512,[],"f000","M204.8 368 124.8 448h-22.4L22.4 368l22.4 -22.4L96 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM256 64h256v64H256zm0 105.6h192v64H256zm0 108.8h128v64H256zM256 384h64v64H256z"]},Fd={prefix:"dh",iconName:"sort-down",icon:[512,512,[],"f000","m128 288 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},xd={prefix:"dh",iconName:"sort-up",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128z"]},Yo={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Hr={prefix:"dh",iconName:"square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16z"]},Qo={prefix:"dh",iconName:"table",icon:[512,512,[],"f000","M432 64h-384l-16 16v352l16 16h384l16 -16v-352l-16 -16zM160 416H64v-64h96v64zm0 -96H64V256h96v64zm0 -96H64V160h96v64zm128 192H192v-64h96v64zm0 -96H192V256h96v64zm0 -96H192V160h96v64zm128 192h-96v-64h96v64zm0 -96h-96V256h96v64zm0 -96h-96V160h96v64z"]},Od={prefix:"dh",iconName:"trash-undo",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64c0 -19.2 12.8 -32 32 -32h96c19.2 0 32 12.8 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm112 -64L160 272v-22.4l80 -80 22.4 22.4 -51.2 54.4H320v32H211.2l51.2 51.2 -22.4 22.4z"]},Ad={prefix:"dh",iconName:"triangle-down-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-160 288h-22.4L99.2 208l9.6 -16h291.2l9.6 12.8L265.6 352z"]},kd={prefix:"dh",iconName:"unlink",icon:[512,512,[],"f000","M32 211.2v-6.4C32 144 80 96 140.8 96h99.2c12.8 0 25.6 3.2 38.4 6.4l-25.6 25.6H140.8C99.2 128 64 163.2 64 204.8v6.4c0 28.8 16 54.4 38.4 67.2l-22.4 22.4C51.2 281.6 32 249.6 32 211.2zM403.2 6.4l-38.4 38.4 -67.2 67.2 -22.4 25.6 -150.4 147.2 -25.6 25.6 -54.4 54.4 -38.4 38.4L51.2 448 448 51.2 403.2 6.4zM384 192v32c38.4 6.4 64 38.4 64 76.8v6.4c0 41.6 -35.2 76.8 -76.8 76.8H272c-32 0 -60.8 -22.4 -73.6 -51.2l-25.6 25.6c19.2 35.2 54.4 60.8 96 60.8h99.2c60.8 0 108.8 -48 108.8 -108.8v-9.6C480 246.4 438.4 198.4 384 192zM246.4 288l-22.4 19.2v12.8h16c60.8 0 108.8 -48 108.8 -108.8v-6.4c0 -6.4 0 -12.8 -3.2 -19.2l-32 32c0 38.4 -32 67.2 -67.2 70.4z"]},_r={prefix:"dh",iconName:"warning-circle-filled",icon:[512,512,[],"f000","M470.4 195.2c-9.6 -38.4 -28.8 -70.4 -57.6 -99.2 -25.6 -25.6 -60.8 -44.8 -96 -54.4C297.6 35.2 275.2 32 256 32c-19.2 0 -41.6 3.2 -60.8 9.6 -16 3.2 -35.2 9.6 -51.2 22.4 -35.2 19.2 -60.8 44.8 -80 80 -12.8 16 -19.2 35.2 -25.6 51.2C35.2 214.4 32 236.8 32 256c0 19.2 3.2 41.6 6.4 60.8 6.4 16 12.8 35.2 25.6 51.2 9.6 16 22.4 32 35.2 44.8 12.8 16 28.8 25.6 44.8 35.2 16 9.6 35.2 16 54.4 22.4 16 6.4 38.4 9.6 57.6 9.6 19.2 0 41.6 -3.2 60.8 -6.4 19.2 -6.4 35.2 -12.8 54.4 -22.4 32 -19.2 60.8 -48 80 -80 9.6 -16 16 -35.2 22.4 -54.4 3.2 -19.2 6.4 -41.6 6.4 -60.8s-3.2 -41.6 -9.6 -60.8zM275.2 352H236.8v-32h38.4v32zm0 -64H236.8V160h38.4v128z"]},Ul={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};const Ki=Y.forwardRef((e,t)=>{var b;function n(C){const{menuItem:w,onMenuItemClick:S}=e;S(w,C)}function s(C){const{menuItem:w,onMenuItemMouseMove:S}=e;S(w,C)}function i(C){const{menuItem:w,onMenuItemContextMenu:S}=e;S(w,C)}function o(C,w,S){if(typeof C.type=="string")return C;const{closeMenu:I,menuItem:v,isKeyboardSelected:R,isMouseSelected:D,"data-testid":F}=e,L={menuItem:v,closeMenu:I,isKeyboardSelected:R,isMouseSelected:D,iconElement:w,displayShortcut:S,"data-testid":F};return Y.cloneElement(C,{forwardedProps:L})}const{children:r,menuItem:l,isKeyboardSelected:a,isMouseSelected:c,"data-testid":d}=e,h=(b=l.shortcut)==null?void 0:b.getDisplayText();let m=null;if(l.icon){const C=l.icon;if(Y.isValidElement(C))m=C;else{let w;l.iconColor&&!l.disabled&&(w={color:l.iconColor}),m=u(q,{icon:C,style:w})}}let p=null;const g=!!r;l.actions&&(p=u(q,{icon:Fl}));let f=null;if(l.menuElement)f=u("div",{className:"custom-menu-item",onMouseMove:s,children:o(l.menuElement,m,h)});else{const C=l.disabled,w=l.iconOutline;f=u("button",{type:"button",className:$("btn-context-menu",{disabled:C},{active:(g||c)&&!C},{"keyboard-active":a&&!C}),onClick:n,onMouseMove:s,onContextMenu:i,title:l.description||"",children:T("div",{className:"btn-context-menu-wrapper",children:[u("span",{className:$("icon",{outline:w}),children:m}),u("span",{className:"title",children:l.title}),h&&u("span",{className:"shortcut",children:h}),p&&u("span",{className:$("submenu-indicator",{disabled:C}),children:p})]})})}return T("div",{className:"context-menu-item",ref:t,"data-testid":d,children:[r,f]})});Ki.displayName="ContextMenuItem";Ki.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};class Es extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class Xi{static isDark(t){const n=document.createElement("div");n.style.display="none",n.style.color=t;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),Xi.getBrightness(o)<125}static getBrightness(t){return Math.round((t[0]*299+t[1]*587+t[2]*114)/1e3)}}const Ld="table_",Bl="column_",Pd=new Set(["in","not","i","ii","k"]),Hd=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"]),_d=/[^a-zA-Z0-9_$+@-]/g,Vd=/[^A-Za-z0-9_$]/g,Ms=class{};let Pn=Ms;Pn.legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(Pd.has(o)||Hd.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};Pn.legalizeTableName=e=>Ms.legalize(e,Ld,_d,!1,0);Pn.legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=Ms.legalizeColumnName(n,s);t.includes(i)&&(i=Bl+s),t.push(i)}),t};Pn.legalizeColumnName=(e,t=0)=>Ms.legalize(e,Bl,Vd,!0,t);Pn.isValidTableName=e=>Ms.legalizeTableName(e)===e;Pn.isValidColumnName=e=>Ms.legalizeColumnName(e)===e;function Ud(e,t){return e?e.closest(`.${t}`):null}const Bd={getClosestByClassName:Ud};class ye extends CustomEvent{constructor(t,n){super(t,n)}}class Wl extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class He{static makeCancelable(t,n){let s=!1,i;const o=new Promise((r,l)=>{Promise.resolve(t).then(a=>{s?(n&&n(a),l(new Es)):(i=a,r(a))},a=>l(s?new Es:a))});return o.cancel=()=>{s=!0,i!=null&&n&&n(i)},o}static isCanceled(t){return t instanceof Es}static isTimedOut(t){return t instanceof Wl}}class Yi{constructor(){this.pending=[],this.resolved=[]}add(t,n){const s=He.makeCancelable(t,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(t){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===t){this.pending.splice(n,1);return}}resolve(t){this.remove(t),this.resolved.push(t)}cancel(){const t=[...this.pending,...this.resolved];for(let n=0;n<t.length;n+=1)t[n].cancel();this.pending=[],this.resolved=[]}}function O(e){if(e==null)throw new Error("Value is null or undefined")}class Gt{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!Gt.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const i=t[s],o=i[0],r=i[1];if(o<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,i]=n;const o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(a<=s&&i<=c)return o;s<=c&&a<=i&&(s=Math.min(s,a),i=Math.max(i,c),o.splice(r,1))}return o.push([s,i]),o}static deselectRange(t,n){const[s,i]=n,o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(!(i<a||c<s))if(a<s&&i<c){o[r]=[a,s-1],o.splice(r+1,0,[i+1,c]);break}else s<=a&&c<=i?o.splice(r,1):a<s?o[r]=[a,s-1]:o[r]=[i+1,c]}return o}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class jo{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),i=t[t.length-1];return`${s}, ${n} ${i}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const zl=class{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;return`${t>0?`${t}h `:""}${n>0||t>0?`${n}m `:""}${e>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),s=String(Math.floor(n/60)).padStart(2,"0"),i=n%60,o=String(Math.ceil(i)).padStart(2,"0");return`${t}:${s}:${o}`}static isTimeString(e){return new RegExp(zl.TIME_PATTERN).test(e)}static parseTime(e){if(!e||typeof e!="string")throw new Error(`${e} is not a valid string`);const t=e.split(":");if(t.length!==3)throw new Error(`${e} is not a time string that can be parsed`);return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}};let Xt=zl;Xt.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Xt.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\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",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\u22125",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"}]);class Wd extends Error{constructor(){super(...arguments),this.isInvalid=!0}}const Ht=({className:e="","data-testid":t})=>T("div",{className:$("loading-spinner fa-layers",e),"data-testid":t,children:[u(q,{icon:Zc,className:"text-white-50"}),u(q,{icon:Ll,className:"text-primary",spin:!0})]}),Vr=ne.module("ContextMenu"),Lo=class extends y.exports.PureComponent{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=Y.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=Y.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var i,o,r;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(i=this.container.current)==null||i.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(o=this.container.current)!=null&&o.contains(document.activeElement)||(r=this.container.current)==null||r.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);const{options:e}=this.props;let t=e.initialKeyboardIndex;t===void 0&&(t=-1);const{actions:n}=this.props,s=Se.getMenuItems(n),i=[];for(let o=s.length-1;o>=0;o-=1){const r=s[o];r instanceof Promise?this.initMenuPromise(r):i.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:Se.sortActions(i)})}initMenuPromise(e){const t=He.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{menuItems:Se.sortActions(s.menuItems.concat(n)),pendingItems:o}}return null})},n=>{He.isCanceled(n)||(this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{pendingItems:o}}return null}),Vr.error(n))})}cancelPromises(){const{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current===null)return;const e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}verifyPosition(){var h,m,p,g;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:i,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition)return;let{top:r,left:l}=this.initialPosition;const{width:a,height:c}=(m=(h=this.container.current)==null?void 0:h.getBoundingClientRect())!=null?m:{width:0,height:0},d=((g=(p=this.container.current)==null?void 0:p.scrollHeight)!=null?g:0)>window.innerHeight;c===0||a===0||(r+c>window.innerHeight&&(r-c-s>0?r-=c-s:r=window.innerHeight-c),l+a>window.innerWidth&&(l=l-a-n),(o!==l||i!==r)&&(this.setState({hasOverflow:d}),t(r,l)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Vr.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,n=!1;for(;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){const{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n,i=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?i=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=Se.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=Se.getNextMenuItem(s,1,t)),i){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:n}=this.state,s=t[e].actions?e:null;n!==s&&this.setState({activeSubMenu:s,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:n}=this.state;e!=null&&!e.disabled&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&!e.disabled&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:i,keyboardIndex:o,menuItems:r,mouseIndex:l,pendingItems:a,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:h,subMenuParentHeight:m}=this.state;for(let C=0;C<r.length;C+=1){const w=r[C];C>0&&w.group!==r[C-1].group&&e.push(u("hr",{},`${C}.separator`));const S=u(Ki,{ref:s===C?this.activeSubMenuRef:null,isKeyboardSelected:o===C,isMouseSelected:l===C,menuItem:w,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},C);e.push(S)}let p=null;a.length>0&&(p=u("div",{className:"loading",children:u(Ht,{})}));const{menuStyle:g,"data-testid":f}=this.props,b=s!==null&&c!==null&&d!==null;return T(Fe,{children:[T("div",{className:$({"has-overflow":i},"context-menu-container"),style:{top:t,left:n,...g},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Lo.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":f,children:[e,p]}),b&&s!==null&&c!==null&&d!==null&&u(Lo,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(C,w)=>{this.setState({subMenuTop:C,subMenuLeft:w})},subMenuParentWidth:h,subMenuParentHeight:m},`sub-${s}`)]})}};let $l=Lo;$l.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class zd extends y.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=Y.createRef(),this.openMenu=Y.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!Se.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=Se.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),i=t.clientY-s.top,o=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(l)});return}return}t.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(t=u($l,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),u("div",{className:$("context-menu-root",{active:s}),ref:this.container,children:t})}}const Qn=class extends y.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${Qn.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${Qn.getHeight(t)}px`}static getHeight(e){const t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){const t=e;t.style.height="";const{autoFocusOnShow:n}=this.props;if(n){const s=t.querySelector("input, select, textarea");s&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return u(ot,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Qn.handleEnter,onEntering:Qn.handleEntering,onEntered:this.handleEntered,onExit:Qn.handleExit,onExiting:Qn.handleExiting,timeout:350,children:i=>u("div",{className:$({collapse:i==="exited"},t),"data-testid":s,children:e})})}};let Gl=Qn;Gl.propTypes={className:M.exports.string,in:M.exports.bool.isRequired,children:M.exports.node.isRequired,autoFocusOnShow:M.exports.bool,"data-testid":M.exports.string};Gl.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function Zo(e){const t=y.exports.useRef();return y.exports.useEffect(function(){t.current=e}),t.current}function ql(e){const t=y.exports.useRef(null);return y.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const It=Y.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:i,disabled:o,inputClassName:r,isInvalid:l,labelClassName:a,name:c,onChange:d,"data-testid":h}=e,[m]=y.exports.useState(jt()),p=ql(t);y.exports.useEffect(function(){p.current&&(p.current.indeterminate=n===null)},[p,n]);const g=y.exports.useCallback(f=>{p.current&&(p.current.indeterminate=n===null),d&&d(f)},[p,n,d]);return T("div",{className:$("custom-control custom-checkbox",i),children:[u("input",{type:"checkbox",ref:p,checked:n!=null?n:!1,className:$("custom-control-input",r,{"is-invalid":l}),disabled:o,id:m,name:c,onChange:g,"data-testid":h}),u("label",{className:$("custom-control-label",a),htmlFor:m,children:s})]})});It.displayName="Checkbox";It.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:M.exports.node.isRequired,className:M.exports.string,disabled:M.exports.bool,inputClassName:M.exports.string,isInvalid:M.exports.bool,labelClassName:M.exports.string,name:M.exports.string,onChange:M.exports.func,"data-testid":M.exports.string};It.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class Hn extends y.exports.PureComponent{constructor(t){super(t),this.inputField=Y.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onBlur:s,onChange:i,className:o,disabled:r,matchCount:l,id:a,onKeyDown:c,"data-testid":d}=this.props;return T("div",{className:$("search-group",o),children:[u("input",{type:"search",value:t,onBlur:s,onChange:i,onKeyDown:c,className:"form-control",disabled:r,placeholder:n,ref:this.inputField,id:a,"data-testid":d}),l!=null&&u("span",{className:"search-match",children:l}),u("span",{className:"search-icon",children:u(q,{icon:_l})})]})}}Hn.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var Kl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Kl||{});const Ws=class extends y.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.toLowerCase())>=0)),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Y.createRef(),this.cbContainer=Y.createRef(),this.toggleButton=Y.createRef(),this.menuContainer=Y.createRef(),this.input=Y.createRef(),this.searchInput=Y.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,l;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,o=t?n:i;switch(e.key){case"Enter":((r=o[s])==null?void 0:r.value)!=null&&this.updateInputValue(o[s].value),this.closeMenu(),(l=this.input.current)==null||l.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Ws.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Ws.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,r=(t?n:i).length;let l=0;switch(e){case Ws.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case Ws.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(s+l+r)%r})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:i}=this.props,o=n?s:i;this.updateInputValue(o[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var i;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(i=this.popper.current)==null||i.scheduleUpdate()}handleMenuBlur(e){var t;e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,o=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return T("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[u("div",{className:"cb-search-input-container",children:u(Hn,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u("div",{className:"cb-options-container",children:u("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:s}=this.state;return(n?s:e).map((o,r)=>{const l=`option-${r}-${o.value}`;return u("button",{type:"button",value:r,className:$("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:i,spellCheck:o,"data-testid":r}=this.props,{value:l}=this.state;let{popperOptions:a}=this.props;return a={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...a},T("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:$("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0]&&e[0].title,disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r?`${r}-input`:void 0}),u("div",{className:"input-group-append cb-dropdown",children:T("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r?`${r}-btn`:void 0,children:[u(q,{icon:Nn}),u(fn,{ref:this.popper,options:a,className:$("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Ns=Ws;Ns.MENU_NAVIGATION_DIRECTION=Kl;Ns.DROP_DOWN_MENU_HEIGHT=200;Ns.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired}),onChange:M.exports.func,inputPlaceholder:M.exports.string,searchPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultValue:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,"data-testid":M.exports.string};Ns.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const At=ne.module("MaskedInput"),gs={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},wi="\u2007";function Jo(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}function $d(e,t,n){return e.length<n?`${e}${t.substring(e.length,n)}`:e}function Ur(e,t){let{length:n}=e;for(let s=e.length-1;s>=0&&t[s]===e[s];s-=1)n=s;return e.substring(0,n)}const Qi=Y.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:i=(N,_,k)=>k,getPreferredReplacementString:o=Jo,onChange:r=()=>!1,onSelect:l=()=>!1,pattern:a,placeholder:c,selection:d,value:h,onFocus:m=()=>!1,onBlur:p=()=>!1,"data-testid":g}=e,f=ql(t),b=y.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]),C=y.exports.useMemo(()=>b[0].replace(/[a-zA-Z0-9]/g,wi),[b]);y.exports.useEffect(function(){var _;if(d!=null){At.debug("setting selection...",d);const{selectionStart:k,selectionEnd:P,selectionDirection:H}=d;(_=f.current)==null||_.setSelectionRange(k,P,H),At.debug("selection set!")}},[d,f]);const w=y.exports.useCallback(N=>{let _=N,k=N;const P=b.length>0?b[0]:h;for(let V=_-1;V>=0&&/[a-zA-Z0-9]/g.test(P.charAt(V));V-=1)_=V;for(let V=k;V<P.length&&/[a-zA-Z0-9]/g.test(P.charAt(V));V+=1)k=V+1;const H=_===k?gs.NONE:gs.BACKWARD;return{selectionStart:_,selectionEnd:k,selectionDirection:H}},[b,h]);function S(N,_,k=N.length){let P="";for(let H=0;H<k;H+=1)N.charAt(H)!==wi?P=P.concat(N[H]):P=P.concat(_[H]);return P=P.concat(_.substring(k)),P}function I(N,_=N.length){const k=new RegExp(`^${a}$`);if(k.test(N))return!0;for(let P=0;P<b.length;P+=1){const H=S(N,b[P],_);if(k.test(H))return!0}return!1}function v(N){const _=w(N),k=_.selectionEnd+1;return k>=h.length?_:w(k)}function R(N){const _=w(N),k=_.selectionStart-1;return k<=0?_:w(k)}function D(N,_){const k=w(N),P=h.substring(k.selectionStart,k.selectionEnd),H=i(k,_,P,h),V=h.substring(0,k.selectionStart)+H+h.substring(k.selectionEnd);I(V,k.selectionEnd)&&(r(V),l(k))}const F=y.exports.useCallback(N=>{const{selectionStart:_=0,selectionEnd:k=0,selectionDirection:P="none"}=N.target;if(_===null||k===null||P===null){At.error("Selection attempted on non-text input element",N.target);return}if(At.debug2("handleSelect",_,k,P),!(d!=null&&_===d.selectionStart&&k===d.selectionEnd)){if(d!=null&&_===h.length&&k===h.length&&N.nativeEvent.type!=="mouseup"){l({...d});return}if(_===k){const H=w(_);At.debug("Selection segment from ",_,k,"=>",H),l(H)}else l({selectionStart:_,selectionEnd:k,selectionDirection:P})}},[w,l,d,h]),L=y.exports.useCallback(N=>{if(!f.current)return;At.debug("handleSelectCapture",N);const _=f.current.selectionStart||0;_===h.length&&d!=null&&_!==d.selectionStart&&(N.preventDefault(),N.stopPropagation())},[f,d,h]);function W(N){if(N.preventDefault(),N.stopPropagation(),!f.current)return;const{key:_}=N,{selectionStart:k=0,selectionEnd:P=0}=f.current;if(k===null||P===null){At.error("Selection arrow nvaigation attempted on non-text input element",N.target);return}_==="ArrowLeft"?l(R(k)):_==="ArrowRight"?l(v(P)):_==="ArrowUp"?D(k,-1):_==="ArrowDown"&&D(k,1)}function B(N){if(!f.current)return;At.debug("handleKeyDown",N);const{key:_}=N,{selectionStart:k=0,selectionEnd:P=0}=f.current;if(k===null||P===null){At.error("Selection key event on non-text input element",N.target);return}if(_.startsWith("Arrow")){W(N);return}if(_==="Delete"||_==="Backspace"){if(N.preventDefault(),N.stopPropagation(),P>=Ur(h,C).length){const V=h.substring(0,k===P?k-1:k),G=Ur(V,C);G!==h&&(r(G),l({selectionStart:G.length,selectionEnd:G.length,selectionDirection:gs.NONE}));return}if(k!==P){const V=h.substring(0,k)+h.substring(k,P).replace(/[a-zA-Z0-9]/g,wi)+h.substring(P);At.debug("Range ",k,P,"deleted, setting value",V),r(V),l({selectionStart:k,selectionEnd:k,selectionDirection:gs.NONE})}else if(k>0)for(let V=k-1;V>=0;V-=1){const G=h.substring(0,V)+h.substring(V,k).replace(/[a-zA-Z0-9]/g,wi)+h.substring(k);if(G!==h){r(G),l({selectionStart:V,selectionEnd:V,selectionDirection:gs.NONE});return}}return}if(N.altKey||N.metaKey||N.ctrlKey||_.length>1)return;N.preventDefault(),N.stopPropagation();const H=Array.from(new Set([_,_.toUpperCase(),_.toLowerCase()]));for(let V=0;V<H.length;V+=1){const G=H[V],Q=/[a-zA-Z0-9]/g.test(G)?b[0].length-1:k;for(let J=k;J<=Q;J+=1){const re=$d(h,b[0],J+1),Ce=o(re,J,G,k,P);if(I(Ce,J+1)){const de=w(J),ve=J+1;let _e={selectionStart:ve,selectionEnd:ve,selectionDirection:gs.NONE};if(ve>=de.selectionEnd){const Ke=v(J);Ke.selectionStart!==de.selectionStart&&(_e=Ke)}At.debug("handleKeyDown",_,"=>",Ce,_e),r(Ce),l(_e);return}}}}return u("input",{ref:f,className:$("form-control masked-input",n),type:"text",pattern:a,placeholder:c,value:h,onChange:()=>{},onKeyDown:B,onSelect:F,onSelectCapture:L,onFocus:m,onBlur:p,"data-testid":g})});Qi.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:Jo,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const Gd=ne.module("TimeInput"),qd="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Kd=["00:00:00","12:34:56","23:59:59"],Xl=Y.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:i=()=>!1,value:o=0,onFocus:r=()=>!1,onBlur:l=()=>!1,onSelect:a=()=>!1,"data-testid":c}=e,[d,h]=y.exports.useState(Xt.formatTime(o)),[m,p]=y.exports.useState(),g=y.exports.useRef(null);y.exports.useImperativeHandle(t,()=>({focus:()=>{var S;(S=g.current)==null||S.focus()},setSelection:S=>{var I;(I=g.current)==null||I.focus(),p(S)}}),[]),y.exports.useEffect(function(){h(Xt.formatTime(o))},[o]);function f(S,I,v){const R=S.selectionStart===0?24:60;let D=parseInt(v,10)-I;return Number.isNaN(D)?D=0:n?D=(D%R+R)%R:D=Math.min(Math.max(0,D),R-1),`${D}`.padStart(2,"0")}function b(S,I,v,R,D){return R===0&&D===2&&I===1&&parseInt(v,10)>1?`0${v}${S.substring(2)}`:Jo(S,I,v)}function C(S){Gd.debug("handleChange",S),h(S),Xt.isTimeString(S)&&i(Xt.parseTime(S))}const w=y.exports.useCallback(S=>{p(S),a(S)},[a]);return u(Qi,{ref:g,className:s,example:Kd,getNextSegmentValue:f,getPreferredReplacementString:b,onChange:C,onSelect:w,pattern:qd,selection:m,value:d,onFocus:r,onBlur:l,"data-testid":c})});Xl.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class Yl extends y.exports.PureComponent{constructor(t){var i;super(t),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=Y.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(i=n.initialKeyboardIndex)!=null?i:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=Se.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:Se.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let i=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?i=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?i=Se.getNextMenuItem(i!=null?i:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(i=Se.getNextMenuItem(i!=null?i:0,1,n)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&!t.disabled&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:o}=this.state;for(let l=0;l<i.length;l+=1){const a=i[l];l>0&&a.group!==i[l-1].group&&t.push(u("hr",{},`${l}.separator`));const c=u(Ki,{isKeyboardSelected:s===l,isMouseSelected:o===l,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},l);t.push(c)}const{menuStyle:r}=this.props;return u("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}Yl.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class On extends y.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=Y.createRef(),this.parent=null,this.popper=Y.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":i}=this.props,{menuStyle:o}=this.props;let{options:r,popperOptions:l}=this.props;return l={placement:"bottom",...l},r={separateKeyboardMouse:!0,...r},u("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u(fn,{ref:this.popper,options:l,className:$("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u(Yl,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:o})})})}}On.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const Br=-1;var Ql=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Ql||{});const ln=class extends y.exports.Component{constructor(e){super(e);const{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=Y.createRef(),this.menuContainer=Y.createRef(),this.button=Y.createRef(),this.input=Y.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let i=0;i<e.length;i+=1){const o=e[i];if(o.value===t)return o.title}return Xt.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(s[t].value),this.closeMenu(),(i=this.button.current)==null||i.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props,i=s.length;let o=t;switch(e){case ln.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%i,this.setState({keyboardOptionIndex:o})):t===0&&(o=i-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case ln.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(o=(o+1)%i,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:i}=this.state;if(t===Br){const o=s(i);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var o;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>ln.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-ln.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u("div",{className:"cs-options-container",children:u("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:i,customTime:o,inputFocused:r}=this.state;let l=!1;const a=[];for(let c=0;c<e.length;c+=1){const d=e[c],h=`option-${c}-${d.value}`;l=l||d.value===t,a.push(T("button",{type:"button",value:c,className:$("cs-option-btn",{"keyboard-active":i===c&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[d.value===t&&u(q,{icon:n,className:"mr-2"}),d.value!==t&&u("span",{className:"mr-4"}),d.title]},h))}return a.push(u("hr",{className:"cs-divider"},"option-divider")),a.push(T("button",{type:"button",value:Br,className:$("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u(q,{icon:n,className:"mr-2"}):u("span",{className:"mr-4"}),s]},"option-custom-label")),a.push(T("div",{className:"cs-custom-container",children:[u("span",{className:"mr-2"}),u(Xl,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u("span",{className:"ml-2"})]},"cs-custom-container")),a.push(u("hr",{className:"mb-2"},"option-end")),a}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:i}=this.state;let{popperOptions:o}=this.props;return o={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...o},u("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:u("div",{className:$("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:T("button",{type:"button",className:$("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u("span",{className:$({"text-muted":n===null}),children:this.getSelectedText()}),u("span",{children:u(q,{icon:Yo,className:"cs-caret"})}),u(On,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let er=ln;er.MENU_NAVIGATION_DIRECTION=Ql;er.DROP_DOWN_MENU_HEIGHT=125;er.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:os,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0};function fs(e,t,n,s,i){const o=s-n+1;return`${((parseInt(t,10)-e-n)%o+o)%o+n}`.padStart(i,"0")}function jl(e,t,n){const{selectionStart:s}=e;return s===0?fs(t,n,1900,2099,4):s===5?fs(t,n,1,12,2):s===8?fs(t,n,1,31,2):s===11?fs(t,n,0,23,2):s===17||s===14?fs(t,n,0,59,2):s===20||s===24||s===28?fs(t,n,0,999,3):n}const Xd=ne.module("DateTimeInput"),Yd="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Qd="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}\u200B[0-9]{3}\u200B[0-9]{3}",jd=`${Yd} ${Qd}`,Zd="2022-01-01 00:00:00.000000000",Jd="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function Zl(e){const t=e.substring(0,23),n=e.substring(23,26),s=e.substring(26);return[t,n,s].filter(i=>i!=="").join("\u200B")}const eh=e=>e.replace(/\u200B/g,""),th=[Zl(Zd)],Jl=Y.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:i="",onFocus:o=()=>{},onBlur:r=()=>{},"data-testid":l}=e,[a,c]=y.exports.useState(i.length>0?Zl(i):""),[d,h]=y.exports.useState(),m=y.exports.useCallback(p=>{Xd.debug("handleChange",p),c(p),s(eh(p))},[s]);return u("div",{className:"d-flex flex-row align-items-center",children:u(Qi,{ref:t,className:$(n),example:th,getNextSegmentValue:jl,onChange:m,onSelect:h,pattern:jd,placeholder:Jd,selection:d,value:a,onFocus:o,onBlur:r,"data-testid":l})})});Jl.displayName="DateTimeInput";Jl.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const nh=ne.module("DateInput"),sh="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",ih=["2000-01-01","2022-12-31"],oh="YYYY-MM-DD",ea=Y.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:i="",onFocus:o=()=>{},onBlur:r=()=>{},"data-testid":l}=e,[a,c]=y.exports.useState(i),[d,h]=y.exports.useState(),m=y.exports.useCallback(p=>{nh.debug("handleChange",p),c(p),s(p)},[s]);return u("div",{className:"d-flex flex-row align-items-center",children:u(Qi,{ref:t,className:$(n),example:ih,getNextSegmentValue:jl,onChange:m,onSelect:h,pattern:sh,placeholder:oh,selection:d,value:a,onFocus:o,onBlur:r,"data-testid":l})})});ea.displayName="DateInput";ea.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class rh extends y.exports.PureComponent{constructor(t){super(t),this.searchInput=Y.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Tt(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:i,"data-testid":o}=this.props,{value:r}=this.state;return u(Hn,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:i,"data-testid":o})}}rh.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const lh=({className:e="",show:t=!0,"data-testid":n})=>T("div",{className:$("dh-loader",e,{show:t}),"data-testid":n,children:[u("svg",{className:"dh-outer-shape",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("path",{d:"M82.7429,0L82.7429,41.3714L45.2571,41.3714L45.2571,0L0,0L0,128L45.2571,128L45.2571,86.6286L82.5143,86.6286L82.5143,128L128,128L128,0L82.7429,0ZM41.3714,124.114L4.11429,124.114L4.11429,86.6286L41.3714,86.6286L41.3714,124.114ZM41.3714,82.7429L4.11429,82.7429L4.11429,45.2571L41.3714,45.2571L41.3714,82.7429ZM41.3714,41.3714L4.11429,41.3714L4.11429,4.11429L41.3714,4.11429L41.3714,41.3714ZM45.2571,82.7429L45.2571,45.2571L82.5143,45.2571L82.5143,82.5143L45.2571,82.5143ZM124.114,124.114L86.6286,124.114L86.6286,86.6286L123.886,86.6286L123.886,124.114ZM124.114,82.7429L86.6286,82.7429L86.6286,45.2571L123.886,45.2571L123.886,82.7429ZM86.6286,41.3714L86.6286,4.11429L123.886,4.11429L123.886,41.3714L86.6286,41.3714Z",fill:"#f0f0ee"})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-3",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3438",height:"37.6389",fill:"#5189e5",transform:"translate(-21.9838,29.7957) translate(21.9838,15.3027)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-2",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2755",height:"37.4675",fill:"#5189e5",transform:"translate(-21.9838,69.7957) translate(22.0822,16.7783)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-5",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3512",height:"41.3781",fill:"#35618c",transform:"translate(18.0162,72.7957) translate(23.1643,13.7278)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-6",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2483",height:"37.5869",fill:"#35618c",transform:"translate(59.0162,29.7957) translate(23.6379,15.3564)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-7",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.5664",height:"41.2747",fill:"#35618c",transform:"translate(17.0162,-13.2043) translate(24.2531,13.2043)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-4",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2854",height:"37.3014",fill:"#5189e5",transform:"translate(-21.9838,-13.2043) translate(22.0822,17.1792)"})})})})]});const ah=ne.module("ItemListItem"),ta=class extends y.exports.Component{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=Y.createRef()}static handleKeyDown(){return ah.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:i,"data-testid":o}=this.props;return u("div",{className:$("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:ta.handleKeyDown,onContextMenu:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"presentation",style:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:i})}};let na=ta;na.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Wr=ne.module("ItemList"),ys=class extends y.exports.PureComponent{constructor(e){super(e),this.getItemSelected=ue((s,i)=>Gt.isSelected(i,s),{max:ys.CACHE_SIZE}),this.getCachedItem=ue((s,i,o,r,l,a,c,d)=>{const h=a({item:o,itemIndex:s,isFocused:r,isSelected:l,style:c});return u(na,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:d,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:l,itemIndex:s,style:c,children:h},i)},{max:ys.CACHE_SIZE}),this.getOuterElement=ue(s=>{const i=Y.forwardRef((o,r)=>u("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...o}));return i.displayName="ItemListOuterElement",i}),this.getInnerElement=ue(()=>{const s=Y.forwardRef((i,o)=>u("div",{className:"item-list-inner-element",ref:o,...i}));return s.displayName="ItemListInnerElement",s}),this.getItemData=ue((s,i,o)=>({items:s,selectedRanges:i,renderItem:o})),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=Y.createRef(),this.listContainer=Y.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null}}static renderItem({item:e}){return u("div",{className:"item-list-item-content",children:e&&(e.displayValue||e.value||`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:i,scrollOffset:o,height:r,selectedRanges:l}=this.state;if(i&&!this.isListAtBottom()&&this.scrollToBottom(),(o!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==l)this.setSelectedRanges(n);else if(l!==t.selectedRanges){const{onSelectionChange:a}=this.props;a(l)}if(s!==t.focusIndex){const{onFocusChange:a}=this.props;a(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),i=e-n;return s[i]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,i=Gt.isSelected(n,e)||Se.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:i})=>({selectedRanges:Gt.selectRange(i,[e,e])}),()=>{s(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Wr.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Wr.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:s}=n;return s!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:s,disableSelect:i}=this.props,{mouseDownIndex:o,selectedRanges:r}=this.state;o==null||i||(this.setState({isDragging:!0}),(n||o===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!Se.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,Se.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:i}=this.props,{mouseDownIndex:o,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!r){const l=t.shiftKey,a=Se.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,a,n),!s&&!l&&!a&&i(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:i}=this.state;let o=i;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&s(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=n-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,n-1):o=0;else return;if(i!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:l}=this.state;if(e.shiftKey&&l.length>0){const a=l[l.length-1];this.selectRange([Math.min(o,a[0]),Math.max(o,a[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:i}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:i}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n,s=!0){const{isMultiSelect:i}=this.props,{selectedRanges:o}=this.state;if(i&&t&&o.length>0){const r=o[o.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else i&&o.length===1&&o[0][0]===e&&o[0][1]===e?s&&this.deselectItem(e):i&&n?this.getItemSelected(e,o)?s&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){Gt.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:Gt.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Gt.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:Gt.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:s}=this.props,i=Math.floor(e/s),o=i+Math.ceil(t/s);n(i,o)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:s}=this.props;return e+t>=n*s}renderInnerElement({index:e,style:t}){const{items:n,offset:s,renderItem:i,disableSelect:o}=this.props,{focusIndex:r,selectedRanges:l}=this.state;if(e<s||e>=s+n.length)return null;const a=n[e-s];return this.getCachedItem(e,e,a,e===r&&!o,this.getItemSelected(e,l),i,t,o)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:i,"data-testid":o}=this.props,{selectedRanges:r}=this.state;return u(ec,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:l,height:a})=>u(tc,{className:"item-list-scroll-pane",height:a,width:l,itemCount:t,itemSize:i,itemData:this.getItemData(e,r,s),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":o,children:this.renderInnerElement})})}};let Zt=ys;Zt.CACHE_SIZE=1e3;Zt.DEFAULT_ROW_HEIGHT=20;Zt.DEFAULT_OVERSCAN=10;Zt.defaultProps={offset:0,items:[],rowHeight:ys.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:ys.DEFAULT_OVERSCAN,renderItem:ys.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const ss=class extends y.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=ue((t,n,s,i,o,r,l,a)=>u(zi,{draggableId:ss.getDraggableId(t,i),index:i,isDragDisabled:l,children:c=>u("div",{role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1,...c.draggableProps,...c.dragHandleProps,children:n({item:s,itemIndex:i,isFocused:o,isSelected:r,style:a,isClone:!1})})},i),{max:Zt.CACHE_SIZE}),this.getCachedRenderDraggableItem=ue((t,n,s)=>({item:i,itemIndex:o,isFocused:r,isSelected:l,style:a})=>this.getCachedDraggableItem(t,s,i,o,r,l,n,a),{max:1}),this.getCachedRenderClone=ue((t,n,s,i)=>(o,r,l)=>{const{selectedCount:a}=this.state,{index:c}=l.source,d=n[c-s];return u("div",{className:$("draggable-item-list-dragging-item-container",t),...o.draggableProps,...o.dragHandleProps,ref:o.innerRef,children:u("div",{className:$("draggable-item-list-dragging-item",{"two-dragged":a===2},{"multiple-dragged":a>2}),children:i({item:d,itemIndex:c,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:a})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=Y.createRef(),this.state={selectedCount:0}}static renderHandle(){return T("div",{children:[u(me,{children:"Drag to re-order"}),u(q,{icon:qi})]})}static renderBadge({text:e}){return e?u("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return T("div",{className:$("item-list-item-content","draggable-item-list-item-content",n),children:[u("span",{className:"title",children:e}),ss.renderBadge({text:t}),ss.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e&&(e.displayValue||e.value||`${e}`),i=t?`${n}`:"",o=t?"item-list-item-clone":"";return ss.renderTextItem({text:s,badgeText:i,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){return parseInt(e.split("/").pop()||"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:Gt.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:i,isDragDisabled:o,isDropDisabled:r,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,offset:h,onFocusChange:m,onSelect:p,onViewportChange:g,renderItem:f,rowHeight:b,selectedRanges:C,style:w,"data-testid":S}=this.props;return u(Ys,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,d,h,f),"data-testid":S,children:(I,v)=>u("div",{role:"menu",className:$("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":o,"is-dragging-from-this":v.draggingFromThisWith,"is-dragging-over":v.isDraggingOver,"is-dropping":v.draggingOverWith}),style:w,ref:I.innerRef,...I.droppableProps,children:u(Zt,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,onFocusChange:m,onSelect:p,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:h,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,f),rowHeight:b,selectedRanges:C})})})}};let Ct=ss;Ct.DEFAULT_ROW_HEIGHT=30;Ct.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:ss.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:ss.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};class dt{static reorder(t,n,s,i){const o=t===s?dt.adjustDestinationIndex(i,n):i,r=dt.removeItems(t,n);return s.splice(o,0,...r),r}static removeItems(t,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,c]=r;s[l]=t.splice(a,c-a+1)}return nc(s)}static adjustDestinationIndex(t,n){let s=t;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>t)break;s-=Math.min(r,t-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const Fi=class extends y.exports.Component{static isParentSelected(e,t){const n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;const s=Array.from(n.values()).includes(!0),i=Array.from(n.values()).includes(!1);return s&&i?null:s}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{const{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){const{valueMap:n,onUpdateValueMap:s}=this.props,i=new Map(n),o=i.get(e);if(o instanceof Map){const l=new Map(o);if(t!=null)l.set(t,!o.get(t));else{const a=!Fi.isParentSelected(e,i);o.forEach((c,d)=>l.set(d,a))}i.set(e,l)}else i.set(e,!o);const r=i.get(e);t===void 0&&r!==void 0&&typeof r!="boolean"&&(Fi.isParentSelected(e,n)?r.forEach((l,a)=>r.set(a,!1)):r.forEach((l,a)=>r.set(a,!0))),s(i)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((i,o)=>{if(typeof i=="boolean")s.set(o,e);else{const r=new Map;i.forEach((l,a)=>r.set(a,e)),s.set(o,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return T("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>T("div",{children:[u(It,{className:"hcm-parent",checked:Fi.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([i,o])=>u(It,{className:"hcm-child",checked:o,onChange:()=>this.toggleValueFor(n,i),children:i},i))]},n)),u("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,"data-testid":t?`${t}-btn-select-all`:void 0,children:"Select All"}),u("button",{type:"button",className:"btn btn-link",onClick:this.clear,"data-testid":t?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":i}=this.props,{menuIsOpen:o}=this.state;return T("button",{type:"button",className:$("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":i,children:[T("span",{children:[n&&u(q,{icon:n,className:"hcm-icon mr-1"}),e]}),u(q,{icon:Yo,className:"hcm-icon ml-1"}),u(fn,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let ch=Fi;ch.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const sa=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>u(ot,{in:!!n||!e||t,timeout:Rt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"fill-parent-absolute","data-testid":s,children:u("div",{className:$("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:T("div",{className:"message-content",children:[T("div",{className:"message-icon",children:[t&&u(Ht,{}),!t&&n&&u(q,{icon:as})]}),u("div",{className:"message-text",children:n})]})})})});const ia=({on:e,id:t,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r})=>u("button",{type:"button",className:$("btn","btn-switch",n,{active:e},{"is-invalid":s}),id:t,onClick:o,disabled:i,"data-testid":r,children:u("div",{className:"handle"})});function zr(e){return e.isOn!==void 0}const hh=({item:e,onSelect:t=()=>{},"data-testid":n})=>{const{icon:s,subtitle:i,title:o}=e,r=y.exports.useMemo(()=>zr(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return T("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s&&u("div",{className:"icon",children:u(q,{icon:s})}),u("div",{className:"title",children:o}),i&&u("div",{className:"shortcut",children:i}),u("div",{className:"accessory","data-testid":n,children:zr(e)&&u(ia,{on:e.isOn,onClick:l=>{l.stopPropagation(),r()}})||u(q,{icon:Fl})})]})};const oa=({items:e,onSelect:t=()=>{},"data-testid":n})=>u("div",{className:"navigation-menu-view","data-testid":n,children:u("ul",{className:"navigation-menu-list",children:e.map((s,i)=>u("li",{children:u(hh,{item:s,onSelect:()=>{t(i)}})},s.title))})});const $r=({children:e,onBack:t,onClose:n,title:s,"data-testid":i})=>T("div",{className:"navigation-page","data-testid":i,children:[T("div",{className:"navigation-title-bar",children:[u("div",{className:"navigation-left-buttons",children:t!==void 0&&T("button",{className:"btn btn-link btn-back","data-testid":"btn-page-back",type:"button",onClick:t,children:[u(q,{icon:Qc}),"Back"]})}),u("div",{className:"navigation-title",children:s}),u("div",{className:"navigation-right-buttons",children:n!==void 0&&u("button",{className:"btn btn-link btn-link-icon btn-close px-2 m-1","data-testid":"btn-page-close",type:"button",onClick:n,children:u(q,{icon:Gi})})})]}),u("div",{className:"navigation-content",children:e})]});const uh=({children:e,"data-testid":t})=>{const n=y.exports.useMemo(()=>Y.Children.toArray(e),[e]),s=Zo(n),[i,o]=y.exports.useState(n[n.length-1]),[r,l]=y.exports.useState(null),[a,c]=y.exports.useState(null);y.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),c(s[s.length-1]))},[n,s,r,a,i]);const d=y.exports.useCallback(()=>{o(r),l(null)},[r]),h=y.exports.useCallback(()=>{c(null)},[]);return T("div",{className:"navigation-stack",children:[u("div",{className:"main-view","data-testid":t,children:i}),u(ot,{in:a!=null,timeout:Rt.transitionMidMs,classNames:"slide-right",onEntered:h,children:u(Fe,{children:a&&u("div",{className:"popping-view",children:a})})}),u(ot,{in:r!=null,timeout:Rt.transitionMidMs,classNames:"slide-left",onEntered:d,children:u(Fe,{children:r&&u("div",{className:"pushing-view",children:r})})})]})},mh=({children:e,disabled:t,value:n,"data-testid":s})=>u("option",{value:n,disabled:t,"data-testid":s,children:e}),tr=e=>{const{children:t,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=e,[l]=y.exports.useState(s||jt());return u(Fe,{children:Y.Children.map(t,a=>a?Y.cloneElement(a,{name:l,onChange:a.props.onChange||i,checked:o===a.props.value,disabled:a.props.disabled||n,"data-testid":r}):null)})},gn=Y.forwardRef((e,t)=>{const{checked:n,children:s,className:i="",disabled:o=!1,inputClassName:r="",isInvalid:l=!1,labelClassName:a="",name:c,onChange:d,value:h,"data-testid":m}=e,[p]=y.exports.useState(jt());return T("div",{className:$("custom-control custom-radio",i),children:[u("input",{type:"radio",id:p,"data-testid":m,name:c,ref:t,className:$("custom-control-input",r,{"is-invalid":l}),checked:n,disabled:o,value:h,onChange:d}),u("label",{className:$("custom-control-label",a),htmlFor:p,children:s})]})});gn.displayName="RadioItem";gn.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const ph=({children:e,onBlur:t,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a})=>{const c=y.exports.useCallback(d=>{n(d.target.value)},[n]);return u("select",{className:$("custom-select",s),onBlur:t,onChange:c,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:e})};class ra extends y.exports.PureComponent{constructor(t){super(t),this.getCachedItem=ue((n,s,i,o,r,l,a)=>{const c={height:r},d=o!=null?o:i;return u("li",{className:"value-list-item",style:c,tabIndex:-1,children:u(It,{checked:l,disabled:a,onChange:()=>this.handleSelect(n),children:d})},s)},{max:1e3}),this.getCachedItems=ue((n,s,i,o)=>{const r=[];for(let l=0;l<n.length;l+=1){const a=n[l],{value:c,displayValue:d,isSelected:h}=a,m=i+l,p=m,g=this.getCachedItem(m,p,c,d,s,h,o);r.push(g)}return r},{max:1}),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=Y.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(t){if(!t.relatedTarget||this.list.current&&t.relatedTarget instanceof HTMLElement&&!this.list.current.contains(t.relatedTarget)){const{onBlur:n}=this.props;n==null||n(t)}}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:i}=this.props,o=t-s;if(o>=0&&o<n.length){const r=n[o],{value:l}=r;i(t,l)}else i(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,o=Math.floor(s/n),r=Math.ceil(i/n);(this.topRow!==o||this.bottomRow!==r)&&(this.topRow=o,this.bottomRow=r,t(o,r))}getElement(t){return this.list.current==null?null:this.list.current.querySelectorAll(".value-list-item")[t]}scrollIntoView(t){const n=this.getElement(t);n==null||n.scrollIntoView({block:"center"})}render(){const{className:t,disabled:n,isInvalid:s,items:i,itemCount:o,offset:r,rowHeight:l,"data-testid":a}=this.props,c=this.getCachedItems(i,l,r,n);return u("div",{className:$("select-value-list-scroll-pane h-100 w-100",{"is-invalid":s},t),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":a,children:u("div",{className:"select-value-list",style:{height:o*l},children:u("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*l,top:r*l,left:0},children:c})})})}}ra.defaultProps={disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0};const Gr=ne.module("Shortcut");var ie=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(ie||{}),ae=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(ae||{});const gh=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),$e=class extends Wo{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:i,tooltip:o}){super(),this.id=e,this.name=i,this.tooltip=o,this.isEditable=s;const l=$e.isMacPlatform?n:t;this.defaultKeyState=$e.createKeyState(l),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(ae).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!$e.isMacPlatform&&e.metaKey||!$e.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||gh.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!$e.isAllowedKey(t)&&$e.isAllowedKey(String.fromCharCode(n))?s=String.fromCharCode(n):s=t,{keyValue:s,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":$e.isMacPlatform?$e.getMacDisplayText(e):$e.getWindowsDisplayText(e)}getDisplayText(){return $e.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){$e.isValidKeyState(e)?(Gr.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new ye("onUpdate",{detail:this}))):Gr.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return $e.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState($e.NULL_KEY_STATE)}isNull(){return $e.doKeyStatesMatch(this.keyState,$e.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return $e.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState($e.getKeyStateFromEvent(e))}};let nr=$e;nr.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};nr.isMacPlatform=Se.isMacPlatform();const qr=ne.module("ShortcutRegistry");class fh extends Wo{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new nr(t);return this.add(n)}add(t){var i;const n=this.shortcutMap.get(t.id);if(n)return qr.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;qr.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:o})=>this.dispatchEvent(new ye("onUpdate",{detail:o})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const Me=Object.freeze(new fh),sr={COPY:Me.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[ie.CTRL,ae.C],macShortcut:[ie.CMD,ae.C],isEditable:!1}),PASTE:Me.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[ie.CTRL,ae.V],macShortcut:[ie.CMD,ae.V],isEditable:!1}),SAVE:Me.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[ie.CTRL,ae.S],macShortcut:[ie.CMD,ae.S],isEditable:!1}),SELECT_ALL:Me.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[ie.CTRL,ae.A],macShortcut:[ie.CMD,ae.A],isEditable:!1}),LINKER:Me.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[ie.CTRL,ae.L],macShortcut:[ie.CMD,ae.L]}),LINKER_CLOSE:Me.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[ae.ESCAPE],macShortcut:[ae.ESCAPE],isEditable:!1})};const la=Y.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,isLinked:o,isLinkedSource:r,isInvalid:l,onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,"data-testid":m}=e;return T("button",{ref:t,type:"button",className:$("btn-socketed",{"btn-socketed-linked":o||r},{"btn-socketed-linked-source":r},{"is-invalid":l},s),onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,disabled:i,"data-testid":m,children:[n,u(q,{icon:kl,className:"linked btn-socketed-icon",transform:"down-1"}),u(q,{icon:Sd,className:"is-invalid btn-socketed-icon"})]})});la.displayName="SocketedButton";la.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Ch="_track_xvu02_28",bh="_handle_xvu02_11",wh="_ticks_xvu02_96",aa={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Ch,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:bh,ticks:wh,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(aa["handle-size"],10);parseInt(aa["popover-width"],10);Object.freeze({ERROR:"error"});var cs=(e=>(e.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS="filter-control-change-clears-all-filters",e.LINK_CHANGE_CLEARS_ALL_FILTERS="link-change-clears-all-filters",e))(cs||{});Object.freeze([[cs.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS,!1],[cs.LINK_CHANGE_CLEARS_ALL_FILTERS,!1]]);var we=(e=>(e.COUNT="Count",e.MIN="Min",e.MAX="Max",e.SUM="Sum",e.ABS_SUM="AbsSum",e.VAR="Var",e.AVG="Avg",e.STD="Std",e.FIRST="First",e.LAST="Last",e.SKIP="Skip",e.COUNT_DISTINCT="CountDistinct",e.DISTINCT="Distinct",e.UNIQUE="Unique",e))(we||{});class ke{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}ke.TYPE_GLOBAL="type-global";ke.TYPE_CONTEXT_PRESET="type-context-preset";ke.TYPE_CONTEXT_CUSTOM="type-context-custom";class Sh extends ke{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class vh extends ke{format(t){return String.fromCharCode(t)}}const{dh:E}=globalThis,ji=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),ca=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),Th=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:ji.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Eh=M.exports.shape({columns:M.exports.arrayOf(ji).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(ca),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),yh=M.exports.shape({columns:M.exports.arrayOf(ji),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),xi=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),Rh=M.exports.shape({created:M.exports.arrayOf(xi).isRequired,updated:M.exports.arrayOf(xi).isRequired,removed:M.exports.arrayOf(xi).isRequired}),Ih=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),Dh=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:ji,FilterCondition:ca,IdeSession:Dh,RollupConfig:Ih,Sort:Th,Table:Eh,TreeTable:yh,VariableChanges:Rh,VariableDefinition:xi});const Kr=ne.module("DateTimeColumnFormatter"),jn=class extends ke{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=jn.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const i=e||jn.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=E.i18n.TimeZone.getTimeZone(i)}catch{Kr.error("Unsupported time zone id",i),this.dhTimeZone=E.i18n.TimeZone.getTimeZone(jn.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=jn.makeFormatStringMap(t,n)}static isValid(e){try{return E.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getGlobalFormats(e,t){return[...jn.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${s}`],["MM-dd-yyyy",`MM-dd-yyyy${s}`],["HH:mm:ss",`HH:mm:ss${s}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${s}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${s}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getFormats(e,t){return[...jn.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)||e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return E.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{Kr.error("Invalid format arguments")}return""}};let An=jn;An.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";An.DEFAULT_TIME_ZONE_ID="America/New_York";const Mh=ne.module("DecimalColumnFormatter"),Yt=class extends ke{constructor({defaultFormatString:e=Yt.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return E.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Yt.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Yt.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return E.i18n.NumberFormat.format(n,s)}catch{Mh.error("Invalid format arguments")}return""}};let We=Yt;We.DEFAULT_FORMAT_STRING="###,##0.0000";We.FORMAT_PERCENT=Yt.makePresetFormat("Percent","##0.00%");We.FORMAT_BASIS_POINTS=Yt.makePresetFormat("Basis Points","###,##0 bp",1e4);We.FORMAT_MILLIONS=Yt.makePresetFormat("Millions","###,##0.000 mm",1e-6);We.FORMAT_ROUND=Yt.makePresetFormat("Round","###,##0");We.FORMAT_ROUND_TWO_DECIMALS=Yt.makePresetFormat("0.00","###,##0.00");We.FORMAT_ROUND_FOUR_DECIMALS=Yt.makePresetFormat("0.0000","###,##0.0000");class Nh extends ke{format(t){return`${t}`}}const Fh=ne.module("IntegerColumnFormatter"),qs=class extends ke{constructor({defaultFormatString:e=qs.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return E.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return qs.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return qs.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return E.i18n.NumberFormat.format(n,s)}catch{Fh.error("Invalid format arguments")}return""}};let un=qs;un.DEFAULT_FORMAT_STRING="###,##0";un.FORMAT_MILLIONS=qs.makePresetFormat("Millions","###,##0.000 mm",1e-6);class xh extends ke{format(t){return t}}const at=class{static makeDateWrapper(e,t,n=0,s=1,i=0,o=0,r=0,l=0){if(!e)throw new Error("No timezone provided");const a=`${t}`.padStart(4,"0"),c=`${n+1}`.padStart(2,"0"),d=`${s}`.padStart(2,"0"),h=`${i}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),p=`${r}`.padStart(2,"0"),g=`${l}`.padStart(9,"0"),f=`${a}-${c}-${d} ${h}:${m}:${p}.${g}`;return E.i18n.DateTimeFormat.parse(at.FULL_DATE_FORMAT,f,E.i18n.TimeZone.getTimeZone(e))}static getNextNanos(e){const t=parseInt(e,10),n="0".repeat(9-e.length),s=`${t+1}${n}`;return parseInt(s,10)}static getNextDate(e,t,n){let{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;c=at.getNextNanos(e.nanos),c>999999999&&(a+=1,c=0)}else e.seconds!=null?a+=1:e.minutes!=null?l+=1:e.hours!=null?r+=1:e.date!=null?o+=1:e.month!=null?i+=1:s+=1;const d=new Date(s,i,o,r,l,a);return at.makeDateWrapper(n,d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),c)}static parseMonth(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;const n=e.trim().toLowerCase();if(n.length>=3){for(let s=0;s<at.months.length;s+=1)if(at.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,i,o,r){const l=parseInt(e,10),a=t!=null?this.parseMonth(t):0,c=n!=null?parseInt(n,10):1,d=s!=null?parseInt(s,10):0,h=i!=null?parseInt(i,10):0,m=o!=null?parseInt(o,10):0,p=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(a)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:a,date:c,hours:d,minutes:h,seconds:m,nanos:p}}static parseDateTimeString(e){const n=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(e);if(n==null)throw new Error(`Unexpected date string: ${e}`);const[,s,,i,,o,,r,,l,,a,,c,d]=n;if(d!=null&&d.length>0)throw new Error(`Unexpected characters after date string '${e}': ${d}`);return{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}}static parseDateRange(e,t){const n=e.trim().toLowerCase();if(n.length===0)throw new Error("Cannot parse date range from empty string");if(n==="null")return[null,null];if(n==="today"){const l=new Date(Date.now()),a=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()),c=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()+1);return[a,c]}if(n==="yesterday"){const l=new Date(Date.now()),a=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()-1),c=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate());return[a,c]}if(n==="now"){const l=new Date(Date.now());return[E.DateWrapper.ofJsDate(l),null]}const s=at.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const i=at.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(i==null)throw new Error(`Unable to extract date values from ${s}`);const o=at.makeDateWrapper(t,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),r=at.getNextDate(s,i,t);return[o,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let kn=at;kn.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";kn.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class Kt{}Kt.not="not";Kt.and="and";Kt.or="or";function Oh(e){if(!(e==="not"||e==="and"||e==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class z{}z.eq="eq";z.eqIgnoreCase="eqIgnoreCase";z.notEq="notEq";z.notEqIgnoreCase="notEqIgnoreCase";z.greaterThan="greaterThan";z.greaterThanOrEqualTo="greaterThanOrEqualTo";z.lessThan="lessThan";z.lessThanOrEqualTo="lessThanOrEqualTo";z.in="in";z.inIgnoreCase="inIgnoreCase";z.notIn="notIn";z.notInIgnoreCase="notInIgnoreCase";z.isTrue="isTrue";z.isFalse="isFalse";z.isNull="isNull";z.invoke="invoke";z.contains="contains";z.notContains="notContains";z.startsWith="startsWith";z.endsWith="endsWith";z.containsAny="containsAny";function Ah(e){switch(e){case z.eq:return"is exactly";case z.eqIgnoreCase:return"is exactly (ignore case)";case z.notEq:return"is not exactly";case z.notEqIgnoreCase:return"is not exactly (ignore case)";case z.contains:return"contains";case z.notContains:return"does not contain";case z.startsWith:return"starts with";case z.endsWith:return"ends with";default:throw new Error(`Unrecognized text filter type ${e}`)}}function kh(e){switch(e){case z.eq:return"is equal to";case z.notEq:return"is not equal to";case z.greaterThan:return"greater than";case z.greaterThanOrEqualTo:return"greater than or equal to";case z.lessThan:return"less than";case z.lessThanOrEqualTo:return"less than or equal to";default:throw new Error(`Unrecognized number filter type ${e}`)}}function Lh(e){switch(e){case z.eq:return"date is";case z.notEq:return"date is not";case z.notEqIgnoreCase:case z.greaterThan:return"date is after";case z.greaterThanOrEqualTo:return"date is after or equal";case z.lessThan:return"date is before";case z.lessThanOrEqualTo:return"date is before or equal";default:throw new Error(`Unrecognized date filter type ${e}`)}}function Ph(e){switch(e){case z.isTrue:return"Is True";case z.isFalse:return"Is False";case z.isNull:return"Is Null";default:throw new Error(`Unrecognized boolean filter type ${e}`)}}const on=ne.module("TableUtils"),X=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=X.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return X.isBooleanType(e)?[z.isTrue,z.isFalse,z.isNull]:X.isCharType(e)||X.isNumberType(e)||X.isDateType(e)?[z.eq,z.notEq,z.greaterThan,z.greaterThanOrEqualTo,z.lessThan,z.lessThanOrEqualTo]:X.isTextType(e)?[z.eq,z.eqIgnoreCase,z.notEq,z.notEqIgnoreCase,z.contains,z.notContains,z.startsWith,z.endsWith]:[]}static getNextSort(e,t,n){if(!e||n<0||n>=e.length)return null;const s=X.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===X.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(!e||t<0||t>=e.length||n===X.sortDirection.none)return null;let i=e[t].sort();switch(n){case X.sortDirection.ascending:i=i.asc();break;case X.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const i=X.getNextSort(t,e,n);return X.setSortForColumn(e,n,i,s)}static sortColumn(e,t,n,s,i,o){if(!e||n<0||n>=t.length)return[];const r=X.makeColumnSort(t,n,s,i);return X.setSortForColumn(e,n,r,o)}static setSortForColumn(e,t,n,s=!1){const i=X.getSortIndex(e,t);let o=[];return s&&(o=o.concat(e.filter(({direction:r})=>r!==X.sortDirection.reverse)),i!==null&&o.splice(i,1)),n!==null&&o.push(n),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case X.dataType.BOOLEAN:return X.dataType.BOOLEAN;case"char":case"java.lang.Character":case X.dataType.CHAR:return X.dataType.CHAR;case"java.lang.String":case X.dataType.STRING:return X.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case X.dataType.DATETIME:return X.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case X.dataType.DECIMAL:return X.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case X.dataType.INT:return X.dataType.INT;default:return X.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return X.isIntegerType(e)||X.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return X.getNormalizedType(e)===X.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let i=null;for(let o=0;o<s.length;o+=1){const l=s[o].split("&&");let a=null;for(let c=0;c<l.length;c+=1){const d=l[c].trim();if(d.length>0){const h=X.makeQuickFilterFromComponent(e,d,n);if(h)a?a=a.and(h):a=h;else throw new Error(`Unable to parse quick filter from text ${t}`)}}i&&a?i=i.or(a):i=a}return i}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return X.isNumberType(s)?this.makeQuickNumberFilter(e,t):X.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n&&X.isDateType(s)?this.makeQuickDateFilter(e,t,n):X.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,l=null,a=null,c=null,d=null;if(o!==null&&o.length>3&&([,r,l,a,c,d]=o),d!=null&&d.trim().length>0)return null;if(r==null&&(r="="),c!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":s=n.isNull();break;case"nan":s=E.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":l!=null?s=E.FilterCondition.invoke("isInf",n).and(n.lessThan(E.FilterValue.ofNumber(0))):s=E.FilterCondition.invoke("isInf",n).and(n.greaterThan(E.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(a==null)return null;if(a=X.removeCommas(a),X.isLongType(e.type))try{a=E.FilterValue.ofNumber(E.LongWrapper.ofString(`${l!=null?"-":""}${a}`))}catch(h){return on.warn("Unable to create long filter",h),null}else{if(a=parseFloat(a),a==null||Number.isNaN(a))return null;a=E.FilterValue.ofNumber(l!=null?0-a:a)}return s=e.filter(),X.makeRangeFilterWithOperation(s,r,a)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(n);let o=null,r=null;if(i!==null&&i.length>2&&([,o,r]=i,r!=null&&(r=r.trim())),r==null||r.length===0)return null;o==null&&(o="=");const l=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}let a=null,c=null;switch(r.startsWith("*")?(a="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(c="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),o){case"~":return l.isNull().not().and(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return a==="*"?l.isNull().or(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):c==="*"?l.isNull().or(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):l.notEqIgnoreCase(E.FilterValue.ofString(r.toLowerCase()));case"=":return a==="*"?l.isNull().not().and(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):c==="*"?l.isNull().not().and(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):l.eqIgnoreCase(E.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,i,o]=s,r=i==="!"||i==="!=",l=o.trim().toLowerCase();let a=e.filter();try{const c=X.makeBooleanValue(l);return c?a=a.isTrue():c===null?a=a.isNull():a=a.isFalse(),r?a.not():a}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(o==null||o.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,l=null;[,r,l]=o;let a=z.eq;switch(r){case"<":a=z.lessThan;break;case"<=":case"=<":a=z.lessThanOrEqualTo;break;case">":a=z.greaterThan;break;case">=":case"=>":a=z.greaterThanOrEqualTo;break;case"!=":case"!":a=z.notEq;break;case"=":case"==":default:a=z.eq;break}return X.makeQuickDateFilterWithOperation(e,l,a,n)}static makeQuickDateFilterWithOperation(e,t,n=z.eq,s){if(e==null)throw new Error("Column is null");const[i,o]=kn.parseDateRange(t,s),r=i!=null?E.FilterValue.ofNumber(i):null,l=o!=null?E.FilterValue.ofNumber(o):null,a=e.filter();if(r==null)return n===z.notEq?a.isNull().not():a.isNull();switch(n){case z.eq:{if(l!=null){const c=a.greaterThanOrEqualTo(r),d=a.lessThan(l);return c.and(d)}return a.eq(r)}case z.lessThan:return a.lessThan(r);case z.lessThanOrEqualTo:return l!=null?a.lessThan(l):a.lessThanOrEqualTo(r);case z.greaterThan:return l!=null?a.greaterThanOrEqualTo(l):a.greaterThan(r);case z.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(r);case z.notEq:{if(l!=null){const c=a.lessThan(r),d=a.greaterThanOrEqualTo(l);return c.or(d)}return a.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:`"${e}"`}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(n);let o=null,r=null,l=null;if(i!==null&&i.length>3&&([,o,r,l]=i),l!=null&&l.trim().length>0||r==null||r.length===0)return null;o==null&&(o="=");const a=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}const c=E.FilterValue.ofString(X.isRangeOperation(o)?X.quoteValue(r):r);return X.makeRangeFilterWithOperation(a,o,c)}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return He.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t,n=0,s=null){let i,o,r=!0;const l=new Promise((a,c)=>{o=setTimeout(()=>{i(),r=!1,c(new Wl(`Event "${t}" timed out.`))},n),i=e.addEventListener(t,d=>{if(s!=null&&!s(d)){on.debug2("Event triggered, but matcher returned false.");return}on.debug2("Event triggered, resolving."),i(),clearTimeout(o),r=!1,a(d)})});return l.cancel=()=>{if(r){on.debug2("Pending promise cleanup."),i(),clearTimeout(o),r=!1;return}on.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:i,invertSelection:o,selectedValues:r}=t;let l=null;for(let c=0;c<s.length;c+=1){const d=s[c],{selectedType:h,value:m}=d;if(h!=null&&h.length>0&&m!=null&&m.length>0)try{const p=X.makeAdvancedValueFilter(e,h,m,n);if(p!=null){if(c===0)l=p;else if(l!==null&&c-1<i.length){const g=i[c-1];if(g===Kt.and)l=l.and(p);else if(g===Kt.or)l=l.or(p);else{on.error("Unexpected filter operator",g,p),l=null;break}}}else on.debug2("Empty filter ignored for",h,m)}catch(p){on.error("Unable to create filter",p),l=null;break}}const a=X.makeSelectValueFilter(e,r,o);return a!=null&&(l!=null?l=l.and(a):l=a),l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=X.getBaseType(e);return X.isTextType(n)?E.FilterValue.ofString(t):X.isLongType(n)?E.FilterValue.ofNumber(E.LongWrapper.ofString(X.removeCommas(t))):E.FilterValue.ofNumber(X.removeCommas(t))}static makeFilterRawValue(e,t){return X.isTextType(e)?E.FilterValue.ofString(t):X.isBooleanType(e)?E.FilterValue.ofBoolean(t):E.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(X.isTextType(e))return t;if(X.isLongType(e))return E.LongWrapper.ofString(X.removeCommas(t));if(X.isBooleanType(e))return X.makeBooleanValue(t,!0);if(X.isDateType(e)){const[s]=kn.parseDateRange(t,n);return s}return X.isNumberType(e)?X.makeNumberValue(t):(on.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error(`Invalid boolean '${e}'`)}}static makeNumberValue(e){if(e==null||e==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=X.removeCommas(t);if(X.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static getFilterOperatorString(e){switch(e){case z.eq:return"=";case z.notEq:return"!=";case z.greaterThan:return">";case z.greaterThanOrEqualTo:return">=";case z.lessThan:return"<";case z.lessThanOrEqualTo:return"<=";case z.contains:return"~";case z.notContains:return"!~";default:throw new Error(`Unexpected filter type ${e}`)}}static makeAdvancedValueFilter(e,t,n,s){if(X.isDateType(e.type))return X.makeQuickDateFilterWithOperation(e,n,t,s);if(X.isNumberType(e.type)||X.isCharType(e.type))return X.makeQuickFilter(e,`${X.getFilterOperatorString(t)}${n}`);const i=X.makeFilterValue(e.type,n),o=e.filter();switch(t){case z.eq:return o.eq(i);case z.eqIgnoreCase:return o.eqIgnoreCase(i);case z.notEq:return o.notEq(i);case z.notEqIgnoreCase:return o.notEqIgnoreCase(i);case z.greaterThan:return o.greaterThan(i);case z.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(i);case z.lessThan:return o.lessThan(i);case z.lessThanOrEqualTo:return o.lessThanOrEqualTo(i);case z.isTrue:return o.isTrue();case z.isFalse:return o.isFalse();case z.isNull:return o.isNull();case z.contains:return o.isNull().not().and(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case z.notContains:return o.isNull().or(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case z.startsWith:return o.isNull().not().and(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case z.endsWith:return o.isNull().not().and(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case z.in:case z.inIgnoreCase:case z.notIn:case z.notInIgnoreCase:case z.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let o=null;X.isTextType(e.type)?o=E.FilterValue.ofString("a"):X.isBooleanType(e.type)?o=E.FilterValue.ofBoolean(!0):X.isDateType(e.type)?o=E.FilterValue.ofNumber(E.DateWrapper.ofJsDate(new Date)):o=E.FilterValue.ofNumber(0);const r=e.filter().eq(o),l=e.filter().notEq(o);return r.and(l)}const s=[];let i=!1;for(let o=0;o<t.length;o+=1){const r=t[o];r==null?i=!0:X.isTextType(e.type)?s.push(E.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):X.isBooleanType(e.type)?s.push(E.FilterValue.ofBoolean(!!r)):s.push(E.FilterValue.ofNumber(r))}return i?s.length>0?n?e.filter().isNull().not().and(e.filter().notIn(s)):e.filter().isNull().or(e.filter().in(s)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(s):e.filter().in(s)}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e,t=!0){return[...e].sort((n,s)=>{const i=n.name.toUpperCase(),o=s.name.toUpperCase();return jo.sort(i,o,t)})}};let x=X;x.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};x.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};x.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});x.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class Qt{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const i=x.getNormalizedType(s.columnType);if(i===null)return n;n.has(i)||n.set(i,new Map);const o=n.get(i);return o==null||o.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,i,o=!1){this.defaultColumnFormatter=new Nh,this.typeFormatterMap=new Map([[x.dataType.BOOLEAN,new Sh],[x.dataType.CHAR,new vh],[x.dataType.DATETIME,new An(n)],[x.dataType.DECIMAL,new We(s)],[x.dataType.INT,new un(i)],[x.dataType.STRING,new xh]]),this.columnFormatMap=Qt.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(t,n=!1){const s=x.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var i;const s=this.getColumnFormatMapForType(t);return(i=s==null?void 0:s.get(n))!=null?i:null}getColumnTypeFormatter(t){var i;const n=x.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(i=this.typeFormatterMap.get(n))!=null?i:s),s}getFormattedString(t,n,s="",i){if(t==null)return"";const o=this.getColumnTypeFormatter(n),r=i||this.getColumnFormat(n,s);return o.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(x.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}function Hh(e){if(e&&e.formatter){const{formatter:t}=e;return t}}function _h(e){return{timeZone:e==null?void 0:e.timeZone,defaultDateTimeFormatString:e==null?void 0:e.defaultDateTimeFormat,showTimeZone:e==null?void 0:e.showTimeZone,showTSeparator:e==null?void 0:e.showTSeparator}}function Vh(e,t,n){const s=e.getColumnFormat(n,t);return s!=null&&(s.type===ke.TYPE_CONTEXT_PRESET||s.type===ke.TYPE_CONTEXT_CUSTOM)}const rs={getColumnFormats:Hh,getDateTimeFormatterOptions:_h,isCustomColumnFormatDefined:Vh},Uh=e=>{switch(e){default:return!1}},Bh=(e,t)=>{switch(e){case we.COUNT:case we.FIRST:case we.LAST:case we.COUNT_DISTINCT:case we.DISTINCT:case we.UNIQUE:return!0;case we.MIN:case we.MAX:return x.isNumberType(t)||x.isDateType(t)||x.isTextType(t);case we.SUM:case we.ABS_SUM:case we.VAR:case we.AVG:case we.STD:return x.isNumberType(t);case we.SKIP:return!1}},ir=(e,t)=>e.filter(n=>Bh(t,n.type)),Wh=(e,t,n,s)=>ir(e,t).map(({name:i})=>i).filter(i=>n.includes(i)?!s:s),Fn={isRollupOperation:Uh,filterValidColumns:ir,getOperationColumnNames:Wh};const Xr=ne.module("Aggregations"),zh=[we.SUM,we.ABS_SUM,we.MIN,we.MAX,we.VAR,we.AVG,we.STD,we.FIRST,we.LAST,we.COUNT_DISTINCT,we.DISTINCT,we.COUNT,we.UNIQUE],$h=({isRollup:e,settings:t,onChange:n,onEdit:s})=>{const{aggregations:i,showOnTop:o}=t,r=y.exports.useMemo(()=>zh.filter(L=>!i.some(W=>W.operation===L)),[i]),[l,a]=y.exports.useState(r[0]),[c,d]=y.exports.useState([]),h=y.exports.useCallback(L=>{n({...t,...L})},[n,t]),m=y.exports.useCallback(L=>{h({aggregations:L})},[h]),p=y.exports.useCallback(L=>{h({showOnTop:L})},[h]),g=y.exports.useCallback(()=>{Xr.debug("handleDragStart"),dt.startDragging()},[]),f=y.exports.useCallback(({destination:L,source:W})=>{if(Xr.debug("handleDragEnd",L,W),dt.stopDragging(),L===null)return;let B=L.index;W.index<L.index&&(B+=1);const N=[...i],_=dt.reorder(N,c,N,B),k=dt.adjustDestinationIndex(B,c),P=[[k,k+_.length-1]];m(N),d(P)},[m,i,c,d]),b=y.exports.useCallback(L=>{a(L)},[a]),C=y.exports.useCallback(()=>{m([...i,{operation:l,selected:[],invert:!0}])},[i,l,m]),w=y.exports.useCallback(L=>{m(i.filter((W,B)=>B!==L))},[i,m]),S=y.exports.useCallback(L=>{d(L)},[d]),I=y.exports.useCallback(L=>{const W=i[L];Fn.isRollupOperation(W.operation)||s(W)},[i,s]),v=y.exports.useCallback(L=>{p(L.target.value==="true")},[p]);y.exports.useEffect(function(){r.length>0&&!r.includes(l)&&a(r[0])},[r,l]);const R=y.exports.useCallback(({item:L,itemIndex:W,isClone:B,selectedCount:N})=>{const _=L.operation,k=B?`${N}`:void 0,P=B?"item-list-item-clone":void 0,H=Fn.isRollupOperation(L.operation),V=!B&&!H;return T(Fe,{children:[T("div",{className:$("item-list-item-content","draggable-item-list-item-content",P),children:[T("span",{className:"title",children:[_,!e&&H&&T("span",{className:"small text-warning",children:[u(q,{icon:Ul})," Requires rollup"]})]}),Ct.renderBadge({text:k}),Ct.renderHandle()]}),!B&&T(Fe,{children:[u(De,{kind:"ghost",className:"btn-edit",icon:Ol,tooltip:"Edit Columns",onClick:()=>s(L),disabled:!V}),u(De,{kind:"ghost",className:"btn-delete",icon:Ln,tooltip:"Delete Aggregation",onClick:()=>w(W)})]})]})},[w,s,e]),D=r.length>0,F=i.length>0;return T("div",{className:"aggregations",children:[D&&T("div",{className:"form-inline",children:[u(ph,{onChange:b,value:l,children:r.map(L=>u(mh,{value:L,children:L},L))}),T("button",{type:"button",className:"btn btn-link btn-add",onClick:C,children:[u(q,{icon:Ds}),"Add Aggregation"]})]}),D&&F&&u("hr",{}),F&&T(Fe,{children:[!e&&T("div",{className:"form-inline",children:[u("label",{children:"Placement:\xA0"}),T(tr,{onChange:v,value:`${o}`,children:[u(gn,{value:"true",children:"Top"}),u(gn,{value:"false",children:"Bottom"})]})]}),u(Qs,{onDragStart:g,onDragEnd:f,children:u(Ct,{className:"selected-aggregations",itemCount:i.length,items:i,renderItem:R,offset:0,onSelectionChange:S,onSelect:I,selectedRanges:c,isMultiSelect:!0})})]})]})};const Gh=30,qh=({aggregation:e,columns:t,onChange:n})=>{const[s,i]=y.exports.useState(-1),[o,r]=y.exports.useState(-1),[l,a]=y.exports.useState(0),{invert:c,selected:d}=e,h=y.exports.useRef(null),m=y.exports.useCallback(v=>d.includes(v)?!c:c,[c,d]),p=y.exports.useMemo(()=>{let v=ir(t,e.operation);return l!==0&&(v=x.sortColumns(v,l===1)),v},[t,e.operation,l]),g=y.exports.useMemo(()=>s>=0?p.slice(s,o+1).map(v=>({value:v.name,displayValue:v.name,isSelected:m(v.name)})):[],[p,m,o,s]),f=y.exports.useCallback(v=>{const{name:R}=p[v],D=d.indexOf(R);let F=[...d],L=c;D>=0?F.splice(D,1):(F.push(R),F.length===p.length&&(F=[],L=!c)),n({...e,selected:F,invert:L})},[e,c,p,d,n]),b=y.exports.useCallback(()=>{a(0),n({...e,selected:[],invert:!0})},[e,n]),C=y.exports.useCallback((v,R)=>{i(v),r(R)},[i,r]),w=y.exports.useCallback(()=>{d.length===0?n({...e,invert:!c}):n({...e,selected:[],invert:!0})},[e,c,n,d]),S=d.length===0?c:null,I=d.length!==0||!c||l!==0;return T("div",{role:"menu",className:"aggregation-edit",children:[u("div",{className:"top-menu",children:T("div",{className:"form-inline",children:[u(It,{checked:S,onChange:w,children:"Toggle All"}),u("div",{className:"spacer"}),u(ot,{in:I,timeout:Rt.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u(De,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),u(De,{kind:"ghost",className:$({active:l===1}),icon:Ko,tooltip:"Sort ascending",onClick:()=>a(1)}),u(De,{kind:"ghost",className:$({active:l===2}),icon:Xo,tooltip:"Sort descending",onClick:()=>a(2)})]})}),u("div",{className:"aggregation-edit-item-list",children:u(Zt,{itemCount:p.length,items:g,offset:s,renderItem:({item:v})=>u(It,{checked:m(v.value),children:v.displayValue}),onSelect:f,onViewportChange:C,rowHeight:Gh,focusSelector:"input",ref:h})})]})};function Kh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})})}function Xh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})})}function Yh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),u("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),u("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})})}function Qh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),u("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})})}function jh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),u("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})})}function Zh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),u("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]})}function Jh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),u("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),u("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]})}const Yr=ne.module("ChartBuilder"),Ge=class extends y.exports.PureComponent{static getTypeName(e){switch(e){case E.plot.SeriesPlotStyle.LINE:return"Line";case E.plot.SeriesPlotStyle.BAR:return"Bar";case E.plot.SeriesPlotStyle.SCATTER:return"Scatter";case E.plot.SeriesPlotStyle.PIE:return"Pie";case E.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}static getTypeIcon(e){switch(e){case E.plot.SeriesPlotStyle.LINE:return u(Yh,{});case E.plot.SeriesPlotStyle.BAR:return u(Kh,{});case E.plot.SeriesPlotStyle.SCATTER:return u(jh,{});case E.plot.SeriesPlotStyle.PIE:return u(Qh,{});case E.plot.SeriesPlotStyle.HISTOGRAM:return u(Xh,{});default:return null}}static getMaxSeriesCount(e){switch(e){case E.plot.SeriesPlotStyle.PIE:return 1;case E.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static getXAxisLabel(e){switch(e){case E.plot.SeriesPlotStyle.PIE:return"Labels";case E.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}static getSeriesLabel(e){switch(e){case E.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}static makeSeriesItem(e){return{id:jt.generate(),value:e}}static makeDefaultSeriesItems(e,t){if(Ge.getMaxSeriesCount(e)===0||t==null||t.length===0)return[];const s=t.length>1?t[1].name:t[0].name;return[Ge.makeSeriesItem(s)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),this.handleAddSeries=this.handleAddSeries.bind(this),this.handleLinkStateChange=this.handleLinkStateChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSeriesChange=this.handleSeriesChange.bind(this),this.handleSeriesDeleteClick=this.handleSeriesDeleteClick.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleTypeClick=this.handleTypeClick.bind(this),this.handleXAxisChange=this.handleXAxisChange.bind(this),this.sendChange=this.sendChange.bind(this);const{model:t}=e,{columns:n}=t,s=Ge.types[0],i=Ge.getDefaultXAxis(s,n),o=Ge.makeDefaultSeriesItems(s,n);this.state={type:s,seriesItems:o,xAxis:i,isLinked:!0}}handleAddSeries(){this.setState(e=>{let{seriesItems:t}=e;t=[...t];const{model:n}=this.props,{columns:s}=n;return t.push({id:jt.generate(),value:s[0].name}),{seriesItems:t}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){const{model:e}=this.props,{columns:t}=e,n=Ge.types[0],s=Ge.getDefaultXAxis(n,t),i=Ge.makeDefaultSeriesItems(n,t),o=!0;this.setState({type:n,seriesItems:i,xAxis:s,isLinked:o},this.sendChange)}handleSeriesChange(e){const{value:t}=e.target,n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o[s].value=t,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o.splice(s,1),{seriesItems:o}},this.sendChange)}handleSubmit(e){e.preventDefault();const{onSubmit:t}=this.props,{type:n,seriesItems:s,xAxis:i,isLinked:o}=this.state,r=s.map(l=>l.value);t({type:`${n}`,series:r,xAxis:i,isLinked:o})}handleTypeClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10),i=Ge.types[s];Yr.debug2("handleTypeSelect",i),this.setState(o=>{const r=Ge.getMaxSeriesCount(i);let{seriesItems:l}=o;if(l=l.slice(0,r),l.length===0&&r>0){const{model:a}=this.props,{columns:c}=a;l=Ge.makeDefaultSeriesItems(i,c)}return{type:i,seriesItems:l}},this.sendChange)}handleXAxisChange(e){const t=e.target.value;Yr.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){const{onChange:e}=this.props,{isLinked:t,type:n,seriesItems:s,xAxis:i}=this.state,o=s.map(r=>r.value);e({type:n,series:o,xAxis:i,isLinked:t})}render(){const{model:e}=this.props,{columns:t}=e,{seriesItems:n,type:s,xAxis:i,isLinked:o}=this.state,r=Ge.getMaxSeriesCount(s),l=Ge.getXAxisLabel(s),a=Ge.getSeriesLabel(s),c=n.length>0,d=n.length<r;return u("div",{className:"chart-builder",children:T("form",{onSubmit:this.handleSubmit,children:[T("div",{className:"form-row",children:[u("label",{children:"Select Chart Type"}),u("div",{className:"form-row",children:Ge.types.map((h,m)=>{const p=h;return u("div",{className:"col col-chart-type",children:T("button",{type:"button",className:$("btn","btn-icon","btn-chart-type",{active:h===s}),"data-index":m,onClick:this.handleTypeClick,children:[Ge.getTypeIcon(h),Ge.getTypeName(h)]})},p)})})]}),u("hr",{}),T("div",{className:"form-row form-inline",children:[u("label",{className:"col-2 label-left",children:l}),u("select",{className:"form-control custom-select select-x-axis col",value:i,onChange:this.handleXAxisChange,children:t.map(h=>u("option",{value:h.name,children:h.name},h.name))})]}),c&&u("hr",{}),n.map((h,m)=>T("div",{className:"form-row form-inline form-series-item","data-testid":`form-series-item-${m}`,children:[u("label",{className:"col-2 label-left",children:m===0?a:""}),u("select",{className:"form-control custom-select select-series col",value:h.value,onChange:this.handleSeriesChange,"data-testid":`select-series-item-${m}`,"data-index":m,children:t.map(p=>u("option",{value:p.name,"data-index":m,children:p.name},p.name))}),n.length>1&&u("button",{type:"button",className:"btn btn-link btn-link-icon btn-delete-series ml-2 px-2","data-index":m,"data-testid":`delete-series-${m}`,onClick:this.handleSeriesDeleteClick,children:u(q,{icon:Ln})})]},h.id)),d&&T("div",{className:"form-row",children:[u("div",{className:"col-2"}),T("button",{type:"button",className:"btn btn-link btn-add-series mt-1",onClick:this.handleAddSeries,children:[u(q,{icon:Ds}),"Add Series"]})]}),T("div",{className:"form-row chart-builder-link",children:[u("label",{className:"col-2 label-right",children:T("div",{className:"fa-md fa-layers",children:[u(q,{mask:Qo,icon:Go,transform:"right-5 down-5"}),u(q,{icon:o?kl:kd,transform:"grow-2 right-8 down-6"})]})}),T(tr,{onChange:this.handleLinkStateChange,value:`${o}`,children:[u(gn,{value:"true",children:"Sync State"}),u(gn,{value:"false",children:"Freeze State"})]})]}),T("div",{className:"form-row",children:[u("div",{className:"col-2 label-right"}),u("div",{className:"col chart-builder-link-info",children:o?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),T("div",{className:$("form-row","justify-content-end","my-3"),children:[u("button",{type:"button",className:"btn btn-outline-primary btn-reset",onClick:this.handleReset,children:"Reset"}),u("button",{type:"submit",className:"btn btn-primary btn-submit",children:"Create"})]})]})})}};let da=Ge;da.types=[E.plot.SeriesPlotStyle.LINE,E.plot.SeriesPlotStyle.BAR,E.plot.SeriesPlotStyle.SCATTER,E.plot.SeriesPlotStyle.PIE];class ha extends y.exports.Component{constructor(t){super(t),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var i;const{value:t,editorSettings:n}=this.props,s={copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0,...n};if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=pn.create(this.editorContainer,s),this.editor.layout(),(i=this.editor.getModel())==null||i.updateOptions({tabSize:0}),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var t;(t=this.editor)==null||t.dispose(),this.editor=void 0}handleContentChanged(){var s,i;const{onContentChanged:t}=this.props,n=(i=(s=this.editor)==null?void 0:s.getModel())==null?void 0:i.getValue();n&&this.setState({isEditorEmpty:n.length===0}),t(n)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var n,s;const t=(s=(n=this.editor)==null?void 0:n.getModel())==null?void 0:s.getValue();if(!t)throw new Error("value is undefined");this.setState({isEditorEmpty:t.length===0,isEditorFocused:!1})}handleContainerClick(){var n;const{isEditorFocused:t}=this.state;t||(n=this.editor)==null||n.focus()}handleKeyDown(t){const{onTab:n,editorIndex:s}=this.props;t.key==="Tab"&&n(s,t.shiftKey)}render(){const{value:t,invalid:n}=this.props,{isEditorFocused:s,isEditorEmpty:i}=this.state;return T("div",{className:$("input-editor-wrapper",{focused:s,invalid:n}),onKeyDown:this.handleKeyDown,role:"presentation",onClick:this.handleContainerClick,children:[u("div",{className:"editor-container",ref:o=>{this.editorContainer=o}}),i&&!t&&u("div",{className:"editor-placeholder text-muted",children:"Column Formula"})]})}}ha.defaultProps={value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1};const Po=class extends y.exports.PureComponent{constructor(e){super(e),this.handleFormulaEditorContentChanged=this.handleFormulaEditorContentChanged.bind(this)}handleFormulaEditorContentChanged(e){const{onChange:t,eventKey:n}=this.props;e&&(e.replace(/(\r\n|\n|\r)/gm,""),t(n,Po.INPUT_TYPE.FORMULA,e))}render(){const{eventKey:e,name:t,formula:n,onChange:s,onDeleteColumn:i,inputIndex:o,onTabInEditor:r,invalid:l}=this.props;return u(zi,{draggableId:e,index:o,disableInteractiveElementBlocking:!0,children:(a,c)=>T("div",{className:$("draggable-container",{dragging:c.isDragging}),ref:a.innerRef,...a.draggableProps,children:[T("div",{className:"custom-column-input-container",children:[T("div",{className:"d-flex flex-row pb-3 custom-column-name",children:[u("input",{className:$("form-control custom-column-input",{"is-invalid":l}),placeholder:"Column Name",value:t,onChange:d=>{s(e,Po.INPUT_TYPE.NAME,d.target.value)}}),T("button",{type:"button",className:"btn btn-link btn-link-icon ml-1 px-2",onClick:()=>{i(e)},children:[u(me,{children:"Delete custom column"}),u(q,{icon:Ln})]}),T("button",{type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",...a.dragHandleProps,children:[u(me,{children:"Drag column to re-order"}),u(q,{icon:qi})]})]}),u(ha,{editorSettings:{language:"deephavenDb"},editorIndex:o,value:n,onContentChanged:this.handleFormulaEditorContentChanged,onTab:r,invalid:l})]}),u("hr",{})]})})}};let or=Po;or.INPUT_TYPE={NAME:"name",FORMULA:"formula"};or.defaultProps={name:"",inputIndex:0,formula:"",onChange:()=>{},onDeleteColumn:()=>{},onTabInEditor:()=>{},invalid:!1};class ua extends Error{constructor(){super(...arguments),this.isAssertionFailed=!0}}function Qr(e){if(e==null)throw new ua(`Expected 'val' to be defined, but received ${e}`)}class So extends Error{constructor(){super(...arguments),this.isPasteError=!0}}function Ae(e){return(e==null?void 0:e.isEditable)!==void 0}function jr(e){if(!Ae(e))throw new ua(`Expected 'model' to be editable, but received ${e}`)}function qe(e){return(e==null?void 0:e.hasExpandableRows)!==void 0}var Pt=(e=>(e.DOWN="DOWN",e.UP="UP",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Pt||{});const ce=class{static normalize(e,t,n,s){let i=e,o=t,r=n,l=s;return i!=null&&r!=null&&r<i&&(i=r,r=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[i,o,r,l]}static makeNormalized(e,t,n,s){return new ce(...ce.normalize(e,t,n,s))}static makeCell(e,t){return new ce(e,t,e,t)}static makeColumn(e){return new ce(e,null,e,null)}static makeRow(e){return new ce(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){const t=e.slice();let n=!0;for(;n;){n=!1;for(let s=0;s<t.length&&!n;s+=1){const i=t[s];for(let o=t.length-1;o>s;o-=1){const r=t[o];if(i.contains(r))t.splice(o,1);else if(r.contains(i)){n=!0,t[s]=r,t.splice(o,1);break}else if(i.startRow===r.startRow&&i.endRow===r.endRow){if(i.touches(r)){const{startRow:l,endRow:a}=i,c=ce.minOrNull(i.startColumn,r.startColumn),d=ce.maxOrNull(i.endColumn,r.endColumn);n=!0,t[s]=new ce(c,l,d,a),t.splice(o,1);break}}else if(i.startColumn===r.startColumn&&i.endColumn===r.endColumn&&i.touches(r)){const{startColumn:l,endColumn:a}=i,c=ce.minOrNull(i.startRow,r.startRow),d=ce.maxOrNull(i.endRow,r.endRow);n=!0,t[s]=new ce(l,c,a,d),t.splice(o,1);break}}}}return t}static isAxisRangeTouching(e,t,n,s){return e==null?t==null||n==null?!0:n<=t+1:t==null?s==null?!0:s>=e-1:n==null?s==null?!0:e<=s+1:s==null?t>=n-1:n>=e-1?n<=t+1:s>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!e[n].equals(t[n]))return!1;return!0}static intersection(e,t){if(e.equals(t))return e;let{startColumn:n,startRow:s,endColumn:i,endRow:o}=e;return n=n!=null&&t.startColumn!=null?Math.max(n,t.startColumn):n!=null?n:t.startColumn,i=i!=null&&t.endColumn!=null?Math.min(i,t.endColumn):i!=null?i:t.endColumn,s=s!=null&&t.startRow!=null?Math.max(s,t.startRow):s!=null?s:t.startRow,o=o!=null&&t.endRow!=null?Math.min(o,t.endRow):o!=null?o:t.endRow,n!=null&&n>(i!=null?i:-1)||s!=null&&s>(o!=null?o:-1)?null:new ce(n,s,i,o)}static subtractFromRange(e,t){const n=[],s=ce.intersection(e,t);return s==null?[e]:(s.startRow!=null&&(e.startRow==null||e.startRow<s.startRow)&&n.push(new ce(e.startColumn,e.startRow,e.endColumn,s.startRow-1)),s.startColumn!=null&&(e.startColumn==null||e.startColumn<s.startColumn)&&n.push(new ce(e.startColumn,s.startRow,s.startColumn-1,s.endRow)),s.endColumn!=null&&(e.endColumn==null||e.endColumn>s.endColumn)&&n.push(new ce(s.endColumn+1,s.startRow,e.endColumn,s.endRow)),s.endRow!=null&&(e.endRow==null||e.endRow>s.endRow)&&n.push(new ce(e.startColumn,s.endRow+1,e.endColumn,e.endRow)),n)}static subtractFromRanges(e,t){const n=[];for(let s=0;s<e.length;s+=1)n.push(...ce.subtractFromRange(e[s],t));return n}static subtractRangesFromRanges(e,t){if(!t||t.length===0)return e;let n=[...e];for(let s=0;s<t.length;s+=1)n=ce.subtractFromRanges(n,t[s]);return n}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,n){var s,i,o,r;return ce.isBounded(e)?e:new ce((s=e.startColumn)!=null?s:0,(i=e.startRow)!=null?i:0,(o=e.endColumn)!=null?o:t-1,(r=e.endRow)!=null?r:n-1)}static boundedRanges(e,t,n){return e.map(s=>ce.boundedRange(s,t,n))}static offset(e,t,n){return new ce(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+n:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+n:null)}static nextCell(e,t=null,n=null,s=ce.SELECTION_DIRECTION.DOWN){if(e.length===0)return null;let i=-1;if(t!=null&&n!=null&&(i=e.findIndex(o=>o.containsCell(t,n)),i>=0)){const r=e[i].nextCell(t,n,s);if(r!=null)return r}switch(s){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:{const o=i<e.length-1?i+1:0;return e[o].startCell(s)}case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:{const o=i>0?i-1:e.length-1;return e[o].startCell(s)}default:throw new Error(`Invalid direction: ${s}`)}}static cellCount(e){return e.reduce((t,n)=>{var s,i,o,r;return t+(((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1)*(((o=n.endColumn)!=null?o:NaN)-((r=n.startColumn)!=null?r:NaN)+1)},0)}static rowCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1},0)}static columnCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endColumn)!=null?s:NaN)-((i=n.startColumn)!=null?i:NaN)+1},0)}static containsCell(e,t,n){for(let s=0;s<e.length;s+=1)if(e[s].containsCell(t,n))return!0;return!1}static forEachCell(e,t,n=ce.SELECTION_DIRECTION.RIGHT){for(let s=0;s<e.length;s+=1)e[s].forEach(t,n)}constructor(e,t,n,s){this.startColumn=e,this.startRow=t,this.endColumn=n,this.endRow=s}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return ce.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&ce.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return ce.subtractFromRange(this,e)}startCell(e=ce.SELECTION_DIRECTION.DOWN){if(!ce.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error(`Invalid direction: ${e}`)}}nextCell(e,t,n){if(!ce.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");const{startColumn:s,endColumn:i,startRow:o,endRow:r}=this;switch(n){case ce.SELECTION_DIRECTION.DOWN:if(t<r)return{column:e,row:Math.max(t+1,o)};if(e<i)return{column:Math.max(e+1,s),row:o};break;case ce.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,r)};if(e>s)return{column:Math.min(e-1,i),row:r};break;case ce.SELECTION_DIRECTION.RIGHT:if(e<i)return{column:Math.max(e+1,s),row:t};if(t<r)return{column:s,row:Math.max(t+1,o)};break;case ce.SELECTION_DIRECTION.LEFT:if(e>s)return{column:Math.min(e-1,i),row:t};if(t>o)return{column:i,row:Math.min(t-1,r)};break;default:throw new Error(`Invalid direction: ${n}`)}return null}forEach(e,t=ce.SELECTION_DIRECTION.RIGHT){var o;let n=0,{column:s,row:i}=this.startCell(t);for(;s!=null&&i!=null;)e(s,i,n),n+=1,{column:s,row:i}=(o=this.nextCell(s,i,t))!=null?o:{}}};let j=ce;j.SELECTION_DIRECTION=Pt;function eu(e){return Array.isArray(e)&&e.length===2&&(e[0]===null||typeof e[0]=="number")&&(e[1]===null||typeof e[1]=="number")}function vo(e){return eu(e)&&e[0]!=null&&e[1]!=null}const fe=class{static getGridPointFromXY(e,t,n){const s=fe.getColumnAtX(e,n),i=fe.getRowAtY(t,n),o=fe.getColumnHeaderDepthAtY(t,n);return{x:e,y:t,row:i,column:s,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,n){const{row:s,column:i}=fe.getGridPointFromXY(e,t,n),{visibleColumnWidths:o,visibleRowHeights:r,visibleColumnXs:l,visibleRowYs:a,modelColumns:c,modelRows:d}=n,h=s!==null?d.get(s):null,m=i!==null?c.get(i):null,p=i!==null?l.get(i):null,g=s!==null?a.get(s):null,f=i!==null?o.get(i):null,b=s!==null?r.get(s):null;return{row:s,column:i,modelRow:h!=null?h:null,modelColumn:m!=null?m:null,left:p!=null?p:null,top:g!=null?g:null,columnWidth:f!=null?f:null,rowHeight:b!=null?b:null}}static getColumnHeaderDepthAtY(e,t){const n=fe.getRowAtY(e,t),{columnHeaderHeight:s,columnHeaderMaxDepth:i}=t;if(n===null&&e<=s*i)return rt(i-Math.ceil(e/s),0,i-1)}static iterateFloatingStart(e,t,n){for(let s=0;s<e&&s<t;s+=1){const i=n(s);if(i!==void 0)return i}}static iterateFloatingEnd(e,t,n){for(let s=0;s<e&&t-(e-s)>=0;s+=1){const i=n(t-(e-s));if(i!==void 0)return i}}static iterateFloating(e,t,n,s){const i=fe.iterateFloatingStart(e,n,s);return i!==void 0?i:fe.iterateFloatingEnd(t,n,s)}static iterateAllItems(e,t,n,s,i,o){const r=Math.max(e,n),l=Math.min(t,i-s-1);let a=fe.iterateFloating(n,s,i,o);if(a!==void 0)return a;for(let c=r;c<=l;c+=1)if(a=o(c),a!==void 0)return a}static isInItem(e,t,n,s){var r,l;const i=(r=t.get(e))!=null?r:0,o=(l=n.get(e))!=null?l:0;return i<=s&&s<=i+o}static getItemAtOffset(e,t,n,s,i,o,r,l=!1){const a=l?void 0:fe.iterateFloating(n,s,t,c=>{if(fe.isInItem(c,o,r,e))return c});if(!l&&a!==void 0)return a;for(let c=0;c<i.length;c+=1){const d=i[c];if(fe.isInItem(d,o,r,e))return d}return null}static getColumnAtX(e,t,n=!1){const{columnCount:s,floatingLeftColumnCount:i,floatingRightColumnCount:o,visibleColumns:r,visibleColumnXs:l,visibleColumnWidths:a,gridX:c}=t;return e<c?null:this.getItemAtOffset(e-c,s,i,o,r,l,a,n)}static getRowAtY(e,t){const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i,visibleRows:o,visibleRowYs:r,visibleRowHeights:l,gridY:a}=t;return e<a?null:this.getItemAtOffset(e-a,i,n,s,o,r,l)}static getNextShownItem(e,t,n,s){let i=n.findIndex(o=>o===e)||0;for(i-=1;i!=null&&i>=0;){const o=n[i],r=t.get(o);if(r!=null&&s.get(r)!==0)return o;i-=1}return null}static getNextShownColumn(e,t){const{modelColumns:n,visibleColumns:s,userColumnWidths:i}=t;return fe.getNextShownItem(e,n,s,i)}static getNextShownRow(e,t){const{modelRows:n,visibleRows:s,userRowHeights:i}=t;return fe.getNextShownItem(e,n,s,i)}static getColumnSeparatorIndex(e,t,n,s){var C,w,S,I;const{rowHeaderWidth:i,columnHeaderHeight:o,floatingColumns:r,floatingLeftWidth:l,visibleColumns:a,visibleColumnXs:c,visibleColumnWidths:d,columnHeaderMaxDepth:h}=n,{allowColumnResize:m,headerSeparatorHandleSize:p}=s;if(h*o<t||!m||p<=0)return null;const g=e-i,f=p*.5;let b=!1;for(let v=r.length-1;v>=0;v-=1){const R=r[v],D=(C=c.get(R))!=null?C:0,F=(w=d.get(R))!=null?w:0,L=F===0;if(!b||!L){let W=D+F;L?W+=f:b&&(W-=f);const B=W-f,N=W+f;if(B<=g&&g<=N)return R;b=L}}b=!1;for(let v=a.length-1;v>=0;v-=1){const R=a[v],D=(S=c.get(R))!=null?S:0,F=(I=d.get(R))!=null?I:0,L=F===0;if(D<l-F)return null;if(!b||!L){let W=D+F;L?W+=f:b&&(W-=f);const B=W-f,N=W+f;if(B<=g&&g<=N)return R;b=L}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){const{visibleColumnWidths:n}=t;return fe.isItemHidden(e,n)}static isFloatingRow(e,t){if(e==null)return!1;const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t;return e<n||e>=i-s}static isFloatingColumn(e,t){if(e==null)return!1;const{floatingLeftColumnCount:n,floatingRightColumnCount:s,columnCount:i}=t;return e<n||e>=i-s}static getHiddenItems(e,t,n){if(!fe.isItemHidden(e,t))return[];const s=[e],i=n.findIndex(o=>o===e);for(let o=i-1;o>=0;o-=1){const r=n[o];if(!fe.isItemHidden(r,t))break;s.push(r)}return s}static getHiddenColumns(e,t){const{visibleColumns:n,visibleColumnWidths:s}=t;return fe.getHiddenItems(e,s,n)}static getRowSeparatorIndex(e,t,n,s){var g,f;const{rowHeaderWidth:i,columnHeaderHeight:o,visibleRows:r,visibleRowYs:l,visibleRowHeights:a}=n,{allowRowResize:c,headerSeparatorHandleSize:d}=s;if(i<e||!c||d<=0)return null;const h=t-o,m=d*.5;let p=!1;for(let b=r.length-1;b>=0;b-=1){const C=r[b],w=(g=l.get(C))!=null?g:0,S=(f=a.get(C))!=null?f:0,I=S===0;if(!p||!I){let v=w+S;I?v+=m:p&&(v-=m);const R=v-m,D=v+m;if(R<=h&&h<=D)return C;p=I}}return null}static isRowHidden(e,t){const{visibleRowHeights:n}=t;return fe.isItemHidden(e,n)}static getHiddenRows(e,t){const{visibleRows:n,visibleRowHeights:s}=t;return fe.getHiddenItems(e,s,n)}static moveItem(e,t,n){if(e===t)return n;const s=[...n],i=s[s.length-1];return i&&!vo(i.from)&&i.to===e?i.from===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s}static moveRange(e,t,n){if(e[0]===t)return n;const s=[...n],i=s[s.length-1];return i&&vo(i.from)&&i.from[1]-i.from[0]===e[1]-e[0]&&i.to===e[0]?i.from[0]===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s[s.length-1].from===s[s.length-1].to&&s.pop(),s}static applyItemMoves(e,t,n,s=!1){var o,r;let i=[[e,t]];for(let l=s?n.length-1:0;s?l>=0:l<n.length;s?l-=1:l+=1){const{from:a,to:c}=n[l];let d=1,h;vo(a)?(d=a[1]-a[0]+1,[h]=a):h=a;const m=s?c:h,p=m+d-1,g=s?h:c,f=g-m,b=[];for(let C=0;C<i.length;C+=1){const w=(o=i[C][0])!=null?o:Number.NEGATIVE_INFINITY,S=(r=i[C][1])!=null?r:Number.POSITIVE_INFINITY;let I;const v=[[w,m-1],[m,p],[p+1,S]].map(([R,D])=>[Math.max(R,w),Math.min(D,S)]).filter(([R,D])=>R<=D).map(R=>{const[D,F]=R;return m<=D&&p>=F?(I=[D+f,F+f],I):p<D?[D-d,F-d]:R}).map(R=>{const[D,F]=R;return g>D&&g<=F?[[D,g-1],[g+d,F+d]]:R===I?[R]:g<=D?[[D+d,F+d]]:[R]}).flat();b.push(...v)}i=b.map(([C,w])=>[Number.isFinite(C)?C:null,Number.isFinite(w)?w:null])}return i}static translateRange(e,t,n,s){const i=fe.applyItemMoves(e.startColumn,e.endColumn,t,s),o=fe.applyItemMoves(e.startRow,e.endRow,n,s),r=[];for(let l=0;l<i.length;l+=1){const a=i[l];for(let c=0;c<o.length;c+=1){const d=o[c];r.push(new j(a[0],d[0],a[1],d[1]))}}return r}static getModelIndex(e,t){return fe.applyItemMoves(e,e,t,!0)[0][0]}static getModelIndexes(e,t){return e.map(n=>fe.getModelIndex(n,t))}static getModelRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!0)}static getModelRange(e,t=[],n=[]){return fe.translateRange(e,t,n,!0)}static getModelRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getModelRange(e[i],t,n));return s}static getVisibleRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!1)}static getVisibleRange(e,t=[],n=[]){return this.translateRange(e,t,n,!1)}static getVisibleRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getVisibleRange(e[i],t,n));return s}static getVisibleIndex(e,t){return fe.applyItemMoves(e,e,t)[0][0]}static getVisibleIndexes(e,t){return e.map(n=>fe.getVisibleIndex(n,t))}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return fe.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=fe.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(n=>t.get(n)===0)}static getScrollDragBounds(e,t,n){const{gridX:s,gridY:i,width:o,height:r,floatingTopRowCount:l,floatingBottomRowCount:a,floatingLeftColumnCount:c,floatingRightColumnCount:d,floatingLeftWidth:h,floatingRightWidth:m,floatingTopHeight:p,floatingBottomHeight:g,columnCount:f,rowCount:b}=e;let C=s,w=i,S=o,I=r;return n!=null&&(n>c&&(C+=h),n<f-d&&(S-=m)),t!=null&&(t>l&&(w+=p),t<b-a&&(I-=g)),{x1:C,y1:w,x2:S,y2:I}}static getScrollDelta(e,t=1024,n=768,s=20,i=20){let{deltaX:o,deltaY:r}=e;return!fe.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,r=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,r*=n):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(fe.isMacPlatform()?(o=Math.round(o*s),r=Math.round(r*i)):(o=Math.round(o*this.PIXELS_PER_LINE),r=Math.round(r*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:r}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],i=s[0],o=s[1];n===0?t.push([i,o]):i-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([i,o])}return t}};let U=fe;U.PIXELS_PER_LINE=100/3;function A(e,t,n=void 0){var i;const s=(i=e.get(t))!=null?i:n;if(s!==void 0)return s;throw new Error(`Missing value for key ${t}`)}function Si(e,t=js.CACHE_SIZE,n=Math.floor(t/2)){if(e.size>t){const s=e.keys();for(;e.size>n;)e.delete(s.next().value)}}function Zr(e,t,n,s,i){const o=new Map;let r=0;for(let l=0;l<e&&l<n;l+=1)o.set(l,r),r+=A(i,l);r=s;for(let l=0;l<t&&n-l-1>=0;l+=1)r-=A(i,n-l-1),o.set(n-l-1,r);return o}const ma=class{constructor({userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:n=new Map,calculatedRowHeights:s=new Map,fontWidths:i=new Map,modelRows:o=new Map,modelColumns:r=new Map,movedRows:l=[],movedColumns:a=[]}={}){this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=s,this.calculatedColumnWidths=n,this.fontWidths=i,this.modelRows=o,this.modelColumns=r,this.movedRows=l,this.movedColumns=a}getMetrics(e){const{left:t,top:n,leftOffset:s,topOffset:i,width:o,height:r,theme:l,model:a,movedRows:c,movedColumns:d,draggingColumn:h}=e,{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,columnWidth:f,columnHeaderHeight:b,minScrollHandleSize:C,scrollBarSize:w}=l;c!==this.movedRows&&(this.movedRows=c,this.modelRows.clear()),d!==this.movedColumns&&(this.movedColumns=d,this.modelColumns.clear());const{columnCount:S,rowCount:I,floatingTopRowCount:v,floatingBottomRowCount:R,floatingLeftColumnCount:D,floatingRightColumnCount:F,columnHeaderMaxDepth:L}=a,W=this.getFirstRow(e),B=this.getFirstColumn(e),N=this.getGridX(e),_=this.getGridY(e),k=qe(a)&&a.hasExpandableRows?this.calculateTreePaddingX(e):0,P=0;let H=this.getVisibleRowHeights(e),V=this.getVisibleColumnWidths(e,B,k);const G=Array.from(H.keys()),Q=Array.from(V.keys());H=new Map([...H,...this.getFloatingRowHeights(e)]),V=new Map([...V,...this.getFloatingColumnWidths(e)]);let J=this.getVisibleColumnXs(V,Q,s),re=this.getVisibleRowYs(H,G,i);const Ce=G.length>0?G[G.length-1]:n,de=Q.length>0?Q[Q.length-1]:t,ve=this.getBottomViewport(e,G,re,H),_e=this.getRightViewport(e,Q,J,V),Ke=this.getFloatingTopHeight(e,H),Dt=this.getFloatingBottomHeight(e,H),Xe=this.getFloatingLeftWidth(e,V),Ze=this.getFloatingRightWidth(e,V),Le=Array.from(V.values()),_t=Array.from(H.values()),_n=Le.reduce((Be,ms)=>Be+ms,0)-s,en=_t.reduce((Be,ms)=>Be+ms,0)-i,nt=this.getLastLeft(e,null,o-N-w-g),pe=this.getLastTop(e,null,r-_-w-Dt),ze=s+_n+g,Ue=i+en,ht=o-N,Mt=r-_,Nt=nt>0||ze>ht,ut=Nt?w:0,Vn=pe>0||Ue>Mt-ut,Ft=Vn?w:0,xt=o-p-Ft,Un=r-b-ut,io=p,oo=b,ro=S===1?xt/ze:(S-nt)/S,ni=I===1?Un/Ue:(I-pe)/I,si=Nt?rt(xt*ro,C,xt-1):0,ii=Vn?rt(Un*ni,C,Un-1):0,oi=A(V,t,0),ri=A(H,n,0),li=oi>0?s/oi:0,ai=ri>0?i/ri:0,lo=S===1?s/(ze-ht):(t+li)/nt,ao=I===1?i/(Ue-Mt):(n+ai)/pe,Bn=Nt?lo*(xt-si):0,co=Vn?ao*(Un-ii):0;let us=[];(v>0||R>0)&&(us=[...Array(v).keys(),...[...Array(R).keys()].map(Be=>I-Be-1)],re=new Map([...re,...this.getFloatingRowYs(e,H,Math.floor(r-_-ut))]));let As=[];(D>0||F>0)&&(As=[...Array(D).keys(),...[...Array(F).keys()].map(Be=>S-Be-1)],J=new Map([...J,...this.getFloatingColumnXs(e,V,Math.floor(o-N-Ft))]));const ci=[];if(h)for(let Be=h.range[0];Be<=h.range[1];Be+=1)ci.push(Be),V.has(Be)||V.set(Be,this.getVisibleColumnWidth(Be,e)),J.has(Be)||J.set(Be,0);const di=G.concat(us),ks=Q.concat(As).concat(ci),Ls=this.getModelRows(di,e),ho=this.getModelColumns(ks,e),uo=this.getVisibleRowTreeBoxes(H,Ls,e),hi=this.getTopVisible(e,re,H,G),mo=this.getLeftVisible(e,J,V,Q),ui=pe>0?this.getBottomVisible(e,re,H,G,_):Ce,mi=nt>0?this.getRightVisible(e,J,V,Q,N):de,{fontWidths:pi,userColumnWidths:gi,userRowHeights:fi,calculatedRowHeights:po,calculatedColumnWidths:go}=this;return{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,rowCount:I,columnWidth:f,columnCount:S,columnHeaderHeight:b,floatingTopRowCount:v,floatingBottomRowCount:R,floatingLeftColumnCount:D,floatingRightColumnCount:F,gridX:N,gridY:_,firstRow:W,firstColumn:B,treePaddingX:k,treePaddingY:P,left:t,top:n,bottom:Ce,right:de,topOffset:i,leftOffset:s,topVisible:hi,leftVisible:mo,bottomVisible:ui,rightVisible:mi,bottomViewport:ve,rightViewport:_e,width:o,height:r,maxX:_n,maxY:en,lastLeft:nt,lastTop:pe,barHeight:Un,barTop:oo,barWidth:xt,barLeft:io,handleHeight:ii,handleWidth:si,hasHorizontalBar:Nt,hasVerticalBar:Vn,verticalBarWidth:Ft,horizontalBarHeight:ut,scrollX:Bn,scrollY:co,scrollableContentWidth:ze,scrollableContentHeight:Ue,scrollableViewportWidth:ht,scrollableViewportHeight:Mt,visibleRows:G,visibleColumns:Q,floatingRows:us,floatingColumns:As,allRows:di,allColumns:ks,visibleRowHeights:H,visibleColumnWidths:V,floatingTopHeight:Ke,floatingBottomHeight:Dt,floatingLeftWidth:Xe,floatingRightWidth:Ze,visibleRowYs:re,visibleColumnXs:J,visibleRowTreeBoxes:uo,modelRows:Ls,modelColumns:ho,movedRows:c,movedColumns:d,fontWidths:pi,userColumnWidths:gi,userRowHeights:fi,calculatedRowHeights:po,calculatedColumnWidths:go,columnHeaderMaxDepth:L}}getGridX(e){const{theme:t}=e,{rowHeaderWidth:n}=t;return n}getGridY(e){const{theme:t,model:n}=e,{columnHeaderHeight:s}=t,{columnHeaderMaxDepth:i}=n;return i*s}getVisibleHeight(e,t=this.getFloatingRowHeights(e)){const{height:n,theme:s}=e,{scrollBarSize:i}=s,o=this.getGridY(e),r=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return n-r-l-o-i}getVisibleWidth(e,t=this.getFloatingColumnWidths(e)){const{width:n,theme:s}=e,{scrollBarSize:i,rowFooterWidth:o}=s,r=this.getGridX(e),l=this.getFloatingRightWidth(e,t),a=this.getFloatingLeftWidth(e,t);return n-a-l-r-i-o}getFirstIndex(e,t,n){const s=e.size+1;for(let i=0;i<s;i+=1){const o=t(i,n);if(e.get(o)!==0)return i}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t=null,n=this.getVisibleWidth(e)){const{model:s}=e,{columnCount:i}=s;let o=i-1;t!=null&&(o=t);let r=0;for(;o>=0;){if(r+=this.getVisibleColumnWidth(o,e),r>=n)return Math.min(o+1,i-1);o-=1}return 0}getLastTop(e,t=null,n=this.getVisibleHeight(e)){const{model:s}=e,{rowCount:i,floatingBottomRowCount:o}=s;let r=Math.max(0,i-o-1);t!=null&&(r=t);let l=0;for(;r>0;){if(l+=this.getVisibleRowHeight(r,e),l>=n)return Math.min(r+1,i-1);r-=1}return 0}getTopForTopVisible(e,t){const n=this.getFloatingTopHeight(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleRowHeight(s,e);return s}getTopForBottomVisible(e,t){const{height:n}=e,s=this.getGridY(e),i=this.getFloatingBottomHeight(e),o=n-s-i;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){const n=this.getFloatingLeftWidth(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleColumnWidth(s,e);return s}getLeftForRightVisible(e,t){const{width:n}=e,s=this.getGridX(e),i=this.getFloatingRightWidth(e),o=n-s-i;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){const{model:t}=e,{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t,o=new Map;for(let r=0;r<n&&r<i;r+=1)o.set(r,this.getVisibleRowHeight(r,e));for(let r=0;r<s&&i-r-1>=0;r+=1){const l=i-r-1;o.set(l,this.getVisibleRowHeight(l,e))}return o}getVisibleRowHeights(e){const{top:t,topOffset:n,height:s,model:i}=e;let o=0,r=t;const l=new Map,{rowCount:a}=i;for(;o<s+n&&r<a;){const c=this.getVisibleRowHeight(r,e);l.set(r,c),o+=c,r+=1}return l}getFloatingColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s,l=new Map;for(let a=0;a<o&&a<i;a+=1)l.set(a,this.getVisibleColumnWidth(a,e,t,n));for(let a=0;a<r&&i-a-1>=0;a+=1){const c=i-a-1;l.set(c,this.getVisibleColumnWidth(c,e,t,n))}return l}getVisibleColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{left:s,leftOffset:i,width:o,model:r}=e;let l=0,a=s;const c=new Map,{columnCount:d}=r;for(;l<o+i&&a<d;){const h=this.getVisibleColumnWidth(a,e,t,n);c.set(a,h),l+=h,a+=1}return c}getFloatingColumnXs(e,t,n){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s;return Zr(o,r,i,n,t)}getVisibleColumnXs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getFloatingRowYs(e,t,n){const{model:s}=e,{floatingTopRowCount:i,floatingBottomRowCount:o,rowCount:r}=s;return Zr(i,o,r,n,t)}getVisibleRowYs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getVisibleRowTreeBoxes(e,t,n){const s=new Map,{model:i,theme:o}=n,{treeDepthIndent:r,treeHorizontalPadding:l}=o;return qe(i)&&i.hasExpandableRows&&e.forEach((a,c)=>{const d=A(t,c);if(i.isRowExpandable(d)){const h=i.depthForRow(d),m=h*r+l,p=(h+1)*r+l,g=0,f=a;s.set(c,{x1:m,y1:g,x2:p,y2:f})}}),s}getFloatingLeftWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingLeftColumnCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingRightWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingRightColumnCount:s,columnCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getFloatingTopHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingTopRowCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingBottomHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingBottomRowCount:s,rowCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getTopVisible(e,t,n,s){const i=this.getFloatingTopHeight(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getLeftVisible(e,t,n,s){const i=this.getFloatingLeftWidth(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getBottomVisible(e,t,n,s,i){const{height:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingBottomHeight(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getRightVisible(e,t,n,s,i){const{width:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingRightWidth(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getBottomViewport(e,t,n,s){const{height:i,theme:o}=e,{rowHeight:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getRightViewport(e,t,n,s){const{width:i,theme:o}=e,{columnWidth:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getLastIndexViewport(e,t,n,s,i){let o=0,r=0;return e.length>0&&(o=e[e.length-1],r=A(t,o)+A(n,o)),r<s&&(o+=Math.ceil((s-r)/i)),o}getVisibleItemSize(e,t,n){var i;const s=n();return(i=t.get(e))!=null?i:s}getVisibleRowHeight(e,t){const n=this.getModelRow(e,t);return this.getVisibleItemSize(n,this.userRowHeights,()=>this.calculateRowHeight(e,n,t))}getVisibleColumnWidth(e,t,n=this.getFirstColumn(t),s=this.calculateTreePaddingX(t)){const i=this.getModelColumn(e,t);return this.getVisibleItemSize(i,this.userColumnWidths,()=>this.calculateColumnWidth(e,i,t,n,s))}getModelRows(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelRow(i,t);n.set(i,o)}return n}getModelRow(e,t){if(this.modelRows.has(e))return A(this.modelRows,e);const{movedRows:n}=t,s=U.getModelIndex(e,n);return this.modelRows.set(e,s),s}getModelColumns(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelColumn(i,t);n.set(i,o)}return n}getModelColumn(e,t){if(this.modelColumns.has(e))return A(this.modelColumns,e);const{movedColumns:n}=t,s=U.getModelIndex(e,n);return this.modelColumns.set(e,s),s}calculateRowHeight(e,t,n){const{theme:s}=n,{autoSizeRows:i,rowHeight:o}=s;if(!i)return o;const r=this.calculatedRowHeights.get(t);return r!=null?r:(this.calculatedRowHeights.set(t,Math.ceil(o)),Si(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,n,s=this.getFirstColumn(n),i=this.calculateTreePaddingX(n)){const{theme:o}=n,{autoSizeColumns:r,minColumnWidth:l}=o;if(!r){const{columnWidth:m}=o;return m}const a=this.calculateColumnHeaderWidth(t,n),c=this.calculateColumnDataWidth(t,n),d=this.calculatedColumnWidths.get(t);let h=Math.ceil(Math.max(a,c));return h=Math.max(l,h),d!=null&&d>h?h=d:(this.calculatedColumnWidths.set(t,h),Si(this.calculatedColumnWidths)),e===s&&(h+=i),h}calculateColumnHeaderWidth(e,t){const{model:n,theme:s}=t,{headerFont:i,headerHorizontalPadding:o}=s,r=n.textForColumnHeader(e,0);if(r){const l=this.getWidthForFont(i,t);return r.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){const{top:n,height:s,width:i,model:o,theme:r}=t,{floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c}=o,{font:d,cellHorizontalPadding:h,rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,scrollBarSize:f}=r;let b=0;const C=this.getWidthForFont(d,t),w=s/m,S=Math.ceil(n+w);return U.iterateAllItems(n,S,l,a,c,I=>{const v=this.getModelRow(I,t),R=o.textForCell(e,v);if(R){const D=h*2;b=Math.max(b,R.length*C+D)}}),b=Math.max(Math.min(b,(i-p-f-g)*ma.MAX_COLUMN_WIDTH),h*2),b}calculateTreePaddingX(e){const{top:t,height:n,model:s,theme:i}=e,{rowHeight:o,treeDepthIndent:r}=i;if(!qe(s)||!s.hasExpandableRows)return 0;let l=0;const a=n/o,c=Math.ceil(t+a);for(let d=t;d<=c;d+=1){const h=this.getModelRow(d,e),m=s.depthForRow(h);l=Math.max(l,r*(m+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return A(this.fontWidths,e);const{context:n}=t;n.font=e;const s=n.measureText("8"),{width:i}=s;return this.fontWidths.set(e,i),this.fontWidths.set(n.font,i),i}setColumnWidth(e,t){const n=new Map(this.userColumnWidths);n.set(e,Math.ceil(t)),Si(n),this.userColumnWidths=n}resetColumnWidth(e){const t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){const n=new Map(this.userRowHeights);n.set(e,Math.ceil(t)),Si(n),this.userRowHeights=n}resetRowHeight(e){const t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}};let js=ma;js.CACHE_SIZE=1e4;js.MAX_COLUMN_WIDTH=.8;const tu=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",black:"#000000",white:"#ffffff",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowColor:"#000000",textColor:"#ffffff",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc"}),St=(e,t)=>{let n=!1;const s=ue(e,{...t,dispose:()=>{n||(n=!0,s.clear(),n=!1)}});return s};function nu(e,t,n=6){const s=Oo.hex.lab.raw(e);return s[0]=Math.max(s[0]-s[0]/n*t,0),`#${Oo.lab.hex(s)}`}function su(e,t){const[n,s,i]=Oo.hex.rgb(e);return`rgba(${n}, ${s}, ${i}, ${t})`}const Jr={colorWithAlpha:su,darkenForDepth:nu};class je{constructor(t=5e3){this.cursor=null,this.order=t}onDown(t,n,s){return!1}onMove(t,n,s){return!1}onDrag(t,n,s){return!1}onLeave(t,n,s){return!1}onClick(t,n,s){return!1}onContextMenu(t,n,s){return!1}onDoubleClick(t,n,s){return!1}onUp(t,n,s){return!1}onWheel(t,n,s){return!1}}class pa extends je{constructor(){super(...arguments),this.resizingItems=[],this.hiddenItems=[],this.targetSizes=new Map,this.dragOffset=0}onDown(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);if(r!=null){const l=r.index;return this.dragOffset=0,this.draggingIndex=l,this.resizingItems=[l],this.hiddenItems=this.getHiddenItems(l,s).reverse(),this.targetSizes.clear(),this.addTargetSize(s,l),this.updateCursor(s,l),this.updateSeparator(n,r),!0}return!1}onMove(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);return r!=null?(this.updateCursor(s,r.index),!0):!1}onDrag(t,n){var f;if(this.draggingIndex==null)return!1;const s=t[this.pointProperty],{metricCalculator:i,metrics:o}=n;if(!o)throw new Error("metrics not set");const r=n.getTheme(),l=o[this.visibleOffsetProperty],a=o[this.marginProperty],c=o[this.calculatedSizesProperty],d=o[this.modelIndexesProperty],h=o[this.firstIndexProperty],m=o[this.treePaddingProperty],p=new Map;let g=this.resizingItems[this.resizingItems.length-1];for(;g!=null;){const b=A(l,g),C=s-a-b-this.dragOffset,w=A(d,g),S=this.targetSizes.get(w),I=this.resizingItems.length>1,v=this.hiddenItems.indexOf(g);let R=A(c,w);g===h&&(R+=m);let D=C;Math.abs(C-R)<=r.headerResizeSnapThreshold?D=null:S!==void 0&&C>S&&(I&&v!==0||v>0)?D=S:C<=r.headerResizeHiddenSnapThreshold&&(D=0),D!==R?p.set(w,D):p.set(w,null),C<-r.headerResizeSnapThreshold&&D===0?v>=0&&I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(f=this.targetSizes.get(A(d,g)))!=null?f:0):(g=this.getNextShownItem(g,o),g!==null&&(this.resizingItems.push(g),this.addTargetSize(o,g))):S!==void 0&&C>S+r.headerResizeSnapThreshold&&D===S?v>0?(this.dragOffset+=D,g=this.hiddenItems[v-1],this.resizingItems.push(g),this.addTargetSize(o,g)):I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1]):g=null:g=null}return p.forEach((b,C)=>{b!==null?this.setSize(i,C,b):this.resetSize(i,C)}),this.updateCursor(o,this.draggingIndex),!0}onUp(t,n){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(n,null)),!1}onDoubleClick(t,n){const{metrics:s,metricCalculator:i}=n,{model:o}=n.props,r=n.getTheme();if(!s)throw new Error("metrics not set");const l=this.getSeparator(t,s,o,r);if(l!=null){const a=s[this.modelIndexesProperty],c=A(a,l.index);return this.resetSize(i,c),n.forceUpdate(),!0}return!1}updateCursor(t,n){const s=t[this.visibleSizesProperty];A(s,n)===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(t,n){const s=t[this.modelIndexesProperty],i=t[this.userSizesProperty],o=t[this.calculatedSizesProperty],r=n===0?t[this.treePaddingProperty]:0,l=A(s,n);let a=i.get(l);(a==null||a===0)&&(a=A(o,l)+r),this.targetSizes.set(l,a)}removeTargetSize(t,n){const s=t[this.modelIndexesProperty],i=A(s,n);this.targetSizes.delete(i)}}class Zi extends pa{constructor(){super(...arguments),this.hiddenCursor="e-resize",this.defaultCursor="col-resize",this.pointProperty="x",this.userSizesProperty="userColumnWidths",this.visibleOffsetProperty="visibleColumnXs",this.visibleSizesProperty="visibleColumnWidths",this.marginProperty="rowHeaderWidth",this.calculatedSizesProperty="calculatedColumnWidths",this.modelIndexesProperty="modelColumns",this.firstIndexProperty="firstColumn",this.treePaddingProperty="treePaddingX",this.getHiddenItems=U.getHiddenColumns,this.getNextShownItem=U.getNextShownColumn,this.getSeparator=Zi.getColumnSeparator}static getColumnSeparator(t,n,s,i){if(!i.allowColumnResize)return null;const{x:o,y:r,columnHeaderDepth:l}=t,{modelColumns:a}=n,c=U.getColumnSeparatorIndex(o,r,n,i);return c==null||l==null||l>0?null:a.get(c)!=null?{index:c,depth:0}:null}setSize(t,n,s){t.setColumnWidth(n,s)}resetSize(t,n){t.resetColumnWidth(n)}updateSeparator(t,n){t.setState({draggingColumnSeparator:n,isDragging:n!==null})}}const an=class{constructor(){this.getCachedTruncatedString=St((e,t,n,s,i)=>an.truncateToWidth(e,t,n,s,i),{max:1e4}),this.getCachedBackgroundColors=St((e,t)=>e.split(" ").map(n=>{const s=[];for(let i=0;i<t;i+=1)s.push(Jr.darkenForDepth(n,i,t));return s}),{max:1e3}),this.getCachedColorWithAlpha=St((e,t)=>Jr.colorWithAlpha(e,t),{max:1e3}),this.getCachedColorIsDark=St(e=>Xi.isDark(e),{max:1e3})}static truncate(e,t){return t<e.length?e.substr(0,t)+"\u2026":e}static binaryTruncateToWidth(e,t,n,s=0,i=t.length,o){if(i>=t.length&&e.measureText(t).width<=n)return t;if(o){const c=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(n/c)))}let r=s,l=Math.min(t.length-1,i),a=t;for(;l>=r;){const c=Math.ceil((l+r)/2),d=an.truncate(t,c);if(e.measureText(d).width<=n){if(a=d,r===c)break;r=c}else if(c===0){a=d;break}else l=c-1}return a}static truncateToWidth(e,t,n,s=an.DEFAULT_FONT_WIDTH,i){if(n<=0||t.length<=0)return"";const o=Math.min(Math.max(0,Math.floor(n/s/2)-5),t.length),r=Math.min(Math.ceil(n/s*2),t.length);return an.binaryTruncateToWidth(e,t,n,o,r,i)}drawCanvas(e){const{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){const{theme:n}=t;e.font=n.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){const{theme:n,metrics:s}=t,{width:i,height:o}=s;e.fillStyle=n.backgroundColor,e.fillRect(0,0,i,o)}drawGrid(e,t){const{metrics:n,draggingRow:s,draggingColumn:i}=t,{gridX:o,gridY:r}=n;e.translate(o,r),this.drawGridBackground(e,t,s==null&&i==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-r)}drawFloatingRows(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingTopRowCount:r,floatingBottomRowCount:l,floatingRows:a,rowCount:c,visibleColumns:d,visibleRowYs:h,visibleRowHeights:m}=i;if(a.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,a,o.floatingRowBackgroundColors),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,d,a,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,d,a),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{top:0,bottom:r-1,maxY:A(h,r-1)+A(m,r-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:c-l-1,bottom:c-1,minY:A(h,c-l)+.5,maxY:A(h,c-1)+A(m,c-1)-.5});for(let p=0;p<d.length;p+=1){const g=d[p];for(let f=0;f<a.length;f+=1){const b=a[f];this.drawCellContent(e,t,g,b)}}}}drawFloatingColumns(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingLeftColumnCount:r,floatingRightColumnCount:l,floatingLeftWidth:a,floatingRightWidth:c,floatingColumns:d,gridX:h,maxX:m,columnCount:p,visibleRows:g,visibleColumnXs:f,visibleColumnWidths:b,width:C,height:w}=i;if(d.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,a),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,C-h-c,m)),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,a,w),e.clip(),this.drawGridLinesForItems(e,t,d,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,d,g),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{left:0,maxX:A(f,r-1)+A(b,r-1)}),l>0&&this.drawSelectedRanges(e,t,{left:p-l,right:p-1,minX:A(f,p-l)+.5,maxX:A(f,p-1)+A(b,p-1)});for(let S=0;S<d.length;S+=1){const I=d[S];for(let v=0;v<g.length;v+=1){const R=g[v];this.drawCellContent(e,t,I,R)}}}}drawFloatingBorders(e,t){const{metrics:n,theme:s}=t,{floatingTopRowCount:i,floatingBottomRowCount:o,floatingLeftColumnCount:r,floatingRightColumnCount:l,rowCount:a,columnCount:c,visibleRowYs:d,visibleColumnXs:h,visibleRowHeights:m,visibleColumnWidths:p,maxX:g,maxY:f}=n,{floatingDividerOuterColor:b,floatingDividerInnerColor:C}=s;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=C,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}e.stroke()}drawGridBackground(e,t,n=!1){this.drawRowStripes(e,t),n&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);const{metrics:s}=t,{bottom:i,right:o,floatingBottomRowCount:r,floatingLeftColumnCount:l,floatingRightColumnCount:a,floatingTopRowCount:c,columnCount:d,rowCount:h,visibleRowHeights:m,visibleRowYs:p,visibleColumnXs:g,visibleColumnWidths:f,width:b,height:C}=s;this.drawSelectedRanges(e,t,{bottom:Math.min(i,h-r-1),right:Math.min(o,d-a-1),minX:l>0&&g.has(l+1)?A(g,l+1):-10,minY:c>0&&p.has(c+1)?A(p,c+1):-10,maxX:a>0&&g.has(d-a-1)?A(g,d-a-1)+A(f,d-a-1)-.5:b+10,maxY:r>0&&p.has(h-r-1)?A(p,h-r-1)+A(m,h-r-1)-.5:C+10})}drawRowStripes(e,t){const{metrics:n,theme:s}=t,{visibleRows:i}=n,{rowBackgroundColors:o}=s;!o||this.drawRowStripesForRows(e,t,i,o)}drawRowStripesForRows(e,t,n,s,i=0,o=t.metrics.maxX){const{theme:r,metrics:l,model:a}=t,{maxDepth:c,shadowBlur:d,shadowColor:h}=r,m=this.getCachedBackgroundColors(s,c),{visibleRowYs:p,visibleRowHeights:g}=l,f=new Map,b=[],C=[],w=(S,I)=>{const v=qe(a)?a.depthForRow(S):0,R=m[S%m.length],D=R[Math.min(v,R.length-1)];if(f.has(D)||f.set(D,[]),f.get(D).push(S),I!=null){const F=qe(a)?a.depthForRow(I):0;F<v?b.push(S):F>v&&C.push(I)}};for(let S=0;S<n.length;S+=1){const I=n[S],v=S>0?n[S-1]:void 0;w(I,v)}if(f.forEach((S,I)=>{e.fillStyle=I,e.beginPath();for(let v=0;v<S.length;v+=1){const R=S[v],D=A(p,R),F=A(g,R);e.rect(i,D,o,F)}e.fill()}),b.length>0){e.save();const S=this.getCachedColorWithAlpha(h,.15),I=this.getCachedColorWithAlpha(h,0),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let R=0;R<b.length;R+=1){const D=b[R],F=A(p,D);e.translate(0,F),e.fillRect(i,0,o,d),e.translate(0,-F)}e.restore()}if(C.length>0){e.save();const S=this.getCachedColorWithAlpha(h,0),I=this.getCachedColorWithAlpha(h,.15),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let R=0;R<C.length;R+=1){const D=C[R],F=A(p,D),L=A(g,D),W=F+L-d;e.translate(0,W),e.fillRect(i,0,o,d),e.translate(0,-W)}e.restore()}}drawMouseColumnHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const r=U.getColumnAtX(n,o);if(r==null||!i.columnHoverBackgroundColor)return;const{visibleColumnWidths:l,visibleColumnXs:a,maxY:c}=o;if(s>c)return;const d=A(a,r),h=A(l,r);e.fillStyle=i.columnHoverBackgroundColor,e.fillRect(d,0,h,c)}drawMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const{maxX:r}=o;if(n>r||!i.rowHoverBackgroundColor)return;const l=U.getRowAtY(s,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}drawFloatingMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t,{maxX:r,floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c,rowFooterWidth:d}=o;if(n==null||s==null||n>r+d||!i.rowHoverBackgroundColor)return;const h=U.getRowAtY(s,o);h!=null&&(h<l||c-a<=h)&&this.drawMouseRowHoverForRow(e,t,h)}drawMouseRowHoverForRow(e,t,n){const{metrics:s,selectedRanges:i,theme:o}=t,{visibleRowHeights:r,visibleRowYs:l,maxX:a}=s,c=A(l,n),d=A(r,n);o.rowHoverBackgroundColor&&(e.fillStyle=o.rowHoverBackgroundColor);for(let h=0;h<i.length;h+=1){const{startRow:m,endRow:p}=i[h];if(m!=null&&p!=null&&m<=n&&p>=n){o.selectedRowHoverBackgroundColor&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,c,a,d)}drawGridLines(e,t){const{metrics:n,theme:s}=t,{visibleColumns:i,visibleRows:o}=n;this.drawGridLinesForItems(e,t,i,o,s.gridColumnColor,s.gridRowColor)}drawGridLinesForItems(e,t,n,s,i,o){!i&&!o||(e.lineWidth=1,e.beginPath(),i&&(e.strokeStyle=i,this.drawGridLinesForColumns(e,t,n)),o&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,s)),e.stroke())}drawGridLinesForColumns(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,maxY:o}=s;for(let r=0;r<n.length;r+=1){const l=n[r],a=A(i,l)+.5;e.moveTo(a,0),e.lineTo(a,o)}}drawGridLinesForRows(e,t,n){const{metrics:s}=t,{visibleRowYs:i,maxX:o}=s,r=o;for(let l=0;l<n.length;l+=1){const a=n[l],c=A(i,a)+.5;e.moveTo(.5,c),e.lineTo(r-.5,c)}}drawCellBackgrounds(e,t){const{metrics:n}=t,{visibleColumns:s,visibleRows:i}=n;this.drawCellBackgroundsForItems(e,t,s,i)}drawCellBackgroundsForItems(e,t,n,s){e.save();for(let i=0;i<n.length;i+=1){const o=n[i];for(let r=0;r<s.length;r+=1){const l=s[r],a=r+1<s.length?s[r+1]:void 0;this.drawCellBackground(e,t,o,l,a)}}e.restore()}drawCellBackground(e,t,n,s,i){const{metrics:o,model:r,theme:l}=t,{firstColumn:a,modelColumns:c,modelRows:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g}=o,f=A(d,s),b=A(c,n),C=r.backgroundColorForCell(b,f,l),w=n===a,S=qe(r)&&r.hasExpandableRows;if(C){const I=A(h,n)+1,v=A(p,s)+1,R=A(m,n)-1,D=A(g,s)-1;e.fillStyle=C,e.fillRect(I,v,R,D)}w&&S&&this.drawCellRowTreeDepthLines(e,t,s,i)}drawCellContents(e,t){const{metrics:n}=t,{visibleColumns:s}=n;for(let i=0;i<s.length;i+=1){const o=s[i];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,visibleColumnWidths:o,visibleRows:r,height:l}=s,a=A(i,n),c=A(o,n);e.save(),e.beginPath(),e.rect(a,0,c,l),e.clip();for(let d=0;d<r.length;d+=1){const h=r[d];this.drawCellContent(e,t,n,h)}e.restore()}getTextRenderMetrics(e,t,n,s){const{textAlign:i}=e,{metrics:o,model:r,theme:l}=t,{firstColumn:a,visibleColumnXs:c,visibleColumnWidths:d,visibleRowYs:h,visibleRowHeights:m}=o,{cellHorizontalPadding:p,treeDepthIndent:g,treeHorizontalPadding:f}=l,b=A(c,n),C=A(h,s),w=A(d,n),S=A(m,s),I=n===a;let v=0;qe(r)&&r.hasExpandableRows&&I&&(v=g*(r.depthForRow(s)+1)+f);const R=w-v;let D=b+p;const F=C+S*.5;return i==="right"?D=b+R-p:i==="center"&&(D=b+R*.5),D+=v,{width:R-p*2,x:D,y:F}}drawCellContent(e,t,n,s,i){var I;const{metrics:o,model:r,theme:l}=t,{firstColumn:a,fontWidths:c,modelColumns:d,modelRows:h,visibleRowHeights:m}=o,{textColor:p}=l,g=A(m,s),f=A(h,s),b=A(d,n),C=i!=null?i:r.textForCell(b,f),w=r.truncationCharForCell(b,f),S=n===a;if(C&&g>0){const v=r.textAlignForCell(b,f)||"left";e.textAlign=v;const R=r.colorForCell(b,f,l)||p;e.fillStyle=R;const{width:D,x:F,y:L}=this.getTextRenderMetrics(e,t,n,s),W=(I=c.get(e.font))!=null?I:an.DEFAULT_FONT_WIDTH,B=this.getCachedTruncatedString(e,C,D,W,w);B&&e.fillText(B,F,L)}S&&qe(r)&&r.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,s)}drawCellRowTreeMarker(e,t,n){const{metrics:s,model:i,mouseX:o,mouseY:r,theme:l}=t,{firstColumn:a,gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g,visibleRowTreeBoxes:f}=s,{treeMarkerColor:b,treeMarkerHoverColor:C}=l,w=A(h,a),S=A(m,a),I=A(p,n),v=A(g,n);if(!qe(i)||!i.isRowExpandable(n))return;const R=A(f,n),D=o!=null&&r!=null&&o>=c+w&&o<=c+w+S&&r>=d+I&&r<=d+I+v?C:b;this.drawTreeMarker(e,t,w,I,R,D,i.isRowExpanded(n))}drawTreeMarker(e,t,n,s,i,o,r){const{x1:l,y1:a,x2:c,y2:d}=i,h=r?"\u229F":"\u229E",m=n+(l+c)*.5+.5,p=s+(a+d)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(h,m,p)}drawCellRowTreeDepthLines(e,t,n,s){const{metrics:i,model:o,theme:r}=t;if(!qe(o))return;const l=o.depthForRow(n);if(l===0)return;const{firstColumn:a,visibleColumnXs:c,visibleRowYs:d,visibleRowHeights:h}=i,{treeDepthIndent:m,treeHorizontalPadding:p,treeLineColor:g}=r,f=A(c,a),b=A(d,n),C=A(h,n),w=s!==void 0?o.depthForRow(s):0,S=l>w?l-w:0;if(e.strokeStyle=g,e.lineWidth=1,l-S>0){e.beginPath();for(let I=0;I<l-S;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+C)}e.stroke()}if(S>0){e.beginPath();for(let I=l-S;I<l;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+Math.ceil(C/2)),e.moveTo(v-.5,b+Math.ceil(C/2)+.5),e.lineTo(v+m-.5,b+Math.ceil(C/2)+.5)}e.stroke()}}drawHeaders(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o,draggingColumnSeparator:r,isDragging:l,model:a}=t,{columnHeaderHeight:c,floatingColumns:d,gridX:h,width:m,visibleColumns:p,visibleColumnWidths:g,visibleColumnXs:f,floatingLeftColumnCount:b,floatingLeftWidth:C,floatingRightWidth:w,modelColumns:S,columnHeaderMaxDepth:I}=o;if(c<=0)return;const{headerHiddenSeparatorSize:v,headerHiddenSeparatorHoverColor:R,headerSeparatorColor:D,headerSeparatorHoverColor:F}=i,L=c*.5,W=c*(I-1)+c*.5-L*.5,B=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[p[0],p[p.length-1]],{minX:h+C,maxX:m-w}),B&&this.drawColumnHeadersForRange(e,t,[d[0],d[d.length-1]],{minX:h,maxX:h+C}),D){e.strokeStyle=D;const N=[...g.entries()].filter(([_,k])=>k===0).map(([_])=>_);e.beginPath(),e.fillStyle=D;for(let _=0;_<N.length;_+=1){const k=N[_],P=A(f,k),H=A(g,k),V=h+P+H+.5-v*.5;e.rect(V,W,v,L)}e.fill()}if(F){let{index:N,depth:_}=r!=null?r:{};if(N==null&&n!=null&&s!=null){const P=Zi.getColumnSeparator(U.getGridPointFromXY(n,s,o),o,a,i);N=P==null?void 0:P.index,_=P==null?void 0:P.depth}let k;if(N==null)k=!1;else{const P=S.get(N),H=S.get(N+1);P==null||H==null?k=!1:k=a.textForColumnHeader(P,_)!==a.textForColumnHeader(H,_)}if(k&&N!=null&&_!=null&&(!l||r!=null)){e.strokeStyle=F;const P=A(f,N),H=A(g,N),V=h+P+H+.5,G=p.indexOf(N),Q=G<p.length-1?p[G+1]:null,J=Q!=null?g.get(Q):null,re=H===0,Ce=J!=null&&J===0;re?(e.strokeStyle=R,e.fillStyle=R,e.fillRect(V,W,v*.5,L)):Ce&&(e.fillStyle=F,e.fillRect(V-v*.5,W,v*.5,L)),e.beginPath(),e.moveTo(V,(I-_-1)*c),e.lineTo(V,(I-_)*c-1),e.stroke()}}e.restore()}drawColumnHeadersForRange(e,t,n,s){const{model:i}=t,{columnHeaderMaxDepth:o}=i;if(o!==0)for(let r=0;r<=o;r+=1)this.drawColumnHeadersAtDepth(e,t,n,s,r)}drawColumnHeadersAtDepth(e,t,n,s,i){var D,F,L,W,B,N;const{metrics:o,model:r,theme:l}=t,{modelColumns:a,visibleColumnXs:c,gridX:d,calculatedColumnWidths:h,userColumnWidths:m,visibleColumnWidths:p,movedColumns:g}=o,{columnHeaderHeight:f,columnWidth:b}=l,{columnHeaderMaxDepth:C}=r,{minX:w,maxX:S}=s,I=S-w;if(C===0)return;const v=n[0],R=n[1];if(e.save(),e.translate(0,(C-i-1)*f),i===0){this.drawColumnHeader(e,t,"",w,S);for(let _=v;_<=R;_+=1)this.drawColumnHeaderAtIndex(e,t,_,s)}if(i>0){let _=v;for(;_<=R;){const{columnCount:k}=o,P=A(a,_),H=r.textForColumnHeader(P,i),V=r.colorForColumnHeader(P,i);let G=A(c,_)+d,Q=G+A(p,_);if(H!=null){let J=_-1;for(;J>=0&&(Q-G<I||G>w);){const ve=(D=a.get(J))!=null?D:U.getModelIndex(J,g);if(ve==null||r.textForColumnHeader(ve,i)!==H)break;G-=(L=(F=m.get(ve))!=null?F:h.get(ve))!=null?L:b,J-=1}let re=_+1;for(;re<k&&(Q-G<I||Q<S);){const ve=(W=a.get(re))!=null?W:U.getModelIndex(re,g);if(r.textForColumnHeader(ve,i)!==H)break;Q+=(N=(B=m.get(ve))!=null?B:h.get(ve))!=null?N:b,re+=1}_=re-1;const Ce=Q-G>=I;let de=G;Ce&&(Q<S?de=Q-I:G<w&&(de=w)),this.drawColumnHeader(e,t,H,de,Math.min(Q-G,I),{backgroundColor:V!=null?V:void 0},s)}_+=1}}e.restore()}drawColumnHeaderAtIndex(e,t,n,s){var g;const{metrics:i,model:o}=t,{modelColumns:r,visibleColumnWidths:l,visibleColumnXs:a,gridX:c}=i,d=A(l,n),h=A(a,n)+c,m=A(r,n),p=o.textForColumnHeader(m);p!=null&&this.drawColumnHeader(e,t,p,h,d,{backgroundColor:(g=o.colorForColumnHeader(m))!=null?g:void 0},s)}drawColumnHeader(e,t,n,s,i,o,r){if(i<=0)return;const{metrics:l,theme:a}=t,{headerHorizontalPadding:c,columnHeaderHeight:d,headerBackgroundColor:h,headerColor:m,headerSeparatorColor:p,black:g,white:f}=a,{fontWidths:b,width:C}=l,w=b.get(e.font)||an.DEFAULT_FONT_WIDTH,I=(i-c*2)/w,{backgroundColor:v=h,separatorColor:R=p}=o!=null?o:{};let{textColor:D=m}=o!=null?o:{};try{const re=this.getCachedColorIsDark(v),Ce=this.getCachedColorIsDark(D);re&&Ce?D=f:!re&&!Ce&&(D=g)}catch{}let{minX:F=0,maxX:L=C}=r!=null?r:{};e.save(),e.rect(F,0,L-F,d),e.clip(),v&&(e.fillStyle=v,e.fillRect(s,0,i,d)),R&&(e.strokeStyle=R,e.beginPath(),s>0&&(e.moveTo(s+.5,0),e.lineTo(s+.5,d)),e.moveTo(s+i+.5,0),e.lineTo(s+i+.5,d),e.moveTo(s,d-.5),e.lineTo(s+i,d-.5),e.stroke()),e.beginPath(),e.rect(s,0,i,d),e.clip(),e.fillStyle=D;let W=n;I<=0?W="":W.length>I&&(W=`${W.substring(0,I-1)}\u2026`);const B=W.length*w;let N=s+i*.5;const _=d*.5;F+=c,L-=c;const k=s+c,P=rt(k,F,L),H=s+i-c,G=rt(H,F,L)-P,Q=N-B*.5<F,J=N+B*.5>L;Q?B<G?N=F+B*.5:N=H-B*.5:J&&(B<G?N=L-B*.5:N=k+B*.5),e.textAlign="center",e.fillText(W,N,_),e.restore()}drawRowHeaders(e,t){const{mouseX:n,mouseY:s,metrics:i,theme:o,draggingRowSeparator:r}=t,{gridY:l,rowHeaderWidth:a,height:c,visibleRows:d,visibleRowHeights:h,visibleRowYs:m}=i;if(a<=0)return;const{headerBackgroundColor:p,headerColor:g,headerHiddenSeparatorSize:f,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:C,headerSeparatorHoverColor:w}=o,S=a*.5,I=a*.5-S*.5;if(e.save(),e.beginPath(),e.fillStyle=p,e.fillRect(0,0,a,c),C){e.strokeStyle=C,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(a,l+.5);const v=[];let R=!1;for(let D=0;D<d.length;D+=1){const F=d[D],L=A(m,F),W=A(h,F);if(W>0){const B=l+L+W+.5;e.moveTo(0,B),e.lineTo(a,B),R=!1}else R||(R=!0,v.push(F))}e.moveTo(a-.5,0),e.lineTo(a-.5,c),e.stroke(),e.beginPath(),e.fillStyle=C;for(let D=0;D<v.length;D+=1){const F=v[D],L=A(m,F),W=A(h,F),B=l+L+W+.5-f*.5;e.rect(I,B,S,f)}e.fill()}if(w){let{index:v=null}=r!=null?r:{};if(v==null&&n!=null&&s!=null&&(v=U.getRowSeparatorIndex(n,s,i,o)),v!=null){e.strokeStyle=w;const R=A(m,v),D=A(h,v),F=l+R+D+.5,L=d.indexOf(v),W=L<d.length-1?d[L+1]:null,B=W!=null?h.get(W):null,N=D===0,_=B!=null&&B===0;N?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(I,F,S,f*.5)):_&&(e.fillStyle=w,e.fillRect(I,F-f*.5,S,f*.5)),e.beginPath(),e.moveTo(.5,F),e.lineTo(a+.5,F),e.stroke()}}e.beginPath(),e.rect(0,l,a,c),e.clip(),e.fillStyle=g,e.textAlign="right";for(let v=0;v<d.length;v+=1){const R=d[v],D=A(h,R),F=A(m,R)+l;this.drawRowHeader(e,t,R,F,D)}e.restore()}drawRowHeader(e,t,n,s,i){if(i<=0)return;const{metrics:o,model:r,theme:l}=t,{modelRows:a,rowHeaderWidth:c}=o,d=A(a,n),h=c-l.cellHorizontalPadding,m=s+i*.5;e.fillText(r.textForRowHeader(d),h,m)}drawRowFooters(e,t){const{mouseX:n,mouseY:s,metrics:i,model:o,theme:r,draggingRowSeparator:l}=t,{gridY:a,gridX:c,maxX:d,modelRows:h,rowFooterWidth:m,height:p,verticalBarWidth:g,visibleRows:f,visibleRowHeights:b,visibleRowYs:C,width:w}=i;if(m<=0)return;const{cellHorizontalPadding:S,headerBackgroundColor:I,headerColor:v,headerHiddenSeparatorSize:R,headerHiddenSeparatorHoverColor:D,headerSeparatorColor:F,headerSeparatorHoverColor:L}=r,W=m*.5,B=m*.5-W*.5,N=Math.min(c+d,w-m-g);if(e.save(),e.beginPath(),e.fillStyle=I,e.fillRect(N,a,m,p),F){e.strokeStyle=F,e.beginPath(),e.moveTo(N,a+.5),e.lineTo(m,a+.5);const k=[];let P=!1;for(let H=0;H<f.length;H+=1){const V=f[H],G=A(C,V),Q=A(b,V);if(Q>0){const J=a+G+Q+.5;e.moveTo(N+.5,J),e.lineTo(N+m-.5,J),P=!1}else P||(P=!0,k.push(V))}e.moveTo(N+.5,a),e.lineTo(N+.5,p),e.stroke(),e.beginPath(),e.fillStyle=F;for(let H=0;H<k.length;H+=1){const V=k[H],G=A(C,V),Q=A(b,V),J=a+G+Q+.5-R*.5;e.rect(N+B,J,W,R)}e.fill()}if(L){let{index:k=null}=l!=null?l:{};if(k==null&&n!=null&&s!=null&&(k=U.getRowSeparatorIndex(n,s,i,r)),k!=null){e.strokeStyle=L;const P=A(C,k),H=A(b,k),V=a+P+H+.5,G=f.indexOf(k),Q=G<f.length-1?f[G+1]:null,J=Q!=null?b.get(Q):null,re=H===0,Ce=J!=null&&J===0;re?(e.strokeStyle=D,e.fillStyle=D,e.fillRect(B,V,W,R*.5)):Ce&&(e.fillStyle=L,e.fillRect(B,V-R*.5,W,R*.5)),e.beginPath(),e.moveTo(N+.5,V),e.lineTo(N+m+.5,V),e.stroke()}}e.beginPath(),e.rect(N,a,m,p),e.clip(),e.fillStyle=v,e.textAlign="left";const _=N+S;for(let k=0;k<f.length;k+=1){const P=f[k],H=A(b,P);if(H>0){const V=A(C,P)+a,G=A(h,P),Q=V+H*.5;e.fillText(o.textForRowFooter(G),_,Q)}}e.restore()}drawSelectedRanges(e,t,n={}){const{cursorColumn:s,cursorRow:i,draggingRow:o,draggingColumn:r,editingCell:l,metrics:a,model:c,selectedRanges:d,theme:h}=t,{visibleColumnWidths:m,visibleColumnXs:p,visibleRowHeights:g,visibleRowYs:f,width:b,height:C}=a,{left:w=a.left,top:S=a.top,right:I=a.right,bottom:v=a.bottom,minY:R=-10,maxY:D=C+10,minX:F=-10,maxX:L=b+10}=n;if(d.length===0)return;const W=Ae(c)&&c.isEditable&&l==null&&o==null&&r==null&&s!=null&&i!=null&&p.has(s)&&f.has(i);if(W){const B=A(p,s),N=A(f,i),_=A(m,s),k=A(g,i);e.save(),e.beginPath(),e.rect(0,0,b,C),e.rect(B,N,_,k),e.clip("evenodd")}e.beginPath();for(let B=0;B<d.length;B+=1){const N=d[B],_=N.startColumn!==null?N.startColumn:w,k=N.startRow!==null?N.startRow:S,P=N.endColumn!==null?N.endColumn:I,H=N.endRow!==null?N.endRow:v;if(H>=S&&v>=k&&P>=w&&I>=_){const V=_>=w&&p.has(_)?Math.round(A(p,_))+.5:F,G=k>=S&&f.has(k)?Math.max(Math.round(A(f,k))+.5,.5):R,Q=P<=I&&p.has(P)?Math.round(A(p,P)+A(m,P))-.5:L,J=H<=v&&f.has(H)?Math.round(A(f,H)+A(g,H))-.5:D;e.rect(V,G,Q-V,J-G)}e.fillStyle=h.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=h.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=h.selectionOutlineColor,e.lineWidth=1,e.stroke()}W&&s!=null&&i!=null&&(e.restore(),this.drawActiveCell(e,t,s,i))}drawActiveCell(e,t,n,s,i=an.ACTIVE_CELL_BORDER_WIDTH){const{metrics:o,theme:r}=t,{visibleColumnWidths:l,visibleColumnXs:a,visibleRowHeights:c,visibleRowYs:d}=o,h=A(a,n),m=A(d,s),p=A(l,n),g=A(c,s);let f=h-i*.5,b=m-i*.5,C=p+i,w=g+i;f<=0&&(C+=f-1,f=1),b<=0&&(w+=b-1,b=1);const{lineWidth:S}=e;e.beginPath(),e.lineWidth=i,e.strokeStyle=r.selectionOutlineColor,this.drawRoundedRect(e,f,b,C,w),e.stroke(),e.lineWidth=S}drawRoundedRect(e,t,n,s,i,o=an.DEFAULT_EDGE_RADIUS){e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+s-o,n),e.quadraticCurveTo(t+s,n,t+s,n+o),e.lineTo(t+s,n+i-o),e.quadraticCurveTo(t+s,n+i,t+s-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}drawDraggingColumn(e,t){var J;const{draggingColumn:n,metrics:s,mouseX:i,theme:o,model:r}=t;if(n==null||i==null)return;const{range:l,depth:a}=n,{gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,height:p,width:g,columnHeaderMaxDepth:f,columnHeaderHeight:b,movedColumns:C,modelColumns:w,floatingLeftWidth:S}=s,I=(J=w.get(l[0]))!=null?J:U.getModelIndex(l[0],C),v=r.getColumnHeaderGroup(I,a);if(a>0&&!v)return;const[R,D]=l,F=A(h,R),W=A(h,D)+A(m,D)-F,B=n.left,{backgroundColor:N,font:_,headerFont:k,reorderOffset:P,shadowBlur:H,shadowColor:V}=o,G=(f-a-1)*b;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(S,0,g,p),e.clip(),e.fillStyle=N,e.fillRect(F,G,W,p),e.restore(),e.translate(0,P),e.save(),e.shadowColor=V,e.shadowBlur=H,e.fillStyle=N,e.fillRect(n.left,G+P,n.width,p),e.restore(),e.beginPath(),e.rect(n.left,G,n.width+1,p),e.clip(),e.translate(B-F,0),e.font=k;const Q=[];for(let re=n.range[0];re<=n.range[1];re+=1)Q.push(re);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[Q[0],Q[Q.length-1]],{minX:F,maxX:g}),e.translate(0,d),e.font=_,this.drawGridBackground(e,t);for(let re=R;re<=D;re+=1)this.drawColumnCellContents(e,t,re);e.restore()}drawDraggingRow(e,t){const{draggingRow:n,draggingRowOffset:s,metrics:i,mouseY:o,theme:r}=t;if(n==null||o==null)return;const{gridX:l,gridY:a,visibleRowYs:c,visibleRowHeights:d,width:h}=i,m=A(c,n),p=A(d,n)+1,{backgroundColor:g,font:f,headerFont:b,reorderOffset:C,shadowBlur:w,shadowColor:S}=r;e.save(),e.translate(0,a),e.fillStyle=g,e.fillRect(0,m,h,p),e.translate(l+C,o-m-a-(s!=null?s:0)),e.save(),e.shadowColor=S,e.shadowBlur=w,e.fillStyle=g,e.fillRect(-l,m,h,p),e.restore(),e.beginPath(),e.rect(-l,m,h,p),e.clip(),e.font=f,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-a),e.font=b,this.drawRowHeaders(e,t),e.restore()}drawScrollBars(e,t){const{isDraggingHorizontalScrollBar:n,isDraggingVerticalScrollBar:s,isDragging:i,metrics:o,mouseX:r,mouseY:l,theme:a}=t;if(a.scrollBarSize<=0)return;const{rowHeaderWidth:c,columnHeaderHeight:d,width:h,height:m,handleHeight:p,handleWidth:g,scrollX:f,scrollY:b,hasHorizontalBar:C,hasVerticalBar:w,barWidth:S,barHeight:I}=o,{scrollBarBackgroundColor:v,scrollBarHoverBackgroundColor:R,scrollBarCasingColor:D,scrollBarCornerColor:F,scrollBarColor:L,scrollBarHoverColor:W,scrollBarActiveColor:B,scrollBarSize:N,scrollBarHoverSize:_,scrollBarCasingWidth:k,scrollBarSelectionTick:P,scrollBarSelectionTickColor:H,scrollBarActiveSelectionTickColor:V,autoSelectRow:G,autoSelectColumn:Q}=a,J=r!=null&&l!=null&&r<=h&&l<=m,re=s||w&&!n&&!i&&r!=null&&l!=null&&r>=h-_&&l<=I+d&&J,Ce=n||C&&!s&&!i&&!re&&r!=null&&l!=null&&l>=m-_&&r<=S-c&&J,de=Ce?_:N,ve=re?_:N;if(e.translate(c,d),C&&w&&(e.fillStyle=D,e.fillRect(h-c-N,m-d-N,N,N),e.fillStyle=F,e.fillRect(h-c-N+k,m-d-N+k,N-k,N-k)),C){const _e=f,Ke=m-d-de;if(e.fillStyle=D,e.fillRect(0,Ke,S,de-k),e.fillStyle=Ce?R:v,e.fillRect(0,Ke+k,S,de-k),n?e.fillStyle=B:Ce?e.fillStyle=W:e.fillStyle=L,e.fillRect(_e,Ke+k,g,de-k),!G&&P&&H!=null&&V!=null){e.fillStyle=H;const{selectedRanges:Dt,cursorColumn:Xe}=t,{lastLeft:Ze,columnCount:Le}=o,_n=[...Dt].filter(pe=>pe.startColumn!=null&&pe.endColumn!=null).map(pe=>[pe.startColumn,pe.endColumn]).sort(U.compareRanges),en=U.mergeSortedRanges(_n),nt=pe=>pe<=Ze?pe/Ze*(S-g):S-g+(pe-Ze)/(Le-Ze)*g;for(let pe=0;pe<en.length;pe+=1){const ze=en[pe],Ue=ze[0],ht=ze[1];if(Ue!=null&&ht!=null&&(Ue!==Xe||ht!==Xe)){const Mt=nt(Ue),Nt=Math.max(1,Math.round(nt(ht+1)-Mt)),ut=de-k;e.fillRect(Mt,Ke+k+Math.round(ut/3),Nt,Math.round(ut/3))}}if(Xe!=null){const pe=nt(Xe),ze=2,Ue=de-k;e.fillStyle=V,e.fillRect(pe,Ke+k,ze,Ue)}}}if(w){const _e=h-c-ve,Ke=b;if(e.fillStyle=D,e.fillRect(_e,0,ve-k,I),e.fillStyle=re?R:v,e.fillRect(_e+k,0,ve-k,I),s?e.fillStyle=B:re?e.fillStyle=W:e.fillStyle=L,e.fillRect(_e+k,Ke,ve-k,p),!Q&&P&&H!=null&&V!=null){const{selectedRanges:Dt,cursorRow:Xe}=t,{lastTop:Ze,rowCount:Le}=o,_t=pe=>pe<=Ze?pe/Ze*(I-p):I-p+(pe-Ze)/(Le-Ze)*p;e.fillStyle=H;const en=[...Dt].filter(pe=>pe.startRow!=null&&pe.endRow!=null).map(pe=>[pe.startRow,pe.endRow]).sort(U.compareRanges),nt=U.mergeSortedRanges(en);for(let pe=0;pe<nt.length;pe+=1){const ze=nt[pe],Ue=ze[0],ht=ze[1];if(Ue!=null&&ht!=null&&(Ue!==Xe||ht!==Xe)){const Mt=_t(Ue),Nt=ve-k,ut=Math.max(1,Math.round(_t(ht+1)-Mt));e.fillRect(_e+k+Math.round(Nt/3),Mt,Math.round(Nt/3),ut)}}if(Xe!=null){const pe=Math.round(_t(Xe)),ze=ve-k,Ue=2;e.fillStyle=V,e.fillRect(_e+k,pe,ze,Ue)}}}e.translate(-c,-d)}};let Rs=an;Rs.DEFAULT_FONT_WIDTH=10;Rs.DEFAULT_EDGE_RADIUS=2;Rs.ACTIVE_CELL_BORDER_WIDTH=2;const el=100;class iu extends je{constructor(){super(...arguments),this.hasExtendedFloating=!1}onDown(t,n,s){const{x:i,y:o,column:r,row:l}=t,{metrics:a}=n;if(!a)throw new Error("metrics not set");const{gridX:c,gridY:d,maxX:h,maxY:m}=a,p=i-c,g=o-d;if(p<0||g<0||r==null&&p>h||l==null&&g>m)return!1;const f=U.isModifierKeyDown(s),b=s.shiftKey;f||(b?n.trimSelectedRanges():n.clearSelectedRanges());const C=n.getTheme(),{autoSelectRow:w,autoSelectColumn:S}=C;return(r!==null||!S)&&(l!==null||!w)&&(n.focus(),n.moveCursorToPosition(r,l,b,!1,b&&f)),this.startPoint=t,this.hasExtendedFloating=!1,this.dragBounds=U.getScrollDragBounds(a,l,r),!0}onDrag(t,n){if(this.startPoint===void 0)return!1;this.stopTimer();const{row:s,column:i}=this.startPoint,{x:o,y:r}=t;let{row:l,column:a}=t;const{metrics:c}=n;if(!c)throw new Error("metrics not set");const{left:d,lastLeft:h,top:m,lastTop:p,columnWidth:g,rowHeight:f}=c,b=U.getScrollDragBounds(c,s,i);let C=0,w=0;if(d<h&&(o<b.x1?C=o-b.x1:o>b.x2&&(C=o-b.x2)),m<p&&(r<b.y1?w=r-b.y1:r>b.y2&&(w=r-b.y2)),C!==0||w!==0)this.startTimer(n,t,C>0?Math.ceil(C/g):Math.floor(C/g),w>0?Math.ceil(w/f):Math.floor(w/f));else if(l!=null&&a!=null){const{floatingTopRowCount:S,floatingBottomRowCount:I,floatingLeftColumnCount:v,floatingRightColumnCount:R,columnCount:D,rowCount:F,bottom:L,right:W,topVisible:B,bottomVisible:N,leftVisible:_,rightVisible:k}=c;this.hasExtendedFloating||(s!==null&&s<S&&l>=S?(l=S,this.hasExtendedFloating=!0):s!==null&&s>=F-I&&l<F-I&&(l=F-I-1,this.hasExtendedFloating=!0),i!==null&&i<v&&a>=v?(a=v,this.hasExtendedFloating=!0):i!==null&&i>=D-R&&a<D-R&&(a=D-R-1,this.hasExtendedFloating=!0)),s!==null&&!U.isFloatingRow(s,c)&&U.isFloatingRow(l,c)&&(s>l&&l<m?l=B-1:s<l&&l>L&&(l=N+1)),i!==null&&!U.isFloatingColumn(i,c)&&U.isFloatingColumn(a,c)&&(i>a&&a<d?a=_-1:i<a&&a>W&&(a=k+1)),n.moveCursorToPosition(a,l,!0,!0)}return!0}onUp(t,n){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),n.commitSelection()),!1}moveSelection(t,n,s,i){const{row:o,column:r}=n,{metrics:l}=t;if(!l)throw new Error("metrics not set");const{selectionEndRow:a,selectionEndColumn:c}=t.state;if(a==null||c==null)throw new Error("selection not set");const{rowCount:d,columnCount:h}=l,m=s<0&&r!=null?r:0,p=s>0&&r!=null?r:h-1,g=i<0&&o!=null?o:0,f=i>0&&o!=null?o:d-1;t.moveCursorToPosition(Math.min(Math.max(m,c+s),p),Math.min(Math.max(g,a+i),f),!0),this.lastTriggerTime=Date.now()}startTimer(t,n,s,i){this.stopTimer();const o=this.lastTriggerTime!=null?el-Math.min(el,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(t,n,s,i),this.startTimer(t,n,s,i)},o)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const tl=5,ou=1e3/60,vi=10;function bn(e,t,n,s){var S,I,v,R,D,F,L;const{modelColumns:i,movedColumns:o,visibleColumnXs:r,columnCount:l,visibleColumnWidths:a,userColumnWidths:c,calculatedColumnWidths:d,floatingLeftWidth:h,maxX:m}=n;if(t==null||e==null||e>l||e<0)return null;const p=(S=i.get(e))!=null?S:U.getModelIndex(e,o),g=s.getColumnHeaderGroup(p,t),f=g!=null;let b,C,w;if(g!=null){const[W,B]=g.getVisibleRange(o);b=(I=r.get(W))!=null?I:h,C=((v=r.get(B))!=null?v:m)+((R=a.get(B))!=null?R:0),w=[W,B]}else{const W=r.get(e);if(W==null)return null;b=W,C=b+((L=(F=(D=a.get(e))!=null?D:c.get(p))!=null?F:d.get(p))!=null?L:0),w=[e,e]}return{visibleIndex:e,modelIndex:p,left:b,right:C,width:C-b,isColumnGroup:f,range:w,depth:t}}class ru extends je{constructor(){super(...arguments),this.cursor=null,this.draggingColumn=null}setScrollInterval(t,n){this.scrollingInterval!=null&&n===this.scrollingDirection||(this.scrollingDirection=n,this.scrollingInterval=window.setInterval(()=>{var f,b;const{metrics:s}=t;if(!s)return;const{left:i,lastLeft:o,leftOffset:r,userColumnWidths:l,calculatedColumnWidths:a,movedColumns:c,visibleColumnWidths:d}=s;let h=i,m=r;if(n==="left")for(m-=vi;m<0;){h-=1;const C=U.getModelIndex(i-1,c),w=(f=l.get(C))!=null?f:a.get(C);w===void 0?m=0:m+=w,h<0&&(m=0,h=0)}else{m+=vi;let C=d.get(i);for(;C!==void 0&&m>C;){h+=1,m-=C;const w=U.getModelIndex(i+1,c);C=(b=l.get(w))!=null?b:a.get(w),h>o&&(m=0,h=o)}}const{mouseX:p,mouseY:g}=t.state;!s||p==null||g==null||(this.moveDraggingColumn(p,t,n==="left"?-vi:vi),t.setState({left:h,leftOffset:m}),(n==="left"&&h===0&&r===0||n==="right"&&h===o)&&this.clearScrollInterval())},ou))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(t,n){const{model:s}=n.props,{x:i,column:o,columnHeaderDepth:r}=t,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const a=bn(o,r,l,s);if(o==null||a==null||r==null||r>0&&!a.isColumnGroup)return!1;const{rowHeaderWidth:c}=l;return this.initialGridPoint=t,this.draggingColumn=null,this.cursor=null,a.modelIndex!=null&&r!=null&&s.isColumnMovable(a.modelIndex,r)&&(this.draggingOffset=i-a.left-c,this.initialOffset=this.draggingOffset),!1}onDrag(t,n,s){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;const{x:i,y:o}=t,{columnHeaderDepth:r}=this.initialGridPoint,{model:l}=n.props;let{draggingColumn:a}=this;const{metrics:c}=n;if(!c)throw new Error("Metrics not set");if(!a&&Math.abs(this.initialGridPoint.x-i)<tl&&Math.abs(this.initialGridPoint.y-o)<tl)return!1;if(a==null){const d=bn(this.initialGridPoint.column,r,c,l);if(!d||r==null||!l.isColumnMovable(d.modelIndex)||r>0&&!d.isColumnGroup||d.range[0]==null)return!1;a={range:d.range,depth:r,left:d.left,width:d.width};const h=bn(a.range[0],0,c,l),m=bn(a.range[1],0,c,l);if(!h||!m)return!1;this.draggingColumn=a,n.setState({draggingColumn:a,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(t.x,n,s.movementX),!0}moveDraggingColumn(t,n,s){var D,F,L,W,B;if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||s===0)return;if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+s||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+s?this.draggingOffset=this.initialOffset:this.draggingOffset+=s,this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}const{depth:i}=this.draggingColumn,{model:o}=n.props,{movedColumns:r}=n.state,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const{floatingLeftWidth:a,width:c,columnHeaderMaxDepth:d,visibleColumnXs:h}=l,m=s<0,p=bn(this.draggingColumn.range[0],i,l,o);if(!p)return;const g=t-this.draggingOffset,f=g+p.width;this.draggingColumn={...this.draggingColumn,left:g},n.setState({draggingColumn:this.draggingColumn});const b=bn(U.getColumnAtX(rt(m?g:f,a,c),l,!0),i,l,o),C=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);if(!b)return;if(C){const N=C.getVisibleRange(r);if(b.visibleIndex<N[0]){const _=this.moveColumn(p,N[0],r);this.draggingOffset=t-((D=h.get(N[0]))!=null?D:0),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:_});return}if(b.visibleIndex>N[1]){const _=this.moveColumn(p,N[1]-(p.range[1]-p.range[0]),r),{right:k=0}=(F=bn(N[1],0,l,o))!=null?F:{};this.draggingOffset=t-(k-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:_});return}}if(!o.isColumnMovable(b.modelIndex)){let N=b.visibleIndex;if(m)for(N+=1;N<p.visibleIndex&&!o.isColumnMovable(U.getModelIndex(N,r));)N+=1;else for(N-=1;N>p.visibleIndex&&!o.isColumnMovable(U.getModelIndex(N,r));)N-=1;if(N!==p.visibleIndex){m||(N-=p.range[1]-p.range[0]);const k=this.moveColumn(p,N,r);n.setState({movedColumns:k,draggingColumn:this.draggingColumn})}const _=bn(N,0,l,o);m?this.draggingOffset=t-((L=_==null?void 0:_.left)!=null?L:0):this.draggingOffset=t-(((W=_==null?void 0:_.right)!=null?W:0)-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}if(g<=a?this.setScrollInterval(n,"left"):f>c?this.setScrollInterval(n,"right"):this.clearScrollInterval(),b.visibleIndex===p.visibleIndex||m&&p.visibleIndex<b.visibleIndex||!m&&p.visibleIndex>b.visibleIndex)return;const w=b.left+b.width*.5,S=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);let I,v=((B=S==null?void 0:S.depth)!=null?B:d)-1;for(;v>=0&&I===void 0;)I=o.getColumnHeaderGroup(b.modelIndex,v),v-=1;let R;m&&g<w&&(!I||b.visibleIndex===I.getVisibleRange(r)[0])&&(R=this.moveColumn(p,b.range[0],r)),!m&&f>w&&(!I||b.visibleIndex===I.getVisibleRange(r)[1])&&(R=this.moveColumn(p,b.range[1]-(p.range[1]-p.range[0]),r)),R&&(this.draggingColumn={...this.draggingColumn,left:g},n.setState({movedColumns:R,draggingColumn:this.draggingColumn}))}moveColumn(t,n,s){const i=t.isColumnGroup?U.moveRange(t.range,n,s):U.moveItem(t.visibleIndex,n,s),o=n-t.range[0],r=[t.range[0]+o,t.range[1]+o];return this.draggingColumn&&(this.draggingColumn={...this.draggingColumn,range:r}),i}onUp(t,n){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,n.setState({draggingColumn:null,isDragging:!1}),!0):!1}}class rr extends je{constructor(){super(...arguments),this.cursor="default"}static getLeftWithOffsetFromRawLeft(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToColumn)return{left:Math.round(n),leftOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleColumnWidths.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleColumnWidth(r,d)}const c=a*l;return{left:r,leftOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barLeft:c,barWidth:d,height:h,hasHorizontalBar:m}=r;return m&&i>0&&a>=h-o&&a<h&&l>c&&l<c+d}getLeftWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{barWidth:o,handleWidth:r,lastLeft:l,barLeft:a,columnCount:c,scrollableContentWidth:d,scrollableViewportWidth:h}=s,m=i-a,p=rt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{left:0,leftOffset:p*(d-h)};const g=p*l;return rr.getLeftWithOffsetFromRawLeft(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{handleWidth:o,barLeft:r,scrollX:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;const{left:c,leftOffset:d}=this.getLeftWithOffset(t,n);n.setViewState({left:c,leftOffset:d,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(t,n){if(this.dragOffset!=null){const{left:s,leftOffset:i}=this.getLeftWithOffset(t,n);return n.setViewState({left:s,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(t,n){return this.isInScrollBar(t,n)}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class lu extends je{constructor(){super(...arguments),this.cursor="move"}onDown(t,n){const{model:s}=n.props,{x:i,y:o,row:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{columnHeaderHeight:a,rowHeaderWidth:c,visibleRowYs:d}=l;if(i<=c&&r!==null&&s.isRowMovable(r)){const h=A(d,r);this.draggingOffset=o-h-a,n.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(t,n){if(this.draggingOffset==null)return!1;const{model:s}=n.props;let{draggingRow:i}=n.state;const{mouseX:o,mouseY:r}=n.state;if(o==null||r==null)return!1;if(i==null){const{row:R}=n.getGridPointFromXY(o,r);if(R!=null&&!s.isRowMovable(R)||(i=R,n.setState({draggingRow:i,isDragging:!0}),i==null))return!1}const{metrics:l}=n;if(!l)throw new Error("metrics not set");const{top:a,lastTop:c,bottom:d,bottomVisible:h,rowCount:m,columnHeaderHeight:p,visibleRowHeights:g,visibleRowYs:f,height:b}=l;let C=p;if(a<i){const R=i-1;C=A(f,R)+A(g,R)*.5+p}let w=b;if(i<d){const R=i+1;w=A(f,R)+A(g,R)*.5+p}let{movedRows:S}=n.state;r<C&&i>0&&s.isRowMovable(i-1)?(S=U.moveItem(i,i-1,S),i-=1):w<r&&i<m-1&&s.isRowMovable(i+1)&&(S=U.moveItem(i,i+1,S),i+=1),n.setState({movedRows:S,draggingRow:i});const I=p+A(g,a)*.5,v=p+A(f,h)+A(g,h)*.5;return r<I&&a>0?n.setState({top:a-1}):r>v&&a<c&&n.setState({top:a+1}),!0}onUp(t,n){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,n.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}class lr extends pa{constructor(){super(...arguments),this.hiddenCursor="s-resize",this.defaultCursor="row-resize",this.pointProperty="y",this.userSizesProperty="userRowHeights",this.visibleOffsetProperty="visibleRowYs",this.visibleSizesProperty="visibleRowHeights",this.marginProperty="columnHeaderHeight",this.calculatedSizesProperty="calculatedRowHeights",this.modelIndexesProperty="modelRows",this.firstIndexProperty="firstRow",this.treePaddingProperty="treePaddingY",this.getHiddenItems=U.getHiddenRows,this.getNextShownItem=U.getNextShownRow,this.getSeparator=lr.getRowSeparator}static getRowSeparator(t,n,s,i){if(!i.allowRowResize)return null;const{x:o,y:r}=t,l=U.getRowSeparatorIndex(o,r,n,i);return l!=null?{index:l,depth:0}:null}setSize(t,n,s){t.setRowHeight(n,s)}resetSize(t,n){t.resetRowHeight(n)}updateSeparator(t,n){t.setState({draggingRowSeparator:n,isDragging:n!==null})}}class Li extends je{static isInTreeBox(t,n){const{column:s,row:i,x:o,y:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{gridX:a,gridY:c,firstColumn:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowHeights:p,visibleRowYs:g,visibleRowTreeBoxes:f}=l;if(s===d&&i!=null&&f.get(i)!=null&&o>a&&r>c){const b=A(h,s),C=A(m,s),w=A(g,i),S=A(p,i);if(o>=a+b&&o<=a+b+C&&r>=c+w&&r<=c+w+S)return!0}return!1}onDown(t,n){return Li.isInTreeBox(t,n)}onClick(t,n){if(Li.isInTreeBox(t,n)){const{row:s}=t;if(s!==null)return n.toggleRowExpanded(s),!0}return!1}}class au extends je{isInCorner(t,n){const s=n.getTheme(),{scrollBarSize:i}=s,{metrics:o}=n;if(!o)throw new Error("metrics not set");const{x:r,y:l}=t,{width:a,height:c,hasVerticalBar:d,hasHorizontalBar:h}=o;return i>0&&d&&h&&r>=a-i&&l>=c-i&&r<=a&&l<=c}onDown(t,n){return this.isInCorner(t,n)}onUp(t,n){return this.isInCorner(t,n)}onClick(t,n){return this.isInCorner(t,n)}}class ar extends je{constructor(){super(...arguments),this.cursor="default"}static getTopWithOffsetFromRawTop(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToRow)return{top:Math.round(n),topOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleRowHeights.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleRowHeight(r,d)}const c=a*l;return{top:r,topOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barTop:c,barHeight:d,width:h,hasVerticalBar:m}=r;return m&&i>0&&l>=h-o&&l<h&&a>c&&a<c+d}getTopWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{barHeight:o,handleHeight:r,lastTop:l,barTop:a,rowCount:c,scrollableContentHeight:d,scrollableViewportHeight:h}=s,m=i-a,p=rt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{top:0,topOffset:p*(d-h)};const g=p*l;return ar.getTopWithOffsetFromRawTop(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{handleHeight:o,barTop:r,scrollY:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;const{top:c,topOffset:d}=this.getTopWithOffset(t,n);n.setViewState({top:c,topOffset:d,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(t,n){return this.isInScrollBar(t,n)}onDrag(t,n){if(this.dragOffset!=null){const{top:s,topOffset:i}=this.getTopWithOffset(t,n);return n.setViewState({top:s,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class cu extends je{onDoubleClick({column:t,row:n},s){const{model:i}=s.props;return Ae(i)&&t!=null&&n!=null&&i.isEditableRange(j.makeCell(t,n))?(s.startEditing(t,n),!0):!1}}class hs{constructor(t=5e3){this.order=t}onDown(t,n){return!1}}class du extends hs{onDown(t,n){switch(t.key){case"a":if(U.isModifierKeyDown(t))return n.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,t,n);case"ArrowDown":return this.handleArrowMove(0,1,t,n);case"ArrowRight":return this.handleArrowMove(1,0,t,n);case"ArrowLeft":return this.handleArrowMove(-1,0,t,n);case"k":case"K":return U.isModifierKeyDown(t)?!1:this.handlePageUp(t,n);case"j":case"J":return U.isModifierKeyDown(t)?!1:this.handlePageDown(t,n);case"h":case"H":return U.isModifierKeyDown(t)?!1:(t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(0,n.state.cursorRow,t.shiftKey),!0);case"l":case"L":{if(U.isModifierKeyDown(t))return!1;const{model:s}=n.props,{columnCount:i}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(i-1,n.state.cursorRow,t.shiftKey),!0}case"PageDown":return this.handlePageDown(t,n);case"PageUp":return this.handlePageUp(t,n);case"Home":return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(U.isModifierKeyDown(t)?n.state.cursorColumn:0,U.isModifierKeyDown(t)?0:n.state.cursorRow,t.shiftKey,!0,!0),!0;case"End":{const{model:s}=n.props,{columnCount:i,rowCount:o}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(U.isModifierKeyDown(t)?n.state.cursorColumn:i-1,U.isModifierKeyDown(t)?o-1:n.state.cursorRow,t.shiftKey,!0,!0),!0}case"Escape":return n.clearSelectedRanges(),!0;case"Enter":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?j.SELECTION_DIRECTION.UP:j.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?j.SELECTION_DIRECTION.LEFT:j.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(t,n,s,i){const o=s.shiftKey,r=U.isModifierKeyDown(s);o?i.trimSelectedRanges():i.clearSelectedRanges();const{cursorRow:l,cursorColumn:a,selectionEndColumn:c,selectionEndRow:d}=i.state,h=o?c:a,m=o?d:l;if(r){const{model:p}=i.props,{columnCount:g,rowCount:f}=p,b=r&&o;let C=null,w=null;t<0?(C=0,w=m):t>0?(C=g-1,w=m):n<0?(C=h,w=0):n>0&&(C=h,w=f-1),C!=null&&w!=null&&i.moveCursorToPosition(C,w,o,!0,b)}else{if(!i.metrics)throw new Error("grid.metrics are not set");const{theme:p}=i.props,{autoSelectRow:g,autoSelectColumn:f}=p;if(g&&t!==0){const{lastLeft:b}=i.metrics;let{left:C}=i.state;C=rt(C+t,0,b),i.moveCursorToPosition(C,l,o,!1),i.setViewState({left:C})}else if(f&&n!==0){const{lastTop:b}=i.metrics;let{top:C}=i.state;C=rt(C+n,0,b),i.moveCursorToPosition(C,a,o,!1),i.setViewState({top:C})}else i.moveCursor(t,n,o)}return!0}handlePageUp(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{cursorColumn:i,selectionEndRow:o}=n.state,r=o,l=i;if(r==null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m}=c.getMetrics(a);let p=r-(d-h);p-=m?0:1,p=Math.max(p,0);const g=Math.max(p-(r-h),0);return n.moveCursorToPosition(l,p,s,!1),n.setViewState({top:g}),!0}handlePageDown(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{selectionEndRow:i,cursorColumn:o}=n.state,r=i,l=o;if(r===null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m,rowCount:p,lastTop:g}=c.getMetrics(a),f=p-1;let b=d-h+r;b+=m?0:1,b=Math.min(b,f);const C=Math.min(g,b-(r-h));return n.moveCursorToPosition(l,b,s,!1),n.setViewState({top:C}),!0}}class hu extends hs{onDown(t,n){switch(t.key){case"Enter":case" ":return this.handleExpandKey(t,n)}return!1}handleExpandKey(t,n){const{selectedRanges:s}=n.state;if(s.length===1){const i=s[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!n.metrics)throw new Error("grid.metrics not set");const{model:o}=n.props,{startRow:r,startColumn:l}=i;if(r!=null){const a=n.getModelRow(r);if((l===0||l==null)&&qe(o)&&o.isRowExpandable(a))return n.toggleRowExpanded(r),!0}}}return!1}}class uu extends hs{onDown(t,n){if(U.isModifierKeyDown(t))return!1;const{model:s}=n.props,{cursorColumn:i,cursorRow:o}=n.state;if(i==null||o==null||!Ae(s)||!s.isEditableRange(j.makeCell(i,o)))return!1;const r=i,l=o;return r==null||l==null?!1:t.key.length===1?(n.startEditing(r,l,!0,[1,1],t.key),!0):t.key==="F2"?(n.startEditing(r,l),!0):t.key==="Backspace"?(n.startEditing(r,l,!0,void 0,""),!0):t.key==="Delete"?(n.setValueForCell(r,l,""),!0):!1}}function mu(e){var s,i;const t=[],n=e.querySelectorAll("tr");for(let o=0;o<n.length;o+=1){const l=n[o].querySelectorAll("td"),a=[];for(let c=0;c<l.length;c+=1){const d=l[c];a.push((i=(s=d.textContent)==null?void 0:s.trim())!=null?i:"")}t.push(a)}return t}function pu(e){const t=[];return e.forEach(n=>{var i;const s=(i=n.textContent)!=null?i:"";s.length>0&&t.push(s.split(/\t|\u00a0\u00a0 \u00a0/))}),t}function gu(e){var s,i,o;const t=e.querySelector("table");if(t!=null)return mu(t);const n=(i=(s=e.textContent)==null?void 0:s.trim())!=null?i:"";if(n.length>0){const{childNodes:r}=e,l=n.includes(" "),a=n.includes("\xA0\xA0 \xA0");return l&&r.length!==0&&(r.length===1||r.length>1&&!((o=r[0].textContent)!=null&&o.includes(" ")))?n.split(`
|
|
1
|
+
import{A as M,z as y,R as Y,P as Ja,B as u,C as ot,D as $,E as T,F as Bo,G as ue,H as Tt,I as q,J as Fe,K as jt,L as ec,M as tc,N as zi,O as Ys,Q as nc,S as Wo,T as Qs,U as rt,V as Oo,W as Ne,X as Mr,Y as ct,Z as sc,_ as Ao,$ as Xs,a0 as yl}from"./vendor.f4457b06.js";import{e as pn,W as ic,l as ws,K as yt,a as Nr,b as qt}from"./monaco.11e0929b.js";import{P as Ai,b as oc,h as rc,p as lc,o as ac,s as cc,t as dc,c as Co}from"./plotly.b0044521.js";import"./helpers.162e09a8.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const hc="#1a171a",uc="#f0f0ee",mc="#fcd65b",pc="#9edc6f",gc="#76d9e4",fc="#aa9af4",Cc="#f37e3f",bc="#f95d84",wc="#4878ea",Sc="#5b5a5c",vc="#9edc6f",Tc="#fcd65b",Ec="#f37e3f",yc="#f95d84",Rc="#fcfcfa",Ic="#929192",Dc="#373438",Mc="#f0f0ee",Nc="#1a171a",Fc="#2d2a2e",xc="#1a171a",Oc="#f0f0ee",Ac="0.15s",kc={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:hc,white:uc,yellow:mc,green:pc,blue:gc,purple:fc,orange:Cc,red:bc,primary:wc,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:Sc,success:vc,info:Tc,warning:Ec,danger:yc,light:Rc,mid:Ic,dark:Dc,"text-muted":"#929192",interfacewhite:Mc,interfaceblack:Nc,interfacegray:Fc,"content-bg":"#2d2a2e",background:xc,foreground:Oc,transition:Ac},Rt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...kc});class fn extends y.exports.Component{constructor(t){super(t),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=Y.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",...i},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),t=new Ja(s||o,this.element,i),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:i,closeOnBlur:o}=this.props,{show:r}=this.state;return u(ot,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:$("popper",{interactive:i},t),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:T("div",{className:"popper-content",children:[n,u("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return u("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Bo.createPortal(this.renderContent(),this.element)})}}fn.propTypes={children:M.exports.node.isRequired,options:M.exports.shape({}),className:M.exports.string,timeout:M.exports.number,onEntered:M.exports.func,onExited:M.exports.func,isShown:M.exports.bool,closeOnBlur:M.exports.bool,interactive:M.exports.bool,referenceObject:M.exports.shape({}),"data-testid":M.exports.string};fn.defaultProps={options:{},className:"",timeout:Rt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const Lc=-1,Rl=0,Il=1,zo=2,Dl=3,Ml=4;Object.freeze({SILENT:Lc,ERROR:Rl,WARN:Il,INFO:zo,DEBUG:Dl,DEBUG2:Ml});const Ot=()=>{};class Fr{constructor(t,n){this.name=t,this.prefix=t?`[${t}]`:"",this.error=Ot,this.warn=Ot,this.log=Ot,this.info=Ot,this.debug=Ot,this.debug2=Ot,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=Rl?console.error.bind(console,this.prefix):Ot,this.warn=t>=Il?console.warn.bind(console,this.prefix):Ot,this.log=t>=zo?console.log.bind(console,this.prefix):Ot,this.info=this.log,this.debug=t>=Dl?console.debug.bind(console,this.prefix):Ot,this.debug2=t>=Ml?console.debug.bind(console,this.prefix):Ot}}class Pc extends Fr{constructor(t=zo){super(null,t),this.modules={}}module(t){return this.modules[t]||(this.modules[t]=new Fr(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),!this.modules)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const ne=new Pc,Hc=ne.module("Tooltip"),ft=class extends y.exports.Component{constructor(e){super(e),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=Y.createRef(),this.popper=Y.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){ft.shownTooltipCount-=1,ft.shownTooltipCount===0&&(ft.lastHiddenTime=Date.now())}static handleShown(){ft.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:s}=this.state;s!==n&&(s?ft.handleShown():ft.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&ft.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Hc.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(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:s}=this.state;if(!this.popper.current||!this.parent)return;const i=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(ft.shownTooltipCount>0||Date.now()-ft.lastHiddenTime<ft.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:i,"data-testid":o,onEntered:r}=this.props,{isShown:l}=this.state;return u("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u(fn,{className:$(i),options:n,ref:this.popper,onEntered:r,onExited:this.handleExited,interactive:e,referenceObject:s,children:T("div",{className:"tooltip-content",children:[" ",l&&t]})})})}};let me=ft;me.defaultTimeout=500;me.defaultReshowTimeout=100;me.triggerReshowThreshold=300;me.shownTooltipCount=0;me.lastHiddenTime=Date.now();me.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:ft.defaultReshowTimeout,timeout:ft.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0};const _c=100;var Nl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Nl||{});const Yn=class extends y.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((n,s)=>n.filter(i=>i.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Tt(this.updateInputValue,_c),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Y.createRef(),this.cbContainer=Y.createRef(),this.menuContainer=Y.createRef(),this.input=Y.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(s=>s.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:s}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,s)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){var o;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,i=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),i&&n){this.closeMenu();return}(o=this.popper.current)==null||o.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(i=this.input.current)==null||i.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Yn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let s=n;e===Yn.MENU_NAVIGATION_DIRECTION.UP?n>0?(s=(s-1)%t.length,this.setState({keyboardOptionIndex:s})):n===0&&(s=t.length-1,this.setState({keyboardOptionIndex:s})):e===Yn.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(s=(s+1)%t.length,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuBlur(e){var t;e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:$("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?u("div",{className:"no-match",children:e}):n.map((s,i)=>this.renderOption(s,i))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return u("button",{type:"button",className:$("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},s)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultTitle:i,spellCheck:o,"data-testid":r}=this.props,{title:l,menuIsOpen:a,popperOptions:c,invalid:d}=this.state;return T("div",{className:"aci-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:$("form-control",s,"aci-input",{"is-invalid":d&&!a}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r}),u(fn,{ref:this.popper,options:c,className:$("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let $o=Yn;$o.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({}),onChange:M.exports.func,inputPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultTitle:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,noMatchText:M.exports.string,"data-testid":M.exports.string};$o.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};$o.MENU_NAVIGATION_DIRECTION=Nl;M.exports.string.isRequired,M.exports.func.isRequired,M.exports.string,M.exports.string,M.exports.bool,M.exports.bool,M.exports.string,M.exports.string,M.exports.string;M.exports.node.isRequired,M.exports.string,M.exports.object,M.exports.string;const Vc=["primary","secondary","tertiary","success","danger","inline","ghost"],Uc=["group-end"];function Bc(e,t){switch(e){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return $("btn-link",{"btn-link-icon":t,"px-2":t})}}function Wc(e){switch(e){case"group-end":return $("pl-2","pr-3")}}const De=Y.forwardRef((e,t)=>{const{kind:n,variant:s,type:i,tooltip:o,icon:r,disabled:l,active:a,onClick:c,className:d,style:h,children:m,"data-testid":p,"aria-label":g}=e,b=Bc(n,r&&!m);let C;s&&(C=Wc(s));let w;r&&(w=Y.isValidElement(r)?r:u(q,{icon:r}));let S;o&&(S=typeof o=="string"?u(me,{children:o}):o);const I=T("button",{"data-testid":p,ref:t,type:i,className:$("btn",b,C,{active:a},d),onClick:c,style:h,disabled:l,"aria-label":g,children:[r&&w,m,o&&!l&&S]});return l?T("span",{className:"btn-disabled-wrapper",children:[I,o&&S]}):I});De.displayName="Button";De.propTypes={kind:M.exports.oneOf(Vc).isRequired,variant:M.exports.oneOf(Uc),type:M.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return!t&&n&&!s?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return!n&&!t?new Error("Icon is required if no children are provided"):!t&&!Y.isValidElement(n)&&!(n!=null&&n.iconName)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:M.exports.bool,active:M.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},children:M.exports.node,className:M.exports.string,style:M.exports.object,"data-testid":M.exports.string};De.defaultProps={type:"button",onClick:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const zc=({className:e="theme-bg-light",children:t,role:n="role",keyboard:s=!0,isOpen:i=!1,centered:o=!1,size:r,onOpened:l,onClosed:a,toggle:c,"data-testid":d})=>{const h=y.exports.useRef(),m=y.exports.useCallback(g=>{switch(g.key){case"Escape":c==null||c();break}},[c]);y.exports.useEffect(function(){if(i&&s)return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[m,i,s]),y.exports.useEffect(function(){i&&l&&l()},[l,i]),y.exports.useEffect(function(){!i&&a&&a()},[a,i]),i&&!h.current&&(h.current=document.createElement("div"),h.current.setAttribute("style","padding-right: 15px; display: block"),h.current.setAttribute("role","presentation"),document.body.appendChild(h.current));const p=()=>{h.current&&(document.body.removeChild(h.current),h.current=void 0)};return h.current?Bo.createPortal(T(Fe,{children:[u(ot,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearActive:"show",appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:$("modal-backdrop fade"),style:{zIndex:1050}})}),u(ot,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearDone:"show"},timeout:Rt.transitionMs,onExited:p,children:u("div",{className:"modal fade",onClick:c,role:"dialog",style:{display:"block"},children:u("div",{className:$(`modal-dialog ${e}`,{"modal-lg":r==="lg","modal-sm":r==="sm","modal-xl":r==="xl","modal-dialog-centered":o}),style:{zIndex:1040},children:u("div",{className:"modal-content",onClick:g=>g.stopPropagation(),role:"presentation","data-testid":d,children:t})})})})]}),h.current):u(Fe,{})},$c=({className:e="modal-body",style:t,children:n,"data-testid":s})=>u("div",{className:e,"data-testid":s,style:t,children:n}),Gc=({className:e,children:t,closeButton:n=!0,style:s,toggle:i,"data-testid":o})=>T("div",{className:`modal-header ${e}`,style:s,children:[u("h5",{className:"modal-title",children:t}),n&&u("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",onClick:i,children:u("span",{"aria-hidden":"true",children:"\xD7"})})]});M.exports.bool.isRequired,M.exports.string.isRequired,M.exports.oneOfType([M.exports.string,M.exports.func]).isRequired,M.exports.func,M.exports.func.isRequired,M.exports.func,M.exports.func,M.exports.string,M.exports.string,M.exports.string,M.exports.node,M.exports.string;const $i=Y.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,onClick:o,style:r,id:l}=e;return u("button",{ref:t,type:"button",className:$("btn",s),onClick:o,style:r,disabled:i,id:l,children:n})});$i.displayName="Button";$i.propTypes={children:M.exports.node,className:M.exports.string,disabled:M.exports.bool,onClick:M.exports.func,style:M.exports.shape({}),id:M.exports.string};$i.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function bo(e){return e.then!==void 0}const Dn=class{static disableAllActions(){Dn.actionsDisabled=!0}static enableAllActions(){Dn.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){return e.group!==t.group?(e.group||0)>(t.group||0)?1:-1:e.order!==t.order?(e.order||0)>(t.order||0)?1:-1:e.title!==t.title?(e.title||"")>(t.title||"")?1:-1:e!==t?e>t?1:-1:0}static sortActions(e){if(!e||!Array.isArray(e))return[];const t=e.slice();return t.sort(Dn.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Dn.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Dn.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(Dn.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{Dn.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const o=s[i];let r;typeof o=="function"?r=o():r=o,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(i=>i.title||i.then||i.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let i=1;i<n.length+1;i+=1){const o=(s+t*i+n.length)%n.length,r=n[o];if(!(r instanceof Promise)&&r.disabled!==!0)return o}return e}};let Se=Dn;Se.actionsDisabled=!1;const xr=ne.module("GlobalContextAction");class qc extends y.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(t){const n=t;n.contextActions||(n.contextActions=[]);const{action:s}=this.props;!s.title&&!s.menuElement||(n.contextActions||(n.contextActions=[]),n.contextActions.push(s),xr.debug("Received context menu event at global action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s,i;const{action:n}=this.props;if(!Se.actionsDisabled&&((s=n.shortcut)==null?void 0:s.matchesEvent(t))){xr.debug("Global hotkey matched!",t);const o=(i=n.action)==null?void 0:i.call(n,t);(o||o===void 0)&&(t.preventDefault(),t.stopPropagation())}}render(){return null}}class Kc extends y.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let i=0;i<t.length;i+=1){const o=t[i],{shortcut:r}=o;if(o.title||o.menuElement||r){const l=u(qc,{action:o,"data-testid":n},`${o.title}.${r==null?void 0:r.id}`);s.push(l)}}return s}}const bi=ne.module("ContextActions");class se extends y.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=Y.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,i){if(!t||!n||!s||!i)return;const o=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});o.contextActions=i,t.dispatchEvent(o)}static getDerivedStateFromProps(t){if(!t.actions||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(i=>!bo(i)&&typeof i!="function"&&i.isGlobal),s=t.actions.filter(i=>!bo(i)&&typeof i!="function"&&!i.isGlobal&&i.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let i=t.target;for(;i!=null;){const{classList:o}=i,r=n.find(l=>o.contains(l));if(r!==void 0){bi.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}i=i.parentElement}}if(Se.isContextActionEvent(t)||(t.contextActions=[]),!Se.isContextActionEvent(t))return;const{actions:s}=this.props;if(s){let i=s;Array.isArray(i)&&(i=i.filter(o=>bo(o)||typeof o=="function"||!o.isGlobal)),t.contextActions=t.contextActions.concat(i)}bi.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s,i;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o];if(!Se.actionsDisabled&&((s=r.shortcut)==null?void 0:s.matchesEvent(t))){bi.debug("Context hotkey matched!",t);const l=(i=r.action)==null?void 0:i.call(r,t);if(l||l===void 0){t.stopPropagation(),t.preventDefault();return}bi.debug2("Matched hotkey returned false, key event not consumed")}}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return u("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:u(Kc,{actions:n})})}}se.groups={default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100};var Xc={prefix:"vs",iconName:"arrow-left",icon:[512,512,[],"f000","m224 98.976 -160 160V281.6l160 160 22.624 -22.624 -132.672 -132.704H448v-32H113.92L246.656 121.6 224 98.976z"]},os={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},Yc={prefix:"vs",iconName:"chevron-down",icon:[512,512,[],"f000","m255.232 322.304 139.424 -139.424 19.84 19.776L265.088 352h-19.776L96 202.656l19.808 -19.776 139.424 139.424z"]},Qc={prefix:"vs",iconName:"chevron-left",icon:[512,512,[],"f000","m189.696 255.232 139.424 139.424 -19.776 19.84L160 265.088v-19.776L309.344 96l19.776 19.808 -139.424 139.424z"]},Fl={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},jc={prefix:"vs",iconName:"chevron-up",icon:[512,512,[],"f000","m256.768 189.696 -139.424 139.424 -19.84 -19.776L246.912 160h19.776L416 309.344l-19.808 19.776 -139.424 -139.424z"]},Go={prefix:"vs",iconName:"circle-large-filled",icon:[512,512,[],"f000","M256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568 229.024 229.024 0 0 1 -80.512 80.288 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32z"]},Zc={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},Or={prefix:"vs",iconName:"clippy",icon:[512,512,[],"f000","M224 447.744H128v-288h256v64h32v-80l-16 -16H352v-32h-32a64 64 0 0 0 -128 0H158.08v32H112l-16 16v320l16 16H224v-32zm0 -358.4a32 32 0 0 1 25.6 -25.6 32 32 0 0 1 18.56 1.92 30.08 30.08 0 0 1 14.4 11.52 32 32 0 1 1 -56 30.08 32 32 0 0 1 -2.56 -17.92zm226.56 302.72L416 426.944v-171.2h-32v170.88l-34.56 -34.56 -22.72 22.72 62.08 61.76h22.72l61.76 -61.76 -22.72 -22.72zm-189.44 -133.12h22.72l61.76 61.76 -22.72 22.72 -34.56 -34.56v170.88h-32v-171.2l-34.56 34.88 -22.72 -22.72 62.08 -61.76z"]},Gi={prefix:"vs",iconName:"close",icon:[512,512,[],"f000","m256 278.624 116.672 116.704 22.656 -22.624L278.624 256l116.704 -116.672 -22.624 -22.656L256 233.376 139.328 116.672l-22.624 22.656L233.376 256l-116.672 116.672 22.624 22.656L256 278.624z"]},Jc={prefix:"vs",iconName:"cloud-download",icon:[512,512,[],"f000","M382.624 192h1.6a95.68 95.68 0 0 1 67.712 28.128 96.096 96.096 0 0 1 0 135.744 95.68 95.68 0 0 1 -67.744 28.128v-32a64.064 64.064 0 0 0 0 -128h-29.248l-3.936 -27.424a79.68 79.68 0 0 0 -68.032 -67.904A79.296 79.296 0 0 0 199.392 176l-10.656 24.384 -25.888 -6.048A79.68 79.68 0 0 0 144.736 192c-21.184 0 -41.504 8.416 -56.448 23.424A80.096 80.096 0 0 0 144.736 352h15.936v32h-15.936a111.552 111.552 0 0 1 -84.096 -37.12 112.064 112.064 0 0 1 62.656 -184.96 110.784 110.784 0 0 1 46.976 1.28 111.552 111.552 0 0 1 117.024 -65.92A111.328 111.328 0 0 1 382.624 192zm-168 163.872 42.048 42.048V224h31.808v172.8l40.896 -40.928 22.624 22.624 -68.672 68.704h-22.656L192 378.528l22.624 -22.656z"]},xl={prefix:"vs",iconName:"copy",icon:[512,512,[],"f000","m128 128 32 -32h173.248L448 210.752V448l-32 32H160l-32 -32V128zm288 96 -96 -96H160v320h256V224zM96 32 64 64v320l32 32V64h205.248l-32 -32H96z"]},Ol={prefix:"vs",iconName:"edit",icon:[512,512,[],"f000","M423.36 32h-46.72L112.64 296l-5.12 7.04L32 434.88 77.12 480l131.84 -75.52 7.04 -5.12L480 135.36V88.64L423.36 32zM77.12 434.88l48.32 -96 46.4 46.4 -94.72 49.6zm122.56 -65.92L143.04 312.32l256 -256 56.64 56.64 -256 256z"]},Ar={prefix:"vs",iconName:"file-code",icon:[512,512,[],"f000","m338.24 36.48 104.96 105.6 4.8 11.52v310.4l-16 16h-352l-16 -16v-416l16 -16h247.04l11.2 4.48zM320 160h96l-96 -96v96zM96 64v384h320V192H304L288 176V64H96zm65.984 241.056 58.144 -58.496L197.44 224 128 293.728v22.624l69.472 69.568 22.624 -22.624 -58.112 -58.24zM281.6 246.848l22.4 -22.688 70.048 69.6v22.688L304 385.984l-22.56 -22.688 58.592 -58.24L281.6 246.848z"]},ed={prefix:"vs",iconName:"file-zip",icon:[512,512,[],"f000","M80 32h352l16 16v160l-4.8 11.2 -27.2 27.52v217.28l-16 16h-320l-16 -16v-416l16 -16zM192 64H160v64h32V64zm0 384h128V245.76l-27.2 -27.2L288 207.04V64H224v80l-16 16H192v32H160V160h-16L128 144V64H96v384h64v-32h32v32zm0 -64v32h32v-32H192zm0 -32v32H160v-32h32zm0 -32h32v32H192v-32zm0 -32v32H160V288h32zm0 -32h32v32H192V256zm0 -32v32H160V224h32zm0 0h32V192H192v32zm196.8 4.8 27.2 -27.52V64h-96v136.64l27.2 27.2 4.8 11.2V448h32V240l4.8 -11.2z"]},td={prefix:"vs",iconName:"files",icon:[512,512,[],"f000","M373.333 0h-192L149.333 32V128H53.333L21.333 160v321.493L53.333 512h257.493L341.333 481.493V384h100.267l27.733 -30.507V96L373.333 0zm0 45.227 50.773 50.773H373.333V45.227zm-64 434.773h-256v-320H149.333v193.493L181.333 384h128v96zm128 -128h-256v-320H341.333V128h96v224z"]},ki={prefix:"vs",iconName:"filter",icon:[512,512,[],"f000","M480 64v53.44l-160 152.288V448H192V269.728l-160 -152.32V64h448zM224 256v160h64V256l160 -152.32V96H64v7.68L224 256z"]},nd={prefix:"vs",iconName:"gear",icon:[512,512,[],"f000","M291.2 140.8 275.2 64H236.8l-16 76.8 -22.4 9.6 -64 -41.6 -28.8 25.6 41.6 64 -6.4 22.4 -76.8 16v38.4l76.8 16 9.6 25.6 -41.6 64 25.6 25.6 64 -41.6 25.6 9.6 12.8 73.6h38.4l16 -76.8 25.6 -9.6 64 41.6 25.6 -25.6 -41.6 -64 9.6 -25.6 73.6 -12.8V236.8l-76.8 -16 -9.6 -25.6 41.6 -64 -25.6 -25.6 -64 41.6 -22.4 -6.4zM300.8 32l16 76.8L384 67.2l64 64 -44.8 67.2 76.8 12.8v89.6l-76.8 16L448 384l-64 64 -67.2 -44.8 -16 76.8H211.2l-16 -76.8L128 444.8l-64 -64 44.8 -67.2L32 300.8V211.2l76.8 -16L67.2 128l64 -64 67.2 44.8 12.8 -76.8h89.6zm19.2 224c0 35.2 -28.8 64 -64 64s-64 -28.8 -64 -64 28.8 -64 64 -64 64 28.8 64 64zM256 288c19.2 0 32 -12.8 32 -32s-12.8 -32 -32 -32 -32 12.8 -32 32 12.8 32 32 32z"]},Al={prefix:"vs",iconName:"graph",icon:[512,512,[],"f000","M48 448H480v-32H64V0H32v432l16 16zM96 368v-256l16 -16h64l16 16v256l-16 16h-64l-16 -16zm64 -16V128H128v224h32zm192 -304v320l16 16h64l16 -16v-320l-16 -16h-64l-16 16zm64 16v288h-32V64h32zm-192 304v-192l16 -16h64l16 16v192l-16 16h-64l-16 -16zm64 -16V192H256v160h32z"]},qi={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},sd={prefix:"vs",iconName:"json",icon:[512,512,[],"f000","M192 95.488V64h-2.88c-10.016 0 -19.712 1.984 -29.088 5.92a74.56 74.56 0 0 0 -24.8 16.96 71.36 71.36 0 0 0 -15.776 24.096v0.032a113.344 113.344 0 0 0 -6.336 26.56v0.064a194.56 194.56 0 0 0 -0.768 27.616c0.384 9.28 0.576 18.56 0.576 27.808 0 6.496 -1.28 12.576 -3.744 18.304v0.032a48.128 48.128 0 0 1 -24.48 25.184 44.032 44.032 0 0 1 -17.856 3.68H64v31.488h2.88c6.24 0 12.16 1.28 17.792 3.872l0.032 0.032c5.696 2.496 10.528 5.888 14.56 10.176l0.064 0.064c4.16 4.16 7.456 9.12 9.824 14.88l0.032 0.064c2.496 5.76 3.744 11.776 3.744 18.112 0 9.28 -0.192 18.56 -0.576 27.808 -0.384 9.472 -0.128 18.72 0.768 27.84v0.032c1.056 9.056 3.168 17.856 6.304 26.368v0.032c3.392 8.736 8.672 16.768 15.808 24.096 7.136 7.36 15.424 13.024 24.8 16.96 9.376 3.936 19.072 5.92 29.12 5.92H192v-31.488h-2.88c-6.4 0 -12.384 -1.216 -18.016 -3.68a51.616 51.616 0 0 1 -14.624 -10.24 53.088 53.088 0 0 1 -9.888 -14.944c-2.368 -5.76 -3.52 -11.84 -3.52 -18.336 0 -7.296 0.096 -14.496 0.352 -21.504 0.256 -7.296 0.256 -14.4 0 -21.28a148.448 148.448 0 0 0 -1.76 -20.48 85.824 85.824 0 0 0 -5.376 -19.488A73.088 73.088 0 0 0 112.704 256a73.088 73.088 0 0 0 23.616 -30.56c2.56 -6.144 4.32 -12.576 5.376 -19.264 1.056 -6.72 1.632 -13.536 1.76 -20.48 0.256 -7.04 0.256 -14.144 0 -21.312 -0.256 -7.168 -0.384 -14.4 -0.384 -21.696a47.04 47.04 0 0 1 28.064 -43.328 42.56 42.56 0 0 1 18.016 -3.872H192zm128 321.024V448h2.88c10.016 0 19.712 -1.984 29.088 -5.92 9.376 -3.936 17.664 -9.6 24.8 -16.96 7.136 -7.36 12.416 -15.36 15.776 -24.096v-0.032c3.2 -8.512 5.28 -17.376 6.336 -26.56v-0.064c0.896 -8.96 1.152 -18.144 0.768 -27.616 -0.384 -9.28 -0.576 -18.56 -0.576 -27.808 0 -6.496 1.28 -12.576 3.744 -18.304v-0.032a48.064 48.064 0 0 1 24.48 -25.184 44.16 44.16 0 0 1 17.856 -3.68H448v-31.488h-2.88c-6.272 0 -12.192 -1.28 -17.824 -3.872l-0.032 -0.032a44.032 44.032 0 0 1 -14.56 -10.176l-0.064 -0.064a45.28 45.28 0 0 1 -9.824 -14.88v-0.064a44.96 44.96 0 0 1 -3.776 -18.112c0 -9.28 0.192 -18.56 0.576 -27.808a197.568 197.568 0 0 0 -0.768 -27.84v-0.032a113.184 113.184 0 0 0 -6.304 -26.368v-0.032a71.36 71.36 0 0 0 -15.808 -24.096 74.592 74.592 0 0 0 -24.8 -16.96 74.4 74.4 0 0 0 -29.12 -5.92H320v31.488h2.88c6.4 0 12.384 1.216 17.984 3.68 5.568 2.624 10.432 6.016 14.624 10.24 4.064 4.288 7.36 9.28 9.888 14.944 2.368 5.76 3.52 11.84 3.52 18.336 0 7.296 -0.096 14.464 -0.352 21.504 -0.256 7.296 -0.256 14.4 0 21.28 0.128 7.104 0.704 13.92 1.76 20.48 1.056 6.848 2.848 13.312 5.376 19.488a73.12 73.12 0 0 0 23.616 30.56 73.12 73.12 0 0 0 -23.616 30.56 86.048 86.048 0 0 0 -5.376 19.264c-1.056 6.72 -1.632 13.536 -1.76 20.48a292.8 292.8 0 0 0 0 21.312c0.256 7.168 0.384 14.4 0.384 21.696a47.072 47.072 0 0 1 -28.064 43.328 42.56 42.56 0 0 1 -18.016 3.872H320z"]},id={prefix:"vs",iconName:"kebab-vertical",icon:[512,512,[],"f000","M238.208 442.624a32 32 0 1 0 35.552 -53.216 32 32 0 0 0 -35.52 53.184zM256 288a32 32 0 1 1 0 -64 32 32 0 0 1 0 64zm0 -160a32 32 0 1 1 0 -64 32 32 0 0 1 0 64z"]},od={prefix:"vs",iconName:"link-external",icon:[512,512,[],"f000","M48 32H192v32H64v384h384v-128h32v144l-16 16h-416l-16 -16v-416l16 -16zm432 16V256h-32V86.624L231.776 302.88l-22.624 -22.656L425.376 64H256V32h208l16 16z"]},kl={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},rd={prefix:"vs",iconName:"list-ordered",icon:[512,512,[],"f000","M73.184 74.432 86.144 64h21.664v96h-22.656V89.344l-11.968 8.992v-23.904zM160 96h320v32H160V96zm0 128h320v32H160V224zm320 128H160v32h320v-32zM119.744 244.032l0.928 -1.248 2.08 -2.88a26.88 26.88 0 0 0 4.992 -16.224c0 -3.84 -0.64 -7.68 -1.824 -11.328a27.136 27.136 0 0 0 -15.744 -16.928 35.936 35.936 0 0 0 -14.464 -2.624 35.008 35.008 0 0 0 -14.656 2.784 27.744 27.744 0 0 0 -15.328 16.704A33.216 33.216 0 0 0 64 222.624v1.6h25.92v-1.6a9.6 9.6 0 0 1 1.472 -5.024 5.568 5.568 0 0 1 1.824 -1.728 6.08 6.08 0 0 1 5.504 0 6.016 6.016 0 0 1 1.792 1.92 7.68 7.68 0 0 1 0.992 2.592 14.24 14.24 0 0 1 -1.152 9.28 41.888 41.888 0 0 1 -3.84 5.824l-32 36.416 -0.384 0.416v17.28h63.616v-22.4h-28.8l20.8 -23.168zm-1.184 122.144c1.472 1.024 2.752 2.24 3.84 3.648a26.912 26.912 0 0 1 5.344 17.6c0 3.424 -0.544 6.816 -1.6 10.048a25.344 25.344 0 0 1 -15.584 16 41.216 41.216 0 0 1 -15.36 2.528c-3.68 0 -7.36 -0.512 -10.912 -1.568a30.08 30.08 0 0 1 -8.256 -3.936 24.032 24.032 0 0 1 -5.824 -5.664 34.016 34.016 0 0 1 -3.712 -6.4A33.216 33.216 0 0 1 64 386.496v-1.568h26.048v1.568c0 0.864 0.096 1.76 0.288 2.624a6.624 6.624 0 0 0 0.96 2.368 4.48 4.48 0 0 0 1.696 1.664 6.4 6.4 0 0 0 5.024 0.256 5.088 5.088 0 0 0 1.792 -1.248 7.04 7.04 0 0 0 1.344 -2.4 13.344 13.344 0 0 0 0.544 -4.032 15.456 15.456 0 0 0 -0.704 -5.216 6.4 6.4 0 0 0 -1.632 -2.56 4.416 4.416 0 0 0 -1.92 -0.928 17.184 17.184 0 0 0 -2.464 -0.224h-5.152v-20.64h5.376a7.712 7.712 0 0 0 2.208 -0.352 5.248 5.248 0 0 0 2.08 -1.088 5.6 5.6 0 0 0 1.536 -2.144 9.152 9.152 0 0 0 0.672 -3.872 8.96 8.96 0 0 0 -0.512 -3.2 5.312 5.312 0 0 0 -3.104 -3.168 6.4 6.4 0 0 0 -4.992 0.224 5.248 5.248 0 0 0 -1.76 1.696 11.008 11.008 0 0 0 -1.28 4.992v1.568H64v-1.568a31.584 31.584 0 0 1 5.76 -17.408 25.6 25.6 0 0 1 5.728 -5.952 27.84 27.84 0 0 1 8.384 -4.256c3.648 -1.152 7.488 -1.696 11.328 -1.632 3.712 -0.032 7.392 0.32 11.008 1.152 2.944 0.672 5.76 1.76 8.416 3.2a24.224 24.224 0 0 1 10.24 10.176 23.36 23.36 0 0 1 2.88 11.104 25.92 25.92 0 0 1 -5.344 16.896 17.984 17.984 0 0 1 -3.84 3.648z"]},Ll={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},ld={prefix:"vs",iconName:"lock",icon:[512,512,[],"f000","M416 224h-32V160a128 128 0 1 0 -256 0v64H96L64 256v192l32 32h320l32 -32V256l-32 -32zM160 160a96 96 0 1 1 192 0v64H160V160zm256 288H96V256h320v192z"]},ad={prefix:"vs",iconName:"menu",icon:[512,512,[],"f000","M512 160H0V128h512v32zm0 256H0v-32h512v32zm0 -128.256H0V256h512v31.744z"]},cd={prefix:"vs",iconName:"new-file",icon:[512,512,[],"f000","m304 35.2 108.8 112 3.2 12.8v64h-32V192H256V64H96v352h128v32H80l-16 -16v-384l16 -16h214.4l9.6 3.2zM288 64v96h92.8L288 64zm128 448h-32v-96H288v-32h96V288h32v96h96v32h-96v96z"]},Pl={prefix:"vs",iconName:"pass-filled",icon:[512,512,[],"f000","M256 480A224 224 0 1 0 256 32a224 224 0 0 0 0 448zm-32.64 -132.16h-22.72L128 275.2l22.72 -22.72 61.44 61.44 134.4 -134.72 22.72 22.72 -145.92 145.92z"]},Hl={prefix:"vs",iconName:"pass",icon:[512,512,[],"f000","M200.64 347.84h22.72l145.92 -145.92 -22.72 -22.72 -134.4 134.72 -61.44 -61.44L128 275.2l72.64 72.64zM275.2 32c51.2 3.2 99.2 28.8 134.4 64 41.6 44.8 64 99.2 64 163.2 0 51.2 -19.2 99.2 -51.2 140.8 -32 38.4 -76.8 67.2 -128 76.8 -51.2 9.6 -102.4 3.2 -147.2 -22.4 -44.8 -25.6 -80 -64 -99.2 -112C28.8 294.4 25.6 240 41.6 192c16 -51.2 44.8 -92.8 89.6 -121.6C172.8 41.6 224 28.8 275.2 32zm16 412.8c41.6 -9.6 80 -32 108.8 -67.2 25.6 -35.2 41.6 -76.8 38.4 -121.6 0 -51.2 -19.2 -102.4 -54.4 -137.6 -32 -32 -70.4 -51.2 -115.2 -54.4 -41.6 -3.2 -86.4 6.4 -121.6 32 -35.2 25.6 -60.8 60.8 -73.6 105.6 -12.8 41.6 -12.8 86.4 6.4 128 19.2 41.6 48 73.6 86.4 96 38.4 22.4 83.2 28.8 124.8 19.2z"]},dd={prefix:"vs",iconName:"play",icon:[512,512,[],"f000","M120.96 64 96 77.12v384l24.96 13.44 288 -192V256l-288 -192zM128 431.36V107.2l243.2 162.24L128 431.36z"]},hd={prefix:"vs",iconName:"preview",icon:[512,512,[],"f000","M64 64h384l32 32v320l-32 32H64l-32 -32V96l32 -32zm0 352h384V96H64v320zm352 -288H96v96h320V128zm-32 64H128V160h256v32zm-96 192h128V256H288v128zm32 -96h64v64h-64V288zM224 256H96v32h128V256zm-128 96h128v32H96v-32z"]},sn={prefix:"vs",iconName:"remove",icon:[512,512,[],"f000","M480 256H32V224h448v32z"]},ud={prefix:"vs",iconName:"reply",icon:[512,512,[],"f000","m201.792 68.672 -128.64 128.64v22.656l128.64 128.64 22.656 -22.624L121.824 223.36H182.08c90.016 0 147.36 19.36 182.56 55.328 35.264 36 51.68 92.064 51.68 173.472v11.2h32v-11.2c0 -84.672 -16.864 -151.04 -60.8 -195.872C343.52 211.36 275.744 191.36 182.08 191.36H124.384l100.064 -100.032 -22.656 -22.656z"]},md={prefix:"vs",iconName:"ruby",icon:[512,512,[],"f000","m32 230.08 212.48 212.48h23.04L480 230.08v-23.04l-106.24 -106.24 -11.52 -4.8H149.76l-11.52 4.8L32 207.04v23.04zm224 177.92L66.56 218.56 156.48 128h199.04l89.92 90.56L256 408zm0 -247.36h86.08l57.92 57.92 -144 140.8V160.64z"]},_l={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},pd={prefix:"vs",iconName:"split-horizontal",icon:[512,512,[],"f000","M448 32H96L64 64v352l32 32h352l32 -32V64l-32 -32zM256 416H96V64h160v352zm192 0H288V64h160v352z"]},gd={prefix:"vs",iconName:"symbol-operator",icon:[512,512,[],"f000","M91.936 35.2c10.72 4.352 19.264 12.736 23.84 23.36 2.304 5.44 3.488 11.264 3.424 17.184a42.88 42.88 0 0 1 -19.52 36.32 43.488 43.488 0 0 1 -24.096 7.136A43.36 43.36 0 0 1 32 75.584a43.36 43.36 0 0 1 26.56 -40.192A43.84 43.84 0 0 1 91.936 35.2zm-9.536 56.48a17.632 17.632 0 0 0 10.624 -16 17.536 17.536 0 1 0 -10.624 16zM205.76 35.488 35.52 205.76l21.952 21.984 170.24 -170.24 -21.952 -21.984zM368 288h32v80H480v32h-80V480h-32v-80H288v-32h80V288zm-183.424 16.8 22.624 22.624L150.624 384l56.576 56.576 -22.624 22.624L128 406.624l-56.576 56.576 -22.624 -22.624L105.376 384l-56.576 -56.576 22.624 -22.624L128 361.376l56.576 -56.576zm43.2 -134.24a43.296 43.296 0 0 0 -40.192 -26.56 43.36 43.36 0 0 0 -40.192 26.56 43.584 43.584 0 0 0 40.224 60.64A43.456 43.456 0 0 0 227.776 170.56zm-24.096 23.84a17.696 17.696 0 0 1 -9.248 9.28 17.504 17.504 0 0 1 -19.168 -3.744 16.928 16.928 0 0 1 -3.744 -5.536 17.408 17.408 0 0 1 22.912 -22.88 18.08 18.08 0 0 1 5.536 3.712 17.568 17.568 0 0 1 3.712 19.168zM448 96h-128v32h128V96z"]},kr={prefix:"vs",iconName:"terminal",icon:[512,512,[],"f000","M64 32 32 64v384L64 480h384l32 -32V64L448 32H64zM64 448V64h384v384H64zm120.661 -85.547 22.144 22.635 112.213 -111.851v-19.456l-112.213 -112.213 -22.08 22.613 97.92 100.309 -97.984 97.963z"]},fd={prefix:"vs",iconName:"tools",icon:[512,512,[],"f000","m472.736 111.52 -24.96 -5.888 -67.456 67.072 -38.208 -38.912 65.792 -69.024 -5.76 -25.344a141.44 141.44 0 0 0 -43.104 -7.296 116.48 116.48 0 0 0 -46.624 8.96 122.368 122.368 0 0 0 -37.952 26.88 119.552 119.552 0 0 0 -28 40.48 126.016 126.016 0 0 0 0 94.912 10730.912 10730.912 0 0 0 -197.536 199.488c-6.72 8.8 -9.92 19.776 -9.088 30.816a44.896 44.896 0 0 0 14.848 30.944c3.968 4.32 8.704 7.904 13.984 10.496 5.44 2.4 11.296 3.776 17.216 4.064 10.112 -0.192 19.808 -4.032 27.328 -10.784 49.536 -46.624 144.448 -142.4 198.368 -198.528 14.624 6.208 30.336 9.408 46.208 9.376a119.552 119.552 0 0 0 85.664 -36.256 124.32 124.32 0 0 0 35.552 -87.36 134.752 134.752 0 0 0 -6.272 -44.096zM93.856 445.696a9.92 9.92 0 0 1 -4.32 2.24 13.984 13.984 0 0 1 -4.768 0 11.072 11.072 0 0 1 -4.608 -1.824 10.752 10.752 0 0 1 -3.648 -3.52c-4.48 -4.576 -8.672 -13.28 -4.48 -18.176 43.84 -46.624 134.112 -137.76 190.56 -193.472 3.2 4.224 6.72 8.256 10.496 12.032 3.776 3.936 7.84 7.584 12.16 10.912 -54.592 56 -143.616 146.048 -191.36 191.808zm355.776 -290.08c0.064 24.48 -9.472 48 -26.624 65.536a91.552 91.552 0 0 1 -128.224 0 95.744 95.744 0 0 1 -20.32 -100.384A87.936 87.936 0 0 1 324.48 69.76a88.32 88.32 0 0 1 34.304 -6.848h8.128L308.768 122.848v22.272l60.64 60.352h21.12l59.104 -58.112v8.256zM103.68 214.016h48.992l22.56 22.944 21.696 -21.568 -21.28 -21.696V192.32l1.824 -52.768 -7.04 -13.984 -91.52 -60.224 -18.912 2.112 -26.592 27.168 -2.112 19.168 58.816 93.376 13.568 6.88zm-30.24 -116.224L147.488 146.56 146.24 182.496H111.808L64.064 106.912l9.376 -9.12zm227.36 222.72 21.568 -21.536 99.392 101.92a47.328 47.328 0 0 1 0 65.248 44.928 44.928 0 0 1 -49.568 10.08 41.92 41.92 0 0 1 -13.984 -10.08l-100.544 -102.496 21.728 -21.696 100.224 102.208a12.864 12.864 0 0 0 4.896 3.36 15.264 15.264 0 0 0 11.488 0 12.896 12.896 0 0 0 4.896 -3.36 13.952 13.952 0 0 0 3.2 -4.896 16.8 16.8 0 0 0 1.152 -5.888 17.504 17.504 0 0 0 -1.12 -5.888 13.952 13.952 0 0 0 -3.2 -4.896L300.8 320.512z"]},Ln={prefix:"vs",iconName:"trash",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64a32 32 0 0 1 32 -32h96a32 32 0 0 1 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm64 -256H160v224h32V160zm32 0h32v224H224V160zm64 0h32v224H288V160z"]},Nn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},Vl={prefix:"vs",iconName:"triangle-right",icon:[512,512,[],"f000","M177.92 448 160 434.784V76.576L177.28 64 352 244.064v26.464L177.92 448z"]},as={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},Cd={prefix:"dh",iconName:"arrow-to-bottom",icon:[512,512,[],"f000","m99.2 224 160 160h22.4l160 -160 -22.4 -22.4L288 332.8V64H256v268.8L124.8 201.6l-25.6 22.4zM96 416h352v32H96z"]},bd={prefix:"dh",iconName:"arrow-to-top",icon:[512,512,[],"f000","m444.8 288 -160 -160h-22.4l-160 160 22.4 22.4L256 179.2V448h32V179.2l131.2 131.2 25.6 -22.4zm3.2 -192H96V64h352v32z"]},wd={prefix:"dh",iconName:"check-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-188.8 284.8h-22.4L144 278.4l22.4 -22.4 60.8 60.8 134.4 -134.4 22.4 22.4 -147.2 144z"]},Sd={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},Lr={prefix:"dh",iconName:"eye-slash",icon:[512,512,[],"f000","M480 256c0 -32 -99.2 -160 -224 -160 -32 0 -64 9.6 -92.8 22.4L70.4 25.6 25.6 70.4 435.2 480l44.8 -44.8 -76.8 -76.8C451.2 320 480 272 480 256zM256 131.2c96 0 176 92.8 188.8 124.8 -6.4 16 -32 48 -67.2 76.8L316.8 272c3.2 -6.4 3.2 -9.6 3.2 -16 0 -35.2 -28.8 -64 -64 -64 -6.4 0 -9.6 0 -16 3.2L192 147.2c19.2 -9.6 41.6 -16 64 -16zm0 249.6C160 380.8 80 288 67.2 256c6.4 -9.6 19.2 -32 41.6 -54.4l-25.6 -25.6C51.2 208 32 243.2 32 256c0 32 99.2 160 224 160 19.2 0 38.4 -3.2 57.6 -9.6l-28.8 -28.8c-9.6 3.2 -19.2 3.2 -28.8 3.2z"]},ko={prefix:"dh",iconName:"eye",icon:[512,512,[],"f000","M256 96C131.2 96 32 224 32 256s99.2 160 224 160 224 -128 224 -160 -99.2 -160 -224 -160zm0 284.8C160 380.8 80 288 67.2 256 80 227.2 160 131.2 256 131.2S432 224 444.8 256c-12.8 28.8 -92.8 124.8 -188.8 124.8zM256 192c-35.2 0 -64 28.8 -64 64s28.8 64 64 64 64 -28.8 64 -64 -28.8 -64 -64 -64zm0 92.8c-16 0 -28.8 -12.8 -28.8 -28.8s12.8 -28.8 28.8 -28.8 28.8 12.8 28.8 28.8 -12.8 28.8 -28.8 28.8z"]},vd={prefix:"dh",iconName:"file-csv",icon:[512,512,[],"f000","m444.8 140.8 -105.6 -105.6 -12.8 -3.2H80l-16 16V224h32V64h192v112l16 16H416v32h32V153.6l-3.2 -12.8zM320 160V64l96 96h-96zM80 256l-16 16v192l16 16h352l16 -16v-192l-16 -16h-352zM416 416v32H96V288h320v128zm-217.6 -3.2c-6.4 3.2 -16 3.2 -25.6 3.2 -16 0 -25.6 -3.2 -35.2 -12.8 -9.6 -6.4 -12.8 -19.2 -12.8 -32 0 -16 3.2 -28.8 12.8 -38.4 9.6 -9.6 22.4 -12.8 38.4 -12.8 9.6 0 16 0 22.4 3.2v19.2c-6.4 -3.2 -12.8 -6.4 -22.4 -6.4 -9.6 0 -16 3.2 -22.4 9.6 -6.4 6.4 -9.6 12.8 -9.6 22.4 0 9.6 3.2 16 6.4 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16 -3.2 22.4 -6.4v19.2zm19.2 0v-22.4c3.2 3.2 9.6 6.4 12.8 6.4 3.2 3.2 9.6 3.2 12.8 3.2h6.4c3.2 0 3.2 0 6.4 -3.2l3.2 -3.2v-3.2c0 -3.2 0 -3.2 -3.2 -6.4 3.2 0 0 0 0 -3.2 -3.2 0 -3.2 -3.2 -6.4 -3.2s-6.4 -3.2 -9.6 -3.2c-6.4 -3.2 -12.8 -6.4 -16 -12.8 -3.2 -3.2 -6.4 -9.6 -6.4 -16s0 -9.6 3.2 -12.8c3.2 -3.2 3.2 -6.4 9.6 -9.6 3.2 0 6.4 -3.2 12.8 -3.2h25.6c3.2 0 6.4 0 9.6 3.2v19.2s-3.2 -3.2 -6.4 -3.2 -3.2 0 -6.4 -3.2h-19.2c-3.2 0 -3.2 0 -6.4 3.2l-3.2 3.2v6.4l3.2 3.2s3.2 3.2 6.4 3.2 3.2 3.2 6.4 3.2c3.2 3.2 6.4 3.2 9.6 6.4 3.2 3.2 6.4 3.2 6.4 6.4 3.2 3.2 3.2 6.4 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4 0 9.6 -3.2 12.8 -3.2 3.2 -3.2 6.4 -9.6 9.6 3.2 3.2 0 6.4 -3.2 6.4h-32c-3.2 0 -6.4 -3.2 -12.8 -3.2zm169.6 -92.8 -32 96h-25.6l-32 -96h22.4l19.2 67.2c0 3.2 3.2 6.4 3.2 9.6 0 -3.2 0 -6.4 3.2 -9.6l19.2 -67.2h22.4z"]},Td={prefix:"dh",iconName:"file-download",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm-134.4 182.4 76.8 76.8h22.4l76.8 -76.8 -25.6 -22.4L288 368V227.2H256v140.8L208 320l-22.4 22.4z"]},Ed={prefix:"dh",iconName:"file-spreadsheet",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm64 99.2 -19.2 -19.2H179.2l-19.2 19.2v137.6l19.2 19.2h185.6l19.2 -19.2V259.2zm-150.4 134.4H182.4v-48h51.2v48zm0 -115.2v48H182.4V278.4m115.2 115.2H246.4v-48h48v48zm0 -64H246.4V278.4h48v51.2zm64 64H310.4v-48h48v48zm-51.2 -64V278.4h48v48H310.4z"]},qo={prefix:"dh",iconName:"filter-filled",icon:[512,512,[],"f000","M480 64v54.4l-160 153.6V448H192V268.8L32 118.4V64h448z"]},yd={prefix:"dh",iconName:"freeze",icon:[512,512,[],"f000","m438.4 300.8 -19.2 -28.8 -60.8 35.2L272 256l86.4 -51.2 60.8 35.2 19.2 -28.8 -44.8 -25.6 48 -28.8 -16 -25.6 -48 28.8V108.8h-35.2v67.2L256 227.2V128l60.8 -35.2 -16 -28.8 -44.8 25.6V32H224v57.6L179.2 64l-16 28.8L224 128v99.2L137.6 176V108.8H102.4V160l-48 -28.8 -16 25.6 48 28.8 -44.8 25.6 19.2 28.8 60.8 -35.2L208 256 121.6 307.2 60.8 272l-19.2 28.8 44.8 25.6 -48 28.8 16 25.6 48 -28.8v51.2h35.2v-67.2L224 284.8V384l-60.8 35.2 16 28.8 44.8 -25.6V480h32v-57.6l44.8 25.6 16 -28.8L256 384V284.8l86.4 51.2v67.2h35.2V352l48 28.8 16 -25.6 -48 -28.8z"]},wo={prefix:"dh",iconName:"gear-filled",icon:[512,512,[],"f000","m480 211.2 -76.8 -12.8L448 131.2l-64 -64 -67.2 41.6L300.8 32H211.2l-12.8 76.8L131.2 64l-64 64 41.6 67.2 -76.8 16v89.6l76.8 12.8L64 380.8l64 64 67.2 -41.6 16 76.8h89.6l16 -76.8L384 448l64 -64 -44.8 -67.2 76.8 -16V211.2zM256 320c-38.4 0 -64 -25.6 -64 -64s25.6 -64 64 -64 64 25.6 64 64 -25.6 64 -64 64z"]},Rd={prefix:"dh",iconName:"graph-line-down",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm67.2 -291.2 -22.4 22.4 108.8 112 70.4 -64 108.8 124.8H320v32h112l16 -16V224h-32v70.4L288 150.4l-70.4 64z"]},Id={prefix:"dh",iconName:"graph-line-up",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm153.6 -150.4 70.4 64 128 -144V256h32V144l-16 -16H320v32h76.8L288 284.8l-70.4 -64 -108.8 112 22.4 22.4z"]},Ds={prefix:"dh",iconName:"new-circle-large-filled",icon:[512,512,[],"f000","M240 0C108.8 0 0 108.8 0 240S108.8 480 240 480 480 371.2 480 240 371.2 0 240 0zM352 256H256v96H224V256H128V224h96V128h32v96h96v32z"]},Dd={prefix:"dh",iconName:"pandas",icon:[512,512,[],"f000","M185.6 28.8h54.4v115.2H185.6V28.8zm0 240h54.4V384H185.6V268.8zm0 -89.6h54.4v54.4H185.6V179.2zM96 124.8h54.4V512H96V124.8zm176 240h54.4V480H272v-115.2zm0 -240h54.4v115.2H272V124.8zm0 150.4h54.4v54.4H272V275.2zM361.6 0H416v387.2h-54.4V0z"]},Md={prefix:"dh",iconName:"refresh",icon:[512,512,[],"f000","m313.6 73.6 -9.6 32c83.2 25.6 131.2 118.4 102.4 201.6 -19.2 64 -80 108.8 -150.4 108.8 -89.6 0 -160 -70.4 -160 -160 0 -51.2 22.4 -96 64 -128v64h32V80L176 64H64v32h86.4c-76.8 51.2 -108.8 150.4 -70.4 236.8C112 403.2 179.2 448 256 448c105.6 0 192 -86.4 192 -192 0 -83.2 -54.4 -156.8 -134.4 -182.4z"]},Nd={prefix:"dh",iconName:"remove-square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16zM352 256H128V224h224v32z"]},Ko={prefix:"dh",iconName:"sort-alpha-down",icon:[512,512,[],"f000","M236.8 368 156.8 448h-22.4l-80 -80 22.4 -22.4L128 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM371.2 224l-6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6s-3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 310.4h73.6V448H272v-32l73.6 -89.6H275.2V288h128v32l-70.4 89.6z"]},Xo={prefix:"dh",iconName:"sort-alpha-up",icon:[512,512,[],"f000","M51.2 144 131.2 64h22.4l80 80 -22.4 22.4L160 115.2V448H128V115.2L76.8 166.4l-25.6 -22.4zm320 304 -6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6 0 6.4 -3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 -137.6h73.6V224H272V192l73.6 -89.6H275.2V64h128v32l-70.4 89.6z"]},Pr={prefix:"dh",iconName:"sort-amount-down",icon:[512,512,[],"f000","M204.8 368 124.8 448h-22.4L22.4 368l22.4 -22.4L96 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM256 64h256v64H256zm0 105.6h192v64H256zm0 108.8h128v64H256zM256 384h64v64H256z"]},Fd={prefix:"dh",iconName:"sort-down",icon:[512,512,[],"f000","m128 288 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},xd={prefix:"dh",iconName:"sort-up",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128z"]},Yo={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Hr={prefix:"dh",iconName:"square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16z"]},Qo={prefix:"dh",iconName:"table",icon:[512,512,[],"f000","M432 64h-384l-16 16v352l16 16h384l16 -16v-352l-16 -16zM160 416H64v-64h96v64zm0 -96H64V256h96v64zm0 -96H64V160h96v64zm128 192H192v-64h96v64zm0 -96H192V256h96v64zm0 -96H192V160h96v64zm128 192h-96v-64h96v64zm0 -96h-96V256h96v64zm0 -96h-96V160h96v64z"]},Od={prefix:"dh",iconName:"trash-undo",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64c0 -19.2 12.8 -32 32 -32h96c19.2 0 32 12.8 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm112 -64L160 272v-22.4l80 -80 22.4 22.4 -51.2 54.4H320v32H211.2l51.2 51.2 -22.4 22.4z"]},Ad={prefix:"dh",iconName:"triangle-down-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-160 288h-22.4L99.2 208l9.6 -16h291.2l9.6 12.8L265.6 352z"]},kd={prefix:"dh",iconName:"unlink",icon:[512,512,[],"f000","M32 211.2v-6.4C32 144 80 96 140.8 96h99.2c12.8 0 25.6 3.2 38.4 6.4l-25.6 25.6H140.8C99.2 128 64 163.2 64 204.8v6.4c0 28.8 16 54.4 38.4 67.2l-22.4 22.4C51.2 281.6 32 249.6 32 211.2zM403.2 6.4l-38.4 38.4 -67.2 67.2 -22.4 25.6 -150.4 147.2 -25.6 25.6 -54.4 54.4 -38.4 38.4L51.2 448 448 51.2 403.2 6.4zM384 192v32c38.4 6.4 64 38.4 64 76.8v6.4c0 41.6 -35.2 76.8 -76.8 76.8H272c-32 0 -60.8 -22.4 -73.6 -51.2l-25.6 25.6c19.2 35.2 54.4 60.8 96 60.8h99.2c60.8 0 108.8 -48 108.8 -108.8v-9.6C480 246.4 438.4 198.4 384 192zM246.4 288l-22.4 19.2v12.8h16c60.8 0 108.8 -48 108.8 -108.8v-6.4c0 -6.4 0 -12.8 -3.2 -19.2l-32 32c0 38.4 -32 67.2 -67.2 70.4z"]},_r={prefix:"dh",iconName:"warning-circle-filled",icon:[512,512,[],"f000","M470.4 195.2c-9.6 -38.4 -28.8 -70.4 -57.6 -99.2 -25.6 -25.6 -60.8 -44.8 -96 -54.4C297.6 35.2 275.2 32 256 32c-19.2 0 -41.6 3.2 -60.8 9.6 -16 3.2 -35.2 9.6 -51.2 22.4 -35.2 19.2 -60.8 44.8 -80 80 -12.8 16 -19.2 35.2 -25.6 51.2C35.2 214.4 32 236.8 32 256c0 19.2 3.2 41.6 6.4 60.8 6.4 16 12.8 35.2 25.6 51.2 9.6 16 22.4 32 35.2 44.8 12.8 16 28.8 25.6 44.8 35.2 16 9.6 35.2 16 54.4 22.4 16 6.4 38.4 9.6 57.6 9.6 19.2 0 41.6 -3.2 60.8 -6.4 19.2 -6.4 35.2 -12.8 54.4 -22.4 32 -19.2 60.8 -48 80 -80 9.6 -16 16 -35.2 22.4 -54.4 3.2 -19.2 6.4 -41.6 6.4 -60.8s-3.2 -41.6 -9.6 -60.8zM275.2 352H236.8v-32h38.4v32zm0 -64H236.8V160h38.4v128z"]},Ul={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};const Ki=Y.forwardRef((e,t)=>{var b;function n(C){const{menuItem:w,onMenuItemClick:S}=e;S(w,C)}function s(C){const{menuItem:w,onMenuItemMouseMove:S}=e;S(w,C)}function i(C){const{menuItem:w,onMenuItemContextMenu:S}=e;S(w,C)}function o(C,w,S){if(typeof C.type=="string")return C;const{closeMenu:I,menuItem:v,isKeyboardSelected:R,isMouseSelected:D,"data-testid":F}=e,L={menuItem:v,closeMenu:I,isKeyboardSelected:R,isMouseSelected:D,iconElement:w,displayShortcut:S,"data-testid":F};return Y.cloneElement(C,{forwardedProps:L})}const{children:r,menuItem:l,isKeyboardSelected:a,isMouseSelected:c,"data-testid":d}=e,h=(b=l.shortcut)==null?void 0:b.getDisplayText();let m=null;if(l.icon){const C=l.icon;if(Y.isValidElement(C))m=C;else{let w;l.iconColor&&!l.disabled&&(w={color:l.iconColor}),m=u(q,{icon:C,style:w})}}let p=null;const g=!!r;l.actions&&(p=u(q,{icon:Fl}));let f=null;if(l.menuElement)f=u("div",{className:"custom-menu-item",onMouseMove:s,children:o(l.menuElement,m,h)});else{const C=l.disabled,w=l.iconOutline;f=u("button",{type:"button",className:$("btn-context-menu",{disabled:C},{active:(g||c)&&!C},{"keyboard-active":a&&!C}),onClick:n,onMouseMove:s,onContextMenu:i,title:l.description||"",children:T("div",{className:"btn-context-menu-wrapper",children:[u("span",{className:$("icon",{outline:w}),children:m}),u("span",{className:"title",children:l.title}),h&&u("span",{className:"shortcut",children:h}),p&&u("span",{className:$("submenu-indicator",{disabled:C}),children:p})]})})}return T("div",{className:"context-menu-item",ref:t,"data-testid":d,children:[r,f]})});Ki.displayName="ContextMenuItem";Ki.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};class Es extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class Xi{static isDark(t){const n=document.createElement("div");n.style.display="none",n.style.color=t;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),Xi.getBrightness(o)<125}static getBrightness(t){return Math.round((t[0]*299+t[1]*587+t[2]*114)/1e3)}}const Ld="table_",Bl="column_",Pd=new Set(["in","not","i","ii","k"]),Hd=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"]),_d=/[^a-zA-Z0-9_$+@-]/g,Vd=/[^A-Za-z0-9_$]/g,Ms=class{};let Pn=Ms;Pn.legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(Pd.has(o)||Hd.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};Pn.legalizeTableName=e=>Ms.legalize(e,Ld,_d,!1,0);Pn.legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=Ms.legalizeColumnName(n,s);t.includes(i)&&(i=Bl+s),t.push(i)}),t};Pn.legalizeColumnName=(e,t=0)=>Ms.legalize(e,Bl,Vd,!0,t);Pn.isValidTableName=e=>Ms.legalizeTableName(e)===e;Pn.isValidColumnName=e=>Ms.legalizeColumnName(e)===e;function Ud(e,t){return e?e.closest(`.${t}`):null}const Bd={getClosestByClassName:Ud};class ye extends CustomEvent{constructor(t,n){super(t,n)}}class Wl extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class He{static makeCancelable(t,n){let s=!1,i;const o=new Promise((r,l)=>{Promise.resolve(t).then(a=>{s?(n&&n(a),l(new Es)):(i=a,r(a))},a=>l(s?new Es:a))});return o.cancel=()=>{s=!0,i!=null&&n&&n(i)},o}static isCanceled(t){return t instanceof Es}static isTimedOut(t){return t instanceof Wl}}class Yi{constructor(){this.pending=[],this.resolved=[]}add(t,n){const s=He.makeCancelable(t,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(t){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===t){this.pending.splice(n,1);return}}resolve(t){this.remove(t),this.resolved.push(t)}cancel(){const t=[...this.pending,...this.resolved];for(let n=0;n<t.length;n+=1)t[n].cancel();this.pending=[],this.resolved=[]}}function O(e){if(e==null)throw new Error("Value is null or undefined")}class Gt{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!Gt.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const i=t[s],o=i[0],r=i[1];if(o<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,i]=n;const o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(a<=s&&i<=c)return o;s<=c&&a<=i&&(s=Math.min(s,a),i=Math.max(i,c),o.splice(r,1))}return o.push([s,i]),o}static deselectRange(t,n){const[s,i]=n,o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(!(i<a||c<s))if(a<s&&i<c){o[r]=[a,s-1],o.splice(r+1,0,[i+1,c]);break}else s<=a&&c<=i?o.splice(r,1):a<s?o[r]=[a,s-1]:o[r]=[i+1,c]}return o}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class jo{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),i=t[t.length-1];return`${s}, ${n} ${i}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const zl=class{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;return`${t>0?`${t}h `:""}${n>0||t>0?`${n}m `:""}${e>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),s=String(Math.floor(n/60)).padStart(2,"0"),i=n%60,o=String(Math.ceil(i)).padStart(2,"0");return`${t}:${s}:${o}`}static isTimeString(e){return new RegExp(zl.TIME_PATTERN).test(e)}static parseTime(e){if(!e||typeof e!="string")throw new Error(`${e} is not a valid string`);const t=e.split(":");if(t.length!==3)throw new Error(`${e} is not a time string that can be parsed`);return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}};let Xt=zl;Xt.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Xt.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\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",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\u22125",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"}]);class Wd extends Error{constructor(){super(...arguments),this.isInvalid=!0}}const Ht=({className:e="","data-testid":t})=>T("div",{className:$("loading-spinner fa-layers",e),"data-testid":t,children:[u(q,{icon:Zc,className:"text-white-50"}),u(q,{icon:Ll,className:"text-primary",spin:!0})]}),Vr=ne.module("ContextMenu"),Lo=class extends y.exports.PureComponent{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=Y.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=Y.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var i,o,r;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(i=this.container.current)==null||i.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(o=this.container.current)!=null&&o.contains(document.activeElement)||(r=this.container.current)==null||r.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);const{options:e}=this.props;let t=e.initialKeyboardIndex;t===void 0&&(t=-1);const{actions:n}=this.props,s=Se.getMenuItems(n),i=[];for(let o=s.length-1;o>=0;o-=1){const r=s[o];r instanceof Promise?this.initMenuPromise(r):i.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:Se.sortActions(i)})}initMenuPromise(e){const t=He.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{menuItems:Se.sortActions(s.menuItems.concat(n)),pendingItems:o}}return null})},n=>{He.isCanceled(n)||(this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{pendingItems:o}}return null}),Vr.error(n))})}cancelPromises(){const{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current===null)return;const e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}verifyPosition(){var h,m,p,g;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:i,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition)return;let{top:r,left:l}=this.initialPosition;const{width:a,height:c}=(m=(h=this.container.current)==null?void 0:h.getBoundingClientRect())!=null?m:{width:0,height:0},d=((g=(p=this.container.current)==null?void 0:p.scrollHeight)!=null?g:0)>window.innerHeight;c===0||a===0||(r+c>window.innerHeight&&(r-c-s>0?r-=c-s:r=window.innerHeight-c),l+a>window.innerWidth&&(l=l-a-n),(o!==l||i!==r)&&(this.setState({hasOverflow:d}),t(r,l)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Vr.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,n=!1;for(;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){const{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n,i=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?i=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=Se.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=Se.getNextMenuItem(s,1,t)),i){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:n}=this.state,s=t[e].actions?e:null;n!==s&&this.setState({activeSubMenu:s,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:n}=this.state;e!=null&&!e.disabled&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&!e.disabled&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:i,keyboardIndex:o,menuItems:r,mouseIndex:l,pendingItems:a,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:h,subMenuParentHeight:m}=this.state;for(let C=0;C<r.length;C+=1){const w=r[C];C>0&&w.group!==r[C-1].group&&e.push(u("hr",{},`${C}.separator`));const S=u(Ki,{ref:s===C?this.activeSubMenuRef:null,isKeyboardSelected:o===C,isMouseSelected:l===C,menuItem:w,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},C);e.push(S)}let p=null;a.length>0&&(p=u("div",{className:"loading",children:u(Ht,{})}));const{menuStyle:g,"data-testid":f}=this.props,b=s!==null&&c!==null&&d!==null;return T(Fe,{children:[T("div",{className:$({"has-overflow":i},"context-menu-container"),style:{top:t,left:n,...g},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Lo.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":f,children:[e,p]}),b&&s!==null&&c!==null&&d!==null&&u(Lo,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(C,w)=>{this.setState({subMenuTop:C,subMenuLeft:w})},subMenuParentWidth:h,subMenuParentHeight:m},`sub-${s}`)]})}};let $l=Lo;$l.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class zd extends y.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=Y.createRef(),this.openMenu=Y.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!Se.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=Se.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),i=t.clientY-s.top,o=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(l)});return}return}t.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(t=u($l,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),u("div",{className:$("context-menu-root",{active:s}),ref:this.container,children:t})}}const Qn=class extends y.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${Qn.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${Qn.getHeight(t)}px`}static getHeight(e){const t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){const t=e;t.style.height="";const{autoFocusOnShow:n}=this.props;if(n){const s=t.querySelector("input, select, textarea");s&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return u(ot,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Qn.handleEnter,onEntering:Qn.handleEntering,onEntered:this.handleEntered,onExit:Qn.handleExit,onExiting:Qn.handleExiting,timeout:350,children:i=>u("div",{className:$({collapse:i==="exited"},t),"data-testid":s,children:e})})}};let Gl=Qn;Gl.propTypes={className:M.exports.string,in:M.exports.bool.isRequired,children:M.exports.node.isRequired,autoFocusOnShow:M.exports.bool,"data-testid":M.exports.string};Gl.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function Zo(e){const t=y.exports.useRef();return y.exports.useEffect(function(){t.current=e}),t.current}function ql(e){const t=y.exports.useRef(null);return y.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const It=Y.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:i,disabled:o,inputClassName:r,isInvalid:l,labelClassName:a,name:c,onChange:d,"data-testid":h}=e,[m]=y.exports.useState(jt()),p=ql(t);y.exports.useEffect(function(){p.current&&(p.current.indeterminate=n===null)},[p,n]);const g=y.exports.useCallback(f=>{p.current&&(p.current.indeterminate=n===null),d&&d(f)},[p,n,d]);return T("div",{className:$("custom-control custom-checkbox",i),children:[u("input",{type:"checkbox",ref:p,checked:n!=null?n:!1,className:$("custom-control-input",r,{"is-invalid":l}),disabled:o,id:m,name:c,onChange:g,"data-testid":h}),u("label",{className:$("custom-control-label",a),htmlFor:m,children:s})]})});It.displayName="Checkbox";It.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:M.exports.node.isRequired,className:M.exports.string,disabled:M.exports.bool,inputClassName:M.exports.string,isInvalid:M.exports.bool,labelClassName:M.exports.string,name:M.exports.string,onChange:M.exports.func,"data-testid":M.exports.string};It.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class Hn extends y.exports.PureComponent{constructor(t){super(t),this.inputField=Y.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onBlur:s,onChange:i,className:o,disabled:r,matchCount:l,id:a,onKeyDown:c,"data-testid":d}=this.props;return T("div",{className:$("search-group",o),children:[u("input",{type:"search",value:t,onBlur:s,onChange:i,onKeyDown:c,className:"form-control",disabled:r,placeholder:n,ref:this.inputField,id:a,"data-testid":d}),l!=null&&u("span",{className:"search-match",children:l}),u("span",{className:"search-icon",children:u(q,{icon:_l})})]})}}Hn.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var Kl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Kl||{});const Ws=class extends y.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=ue((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.toLowerCase())>=0)),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Y.createRef(),this.cbContainer=Y.createRef(),this.toggleButton=Y.createRef(),this.menuContainer=Y.createRef(),this.input=Y.createRef(),this.searchInput=Y.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,l;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,o=t?n:i;switch(e.key){case"Enter":((r=o[s])==null?void 0:r.value)!=null&&this.updateInputValue(o[s].value),this.closeMenu(),(l=this.input.current)==null||l.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Ws.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Ws.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,r=(t?n:i).length;let l=0;switch(e){case Ws.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case Ws.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(s+l+r)%r})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:i}=this.props,o=n?s:i;this.updateInputValue(o[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var i;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(i=this.popper.current)==null||i.scheduleUpdate()}handleMenuBlur(e){var t;e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,o=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return T("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[u("div",{className:"cb-search-input-container",children:u(Hn,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u("div",{className:"cb-options-container",children:u("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:s}=this.state;return(n?s:e).map((o,r)=>{const l=`option-${r}-${o.value}`;return u("button",{type:"button",value:r,className:$("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:i,spellCheck:o,"data-testid":r}=this.props,{value:l}=this.state;let{popperOptions:a}=this.props;return a={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...a},T("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:$("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0]&&e[0].title,disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r?`${r}-input`:void 0}),u("div",{className:"input-group-append cb-dropdown",children:T("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r?`${r}-btn`:void 0,children:[u(q,{icon:Nn}),u(fn,{ref:this.popper,options:a,className:$("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Ns=Ws;Ns.MENU_NAVIGATION_DIRECTION=Kl;Ns.DROP_DOWN_MENU_HEIGHT=200;Ns.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired}),onChange:M.exports.func,inputPlaceholder:M.exports.string,searchPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultValue:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,"data-testid":M.exports.string};Ns.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const At=ne.module("MaskedInput"),gs={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},wi="\u2007";function Jo(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}function $d(e,t,n){return e.length<n?`${e}${t.substring(e.length,n)}`:e}function Ur(e,t){let{length:n}=e;for(let s=e.length-1;s>=0&&t[s]===e[s];s-=1)n=s;return e.substring(0,n)}const Qi=Y.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:i=(N,_,k)=>k,getPreferredReplacementString:o=Jo,onChange:r=()=>!1,onSelect:l=()=>!1,pattern:a,placeholder:c,selection:d,value:h,onFocus:m=()=>!1,onBlur:p=()=>!1,"data-testid":g}=e,f=ql(t),b=y.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]),C=y.exports.useMemo(()=>b[0].replace(/[a-zA-Z0-9]/g,wi),[b]);y.exports.useEffect(function(){var _;if(d!=null){At.debug("setting selection...",d);const{selectionStart:k,selectionEnd:P,selectionDirection:H}=d;(_=f.current)==null||_.setSelectionRange(k,P,H),At.debug("selection set!")}},[d,f]);const w=y.exports.useCallback(N=>{let _=N,k=N;const P=b.length>0?b[0]:h;for(let V=_-1;V>=0&&/[a-zA-Z0-9]/g.test(P.charAt(V));V-=1)_=V;for(let V=k;V<P.length&&/[a-zA-Z0-9]/g.test(P.charAt(V));V+=1)k=V+1;const H=_===k?gs.NONE:gs.BACKWARD;return{selectionStart:_,selectionEnd:k,selectionDirection:H}},[b,h]);function S(N,_,k=N.length){let P="";for(let H=0;H<k;H+=1)N.charAt(H)!==wi?P=P.concat(N[H]):P=P.concat(_[H]);return P=P.concat(_.substring(k)),P}function I(N,_=N.length){const k=new RegExp(`^${a}$`);if(k.test(N))return!0;for(let P=0;P<b.length;P+=1){const H=S(N,b[P],_);if(k.test(H))return!0}return!1}function v(N){const _=w(N),k=_.selectionEnd+1;return k>=h.length?_:w(k)}function R(N){const _=w(N),k=_.selectionStart-1;return k<=0?_:w(k)}function D(N,_){const k=w(N),P=h.substring(k.selectionStart,k.selectionEnd),H=i(k,_,P,h),V=h.substring(0,k.selectionStart)+H+h.substring(k.selectionEnd);I(V,k.selectionEnd)&&(r(V),l(k))}const F=y.exports.useCallback(N=>{const{selectionStart:_=0,selectionEnd:k=0,selectionDirection:P="none"}=N.target;if(_===null||k===null||P===null){At.error("Selection attempted on non-text input element",N.target);return}if(At.debug2("handleSelect",_,k,P),!(d!=null&&_===d.selectionStart&&k===d.selectionEnd)){if(d!=null&&_===h.length&&k===h.length&&N.nativeEvent.type!=="mouseup"){l({...d});return}if(_===k){const H=w(_);At.debug("Selection segment from ",_,k,"=>",H),l(H)}else l({selectionStart:_,selectionEnd:k,selectionDirection:P})}},[w,l,d,h]),L=y.exports.useCallback(N=>{if(!f.current)return;At.debug("handleSelectCapture",N);const _=f.current.selectionStart||0;_===h.length&&d!=null&&_!==d.selectionStart&&(N.preventDefault(),N.stopPropagation())},[f,d,h]);function W(N){if(N.preventDefault(),N.stopPropagation(),!f.current)return;const{key:_}=N,{selectionStart:k=0,selectionEnd:P=0}=f.current;if(k===null||P===null){At.error("Selection arrow nvaigation attempted on non-text input element",N.target);return}_==="ArrowLeft"?l(R(k)):_==="ArrowRight"?l(v(P)):_==="ArrowUp"?D(k,-1):_==="ArrowDown"&&D(k,1)}function B(N){if(!f.current)return;At.debug("handleKeyDown",N);const{key:_}=N,{selectionStart:k=0,selectionEnd:P=0}=f.current;if(k===null||P===null){At.error("Selection key event on non-text input element",N.target);return}if(_.startsWith("Arrow")){W(N);return}if(_==="Delete"||_==="Backspace"){if(N.preventDefault(),N.stopPropagation(),P>=Ur(h,C).length){const V=h.substring(0,k===P?k-1:k),G=Ur(V,C);G!==h&&(r(G),l({selectionStart:G.length,selectionEnd:G.length,selectionDirection:gs.NONE}));return}if(k!==P){const V=h.substring(0,k)+h.substring(k,P).replace(/[a-zA-Z0-9]/g,wi)+h.substring(P);At.debug("Range ",k,P,"deleted, setting value",V),r(V),l({selectionStart:k,selectionEnd:k,selectionDirection:gs.NONE})}else if(k>0)for(let V=k-1;V>=0;V-=1){const G=h.substring(0,V)+h.substring(V,k).replace(/[a-zA-Z0-9]/g,wi)+h.substring(k);if(G!==h){r(G),l({selectionStart:V,selectionEnd:V,selectionDirection:gs.NONE});return}}return}if(N.altKey||N.metaKey||N.ctrlKey||_.length>1)return;N.preventDefault(),N.stopPropagation();const H=Array.from(new Set([_,_.toUpperCase(),_.toLowerCase()]));for(let V=0;V<H.length;V+=1){const G=H[V],Q=/[a-zA-Z0-9]/g.test(G)?b[0].length-1:k;for(let J=k;J<=Q;J+=1){const re=$d(h,b[0],J+1),Ce=o(re,J,G,k,P);if(I(Ce,J+1)){const de=w(J),ve=J+1;let _e={selectionStart:ve,selectionEnd:ve,selectionDirection:gs.NONE};if(ve>=de.selectionEnd){const Ke=v(J);Ke.selectionStart!==de.selectionStart&&(_e=Ke)}At.debug("handleKeyDown",_,"=>",Ce,_e),r(Ce),l(_e);return}}}}return u("input",{ref:f,className:$("form-control masked-input",n),type:"text",pattern:a,placeholder:c,value:h,onChange:()=>{},onKeyDown:B,onSelect:F,onSelectCapture:L,onFocus:m,onBlur:p,"data-testid":g})});Qi.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:Jo,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const Gd=ne.module("TimeInput"),qd="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Kd=["00:00:00","12:34:56","23:59:59"],Xl=Y.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:i=()=>!1,value:o=0,onFocus:r=()=>!1,onBlur:l=()=>!1,onSelect:a=()=>!1,"data-testid":c}=e,[d,h]=y.exports.useState(Xt.formatTime(o)),[m,p]=y.exports.useState(),g=y.exports.useRef(null);y.exports.useImperativeHandle(t,()=>({focus:()=>{var S;(S=g.current)==null||S.focus()},setSelection:S=>{var I;(I=g.current)==null||I.focus(),p(S)}}),[]),y.exports.useEffect(function(){h(Xt.formatTime(o))},[o]);function f(S,I,v){const R=S.selectionStart===0?24:60;let D=parseInt(v,10)-I;return Number.isNaN(D)?D=0:n?D=(D%R+R)%R:D=Math.min(Math.max(0,D),R-1),`${D}`.padStart(2,"0")}function b(S,I,v,R,D){return R===0&&D===2&&I===1&&parseInt(v,10)>1?`0${v}${S.substring(2)}`:Jo(S,I,v)}function C(S){Gd.debug("handleChange",S),h(S),Xt.isTimeString(S)&&i(Xt.parseTime(S))}const w=y.exports.useCallback(S=>{p(S),a(S)},[a]);return u(Qi,{ref:g,className:s,example:Kd,getNextSegmentValue:f,getPreferredReplacementString:b,onChange:C,onSelect:w,pattern:qd,selection:m,value:d,onFocus:r,onBlur:l,"data-testid":c})});Xl.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class Yl extends y.exports.PureComponent{constructor(t){var i;super(t),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=Y.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(i=n.initialKeyboardIndex)!=null?i:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=Se.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:Se.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let i=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?i=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?i=Se.getNextMenuItem(i!=null?i:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(i=Se.getNextMenuItem(i!=null?i:0,1,n)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&!t.disabled&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:o}=this.state;for(let l=0;l<i.length;l+=1){const a=i[l];l>0&&a.group!==i[l-1].group&&t.push(u("hr",{},`${l}.separator`));const c=u(Ki,{isKeyboardSelected:s===l,isMouseSelected:o===l,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},l);t.push(c)}const{menuStyle:r}=this.props;return u("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}Yl.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class On extends y.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=Y.createRef(),this.parent=null,this.popper=Y.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":i}=this.props,{menuStyle:o}=this.props;let{options:r,popperOptions:l}=this.props;return l={placement:"bottom",...l},r={separateKeyboardMouse:!0,...r},u("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u(fn,{ref:this.popper,options:l,className:$("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u(Yl,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:o})})})}}On.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const Br=-1;var Ql=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Ql||{});const ln=class extends y.exports.Component{constructor(e){super(e);const{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=Y.createRef(),this.menuContainer=Y.createRef(),this.button=Y.createRef(),this.input=Y.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let i=0;i<e.length;i+=1){const o=e[i];if(o.value===t)return o.title}return Xt.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(s[t].value),this.closeMenu(),(i=this.button.current)==null||i.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(ln.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props,i=s.length;let o=t;switch(e){case ln.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%i,this.setState({keyboardOptionIndex:o})):t===0&&(o=i-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case ln.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(o=(o+1)%i,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:i}=this.state;if(t===Br){const o=s(i);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var o;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>ln.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-ln.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u("div",{className:"cs-options-container",children:u("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:i,customTime:o,inputFocused:r}=this.state;let l=!1;const a=[];for(let c=0;c<e.length;c+=1){const d=e[c],h=`option-${c}-${d.value}`;l=l||d.value===t,a.push(T("button",{type:"button",value:c,className:$("cs-option-btn",{"keyboard-active":i===c&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[d.value===t&&u(q,{icon:n,className:"mr-2"}),d.value!==t&&u("span",{className:"mr-4"}),d.title]},h))}return a.push(u("hr",{className:"cs-divider"},"option-divider")),a.push(T("button",{type:"button",value:Br,className:$("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u(q,{icon:n,className:"mr-2"}):u("span",{className:"mr-4"}),s]},"option-custom-label")),a.push(T("div",{className:"cs-custom-container",children:[u("span",{className:"mr-2"}),u(Xl,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u("span",{className:"ml-2"})]},"cs-custom-container")),a.push(u("hr",{className:"mb-2"},"option-end")),a}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:i}=this.state;let{popperOptions:o}=this.props;return o={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...o},u("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:u("div",{className:$("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:T("button",{type:"button",className:$("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u("span",{className:$({"text-muted":n===null}),children:this.getSelectedText()}),u("span",{children:u(q,{icon:Yo,className:"cs-caret"})}),u(On,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let er=ln;er.MENU_NAVIGATION_DIRECTION=Ql;er.DROP_DOWN_MENU_HEIGHT=125;er.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:os,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0};function fs(e,t,n,s,i){const o=s-n+1;return`${((parseInt(t,10)-e-n)%o+o)%o+n}`.padStart(i,"0")}function jl(e,t,n){const{selectionStart:s}=e;return s===0?fs(t,n,1900,2099,4):s===5?fs(t,n,1,12,2):s===8?fs(t,n,1,31,2):s===11?fs(t,n,0,23,2):s===17||s===14?fs(t,n,0,59,2):s===20||s===24||s===28?fs(t,n,0,999,3):n}const Xd=ne.module("DateTimeInput"),Yd="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Qd="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}\u200B[0-9]{3}\u200B[0-9]{3}",jd=`${Yd} ${Qd}`,Zd="2022-01-01 00:00:00.000000000",Jd="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function Zl(e){const t=e.substring(0,23),n=e.substring(23,26),s=e.substring(26);return[t,n,s].filter(i=>i!=="").join("\u200B")}const eh=e=>e.replace(/\u200B/g,""),th=[Zl(Zd)],Jl=Y.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:i="",onFocus:o=()=>{},onBlur:r=()=>{},"data-testid":l}=e,[a,c]=y.exports.useState(i.length>0?Zl(i):""),[d,h]=y.exports.useState(),m=y.exports.useCallback(p=>{Xd.debug("handleChange",p),c(p),s(eh(p))},[s]);return u("div",{className:"d-flex flex-row align-items-center",children:u(Qi,{ref:t,className:$(n),example:th,getNextSegmentValue:jl,onChange:m,onSelect:h,pattern:jd,placeholder:Jd,selection:d,value:a,onFocus:o,onBlur:r,"data-testid":l})})});Jl.displayName="DateTimeInput";Jl.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const nh=ne.module("DateInput"),sh="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",ih=["2000-01-01","2022-12-31"],oh="YYYY-MM-DD",ea=Y.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:i="",onFocus:o=()=>{},onBlur:r=()=>{},"data-testid":l}=e,[a,c]=y.exports.useState(i),[d,h]=y.exports.useState(),m=y.exports.useCallback(p=>{nh.debug("handleChange",p),c(p),s(p)},[s]);return u("div",{className:"d-flex flex-row align-items-center",children:u(Qi,{ref:t,className:$(n),example:ih,getNextSegmentValue:jl,onChange:m,onSelect:h,pattern:sh,placeholder:oh,selection:d,value:a,onFocus:o,onBlur:r,"data-testid":l})})});ea.displayName="DateInput";ea.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class rh extends y.exports.PureComponent{constructor(t){super(t),this.searchInput=Y.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Tt(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:i,"data-testid":o}=this.props,{value:r}=this.state;return u(Hn,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:i,"data-testid":o})}}rh.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const lh=({className:e="",show:t=!0,"data-testid":n})=>T("div",{className:$("dh-loader",e,{show:t}),"data-testid":n,children:[u("svg",{className:"dh-outer-shape",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("path",{d:"M82.7429,0L82.7429,41.3714L45.2571,41.3714L45.2571,0L0,0L0,128L45.2571,128L45.2571,86.6286L82.5143,86.6286L82.5143,128L128,128L128,0L82.7429,0ZM41.3714,124.114L4.11429,124.114L4.11429,86.6286L41.3714,86.6286L41.3714,124.114ZM41.3714,82.7429L4.11429,82.7429L4.11429,45.2571L41.3714,45.2571L41.3714,82.7429ZM41.3714,41.3714L4.11429,41.3714L4.11429,4.11429L41.3714,4.11429L41.3714,41.3714ZM45.2571,82.7429L45.2571,45.2571L82.5143,45.2571L82.5143,82.5143L45.2571,82.5143ZM124.114,124.114L86.6286,124.114L86.6286,86.6286L123.886,86.6286L123.886,124.114ZM124.114,82.7429L86.6286,82.7429L86.6286,45.2571L123.886,45.2571L123.886,82.7429ZM86.6286,41.3714L86.6286,4.11429L123.886,4.11429L123.886,41.3714L86.6286,41.3714Z",fill:"#f0f0ee"})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-3",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3438",height:"37.6389",fill:"#5189e5",transform:"translate(-21.9838,29.7957) translate(21.9838,15.3027)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-2",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2755",height:"37.4675",fill:"#5189e5",transform:"translate(-21.9838,69.7957) translate(22.0822,16.7783)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-5",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3512",height:"41.3781",fill:"#35618c",transform:"translate(18.0162,72.7957) translate(23.1643,13.7278)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-6",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2483",height:"37.5869",fill:"#35618c",transform:"translate(59.0162,29.7957) translate(23.6379,15.3564)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-7",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.5664",height:"41.2747",fill:"#35618c",transform:"translate(17.0162,-13.2043) translate(24.2531,13.2043)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-4",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2854",height:"37.3014",fill:"#5189e5",transform:"translate(-21.9838,-13.2043) translate(22.0822,17.1792)"})})})})]});const ah=ne.module("ItemListItem"),ta=class extends y.exports.Component{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=Y.createRef()}static handleKeyDown(){return ah.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:i,"data-testid":o}=this.props;return u("div",{className:$("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:ta.handleKeyDown,onContextMenu:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:i})}};let na=ta;na.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Wr=ne.module("ItemList"),ys=class extends y.exports.PureComponent{constructor(e){super(e),this.getItemSelected=ue((s,i)=>Gt.isSelected(i,s),{max:ys.CACHE_SIZE}),this.getCachedItem=ue((s,i,o,r,l,a,c,d)=>{const h=a({item:o,itemIndex:s,isFocused:r,isSelected:l,style:c});return u(na,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:d,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:l,itemIndex:s,style:c,children:h},i)},{max:ys.CACHE_SIZE}),this.getOuterElement=ue(s=>{const i=Y.forwardRef((o,r)=>u("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...o}));return i.displayName="ItemListOuterElement",i}),this.getInnerElement=ue(()=>{const s=Y.forwardRef((i,o)=>u("div",{className:"item-list-inner-element",ref:o,...i}));return s.displayName="ItemListInnerElement",s}),this.getItemData=ue((s,i,o)=>({items:s,selectedRanges:i,renderItem:o})),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=Y.createRef(),this.listContainer=Y.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null}}static renderItem({item:e}){return u("div",{className:"item-list-item-content",children:e&&(e.displayValue||e.value||`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:i,scrollOffset:o,height:r,selectedRanges:l}=this.state;if(i&&!this.isListAtBottom()&&this.scrollToBottom(),(o!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==l)this.setSelectedRanges(n);else if(l!==t.selectedRanges){const{onSelectionChange:a}=this.props;a(l)}if(s!==t.focusIndex){const{onFocusChange:a}=this.props;a(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),i=e-n;return s[i]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,i=Gt.isSelected(n,e)||Se.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:i})=>({selectedRanges:Gt.selectRange(i,[e,e])}),()=>{s(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Wr.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Wr.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:s}=n;return s!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:s,disableSelect:i}=this.props,{mouseDownIndex:o,selectedRanges:r}=this.state;o==null||i||(this.setState({isDragging:!0}),(n||o===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!Se.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,Se.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:i}=this.props,{mouseDownIndex:o,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!r){const l=t.shiftKey,a=Se.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,a,n),!s&&!l&&!a&&i(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:i}=this.state;let o=i;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&s(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=n-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,n-1):o=0;else return;if(i!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:l}=this.state;if(e.shiftKey&&l.length>0){const a=l[l.length-1];this.selectRange([Math.min(o,a[0]),Math.max(o,a[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:i}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:i}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n,s=!0){const{isMultiSelect:i}=this.props,{selectedRanges:o}=this.state;if(i&&t&&o.length>0){const r=o[o.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else i&&o.length===1&&o[0][0]===e&&o[0][1]===e?s&&this.deselectItem(e):i&&n?this.getItemSelected(e,o)?s&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){Gt.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:Gt.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Gt.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:Gt.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:s}=this.props,i=Math.floor(e/s),o=i+Math.ceil(t/s);n(i,o)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:s}=this.props;return e+t>=n*s}renderInnerElement({index:e,style:t}){const{items:n,offset:s,renderItem:i,disableSelect:o}=this.props,{focusIndex:r,selectedRanges:l}=this.state;if(e<s||e>=s+n.length)return null;const a=n[e-s];return this.getCachedItem(e,e,a,e===r&&!o,this.getItemSelected(e,l),i,t,o)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:i,"data-testid":o}=this.props,{selectedRanges:r}=this.state;return u(ec,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:l,height:a})=>u(tc,{className:"item-list-scroll-pane",height:a,width:l,itemCount:t,itemSize:i,itemData:this.getItemData(e,r,s),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":o,children:this.renderInnerElement})})}};let Zt=ys;Zt.CACHE_SIZE=1e3;Zt.DEFAULT_ROW_HEIGHT=20;Zt.DEFAULT_OVERSCAN=10;Zt.defaultProps={offset:0,items:[],rowHeight:ys.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:ys.DEFAULT_OVERSCAN,renderItem:ys.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const ss=class extends y.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=ue((t,n,s,i,o,r,l,a)=>u(zi,{draggableId:ss.getDraggableId(t,i),index:i,isDragDisabled:l,children:c=>u("div",{role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1,...c.draggableProps,...c.dragHandleProps,children:n({item:s,itemIndex:i,isFocused:o,isSelected:r,style:a,isClone:!1})})},i),{max:Zt.CACHE_SIZE}),this.getCachedRenderDraggableItem=ue((t,n,s)=>({item:i,itemIndex:o,isFocused:r,isSelected:l,style:a})=>this.getCachedDraggableItem(t,s,i,o,r,l,n,a),{max:1}),this.getCachedRenderClone=ue((t,n,s,i)=>(o,r,l)=>{const{selectedCount:a}=this.state,{index:c}=l.source,d=n[c-s];return u("div",{className:$("draggable-item-list-dragging-item-container",t),...o.draggableProps,...o.dragHandleProps,ref:o.innerRef,children:u("div",{className:$("draggable-item-list-dragging-item",{"two-dragged":a===2},{"multiple-dragged":a>2}),children:i({item:d,itemIndex:c,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:a})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=Y.createRef(),this.state={selectedCount:0}}static renderHandle(){return T("div",{children:[u(me,{children:"Drag to re-order"}),u(q,{icon:qi})]})}static renderBadge({text:e}){return e?u("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return T("div",{className:$("item-list-item-content","draggable-item-list-item-content",n),children:[u("span",{className:"title",children:e}),ss.renderBadge({text:t}),ss.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e&&(e.displayValue||e.value||`${e}`),i=t?`${n}`:"",o=t?"item-list-item-clone":"";return ss.renderTextItem({text:s,badgeText:i,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){return parseInt(e.split("/").pop()||"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:Gt.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:i,isDragDisabled:o,isDropDisabled:r,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,offset:h,onFocusChange:m,onSelect:p,onViewportChange:g,renderItem:f,rowHeight:b,selectedRanges:C,style:w,"data-testid":S}=this.props;return u(Ys,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,d,h,f),"data-testid":S,children:(I,v)=>u("div",{role:"menu",className:$("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":o,"is-dragging-from-this":v.draggingFromThisWith,"is-dragging-over":v.isDraggingOver,"is-dropping":v.draggingOverWith}),style:w,ref:I.innerRef,...I.droppableProps,children:u(Zt,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,onFocusChange:m,onSelect:p,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:h,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,f),rowHeight:b,selectedRanges:C})})})}};let Ct=ss;Ct.DEFAULT_ROW_HEIGHT=30;Ct.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:ss.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:ss.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};class dt{static reorder(t,n,s,i){const o=t===s?dt.adjustDestinationIndex(i,n):i,r=dt.removeItems(t,n);return s.splice(o,0,...r),r}static removeItems(t,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,c]=r;s[l]=t.splice(a,c-a+1)}return nc(s)}static adjustDestinationIndex(t,n){let s=t;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>t)break;s-=Math.min(r,t-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const Fi=class extends y.exports.Component{static isParentSelected(e,t){const n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;const s=Array.from(n.values()).includes(!0),i=Array.from(n.values()).includes(!1);return s&&i?null:s}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{const{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){const{valueMap:n,onUpdateValueMap:s}=this.props,i=new Map(n),o=i.get(e);if(o instanceof Map){const l=new Map(o);if(t!=null)l.set(t,!o.get(t));else{const a=!Fi.isParentSelected(e,i);o.forEach((c,d)=>l.set(d,a))}i.set(e,l)}else i.set(e,!o);const r=i.get(e);t===void 0&&r!==void 0&&typeof r!="boolean"&&(Fi.isParentSelected(e,n)?r.forEach((l,a)=>r.set(a,!1)):r.forEach((l,a)=>r.set(a,!0))),s(i)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((i,o)=>{if(typeof i=="boolean")s.set(o,e);else{const r=new Map;i.forEach((l,a)=>r.set(a,e)),s.set(o,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return T("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>T("div",{children:[u(It,{className:"hcm-parent",checked:Fi.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([i,o])=>u(It,{className:"hcm-child",checked:o,onChange:()=>this.toggleValueFor(n,i),children:i},i))]},n)),u("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,"data-testid":t?`${t}-btn-select-all`:void 0,children:"Select All"}),u("button",{type:"button",className:"btn btn-link",onClick:this.clear,"data-testid":t?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":i}=this.props,{menuIsOpen:o}=this.state;return T("button",{type:"button",className:$("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":i,children:[T("span",{children:[n&&u(q,{icon:n,className:"hcm-icon mr-1"}),e]}),u(q,{icon:Yo,className:"hcm-icon ml-1"}),u(fn,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let ch=Fi;ch.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const sa=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>u(ot,{in:!!n||!e||t,timeout:Rt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"fill-parent-absolute","data-testid":s,children:u("div",{className:$("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:T("div",{className:"message-content",children:[T("div",{className:"message-icon",children:[t&&u(Ht,{}),!t&&n&&u(q,{icon:as})]}),u("div",{className:"message-text",children:n})]})})})});const ia=({on:e,id:t,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r})=>u("button",{type:"button",className:$("btn","btn-switch",n,{active:e},{"is-invalid":s}),id:t,onClick:o,disabled:i,"data-testid":r,children:u("div",{className:"handle"})});function zr(e){return e.isOn!==void 0}const hh=({item:e,onSelect:t=()=>{},"data-testid":n})=>{const{icon:s,subtitle:i,title:o}=e,r=y.exports.useMemo(()=>zr(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return T("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s&&u("div",{className:"icon",children:u(q,{icon:s})}),u("div",{className:"title",children:o}),i&&u("div",{className:"shortcut",children:i}),u("div",{className:"accessory","data-testid":n,children:zr(e)&&u(ia,{on:e.isOn,onClick:l=>{l.stopPropagation(),r()}})||u(q,{icon:Fl})})]})};const oa=({items:e,onSelect:t=()=>{},"data-testid":n})=>u("div",{className:"navigation-menu-view","data-testid":n,children:u("ul",{className:"navigation-menu-list",children:e.map((s,i)=>u("li",{children:u(hh,{item:s,onSelect:()=>{t(i)}})},s.title))})});const $r=({children:e,onBack:t,onClose:n,title:s,"data-testid":i})=>T("div",{className:"navigation-page","data-testid":i,children:[T("div",{className:"navigation-title-bar",children:[u("div",{className:"navigation-left-buttons",children:t!==void 0&&T("button",{className:"btn btn-link btn-back","data-testid":"btn-page-back",type:"button",onClick:t,children:[u(q,{icon:Qc}),"Back"]})}),u("div",{className:"navigation-title",children:s}),u("div",{className:"navigation-right-buttons",children:n!==void 0&&u("button",{className:"btn btn-link btn-link-icon btn-close px-2 m-1","data-testid":"btn-page-close",type:"button",onClick:n,children:u(q,{icon:Gi})})})]}),u("div",{className:"navigation-content",children:e})]});const uh=({children:e,"data-testid":t})=>{const n=y.exports.useMemo(()=>Y.Children.toArray(e),[e]),s=Zo(n),[i,o]=y.exports.useState(n[n.length-1]),[r,l]=y.exports.useState(null),[a,c]=y.exports.useState(null);y.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),c(s[s.length-1]))},[n,s,r,a,i]);const d=y.exports.useCallback(()=>{o(r),l(null)},[r]),h=y.exports.useCallback(()=>{c(null)},[]);return T("div",{className:"navigation-stack",children:[u("div",{className:"main-view","data-testid":t,children:i}),u(ot,{in:a!=null,timeout:Rt.transitionMidMs,classNames:"slide-right",onEntered:h,children:u(Fe,{children:a&&u("div",{className:"popping-view",children:a})})}),u(ot,{in:r!=null,timeout:Rt.transitionMidMs,classNames:"slide-left",onEntered:d,children:u(Fe,{children:r&&u("div",{className:"pushing-view",children:r})})})]})},mh=({children:e,disabled:t,value:n,"data-testid":s})=>u("option",{value:n,disabled:t,"data-testid":s,children:e}),tr=e=>{const{children:t,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=e,[l]=y.exports.useState(s||jt());return u(Fe,{children:Y.Children.map(t,a=>a?Y.cloneElement(a,{name:l,onChange:a.props.onChange||i,checked:o===a.props.value,disabled:a.props.disabled||n,"data-testid":r}):null)})},gn=Y.forwardRef((e,t)=>{const{checked:n,children:s,className:i="",disabled:o=!1,inputClassName:r="",isInvalid:l=!1,labelClassName:a="",name:c,onChange:d,value:h,"data-testid":m}=e,[p]=y.exports.useState(jt());return T("div",{className:$("custom-control custom-radio",i),children:[u("input",{type:"radio",id:p,"data-testid":m,name:c,ref:t,className:$("custom-control-input",r,{"is-invalid":l}),checked:n,disabled:o,value:h,onChange:d}),u("label",{className:$("custom-control-label",a),htmlFor:p,children:s})]})});gn.displayName="RadioItem";gn.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const ph=({children:e,onBlur:t,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a})=>{const c=y.exports.useCallback(d=>{n(d.target.value)},[n]);return u("select",{className:$("custom-select",s),onBlur:t,onChange:c,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:e})};class ra extends y.exports.PureComponent{constructor(t){super(t),this.getCachedItem=ue((n,s,i,o,r,l,a)=>{const c={height:r},d=o!=null?o:i;return u("li",{className:"value-list-item",style:c,tabIndex:-1,children:u(It,{checked:l,disabled:a,onChange:()=>this.handleSelect(n),children:d})},s)},{max:1e3}),this.getCachedItems=ue((n,s,i,o)=>{const r=[];for(let l=0;l<n.length;l+=1){const a=n[l],{value:c,displayValue:d,isSelected:h}=a,m=i+l,p=m,g=this.getCachedItem(m,p,c,d,s,h,o);r.push(g)}return r},{max:1}),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=Y.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(t){if(!t.relatedTarget||this.list.current&&t.relatedTarget instanceof HTMLElement&&!this.list.current.contains(t.relatedTarget)){const{onBlur:n}=this.props;n==null||n(t)}}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:i}=this.props,o=t-s;if(o>=0&&o<n.length){const r=n[o],{value:l}=r;i(t,l)}else i(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,o=Math.floor(s/n),r=Math.ceil(i/n);(this.topRow!==o||this.bottomRow!==r)&&(this.topRow=o,this.bottomRow=r,t(o,r))}getElement(t){return this.list.current==null?null:this.list.current.querySelectorAll(".value-list-item")[t]}scrollIntoView(t){const n=this.getElement(t);n==null||n.scrollIntoView({block:"center"})}render(){const{className:t,disabled:n,isInvalid:s,items:i,itemCount:o,offset:r,rowHeight:l,"data-testid":a}=this.props,c=this.getCachedItems(i,l,r,n);return u("div",{className:$("select-value-list-scroll-pane h-100 w-100",{"is-invalid":s},t),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":a,children:u("div",{className:"select-value-list",style:{height:o*l},children:u("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*l,top:r*l,left:0},children:c})})})}}ra.defaultProps={disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0};const Gr=ne.module("Shortcut");var ie=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(ie||{}),ae=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(ae||{});const gh=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),$e=class extends Wo{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:i,tooltip:o}){super(),this.id=e,this.name=i,this.tooltip=o,this.isEditable=s;const l=$e.isMacPlatform?n:t;this.defaultKeyState=$e.createKeyState(l),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(ae).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!$e.isMacPlatform&&e.metaKey||!$e.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||gh.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!$e.isAllowedKey(t)&&$e.isAllowedKey(String.fromCharCode(n))?s=String.fromCharCode(n):s=t,{keyValue:s,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":$e.isMacPlatform?$e.getMacDisplayText(e):$e.getWindowsDisplayText(e)}getDisplayText(){return $e.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){$e.isValidKeyState(e)?(Gr.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new ye("onUpdate",{detail:this}))):Gr.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return $e.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState($e.NULL_KEY_STATE)}isNull(){return $e.doKeyStatesMatch(this.keyState,$e.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return $e.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState($e.getKeyStateFromEvent(e))}};let nr=$e;nr.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};nr.isMacPlatform=Se.isMacPlatform();const qr=ne.module("ShortcutRegistry");class fh extends Wo{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new nr(t);return this.add(n)}add(t){var i;const n=this.shortcutMap.get(t.id);if(n)return qr.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;qr.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:o})=>this.dispatchEvent(new ye("onUpdate",{detail:o})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const Me=Object.freeze(new fh),sr={COPY:Me.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[ie.CTRL,ae.C],macShortcut:[ie.CMD,ae.C],isEditable:!1}),PASTE:Me.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[ie.CTRL,ae.V],macShortcut:[ie.CMD,ae.V],isEditable:!1}),SAVE:Me.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[ie.CTRL,ae.S],macShortcut:[ie.CMD,ae.S],isEditable:!1}),SELECT_ALL:Me.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[ie.CTRL,ae.A],macShortcut:[ie.CMD,ae.A],isEditable:!1}),LINKER:Me.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[ie.CTRL,ae.L],macShortcut:[ie.CMD,ae.L]}),LINKER_CLOSE:Me.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[ae.ESCAPE],macShortcut:[ae.ESCAPE],isEditable:!1})};const la=Y.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,isLinked:o,isLinkedSource:r,isInvalid:l,onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,"data-testid":m}=e;return T("button",{ref:t,type:"button",className:$("btn-socketed",{"btn-socketed-linked":o||r},{"btn-socketed-linked-source":r},{"is-invalid":l},s),onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,disabled:i,"data-testid":m,children:[n,u(q,{icon:kl,className:"linked btn-socketed-icon",transform:"down-1"}),u(q,{icon:Sd,className:"is-invalid btn-socketed-icon"})]})});la.displayName="SocketedButton";la.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Ch="_track_xvu02_28",bh="_handle_xvu02_11",wh="_ticks_xvu02_96",aa={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Ch,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:bh,ticks:wh,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(aa["handle-size"],10);parseInt(aa["popover-width"],10);Object.freeze({ERROR:"error"});var cs=(e=>(e.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS="filter-control-change-clears-all-filters",e.LINK_CHANGE_CLEARS_ALL_FILTERS="link-change-clears-all-filters",e))(cs||{});Object.freeze([[cs.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS,!1],[cs.LINK_CHANGE_CLEARS_ALL_FILTERS,!1]]);var we=(e=>(e.COUNT="Count",e.MIN="Min",e.MAX="Max",e.SUM="Sum",e.ABS_SUM="AbsSum",e.VAR="Var",e.AVG="Avg",e.STD="Std",e.FIRST="First",e.LAST="Last",e.SKIP="Skip",e.COUNT_DISTINCT="CountDistinct",e.DISTINCT="Distinct",e.UNIQUE="Unique",e))(we||{});class ke{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}ke.TYPE_GLOBAL="type-global";ke.TYPE_CONTEXT_PRESET="type-context-preset";ke.TYPE_CONTEXT_CUSTOM="type-context-custom";class Sh extends ke{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class vh extends ke{format(t){return String.fromCharCode(t)}}const{dh:E}=globalThis,ji=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),ca=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),Th=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:ji.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Eh=M.exports.shape({columns:M.exports.arrayOf(ji).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(ca),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),yh=M.exports.shape({columns:M.exports.arrayOf(ji),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),xi=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),Rh=M.exports.shape({created:M.exports.arrayOf(xi).isRequired,updated:M.exports.arrayOf(xi).isRequired,removed:M.exports.arrayOf(xi).isRequired}),Ih=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),Dh=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:ji,FilterCondition:ca,IdeSession:Dh,RollupConfig:Ih,Sort:Th,Table:Eh,TreeTable:yh,VariableChanges:Rh,VariableDefinition:xi});const Kr=ne.module("DateTimeColumnFormatter"),jn=class extends ke{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=jn.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const i=e||jn.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=E.i18n.TimeZone.getTimeZone(i)}catch{Kr.error("Unsupported time zone id",i),this.dhTimeZone=E.i18n.TimeZone.getTimeZone(jn.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=jn.makeFormatStringMap(t,n)}static isValid(e){try{return E.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getGlobalFormats(e,t){return[...jn.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${s}`],["MM-dd-yyyy",`MM-dd-yyyy${s}`],["HH:mm:ss",`HH:mm:ss${s}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${s}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${s}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getFormats(e,t){return[...jn.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)||e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return E.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{Kr.error("Invalid format arguments")}return""}};let An=jn;An.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";An.DEFAULT_TIME_ZONE_ID="America/New_York";const Mh=ne.module("DecimalColumnFormatter"),Yt=class extends ke{constructor({defaultFormatString:e=Yt.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return E.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Yt.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Yt.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return E.i18n.NumberFormat.format(n,s)}catch{Mh.error("Invalid format arguments")}return""}};let We=Yt;We.DEFAULT_FORMAT_STRING="###,##0.0000";We.FORMAT_PERCENT=Yt.makePresetFormat("Percent","##0.00%");We.FORMAT_BASIS_POINTS=Yt.makePresetFormat("Basis Points","###,##0 bp",1e4);We.FORMAT_MILLIONS=Yt.makePresetFormat("Millions","###,##0.000 mm",1e-6);We.FORMAT_ROUND=Yt.makePresetFormat("Round","###,##0");We.FORMAT_ROUND_TWO_DECIMALS=Yt.makePresetFormat("0.00","###,##0.00");We.FORMAT_ROUND_FOUR_DECIMALS=Yt.makePresetFormat("0.0000","###,##0.0000");class Nh extends ke{format(t){return`${t}`}}const Fh=ne.module("IntegerColumnFormatter"),qs=class extends ke{constructor({defaultFormatString:e=qs.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return E.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=ke.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return qs.makeFormat(e,t,ke.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return qs.makeFormat("Custom Format",e,ke.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return E.i18n.NumberFormat.format(n,s)}catch{Fh.error("Invalid format arguments")}return""}};let un=qs;un.DEFAULT_FORMAT_STRING="###,##0";un.FORMAT_MILLIONS=qs.makePresetFormat("Millions","###,##0.000 mm",1e-6);class xh extends ke{format(t){return t}}const at=class{static makeDateWrapper(e,t,n=0,s=1,i=0,o=0,r=0,l=0){if(!e)throw new Error("No timezone provided");const a=`${t}`.padStart(4,"0"),c=`${n+1}`.padStart(2,"0"),d=`${s}`.padStart(2,"0"),h=`${i}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),p=`${r}`.padStart(2,"0"),g=`${l}`.padStart(9,"0"),f=`${a}-${c}-${d} ${h}:${m}:${p}.${g}`;return E.i18n.DateTimeFormat.parse(at.FULL_DATE_FORMAT,f,E.i18n.TimeZone.getTimeZone(e))}static getNextNanos(e){const t=parseInt(e,10),n="0".repeat(9-e.length),s=`${t+1}${n}`;return parseInt(s,10)}static getNextDate(e,t,n){let{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;c=at.getNextNanos(e.nanos),c>999999999&&(a+=1,c=0)}else e.seconds!=null?a+=1:e.minutes!=null?l+=1:e.hours!=null?r+=1:e.date!=null?o+=1:e.month!=null?i+=1:s+=1;const d=new Date(s,i,o,r,l,a);return at.makeDateWrapper(n,d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),c)}static parseMonth(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;const n=e.trim().toLowerCase();if(n.length>=3){for(let s=0;s<at.months.length;s+=1)if(at.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,i,o,r){const l=parseInt(e,10),a=t!=null?this.parseMonth(t):0,c=n!=null?parseInt(n,10):1,d=s!=null?parseInt(s,10):0,h=i!=null?parseInt(i,10):0,m=o!=null?parseInt(o,10):0,p=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(a)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:a,date:c,hours:d,minutes:h,seconds:m,nanos:p}}static parseDateTimeString(e){const n=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(e);if(n==null)throw new Error(`Unexpected date string: ${e}`);const[,s,,i,,o,,r,,l,,a,,c,d]=n;if(d!=null&&d.length>0)throw new Error(`Unexpected characters after date string '${e}': ${d}`);return{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}}static parseDateRange(e,t){const n=e.trim().toLowerCase();if(n.length===0)throw new Error("Cannot parse date range from empty string");if(n==="null")return[null,null];if(n==="today"){const l=new Date(Date.now()),a=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()),c=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()+1);return[a,c]}if(n==="yesterday"){const l=new Date(Date.now()),a=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()-1),c=at.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate());return[a,c]}if(n==="now"){const l=new Date(Date.now());return[E.DateWrapper.ofJsDate(l),null]}const s=at.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const i=at.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(i==null)throw new Error(`Unable to extract date values from ${s}`);const o=at.makeDateWrapper(t,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),r=at.getNextDate(s,i,t);return[o,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let kn=at;kn.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";kn.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class Kt{}Kt.not="not";Kt.and="and";Kt.or="or";function Oh(e){if(!(e==="not"||e==="and"||e==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class z{}z.eq="eq";z.eqIgnoreCase="eqIgnoreCase";z.notEq="notEq";z.notEqIgnoreCase="notEqIgnoreCase";z.greaterThan="greaterThan";z.greaterThanOrEqualTo="greaterThanOrEqualTo";z.lessThan="lessThan";z.lessThanOrEqualTo="lessThanOrEqualTo";z.in="in";z.inIgnoreCase="inIgnoreCase";z.notIn="notIn";z.notInIgnoreCase="notInIgnoreCase";z.isTrue="isTrue";z.isFalse="isFalse";z.isNull="isNull";z.invoke="invoke";z.contains="contains";z.notContains="notContains";z.startsWith="startsWith";z.endsWith="endsWith";z.containsAny="containsAny";function Ah(e){switch(e){case z.eq:return"is exactly";case z.eqIgnoreCase:return"is exactly (ignore case)";case z.notEq:return"is not exactly";case z.notEqIgnoreCase:return"is not exactly (ignore case)";case z.contains:return"contains";case z.notContains:return"does not contain";case z.startsWith:return"starts with";case z.endsWith:return"ends with";default:throw new Error(`Unrecognized text filter type ${e}`)}}function kh(e){switch(e){case z.eq:return"is equal to";case z.notEq:return"is not equal to";case z.greaterThan:return"greater than";case z.greaterThanOrEqualTo:return"greater than or equal to";case z.lessThan:return"less than";case z.lessThanOrEqualTo:return"less than or equal to";default:throw new Error(`Unrecognized number filter type ${e}`)}}function Lh(e){switch(e){case z.eq:return"date is";case z.notEq:return"date is not";case z.notEqIgnoreCase:case z.greaterThan:return"date is after";case z.greaterThanOrEqualTo:return"date is after or equal";case z.lessThan:return"date is before";case z.lessThanOrEqualTo:return"date is before or equal";default:throw new Error(`Unrecognized date filter type ${e}`)}}function Ph(e){switch(e){case z.isTrue:return"Is True";case z.isFalse:return"Is False";case z.isNull:return"Is Null";default:throw new Error(`Unrecognized boolean filter type ${e}`)}}const on=ne.module("TableUtils"),X=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=X.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return X.isBooleanType(e)?[z.isTrue,z.isFalse,z.isNull]:X.isCharType(e)||X.isNumberType(e)||X.isDateType(e)?[z.eq,z.notEq,z.greaterThan,z.greaterThanOrEqualTo,z.lessThan,z.lessThanOrEqualTo]:X.isTextType(e)?[z.eq,z.eqIgnoreCase,z.notEq,z.notEqIgnoreCase,z.contains,z.notContains,z.startsWith,z.endsWith]:[]}static getNextSort(e,t,n){if(!e||n<0||n>=e.length)return null;const s=X.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===X.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(!e||t<0||t>=e.length||n===X.sortDirection.none)return null;let i=e[t].sort();switch(n){case X.sortDirection.ascending:i=i.asc();break;case X.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const i=X.getNextSort(t,e,n);return X.setSortForColumn(e,n,i,s)}static sortColumn(e,t,n,s,i,o){if(!e||n<0||n>=t.length)return[];const r=X.makeColumnSort(t,n,s,i);return X.setSortForColumn(e,n,r,o)}static setSortForColumn(e,t,n,s=!1){const i=X.getSortIndex(e,t);let o=[];return s&&(o=o.concat(e.filter(({direction:r})=>r!==X.sortDirection.reverse)),i!==null&&o.splice(i,1)),n!==null&&o.push(n),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case X.dataType.BOOLEAN:return X.dataType.BOOLEAN;case"char":case"java.lang.Character":case X.dataType.CHAR:return X.dataType.CHAR;case"java.lang.String":case X.dataType.STRING:return X.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case X.dataType.DATETIME:return X.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case X.dataType.DECIMAL:return X.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case X.dataType.INT:return X.dataType.INT;default:return X.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return X.isIntegerType(e)||X.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return X.getNormalizedType(e)===X.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let i=null;for(let o=0;o<s.length;o+=1){const l=s[o].split("&&");let a=null;for(let c=0;c<l.length;c+=1){const d=l[c].trim();if(d.length>0){const h=X.makeQuickFilterFromComponent(e,d,n);if(h)a?a=a.and(h):a=h;else throw new Error(`Unable to parse quick filter from text ${t}`)}}i&&a?i=i.or(a):i=a}return i}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return X.isNumberType(s)?this.makeQuickNumberFilter(e,t):X.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n&&X.isDateType(s)?this.makeQuickDateFilter(e,t,n):X.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,l=null,a=null,c=null,d=null;if(o!==null&&o.length>3&&([,r,l,a,c,d]=o),d!=null&&d.trim().length>0)return null;if(r==null&&(r="="),c!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":s=n.isNull();break;case"nan":s=E.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":l!=null?s=E.FilterCondition.invoke("isInf",n).and(n.lessThan(E.FilterValue.ofNumber(0))):s=E.FilterCondition.invoke("isInf",n).and(n.greaterThan(E.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(a==null)return null;if(a=X.removeCommas(a),X.isLongType(e.type))try{a=E.FilterValue.ofNumber(E.LongWrapper.ofString(`${l!=null?"-":""}${a}`))}catch(h){return on.warn("Unable to create long filter",h),null}else{if(a=parseFloat(a),a==null||Number.isNaN(a))return null;a=E.FilterValue.ofNumber(l!=null?0-a:a)}return s=e.filter(),X.makeRangeFilterWithOperation(s,r,a)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(n);let o=null,r=null;if(i!==null&&i.length>2&&([,o,r]=i,r!=null&&(r=r.trim())),r==null||r.length===0)return null;o==null&&(o="=");const l=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}let a=null,c=null;switch(r.startsWith("*")?(a="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(c="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),o){case"~":return l.isNull().not().and(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return a==="*"?l.isNull().or(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):c==="*"?l.isNull().or(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):l.notEqIgnoreCase(E.FilterValue.ofString(r.toLowerCase()));case"=":return a==="*"?l.isNull().not().and(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):c==="*"?l.isNull().not().and(l.invoke("matches",E.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):l.eqIgnoreCase(E.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,i,o]=s,r=i==="!"||i==="!=",l=o.trim().toLowerCase();let a=e.filter();try{const c=X.makeBooleanValue(l);return c?a=a.isTrue():c===null?a=a.isNull():a=a.isFalse(),r?a.not():a}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(o==null||o.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,l=null;[,r,l]=o;let a=z.eq;switch(r){case"<":a=z.lessThan;break;case"<=":case"=<":a=z.lessThanOrEqualTo;break;case">":a=z.greaterThan;break;case">=":case"=>":a=z.greaterThanOrEqualTo;break;case"!=":case"!":a=z.notEq;break;case"=":case"==":default:a=z.eq;break}return X.makeQuickDateFilterWithOperation(e,l,a,n)}static makeQuickDateFilterWithOperation(e,t,n=z.eq,s){if(e==null)throw new Error("Column is null");const[i,o]=kn.parseDateRange(t,s),r=i!=null?E.FilterValue.ofNumber(i):null,l=o!=null?E.FilterValue.ofNumber(o):null,a=e.filter();if(r==null)return n===z.notEq?a.isNull().not():a.isNull();switch(n){case z.eq:{if(l!=null){const c=a.greaterThanOrEqualTo(r),d=a.lessThan(l);return c.and(d)}return a.eq(r)}case z.lessThan:return a.lessThan(r);case z.lessThanOrEqualTo:return l!=null?a.lessThan(l):a.lessThanOrEqualTo(r);case z.greaterThan:return l!=null?a.greaterThanOrEqualTo(l):a.greaterThan(r);case z.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(r);case z.notEq:{if(l!=null){const c=a.lessThan(r),d=a.greaterThanOrEqualTo(l);return c.or(d)}return a.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:`"${e}"`}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(n);let o=null,r=null,l=null;if(i!==null&&i.length>3&&([,o,r,l]=i),l!=null&&l.trim().length>0||r==null||r.length===0)return null;o==null&&(o="=");const a=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}const c=E.FilterValue.ofString(X.isRangeOperation(o)?X.quoteValue(r):r);return X.makeRangeFilterWithOperation(a,o,c)}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return He.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t,n=0,s=null){let i,o,r=!0;const l=new Promise((a,c)=>{o=setTimeout(()=>{i(),r=!1,c(new Wl(`Event "${t}" timed out.`))},n),i=e.addEventListener(t,d=>{if(s!=null&&!s(d)){on.debug2("Event triggered, but matcher returned false.");return}on.debug2("Event triggered, resolving."),i(),clearTimeout(o),r=!1,a(d)})});return l.cancel=()=>{if(r){on.debug2("Pending promise cleanup."),i(),clearTimeout(o),r=!1;return}on.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:i,invertSelection:o,selectedValues:r}=t;let l=null;for(let c=0;c<s.length;c+=1){const d=s[c],{selectedType:h,value:m}=d;if(h!=null&&h.length>0&&m!=null&&m.length>0)try{const p=X.makeAdvancedValueFilter(e,h,m,n);if(p!=null){if(c===0)l=p;else if(l!==null&&c-1<i.length){const g=i[c-1];if(g===Kt.and)l=l.and(p);else if(g===Kt.or)l=l.or(p);else{on.error("Unexpected filter operator",g,p),l=null;break}}}else on.debug2("Empty filter ignored for",h,m)}catch(p){on.error("Unable to create filter",p),l=null;break}}const a=X.makeSelectValueFilter(e,r,o);return a!=null&&(l!=null?l=l.and(a):l=a),l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=X.getBaseType(e);return X.isTextType(n)?E.FilterValue.ofString(t):X.isLongType(n)?E.FilterValue.ofNumber(E.LongWrapper.ofString(X.removeCommas(t))):E.FilterValue.ofNumber(X.removeCommas(t))}static makeFilterRawValue(e,t){return X.isTextType(e)?E.FilterValue.ofString(t):X.isBooleanType(e)?E.FilterValue.ofBoolean(t):E.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(X.isTextType(e))return t;if(X.isLongType(e))return E.LongWrapper.ofString(X.removeCommas(t));if(X.isBooleanType(e))return X.makeBooleanValue(t,!0);if(X.isDateType(e)){const[s]=kn.parseDateRange(t,n);return s}return X.isNumberType(e)?X.makeNumberValue(t):(on.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error(`Invalid boolean '${e}'`)}}static makeNumberValue(e){if(e==null||e==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=X.removeCommas(t);if(X.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static getFilterOperatorString(e){switch(e){case z.eq:return"=";case z.notEq:return"!=";case z.greaterThan:return">";case z.greaterThanOrEqualTo:return">=";case z.lessThan:return"<";case z.lessThanOrEqualTo:return"<=";case z.contains:return"~";case z.notContains:return"!~";default:throw new Error(`Unexpected filter type ${e}`)}}static makeAdvancedValueFilter(e,t,n,s){if(X.isDateType(e.type))return X.makeQuickDateFilterWithOperation(e,n,t,s);if(X.isNumberType(e.type)||X.isCharType(e.type))return X.makeQuickFilter(e,`${X.getFilterOperatorString(t)}${n}`);const i=X.makeFilterValue(e.type,n),o=e.filter();switch(t){case z.eq:return o.eq(i);case z.eqIgnoreCase:return o.eqIgnoreCase(i);case z.notEq:return o.notEq(i);case z.notEqIgnoreCase:return o.notEqIgnoreCase(i);case z.greaterThan:return o.greaterThan(i);case z.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(i);case z.lessThan:return o.lessThan(i);case z.lessThanOrEqualTo:return o.lessThanOrEqualTo(i);case z.isTrue:return o.isTrue();case z.isFalse:return o.isFalse();case z.isNull:return o.isNull();case z.contains:return o.isNull().not().and(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case z.notContains:return o.isNull().or(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case z.startsWith:return o.isNull().not().and(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case z.endsWith:return o.isNull().not().and(o.invoke("matches",E.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case z.in:case z.inIgnoreCase:case z.notIn:case z.notInIgnoreCase:case z.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let o=null;X.isTextType(e.type)?o=E.FilterValue.ofString("a"):X.isBooleanType(e.type)?o=E.FilterValue.ofBoolean(!0):X.isDateType(e.type)?o=E.FilterValue.ofNumber(E.DateWrapper.ofJsDate(new Date)):o=E.FilterValue.ofNumber(0);const r=e.filter().eq(o),l=e.filter().notEq(o);return r.and(l)}const s=[];let i=!1;for(let o=0;o<t.length;o+=1){const r=t[o];r==null?i=!0:X.isTextType(e.type)?s.push(E.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):X.isBooleanType(e.type)?s.push(E.FilterValue.ofBoolean(!!r)):s.push(E.FilterValue.ofNumber(r))}return i?s.length>0?n?e.filter().isNull().not().and(e.filter().notIn(s)):e.filter().isNull().or(e.filter().in(s)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(s):e.filter().in(s)}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e,t=!0){return[...e].sort((n,s)=>{const i=n.name.toUpperCase(),o=s.name.toUpperCase();return jo.sort(i,o,t)})}};let x=X;x.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};x.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};x.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});x.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class Qt{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const i=x.getNormalizedType(s.columnType);if(i===null)return n;n.has(i)||n.set(i,new Map);const o=n.get(i);return o==null||o.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,i,o=!1){this.defaultColumnFormatter=new Nh,this.typeFormatterMap=new Map([[x.dataType.BOOLEAN,new Sh],[x.dataType.CHAR,new vh],[x.dataType.DATETIME,new An(n)],[x.dataType.DECIMAL,new We(s)],[x.dataType.INT,new un(i)],[x.dataType.STRING,new xh]]),this.columnFormatMap=Qt.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(t,n=!1){const s=x.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var i;const s=this.getColumnFormatMapForType(t);return(i=s==null?void 0:s.get(n))!=null?i:null}getColumnTypeFormatter(t){var i;const n=x.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(i=this.typeFormatterMap.get(n))!=null?i:s),s}getFormattedString(t,n,s="",i){if(t==null)return"";const o=this.getColumnTypeFormatter(n),r=i||this.getColumnFormat(n,s);return o.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(x.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}function Hh(e){if(e&&e.formatter){const{formatter:t}=e;return t}}function _h(e){return{timeZone:e==null?void 0:e.timeZone,defaultDateTimeFormatString:e==null?void 0:e.defaultDateTimeFormat,showTimeZone:e==null?void 0:e.showTimeZone,showTSeparator:e==null?void 0:e.showTSeparator}}function Vh(e,t,n){const s=e.getColumnFormat(n,t);return s!=null&&(s.type===ke.TYPE_CONTEXT_PRESET||s.type===ke.TYPE_CONTEXT_CUSTOM)}const rs={getColumnFormats:Hh,getDateTimeFormatterOptions:_h,isCustomColumnFormatDefined:Vh},Uh=e=>{switch(e){default:return!1}},Bh=(e,t)=>{switch(e){case we.COUNT:case we.FIRST:case we.LAST:case we.COUNT_DISTINCT:case we.DISTINCT:case we.UNIQUE:return!0;case we.MIN:case we.MAX:return x.isNumberType(t)||x.isDateType(t)||x.isTextType(t);case we.SUM:case we.ABS_SUM:case we.VAR:case we.AVG:case we.STD:return x.isNumberType(t);case we.SKIP:return!1}},ir=(e,t)=>e.filter(n=>Bh(t,n.type)),Wh=(e,t,n,s)=>ir(e,t).map(({name:i})=>i).filter(i=>n.includes(i)?!s:s),Fn={isRollupOperation:Uh,filterValidColumns:ir,getOperationColumnNames:Wh};const Xr=ne.module("Aggregations"),zh=[we.SUM,we.ABS_SUM,we.MIN,we.MAX,we.VAR,we.AVG,we.STD,we.FIRST,we.LAST,we.COUNT_DISTINCT,we.DISTINCT,we.COUNT,we.UNIQUE],$h=({isRollup:e,settings:t,onChange:n,onEdit:s})=>{const{aggregations:i,showOnTop:o}=t,r=y.exports.useMemo(()=>zh.filter(L=>!i.some(W=>W.operation===L)),[i]),[l,a]=y.exports.useState(r[0]),[c,d]=y.exports.useState([]),h=y.exports.useCallback(L=>{n({...t,...L})},[n,t]),m=y.exports.useCallback(L=>{h({aggregations:L})},[h]),p=y.exports.useCallback(L=>{h({showOnTop:L})},[h]),g=y.exports.useCallback(()=>{Xr.debug("handleDragStart"),dt.startDragging()},[]),f=y.exports.useCallback(({destination:L,source:W})=>{if(Xr.debug("handleDragEnd",L,W),dt.stopDragging(),L===null)return;let B=L.index;W.index<L.index&&(B+=1);const N=[...i],_=dt.reorder(N,c,N,B),k=dt.adjustDestinationIndex(B,c),P=[[k,k+_.length-1]];m(N),d(P)},[m,i,c,d]),b=y.exports.useCallback(L=>{a(L)},[a]),C=y.exports.useCallback(()=>{m([...i,{operation:l,selected:[],invert:!0}])},[i,l,m]),w=y.exports.useCallback(L=>{m(i.filter((W,B)=>B!==L))},[i,m]),S=y.exports.useCallback(L=>{d(L)},[d]),I=y.exports.useCallback(L=>{const W=i[L];Fn.isRollupOperation(W.operation)||s(W)},[i,s]),v=y.exports.useCallback(L=>{p(L.target.value==="true")},[p]);y.exports.useEffect(function(){r.length>0&&!r.includes(l)&&a(r[0])},[r,l]);const R=y.exports.useCallback(({item:L,itemIndex:W,isClone:B,selectedCount:N})=>{const _=L.operation,k=B?`${N}`:void 0,P=B?"item-list-item-clone":void 0,H=Fn.isRollupOperation(L.operation),V=!B&&!H;return T(Fe,{children:[T("div",{className:$("item-list-item-content","draggable-item-list-item-content",P),children:[T("span",{className:"title",children:[_,!e&&H&&T("span",{className:"small text-warning",children:[u(q,{icon:Ul})," Requires rollup"]})]}),Ct.renderBadge({text:k}),Ct.renderHandle()]}),!B&&T(Fe,{children:[u(De,{kind:"ghost",className:"btn-edit",icon:Ol,tooltip:"Edit Columns",onClick:()=>s(L),disabled:!V}),u(De,{kind:"ghost",className:"btn-delete",icon:Ln,tooltip:"Delete Aggregation",onClick:()=>w(W)})]})]})},[w,s,e]),D=r.length>0,F=i.length>0;return T("div",{className:"aggregations",children:[D&&T("div",{className:"form-inline",children:[u(ph,{onChange:b,value:l,children:r.map(L=>u(mh,{value:L,children:L},L))}),T("button",{type:"button",className:"btn btn-link btn-add",onClick:C,children:[u(q,{icon:Ds}),"Add Aggregation"]})]}),D&&F&&u("hr",{}),F&&T(Fe,{children:[!e&&T("div",{className:"form-inline",children:[u("label",{children:"Placement:\xA0"}),T(tr,{onChange:v,value:`${o}`,children:[u(gn,{value:"true",children:"Top"}),u(gn,{value:"false",children:"Bottom"})]})]}),u(Qs,{onDragStart:g,onDragEnd:f,children:u(Ct,{className:"selected-aggregations",itemCount:i.length,items:i,renderItem:R,offset:0,onSelectionChange:S,onSelect:I,selectedRanges:c,isMultiSelect:!0})})]})]})};const Gh=30,qh=({aggregation:e,columns:t,onChange:n})=>{const[s,i]=y.exports.useState(-1),[o,r]=y.exports.useState(-1),[l,a]=y.exports.useState(0),{invert:c,selected:d}=e,h=y.exports.useRef(null),m=y.exports.useCallback(v=>d.includes(v)?!c:c,[c,d]),p=y.exports.useMemo(()=>{let v=ir(t,e.operation);return l!==0&&(v=x.sortColumns(v,l===1)),v},[t,e.operation,l]),g=y.exports.useMemo(()=>s>=0?p.slice(s,o+1).map(v=>({value:v.name,displayValue:v.name,isSelected:m(v.name)})):[],[p,m,o,s]),f=y.exports.useCallback(v=>{const{name:R}=p[v],D=d.indexOf(R);let F=[...d],L=c;D>=0?F.splice(D,1):(F.push(R),F.length===p.length&&(F=[],L=!c)),n({...e,selected:F,invert:L})},[e,c,p,d,n]),b=y.exports.useCallback(()=>{a(0),n({...e,selected:[],invert:!0})},[e,n]),C=y.exports.useCallback((v,R)=>{i(v),r(R)},[i,r]),w=y.exports.useCallback(()=>{d.length===0?n({...e,invert:!c}):n({...e,selected:[],invert:!0})},[e,c,n,d]),S=d.length===0?c:null,I=d.length!==0||!c||l!==0;return T("div",{role:"menu",className:"aggregation-edit",children:[u("div",{className:"top-menu",children:T("div",{className:"form-inline",children:[u(It,{checked:S,onChange:w,children:"Toggle All"}),u("div",{className:"spacer"}),u(ot,{in:I,timeout:Rt.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u(De,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),u(De,{kind:"ghost",className:$({active:l===1}),icon:Ko,tooltip:"Sort ascending",onClick:()=>a(1)}),u(De,{kind:"ghost",className:$({active:l===2}),icon:Xo,tooltip:"Sort descending",onClick:()=>a(2)})]})}),u("div",{className:"aggregation-edit-item-list",children:u(Zt,{itemCount:p.length,items:g,offset:s,renderItem:({item:v})=>u(It,{checked:m(v.value),children:v.displayValue}),onSelect:f,onViewportChange:C,rowHeight:Gh,focusSelector:"input",ref:h})})]})};function Kh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})})}function Xh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})})}function Yh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),u("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),u("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})})}function Qh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),u("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})})}function jh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:T("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),u("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})})}function Zh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),u("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]})}function Jh(e){return T("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),u("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),u("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]})}const Yr=ne.module("ChartBuilder"),Ge=class extends y.exports.PureComponent{static getTypeName(e){switch(e){case E.plot.SeriesPlotStyle.LINE:return"Line";case E.plot.SeriesPlotStyle.BAR:return"Bar";case E.plot.SeriesPlotStyle.SCATTER:return"Scatter";case E.plot.SeriesPlotStyle.PIE:return"Pie";case E.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}static getTypeIcon(e){switch(e){case E.plot.SeriesPlotStyle.LINE:return u(Yh,{});case E.plot.SeriesPlotStyle.BAR:return u(Kh,{});case E.plot.SeriesPlotStyle.SCATTER:return u(jh,{});case E.plot.SeriesPlotStyle.PIE:return u(Qh,{});case E.plot.SeriesPlotStyle.HISTOGRAM:return u(Xh,{});default:return null}}static getMaxSeriesCount(e){switch(e){case E.plot.SeriesPlotStyle.PIE:return 1;case E.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static getXAxisLabel(e){switch(e){case E.plot.SeriesPlotStyle.PIE:return"Labels";case E.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}static getSeriesLabel(e){switch(e){case E.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}static makeSeriesItem(e){return{id:jt.generate(),value:e}}static makeDefaultSeriesItems(e,t){if(Ge.getMaxSeriesCount(e)===0||t==null||t.length===0)return[];const s=t.length>1?t[1].name:t[0].name;return[Ge.makeSeriesItem(s)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),this.handleAddSeries=this.handleAddSeries.bind(this),this.handleLinkStateChange=this.handleLinkStateChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSeriesChange=this.handleSeriesChange.bind(this),this.handleSeriesDeleteClick=this.handleSeriesDeleteClick.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleTypeClick=this.handleTypeClick.bind(this),this.handleXAxisChange=this.handleXAxisChange.bind(this),this.sendChange=this.sendChange.bind(this);const{model:t}=e,{columns:n}=t,s=Ge.types[0],i=Ge.getDefaultXAxis(s,n),o=Ge.makeDefaultSeriesItems(s,n);this.state={type:s,seriesItems:o,xAxis:i,isLinked:!0}}handleAddSeries(){this.setState(e=>{let{seriesItems:t}=e;t=[...t];const{model:n}=this.props,{columns:s}=n;return t.push({id:jt.generate(),value:s[0].name}),{seriesItems:t}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){const{model:e}=this.props,{columns:t}=e,n=Ge.types[0],s=Ge.getDefaultXAxis(n,t),i=Ge.makeDefaultSeriesItems(n,t),o=!0;this.setState({type:n,seriesItems:i,xAxis:s,isLinked:o},this.sendChange)}handleSeriesChange(e){const{value:t}=e.target,n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o[s].value=t,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o.splice(s,1),{seriesItems:o}},this.sendChange)}handleSubmit(e){e.preventDefault();const{onSubmit:t}=this.props,{type:n,seriesItems:s,xAxis:i,isLinked:o}=this.state,r=s.map(l=>l.value);t({type:`${n}`,series:r,xAxis:i,isLinked:o})}handleTypeClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10),i=Ge.types[s];Yr.debug2("handleTypeSelect",i),this.setState(o=>{const r=Ge.getMaxSeriesCount(i);let{seriesItems:l}=o;if(l=l.slice(0,r),l.length===0&&r>0){const{model:a}=this.props,{columns:c}=a;l=Ge.makeDefaultSeriesItems(i,c)}return{type:i,seriesItems:l}},this.sendChange)}handleXAxisChange(e){const t=e.target.value;Yr.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){const{onChange:e}=this.props,{isLinked:t,type:n,seriesItems:s,xAxis:i}=this.state,o=s.map(r=>r.value);e({type:n,series:o,xAxis:i,isLinked:t})}render(){const{model:e}=this.props,{columns:t}=e,{seriesItems:n,type:s,xAxis:i,isLinked:o}=this.state,r=Ge.getMaxSeriesCount(s),l=Ge.getXAxisLabel(s),a=Ge.getSeriesLabel(s),c=n.length>0,d=n.length<r;return u("div",{className:"chart-builder",children:T("form",{onSubmit:this.handleSubmit,children:[T("div",{className:"form-row",children:[u("label",{children:"Select Chart Type"}),u("div",{className:"form-row",children:Ge.types.map((h,m)=>{const p=h;return u("div",{className:"col col-chart-type",children:T("button",{type:"button",className:$("btn","btn-icon","btn-chart-type",{active:h===s}),"data-index":m,onClick:this.handleTypeClick,children:[Ge.getTypeIcon(h),Ge.getTypeName(h)]})},p)})})]}),u("hr",{}),T("div",{className:"form-row form-inline",children:[u("label",{className:"col-2 label-left",children:l}),u("select",{className:"form-control custom-select select-x-axis col",value:i,onChange:this.handleXAxisChange,children:t.map(h=>u("option",{value:h.name,children:h.name},h.name))})]}),c&&u("hr",{}),n.map((h,m)=>T("div",{className:"form-row form-inline form-series-item","data-testid":`form-series-item-${m}`,children:[u("label",{className:"col-2 label-left",children:m===0?a:""}),u("select",{className:"form-control custom-select select-series col",value:h.value,onChange:this.handleSeriesChange,"data-testid":`select-series-item-${m}`,"data-index":m,children:t.map(p=>u("option",{value:p.name,"data-index":m,children:p.name},p.name))}),n.length>1&&u("button",{type:"button",className:"btn btn-link btn-link-icon btn-delete-series ml-2 px-2","data-index":m,"data-testid":`delete-series-${m}`,onClick:this.handleSeriesDeleteClick,children:u(q,{icon:Ln})})]},h.id)),d&&T("div",{className:"form-row",children:[u("div",{className:"col-2"}),T("button",{type:"button",className:"btn btn-link btn-add-series mt-1",onClick:this.handleAddSeries,children:[u(q,{icon:Ds}),"Add Series"]})]}),T("div",{className:"form-row chart-builder-link",children:[u("label",{className:"col-2 label-right",children:T("div",{className:"fa-md fa-layers",children:[u(q,{mask:Qo,icon:Go,transform:"right-5 down-5"}),u(q,{icon:o?kl:kd,transform:"grow-2 right-8 down-6"})]})}),T(tr,{onChange:this.handleLinkStateChange,value:`${o}`,children:[u(gn,{value:"true",children:"Sync State"}),u(gn,{value:"false",children:"Freeze State"})]})]}),T("div",{className:"form-row",children:[u("div",{className:"col-2 label-right"}),u("div",{className:"col chart-builder-link-info",children:o?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),T("div",{className:$("form-row","justify-content-end","my-3"),children:[u("button",{type:"button",className:"btn btn-outline-primary btn-reset",onClick:this.handleReset,children:"Reset"}),u("button",{type:"submit",className:"btn btn-primary btn-submit",children:"Create"})]})]})})}};let da=Ge;da.types=[E.plot.SeriesPlotStyle.LINE,E.plot.SeriesPlotStyle.BAR,E.plot.SeriesPlotStyle.SCATTER,E.plot.SeriesPlotStyle.PIE];class ha extends y.exports.Component{constructor(t){super(t),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var i;const{value:t,editorSettings:n}=this.props,s={copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0,...n};if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=pn.create(this.editorContainer,s),this.editor.layout(),(i=this.editor.getModel())==null||i.updateOptions({tabSize:0}),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var t;(t=this.editor)==null||t.dispose(),this.editor=void 0}handleContentChanged(){var s,i;const{onContentChanged:t}=this.props,n=(i=(s=this.editor)==null?void 0:s.getModel())==null?void 0:i.getValue();n&&this.setState({isEditorEmpty:n.length===0}),t(n)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var n,s;const t=(s=(n=this.editor)==null?void 0:n.getModel())==null?void 0:s.getValue();if(!t)throw new Error("value is undefined");this.setState({isEditorEmpty:t.length===0,isEditorFocused:!1})}handleContainerClick(){var n;const{isEditorFocused:t}=this.state;t||(n=this.editor)==null||n.focus()}handleKeyDown(t){const{onTab:n,editorIndex:s}=this.props;t.key==="Tab"&&n(s,t.shiftKey)}render(){const{value:t,invalid:n}=this.props,{isEditorFocused:s,isEditorEmpty:i}=this.state;return T("div",{className:$("input-editor-wrapper",{focused:s,invalid:n}),onKeyDown:this.handleKeyDown,role:"presentation",onClick:this.handleContainerClick,children:[u("div",{className:"editor-container",ref:o=>{this.editorContainer=o}}),i&&!t&&u("div",{className:"editor-placeholder text-muted",children:"Column Formula"})]})}}ha.defaultProps={value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1};const Po=class extends y.exports.PureComponent{constructor(e){super(e),this.handleFormulaEditorContentChanged=this.handleFormulaEditorContentChanged.bind(this)}handleFormulaEditorContentChanged(e){const{onChange:t,eventKey:n}=this.props;e&&(e.replace(/(\r\n|\n|\r)/gm,""),t(n,Po.INPUT_TYPE.FORMULA,e))}render(){const{eventKey:e,name:t,formula:n,onChange:s,onDeleteColumn:i,inputIndex:o,onTabInEditor:r,invalid:l}=this.props;return u(zi,{draggableId:e,index:o,disableInteractiveElementBlocking:!0,children:(a,c)=>T("div",{className:$("draggable-container",{dragging:c.isDragging}),ref:a.innerRef,...a.draggableProps,children:[T("div",{className:"custom-column-input-container",children:[T("div",{className:"d-flex flex-row pb-3 custom-column-name",children:[u("input",{className:$("form-control custom-column-input",{"is-invalid":l}),placeholder:"Column Name",value:t,onChange:d=>{s(e,Po.INPUT_TYPE.NAME,d.target.value)}}),T("button",{type:"button",className:"btn btn-link btn-link-icon ml-1 px-2",onClick:()=>{i(e)},children:[u(me,{children:"Delete custom column"}),u(q,{icon:Ln})]}),T("button",{type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",...a.dragHandleProps,children:[u(me,{children:"Drag column to re-order"}),u(q,{icon:qi})]})]}),u(ha,{editorSettings:{language:"deephavenDb"},editorIndex:o,value:n,onContentChanged:this.handleFormulaEditorContentChanged,onTab:r,invalid:l})]}),u("hr",{})]})})}};let or=Po;or.INPUT_TYPE={NAME:"name",FORMULA:"formula"};or.defaultProps={name:"",inputIndex:0,formula:"",onChange:()=>{},onDeleteColumn:()=>{},onTabInEditor:()=>{},invalid:!1};class ua extends Error{constructor(){super(...arguments),this.isAssertionFailed=!0}}function Qr(e){if(e==null)throw new ua(`Expected 'val' to be defined, but received ${e}`)}class So extends Error{constructor(){super(...arguments),this.isPasteError=!0}}function Ae(e){return(e==null?void 0:e.isEditable)!==void 0}function jr(e){if(!Ae(e))throw new ua(`Expected 'model' to be editable, but received ${e}`)}function qe(e){return(e==null?void 0:e.hasExpandableRows)!==void 0}var Pt=(e=>(e.DOWN="DOWN",e.UP="UP",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Pt||{});const ce=class{static normalize(e,t,n,s){let i=e,o=t,r=n,l=s;return i!=null&&r!=null&&r<i&&(i=r,r=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[i,o,r,l]}static makeNormalized(e,t,n,s){return new ce(...ce.normalize(e,t,n,s))}static makeCell(e,t){return new ce(e,t,e,t)}static makeColumn(e){return new ce(e,null,e,null)}static makeRow(e){return new ce(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){const t=e.slice();let n=!0;for(;n;){n=!1;for(let s=0;s<t.length&&!n;s+=1){const i=t[s];for(let o=t.length-1;o>s;o-=1){const r=t[o];if(i.contains(r))t.splice(o,1);else if(r.contains(i)){n=!0,t[s]=r,t.splice(o,1);break}else if(i.startRow===r.startRow&&i.endRow===r.endRow){if(i.touches(r)){const{startRow:l,endRow:a}=i,c=ce.minOrNull(i.startColumn,r.startColumn),d=ce.maxOrNull(i.endColumn,r.endColumn);n=!0,t[s]=new ce(c,l,d,a),t.splice(o,1);break}}else if(i.startColumn===r.startColumn&&i.endColumn===r.endColumn&&i.touches(r)){const{startColumn:l,endColumn:a}=i,c=ce.minOrNull(i.startRow,r.startRow),d=ce.maxOrNull(i.endRow,r.endRow);n=!0,t[s]=new ce(l,c,a,d),t.splice(o,1);break}}}}return t}static isAxisRangeTouching(e,t,n,s){return e==null?t==null||n==null?!0:n<=t+1:t==null?s==null?!0:s>=e-1:n==null?s==null?!0:e<=s+1:s==null?t>=n-1:n>=e-1?n<=t+1:s>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!e[n].equals(t[n]))return!1;return!0}static intersection(e,t){if(e.equals(t))return e;let{startColumn:n,startRow:s,endColumn:i,endRow:o}=e;return n=n!=null&&t.startColumn!=null?Math.max(n,t.startColumn):n!=null?n:t.startColumn,i=i!=null&&t.endColumn!=null?Math.min(i,t.endColumn):i!=null?i:t.endColumn,s=s!=null&&t.startRow!=null?Math.max(s,t.startRow):s!=null?s:t.startRow,o=o!=null&&t.endRow!=null?Math.min(o,t.endRow):o!=null?o:t.endRow,n!=null&&n>(i!=null?i:-1)||s!=null&&s>(o!=null?o:-1)?null:new ce(n,s,i,o)}static subtractFromRange(e,t){const n=[],s=ce.intersection(e,t);return s==null?[e]:(s.startRow!=null&&(e.startRow==null||e.startRow<s.startRow)&&n.push(new ce(e.startColumn,e.startRow,e.endColumn,s.startRow-1)),s.startColumn!=null&&(e.startColumn==null||e.startColumn<s.startColumn)&&n.push(new ce(e.startColumn,s.startRow,s.startColumn-1,s.endRow)),s.endColumn!=null&&(e.endColumn==null||e.endColumn>s.endColumn)&&n.push(new ce(s.endColumn+1,s.startRow,e.endColumn,s.endRow)),s.endRow!=null&&(e.endRow==null||e.endRow>s.endRow)&&n.push(new ce(e.startColumn,s.endRow+1,e.endColumn,e.endRow)),n)}static subtractFromRanges(e,t){const n=[];for(let s=0;s<e.length;s+=1)n.push(...ce.subtractFromRange(e[s],t));return n}static subtractRangesFromRanges(e,t){if(!t||t.length===0)return e;let n=[...e];for(let s=0;s<t.length;s+=1)n=ce.subtractFromRanges(n,t[s]);return n}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,n){var s,i,o,r;return ce.isBounded(e)?e:new ce((s=e.startColumn)!=null?s:0,(i=e.startRow)!=null?i:0,(o=e.endColumn)!=null?o:t-1,(r=e.endRow)!=null?r:n-1)}static boundedRanges(e,t,n){return e.map(s=>ce.boundedRange(s,t,n))}static offset(e,t,n){return new ce(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+n:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+n:null)}static nextCell(e,t=null,n=null,s=ce.SELECTION_DIRECTION.DOWN){if(e.length===0)return null;let i=-1;if(t!=null&&n!=null&&(i=e.findIndex(o=>o.containsCell(t,n)),i>=0)){const r=e[i].nextCell(t,n,s);if(r!=null)return r}switch(s){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:{const o=i<e.length-1?i+1:0;return e[o].startCell(s)}case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:{const o=i>0?i-1:e.length-1;return e[o].startCell(s)}default:throw new Error(`Invalid direction: ${s}`)}}static cellCount(e){return e.reduce((t,n)=>{var s,i,o,r;return t+(((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1)*(((o=n.endColumn)!=null?o:NaN)-((r=n.startColumn)!=null?r:NaN)+1)},0)}static rowCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1},0)}static columnCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endColumn)!=null?s:NaN)-((i=n.startColumn)!=null?i:NaN)+1},0)}static containsCell(e,t,n){for(let s=0;s<e.length;s+=1)if(e[s].containsCell(t,n))return!0;return!1}static forEachCell(e,t,n=ce.SELECTION_DIRECTION.RIGHT){for(let s=0;s<e.length;s+=1)e[s].forEach(t,n)}constructor(e,t,n,s){this.startColumn=e,this.startRow=t,this.endColumn=n,this.endRow=s}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return ce.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&ce.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return ce.subtractFromRange(this,e)}startCell(e=ce.SELECTION_DIRECTION.DOWN){if(!ce.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error(`Invalid direction: ${e}`)}}nextCell(e,t,n){if(!ce.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");const{startColumn:s,endColumn:i,startRow:o,endRow:r}=this;switch(n){case ce.SELECTION_DIRECTION.DOWN:if(t<r)return{column:e,row:Math.max(t+1,o)};if(e<i)return{column:Math.max(e+1,s),row:o};break;case ce.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,r)};if(e>s)return{column:Math.min(e-1,i),row:r};break;case ce.SELECTION_DIRECTION.RIGHT:if(e<i)return{column:Math.max(e+1,s),row:t};if(t<r)return{column:s,row:Math.max(t+1,o)};break;case ce.SELECTION_DIRECTION.LEFT:if(e>s)return{column:Math.min(e-1,i),row:t};if(t>o)return{column:i,row:Math.min(t-1,r)};break;default:throw new Error(`Invalid direction: ${n}`)}return null}forEach(e,t=ce.SELECTION_DIRECTION.RIGHT){var o;let n=0,{column:s,row:i}=this.startCell(t);for(;s!=null&&i!=null;)e(s,i,n),n+=1,{column:s,row:i}=(o=this.nextCell(s,i,t))!=null?o:{}}};let j=ce;j.SELECTION_DIRECTION=Pt;function eu(e){return Array.isArray(e)&&e.length===2&&(e[0]===null||typeof e[0]=="number")&&(e[1]===null||typeof e[1]=="number")}function vo(e){return eu(e)&&e[0]!=null&&e[1]!=null}const fe=class{static getGridPointFromXY(e,t,n){const s=fe.getColumnAtX(e,n),i=fe.getRowAtY(t,n),o=fe.getColumnHeaderDepthAtY(t,n);return{x:e,y:t,row:i,column:s,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,n){const{row:s,column:i}=fe.getGridPointFromXY(e,t,n),{visibleColumnWidths:o,visibleRowHeights:r,visibleColumnXs:l,visibleRowYs:a,modelColumns:c,modelRows:d}=n,h=s!==null?d.get(s):null,m=i!==null?c.get(i):null,p=i!==null?l.get(i):null,g=s!==null?a.get(s):null,f=i!==null?o.get(i):null,b=s!==null?r.get(s):null;return{row:s,column:i,modelRow:h!=null?h:null,modelColumn:m!=null?m:null,left:p!=null?p:null,top:g!=null?g:null,columnWidth:f!=null?f:null,rowHeight:b!=null?b:null}}static getColumnHeaderDepthAtY(e,t){const n=fe.getRowAtY(e,t),{columnHeaderHeight:s,columnHeaderMaxDepth:i}=t;if(n===null&&e<=s*i)return rt(i-Math.ceil(e/s),0,i-1)}static iterateFloatingStart(e,t,n){for(let s=0;s<e&&s<t;s+=1){const i=n(s);if(i!==void 0)return i}}static iterateFloatingEnd(e,t,n){for(let s=0;s<e&&t-(e-s)>=0;s+=1){const i=n(t-(e-s));if(i!==void 0)return i}}static iterateFloating(e,t,n,s){const i=fe.iterateFloatingStart(e,n,s);return i!==void 0?i:fe.iterateFloatingEnd(t,n,s)}static iterateAllItems(e,t,n,s,i,o){const r=Math.max(e,n),l=Math.min(t,i-s-1);let a=fe.iterateFloating(n,s,i,o);if(a!==void 0)return a;for(let c=r;c<=l;c+=1)if(a=o(c),a!==void 0)return a}static isInItem(e,t,n,s){var r,l;const i=(r=t.get(e))!=null?r:0,o=(l=n.get(e))!=null?l:0;return i<=s&&s<=i+o}static getItemAtOffset(e,t,n,s,i,o,r,l=!1){const a=l?void 0:fe.iterateFloating(n,s,t,c=>{if(fe.isInItem(c,o,r,e))return c});if(!l&&a!==void 0)return a;for(let c=0;c<i.length;c+=1){const d=i[c];if(fe.isInItem(d,o,r,e))return d}return null}static getColumnAtX(e,t,n=!1){const{columnCount:s,floatingLeftColumnCount:i,floatingRightColumnCount:o,visibleColumns:r,visibleColumnXs:l,visibleColumnWidths:a,gridX:c}=t;return e<c?null:this.getItemAtOffset(e-c,s,i,o,r,l,a,n)}static getRowAtY(e,t){const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i,visibleRows:o,visibleRowYs:r,visibleRowHeights:l,gridY:a}=t;return e<a?null:this.getItemAtOffset(e-a,i,n,s,o,r,l)}static getNextShownItem(e,t,n,s){let i=n.findIndex(o=>o===e)||0;for(i-=1;i!=null&&i>=0;){const o=n[i],r=t.get(o);if(r!=null&&s.get(r)!==0)return o;i-=1}return null}static getNextShownColumn(e,t){const{modelColumns:n,visibleColumns:s,userColumnWidths:i}=t;return fe.getNextShownItem(e,n,s,i)}static getNextShownRow(e,t){const{modelRows:n,visibleRows:s,userRowHeights:i}=t;return fe.getNextShownItem(e,n,s,i)}static getColumnSeparatorIndex(e,t,n,s){var C,w,S,I;const{rowHeaderWidth:i,columnHeaderHeight:o,floatingColumns:r,floatingLeftWidth:l,visibleColumns:a,visibleColumnXs:c,visibleColumnWidths:d,columnHeaderMaxDepth:h}=n,{allowColumnResize:m,headerSeparatorHandleSize:p}=s;if(h*o<t||!m||p<=0)return null;const g=e-i,f=p*.5;let b=!1;for(let v=r.length-1;v>=0;v-=1){const R=r[v],D=(C=c.get(R))!=null?C:0,F=(w=d.get(R))!=null?w:0,L=F===0;if(!b||!L){let W=D+F;L?W+=f:b&&(W-=f);const B=W-f,N=W+f;if(B<=g&&g<=N)return R;b=L}}b=!1;for(let v=a.length-1;v>=0;v-=1){const R=a[v],D=(S=c.get(R))!=null?S:0,F=(I=d.get(R))!=null?I:0,L=F===0;if(D<l-F)return null;if(!b||!L){let W=D+F;L?W+=f:b&&(W-=f);const B=W-f,N=W+f;if(B<=g&&g<=N)return R;b=L}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){const{visibleColumnWidths:n}=t;return fe.isItemHidden(e,n)}static isFloatingRow(e,t){if(e==null)return!1;const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t;return e<n||e>=i-s}static isFloatingColumn(e,t){if(e==null)return!1;const{floatingLeftColumnCount:n,floatingRightColumnCount:s,columnCount:i}=t;return e<n||e>=i-s}static getHiddenItems(e,t,n){if(!fe.isItemHidden(e,t))return[];const s=[e],i=n.findIndex(o=>o===e);for(let o=i-1;o>=0;o-=1){const r=n[o];if(!fe.isItemHidden(r,t))break;s.push(r)}return s}static getHiddenColumns(e,t){const{visibleColumns:n,visibleColumnWidths:s}=t;return fe.getHiddenItems(e,s,n)}static getRowSeparatorIndex(e,t,n,s){var g,f;const{rowHeaderWidth:i,columnHeaderHeight:o,visibleRows:r,visibleRowYs:l,visibleRowHeights:a}=n,{allowRowResize:c,headerSeparatorHandleSize:d}=s;if(i<e||!c||d<=0)return null;const h=t-o,m=d*.5;let p=!1;for(let b=r.length-1;b>=0;b-=1){const C=r[b],w=(g=l.get(C))!=null?g:0,S=(f=a.get(C))!=null?f:0,I=S===0;if(!p||!I){let v=w+S;I?v+=m:p&&(v-=m);const R=v-m,D=v+m;if(R<=h&&h<=D)return C;p=I}}return null}static isRowHidden(e,t){const{visibleRowHeights:n}=t;return fe.isItemHidden(e,n)}static getHiddenRows(e,t){const{visibleRows:n,visibleRowHeights:s}=t;return fe.getHiddenItems(e,s,n)}static moveItem(e,t,n){if(e===t)return n;const s=[...n],i=s[s.length-1];return i&&!vo(i.from)&&i.to===e?i.from===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s}static moveRange(e,t,n){if(e[0]===t)return n;const s=[...n],i=s[s.length-1];return i&&vo(i.from)&&i.from[1]-i.from[0]===e[1]-e[0]&&i.to===e[0]?i.from[0]===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s[s.length-1].from===s[s.length-1].to&&s.pop(),s}static applyItemMoves(e,t,n,s=!1){var o,r;let i=[[e,t]];for(let l=s?n.length-1:0;s?l>=0:l<n.length;s?l-=1:l+=1){const{from:a,to:c}=n[l];let d=1,h;vo(a)?(d=a[1]-a[0]+1,[h]=a):h=a;const m=s?c:h,p=m+d-1,g=s?h:c,f=g-m,b=[];for(let C=0;C<i.length;C+=1){const w=(o=i[C][0])!=null?o:Number.NEGATIVE_INFINITY,S=(r=i[C][1])!=null?r:Number.POSITIVE_INFINITY;let I;const v=[[w,m-1],[m,p],[p+1,S]].map(([R,D])=>[Math.max(R,w),Math.min(D,S)]).filter(([R,D])=>R<=D).map(R=>{const[D,F]=R;return m<=D&&p>=F?(I=[D+f,F+f],I):p<D?[D-d,F-d]:R}).map(R=>{const[D,F]=R;return g>D&&g<=F?[[D,g-1],[g+d,F+d]]:R===I?[R]:g<=D?[[D+d,F+d]]:[R]}).flat();b.push(...v)}i=b.map(([C,w])=>[Number.isFinite(C)?C:null,Number.isFinite(w)?w:null])}return i}static translateRange(e,t,n,s){const i=fe.applyItemMoves(e.startColumn,e.endColumn,t,s),o=fe.applyItemMoves(e.startRow,e.endRow,n,s),r=[];for(let l=0;l<i.length;l+=1){const a=i[l];for(let c=0;c<o.length;c+=1){const d=o[c];r.push(new j(a[0],d[0],a[1],d[1]))}}return r}static getModelIndex(e,t){return fe.applyItemMoves(e,e,t,!0)[0][0]}static getModelIndexes(e,t){return e.map(n=>fe.getModelIndex(n,t))}static getModelRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!0)}static getModelRange(e,t=[],n=[]){return fe.translateRange(e,t,n,!0)}static getModelRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getModelRange(e[i],t,n));return s}static getVisibleRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!1)}static getVisibleRange(e,t=[],n=[]){return this.translateRange(e,t,n,!1)}static getVisibleRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getVisibleRange(e[i],t,n));return s}static getVisibleIndex(e,t){return fe.applyItemMoves(e,e,t)[0][0]}static getVisibleIndexes(e,t){return e.map(n=>fe.getVisibleIndex(n,t))}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return fe.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=fe.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(n=>t.get(n)===0)}static getScrollDragBounds(e,t,n){const{gridX:s,gridY:i,width:o,height:r,floatingTopRowCount:l,floatingBottomRowCount:a,floatingLeftColumnCount:c,floatingRightColumnCount:d,floatingLeftWidth:h,floatingRightWidth:m,floatingTopHeight:p,floatingBottomHeight:g,columnCount:f,rowCount:b}=e;let C=s,w=i,S=o,I=r;return n!=null&&(n>c&&(C+=h),n<f-d&&(S-=m)),t!=null&&(t>l&&(w+=p),t<b-a&&(I-=g)),{x1:C,y1:w,x2:S,y2:I}}static getScrollDelta(e,t=1024,n=768,s=20,i=20){let{deltaX:o,deltaY:r}=e;return!fe.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,r=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,r*=n):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(fe.isMacPlatform()?(o=Math.round(o*s),r=Math.round(r*i)):(o=Math.round(o*this.PIXELS_PER_LINE),r=Math.round(r*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:r}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],i=s[0],o=s[1];n===0?t.push([i,o]):i-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([i,o])}return t}};let U=fe;U.PIXELS_PER_LINE=100/3;function A(e,t,n=void 0){var i;const s=(i=e.get(t))!=null?i:n;if(s!==void 0)return s;throw new Error(`Missing value for key ${t}`)}function Si(e,t=js.CACHE_SIZE,n=Math.floor(t/2)){if(e.size>t){const s=e.keys();for(;e.size>n;)e.delete(s.next().value)}}function Zr(e,t,n,s,i){const o=new Map;let r=0;for(let l=0;l<e&&l<n;l+=1)o.set(l,r),r+=A(i,l);r=s;for(let l=0;l<t&&n-l-1>=0;l+=1)r-=A(i,n-l-1),o.set(n-l-1,r);return o}const ma=class{constructor({userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:n=new Map,calculatedRowHeights:s=new Map,fontWidths:i=new Map,modelRows:o=new Map,modelColumns:r=new Map,movedRows:l=[],movedColumns:a=[]}={}){this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=s,this.calculatedColumnWidths=n,this.fontWidths=i,this.modelRows=o,this.modelColumns=r,this.movedRows=l,this.movedColumns=a}getMetrics(e){const{left:t,top:n,leftOffset:s,topOffset:i,width:o,height:r,theme:l,model:a,movedRows:c,movedColumns:d,draggingColumn:h}=e,{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,columnWidth:f,columnHeaderHeight:b,minScrollHandleSize:C,scrollBarSize:w}=l;c!==this.movedRows&&(this.movedRows=c,this.modelRows.clear()),d!==this.movedColumns&&(this.movedColumns=d,this.modelColumns.clear());const{columnCount:S,rowCount:I,floatingTopRowCount:v,floatingBottomRowCount:R,floatingLeftColumnCount:D,floatingRightColumnCount:F,columnHeaderMaxDepth:L}=a,W=this.getFirstRow(e),B=this.getFirstColumn(e),N=this.getGridX(e),_=this.getGridY(e),k=qe(a)&&a.hasExpandableRows?this.calculateTreePaddingX(e):0,P=0;let H=this.getVisibleRowHeights(e),V=this.getVisibleColumnWidths(e,B,k);const G=Array.from(H.keys()),Q=Array.from(V.keys());H=new Map([...H,...this.getFloatingRowHeights(e)]),V=new Map([...V,...this.getFloatingColumnWidths(e)]);let J=this.getVisibleColumnXs(V,Q,s),re=this.getVisibleRowYs(H,G,i);const Ce=G.length>0?G[G.length-1]:n,de=Q.length>0?Q[Q.length-1]:t,ve=this.getBottomViewport(e,G,re,H),_e=this.getRightViewport(e,Q,J,V),Ke=this.getFloatingTopHeight(e,H),Dt=this.getFloatingBottomHeight(e,H),Xe=this.getFloatingLeftWidth(e,V),Ze=this.getFloatingRightWidth(e,V),Le=Array.from(V.values()),_t=Array.from(H.values()),_n=Le.reduce((Be,ms)=>Be+ms,0)-s,en=_t.reduce((Be,ms)=>Be+ms,0)-i,nt=this.getLastLeft(e,null,o-N-w-g),pe=this.getLastTop(e,null,r-_-w-Dt),ze=s+_n+g,Ue=i+en,ht=o-N,Mt=r-_,Nt=nt>0||ze>ht,ut=Nt?w:0,Vn=pe>0||Ue>Mt-ut,Ft=Vn?w:0,xt=o-p-Ft,Un=r-b-ut,io=p,oo=b,ro=S===1?xt/ze:(S-nt)/S,ni=I===1?Un/Ue:(I-pe)/I,si=Nt?rt(xt*ro,C,xt-1):0,ii=Vn?rt(Un*ni,C,Un-1):0,oi=A(V,t,0),ri=A(H,n,0),li=oi>0?s/oi:0,ai=ri>0?i/ri:0,lo=S===1?s/(ze-ht):(t+li)/nt,ao=I===1?i/(Ue-Mt):(n+ai)/pe,Bn=Nt?lo*(xt-si):0,co=Vn?ao*(Un-ii):0;let us=[];(v>0||R>0)&&(us=[...Array(v).keys(),...[...Array(R).keys()].map(Be=>I-Be-1)],re=new Map([...re,...this.getFloatingRowYs(e,H,Math.floor(r-_-ut))]));let As=[];(D>0||F>0)&&(As=[...Array(D).keys(),...[...Array(F).keys()].map(Be=>S-Be-1)],J=new Map([...J,...this.getFloatingColumnXs(e,V,Math.floor(o-N-Ft))]));const ci=[];if(h)for(let Be=h.range[0];Be<=h.range[1];Be+=1)ci.push(Be),V.has(Be)||V.set(Be,this.getVisibleColumnWidth(Be,e)),J.has(Be)||J.set(Be,0);const di=G.concat(us),ks=Q.concat(As).concat(ci),Ls=this.getModelRows(di,e),ho=this.getModelColumns(ks,e),uo=this.getVisibleRowTreeBoxes(H,Ls,e),hi=this.getTopVisible(e,re,H,G),mo=this.getLeftVisible(e,J,V,Q),ui=pe>0?this.getBottomVisible(e,re,H,G,_):Ce,mi=nt>0?this.getRightVisible(e,J,V,Q,N):de,{fontWidths:pi,userColumnWidths:gi,userRowHeights:fi,calculatedRowHeights:po,calculatedColumnWidths:go}=this;return{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,rowCount:I,columnWidth:f,columnCount:S,columnHeaderHeight:b,floatingTopRowCount:v,floatingBottomRowCount:R,floatingLeftColumnCount:D,floatingRightColumnCount:F,gridX:N,gridY:_,firstRow:W,firstColumn:B,treePaddingX:k,treePaddingY:P,left:t,top:n,bottom:Ce,right:de,topOffset:i,leftOffset:s,topVisible:hi,leftVisible:mo,bottomVisible:ui,rightVisible:mi,bottomViewport:ve,rightViewport:_e,width:o,height:r,maxX:_n,maxY:en,lastLeft:nt,lastTop:pe,barHeight:Un,barTop:oo,barWidth:xt,barLeft:io,handleHeight:ii,handleWidth:si,hasHorizontalBar:Nt,hasVerticalBar:Vn,verticalBarWidth:Ft,horizontalBarHeight:ut,scrollX:Bn,scrollY:co,scrollableContentWidth:ze,scrollableContentHeight:Ue,scrollableViewportWidth:ht,scrollableViewportHeight:Mt,visibleRows:G,visibleColumns:Q,floatingRows:us,floatingColumns:As,allRows:di,allColumns:ks,visibleRowHeights:H,visibleColumnWidths:V,floatingTopHeight:Ke,floatingBottomHeight:Dt,floatingLeftWidth:Xe,floatingRightWidth:Ze,visibleRowYs:re,visibleColumnXs:J,visibleRowTreeBoxes:uo,modelRows:Ls,modelColumns:ho,movedRows:c,movedColumns:d,fontWidths:pi,userColumnWidths:gi,userRowHeights:fi,calculatedRowHeights:po,calculatedColumnWidths:go,columnHeaderMaxDepth:L}}getGridX(e){const{theme:t}=e,{rowHeaderWidth:n}=t;return n}getGridY(e){const{theme:t,model:n}=e,{columnHeaderHeight:s}=t,{columnHeaderMaxDepth:i}=n;return i*s}getVisibleHeight(e,t=this.getFloatingRowHeights(e)){const{height:n,theme:s}=e,{scrollBarSize:i}=s,o=this.getGridY(e),r=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return n-r-l-o-i}getVisibleWidth(e,t=this.getFloatingColumnWidths(e)){const{width:n,theme:s}=e,{scrollBarSize:i,rowFooterWidth:o}=s,r=this.getGridX(e),l=this.getFloatingRightWidth(e,t),a=this.getFloatingLeftWidth(e,t);return n-a-l-r-i-o}getFirstIndex(e,t,n){const s=e.size+1;for(let i=0;i<s;i+=1){const o=t(i,n);if(e.get(o)!==0)return i}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t=null,n=this.getVisibleWidth(e)){const{model:s}=e,{columnCount:i}=s;let o=i-1;t!=null&&(o=t);let r=0;for(;o>=0;){if(r+=this.getVisibleColumnWidth(o,e),r>=n)return Math.min(o+1,i-1);o-=1}return 0}getLastTop(e,t=null,n=this.getVisibleHeight(e)){const{model:s}=e,{rowCount:i,floatingBottomRowCount:o}=s;let r=Math.max(0,i-o-1);t!=null&&(r=t);let l=0;for(;r>0;){if(l+=this.getVisibleRowHeight(r,e),l>=n)return Math.min(r+1,i-1);r-=1}return 0}getTopForTopVisible(e,t){const n=this.getFloatingTopHeight(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleRowHeight(s,e);return s}getTopForBottomVisible(e,t){const{height:n}=e,s=this.getGridY(e),i=this.getFloatingBottomHeight(e),o=n-s-i;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){const n=this.getFloatingLeftWidth(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleColumnWidth(s,e);return s}getLeftForRightVisible(e,t){const{width:n}=e,s=this.getGridX(e),i=this.getFloatingRightWidth(e),o=n-s-i;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){const{model:t}=e,{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t,o=new Map;for(let r=0;r<n&&r<i;r+=1)o.set(r,this.getVisibleRowHeight(r,e));for(let r=0;r<s&&i-r-1>=0;r+=1){const l=i-r-1;o.set(l,this.getVisibleRowHeight(l,e))}return o}getVisibleRowHeights(e){const{top:t,topOffset:n,height:s,model:i}=e;let o=0,r=t;const l=new Map,{rowCount:a}=i;for(;o<s+n&&r<a;){const c=this.getVisibleRowHeight(r,e);l.set(r,c),o+=c,r+=1}return l}getFloatingColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s,l=new Map;for(let a=0;a<o&&a<i;a+=1)l.set(a,this.getVisibleColumnWidth(a,e,t,n));for(let a=0;a<r&&i-a-1>=0;a+=1){const c=i-a-1;l.set(c,this.getVisibleColumnWidth(c,e,t,n))}return l}getVisibleColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{left:s,leftOffset:i,width:o,model:r}=e;let l=0,a=s;const c=new Map,{columnCount:d}=r;for(;l<o+i&&a<d;){const h=this.getVisibleColumnWidth(a,e,t,n);c.set(a,h),l+=h,a+=1}return c}getFloatingColumnXs(e,t,n){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s;return Zr(o,r,i,n,t)}getVisibleColumnXs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getFloatingRowYs(e,t,n){const{model:s}=e,{floatingTopRowCount:i,floatingBottomRowCount:o,rowCount:r}=s;return Zr(i,o,r,n,t)}getVisibleRowYs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=A(e,r);s.set(r,i),i+=l}return s}getVisibleRowTreeBoxes(e,t,n){const s=new Map,{model:i,theme:o}=n,{treeDepthIndent:r,treeHorizontalPadding:l}=o;return qe(i)&&i.hasExpandableRows&&e.forEach((a,c)=>{const d=A(t,c);if(i.isRowExpandable(d)){const h=i.depthForRow(d),m=h*r+l,p=(h+1)*r+l,g=0,f=a;s.set(c,{x1:m,y1:g,x2:p,y2:f})}}),s}getFloatingLeftWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingLeftColumnCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingRightWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingRightColumnCount:s,columnCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getFloatingTopHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingTopRowCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=A(t,o);return i}getFloatingBottomHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingBottomRowCount:s,rowCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=A(t,i-r-1);return o}getTopVisible(e,t,n,s){const i=this.getFloatingTopHeight(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getLeftVisible(e,t,n,s){const i=this.getFloatingLeftWidth(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(A(t,r)>=i)return r}return 0}getBottomVisible(e,t,n,s,i){const{height:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingBottomHeight(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getRightVisible(e,t,n,s,i){const{width:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingRightWidth(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=A(t,h),p=A(n,h);if(m+p<=c)return h}return 0}getBottomViewport(e,t,n,s){const{height:i,theme:o}=e,{rowHeight:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getRightViewport(e,t,n,s){const{width:i,theme:o}=e,{columnWidth:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getLastIndexViewport(e,t,n,s,i){let o=0,r=0;return e.length>0&&(o=e[e.length-1],r=A(t,o)+A(n,o)),r<s&&(o+=Math.ceil((s-r)/i)),o}getVisibleItemSize(e,t,n){var i;const s=n();return(i=t.get(e))!=null?i:s}getVisibleRowHeight(e,t){const n=this.getModelRow(e,t);return this.getVisibleItemSize(n,this.userRowHeights,()=>this.calculateRowHeight(e,n,t))}getVisibleColumnWidth(e,t,n=this.getFirstColumn(t),s=this.calculateTreePaddingX(t)){const i=this.getModelColumn(e,t);return this.getVisibleItemSize(i,this.userColumnWidths,()=>this.calculateColumnWidth(e,i,t,n,s))}getModelRows(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelRow(i,t);n.set(i,o)}return n}getModelRow(e,t){if(this.modelRows.has(e))return A(this.modelRows,e);const{movedRows:n}=t,s=U.getModelIndex(e,n);return this.modelRows.set(e,s),s}getModelColumns(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelColumn(i,t);n.set(i,o)}return n}getModelColumn(e,t){if(this.modelColumns.has(e))return A(this.modelColumns,e);const{movedColumns:n}=t,s=U.getModelIndex(e,n);return this.modelColumns.set(e,s),s}calculateRowHeight(e,t,n){const{theme:s}=n,{autoSizeRows:i,rowHeight:o}=s;if(!i)return o;const r=this.calculatedRowHeights.get(t);return r!=null?r:(this.calculatedRowHeights.set(t,Math.ceil(o)),Si(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,n,s=this.getFirstColumn(n),i=this.calculateTreePaddingX(n)){const{theme:o}=n,{autoSizeColumns:r,minColumnWidth:l}=o;if(!r){const{columnWidth:m}=o;return m}const a=this.calculateColumnHeaderWidth(t,n),c=this.calculateColumnDataWidth(t,n),d=this.calculatedColumnWidths.get(t);let h=Math.ceil(Math.max(a,c));return h=Math.max(l,h),d!=null&&d>h?h=d:(this.calculatedColumnWidths.set(t,h),Si(this.calculatedColumnWidths)),e===s&&(h+=i),h}calculateColumnHeaderWidth(e,t){const{model:n,theme:s}=t,{headerFont:i,headerHorizontalPadding:o}=s,r=n.textForColumnHeader(e,0);if(r){const l=this.getWidthForFont(i,t);return r.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){const{top:n,height:s,width:i,model:o,theme:r}=t,{floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c}=o,{font:d,cellHorizontalPadding:h,rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,scrollBarSize:f}=r;let b=0;const C=this.getWidthForFont(d,t),w=s/m,S=Math.ceil(n+w);return U.iterateAllItems(n,S,l,a,c,I=>{const v=this.getModelRow(I,t),R=o.textForCell(e,v);if(R){const D=h*2;b=Math.max(b,R.length*C+D)}}),b=Math.max(Math.min(b,(i-p-f-g)*ma.MAX_COLUMN_WIDTH),h*2),b}calculateTreePaddingX(e){const{top:t,height:n,model:s,theme:i}=e,{rowHeight:o,treeDepthIndent:r}=i;if(!qe(s)||!s.hasExpandableRows)return 0;let l=0;const a=n/o,c=Math.ceil(t+a);for(let d=t;d<=c;d+=1){const h=this.getModelRow(d,e),m=s.depthForRow(h);l=Math.max(l,r*(m+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return A(this.fontWidths,e);const{context:n}=t;n.font=e;const s=n.measureText("8"),{width:i}=s;return this.fontWidths.set(e,i),this.fontWidths.set(n.font,i),i}setColumnWidth(e,t){const n=new Map(this.userColumnWidths);n.set(e,Math.ceil(t)),Si(n),this.userColumnWidths=n}resetColumnWidth(e){const t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){const n=new Map(this.userRowHeights);n.set(e,Math.ceil(t)),Si(n),this.userRowHeights=n}resetRowHeight(e){const t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}};let js=ma;js.CACHE_SIZE=1e4;js.MAX_COLUMN_WIDTH=.8;const tu=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",black:"#000000",white:"#ffffff",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowColor:"#000000",textColor:"#ffffff",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc"}),St=(e,t)=>{let n=!1;const s=ue(e,{...t,dispose:()=>{n||(n=!0,s.clear(),n=!1)}});return s};function nu(e,t,n=6){const s=Oo.hex.lab.raw(e);return s[0]=Math.max(s[0]-s[0]/n*t,0),`#${Oo.lab.hex(s)}`}function su(e,t){const[n,s,i]=Oo.hex.rgb(e);return`rgba(${n}, ${s}, ${i}, ${t})`}const Jr={colorWithAlpha:su,darkenForDepth:nu};class je{constructor(t=5e3){this.cursor=null,this.order=t}onDown(t,n,s){return!1}onMove(t,n,s){return!1}onDrag(t,n,s){return!1}onLeave(t,n,s){return!1}onClick(t,n,s){return!1}onContextMenu(t,n,s){return!1}onDoubleClick(t,n,s){return!1}onUp(t,n,s){return!1}onWheel(t,n,s){return!1}}class pa extends je{constructor(){super(...arguments),this.resizingItems=[],this.hiddenItems=[],this.targetSizes=new Map,this.dragOffset=0}onDown(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);if(r!=null){const l=r.index;return this.dragOffset=0,this.draggingIndex=l,this.resizingItems=[l],this.hiddenItems=this.getHiddenItems(l,s).reverse(),this.targetSizes.clear(),this.addTargetSize(s,l),this.updateCursor(s,l),this.updateSeparator(n,r),!0}return!1}onMove(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);return r!=null?(this.updateCursor(s,r.index),!0):!1}onDrag(t,n){var f;if(this.draggingIndex==null)return!1;const s=t[this.pointProperty],{metricCalculator:i,metrics:o}=n;if(!o)throw new Error("metrics not set");const r=n.getTheme(),l=o[this.visibleOffsetProperty],a=o[this.marginProperty],c=o[this.calculatedSizesProperty],d=o[this.modelIndexesProperty],h=o[this.firstIndexProperty],m=o[this.treePaddingProperty],p=new Map;let g=this.resizingItems[this.resizingItems.length-1];for(;g!=null;){const b=A(l,g),C=s-a-b-this.dragOffset,w=A(d,g),S=this.targetSizes.get(w),I=this.resizingItems.length>1,v=this.hiddenItems.indexOf(g);let R=A(c,w);g===h&&(R+=m);let D=C;Math.abs(C-R)<=r.headerResizeSnapThreshold?D=null:S!==void 0&&C>S&&(I&&v!==0||v>0)?D=S:C<=r.headerResizeHiddenSnapThreshold&&(D=0),D!==R?p.set(w,D):p.set(w,null),C<-r.headerResizeSnapThreshold&&D===0?v>=0&&I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(f=this.targetSizes.get(A(d,g)))!=null?f:0):(g=this.getNextShownItem(g,o),g!==null&&(this.resizingItems.push(g),this.addTargetSize(o,g))):S!==void 0&&C>S+r.headerResizeSnapThreshold&&D===S?v>0?(this.dragOffset+=D,g=this.hiddenItems[v-1],this.resizingItems.push(g),this.addTargetSize(o,g)):I?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1]):g=null:g=null}return p.forEach((b,C)=>{b!==null?this.setSize(i,C,b):this.resetSize(i,C)}),this.updateCursor(o,this.draggingIndex),!0}onUp(t,n){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(n,null)),!1}onDoubleClick(t,n){const{metrics:s,metricCalculator:i}=n,{model:o}=n.props,r=n.getTheme();if(!s)throw new Error("metrics not set");const l=this.getSeparator(t,s,o,r);if(l!=null){const a=s[this.modelIndexesProperty],c=A(a,l.index);return this.resetSize(i,c),n.forceUpdate(),!0}return!1}updateCursor(t,n){const s=t[this.visibleSizesProperty];A(s,n)===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(t,n){const s=t[this.modelIndexesProperty],i=t[this.userSizesProperty],o=t[this.calculatedSizesProperty],r=n===0?t[this.treePaddingProperty]:0,l=A(s,n);let a=i.get(l);(a==null||a===0)&&(a=A(o,l)+r),this.targetSizes.set(l,a)}removeTargetSize(t,n){const s=t[this.modelIndexesProperty],i=A(s,n);this.targetSizes.delete(i)}}class Zi extends pa{constructor(){super(...arguments),this.hiddenCursor="e-resize",this.defaultCursor="col-resize",this.pointProperty="x",this.userSizesProperty="userColumnWidths",this.visibleOffsetProperty="visibleColumnXs",this.visibleSizesProperty="visibleColumnWidths",this.marginProperty="rowHeaderWidth",this.calculatedSizesProperty="calculatedColumnWidths",this.modelIndexesProperty="modelColumns",this.firstIndexProperty="firstColumn",this.treePaddingProperty="treePaddingX",this.getHiddenItems=U.getHiddenColumns,this.getNextShownItem=U.getNextShownColumn,this.getSeparator=Zi.getColumnSeparator}static getColumnSeparator(t,n,s,i){if(!i.allowColumnResize)return null;const{x:o,y:r,columnHeaderDepth:l}=t,{modelColumns:a}=n,c=U.getColumnSeparatorIndex(o,r,n,i);return c==null||l==null||l>0?null:a.get(c)!=null?{index:c,depth:0}:null}setSize(t,n,s){t.setColumnWidth(n,s)}resetSize(t,n){t.resetColumnWidth(n)}updateSeparator(t,n){t.setState({draggingColumnSeparator:n,isDragging:n!==null})}}const an=class{constructor(){this.getCachedTruncatedString=St((e,t,n,s,i)=>an.truncateToWidth(e,t,n,s,i),{max:1e4}),this.getCachedBackgroundColors=St((e,t)=>e.split(" ").map(n=>{const s=[];for(let i=0;i<t;i+=1)s.push(Jr.darkenForDepth(n,i,t));return s}),{max:1e3}),this.getCachedColorWithAlpha=St((e,t)=>Jr.colorWithAlpha(e,t),{max:1e3}),this.getCachedColorIsDark=St(e=>Xi.isDark(e),{max:1e3})}static truncate(e,t){return t<e.length?e.substr(0,t)+"\u2026":e}static binaryTruncateToWidth(e,t,n,s=0,i=t.length,o){if(i>=t.length&&e.measureText(t).width<=n)return t;if(o){const c=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(n/c)))}let r=s,l=Math.min(t.length-1,i),a=t;for(;l>=r;){const c=Math.ceil((l+r)/2),d=an.truncate(t,c);if(e.measureText(d).width<=n){if(a=d,r===c)break;r=c}else if(c===0){a=d;break}else l=c-1}return a}static truncateToWidth(e,t,n,s=an.DEFAULT_FONT_WIDTH,i){if(n<=0||t.length<=0)return"";const o=Math.min(Math.max(0,Math.floor(n/s/2)-5),t.length),r=Math.min(Math.ceil(n/s*2),t.length);return an.binaryTruncateToWidth(e,t,n,o,r,i)}drawCanvas(e){const{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){const{theme:n}=t;e.font=n.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){const{theme:n,metrics:s}=t,{width:i,height:o}=s;e.fillStyle=n.backgroundColor,e.fillRect(0,0,i,o)}drawGrid(e,t){const{metrics:n,draggingRow:s,draggingColumn:i}=t,{gridX:o,gridY:r}=n;e.translate(o,r),this.drawGridBackground(e,t,s==null&&i==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-r)}drawFloatingRows(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingTopRowCount:r,floatingBottomRowCount:l,floatingRows:a,rowCount:c,visibleColumns:d,visibleRowYs:h,visibleRowHeights:m}=i;if(a.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,a,o.floatingRowBackgroundColors),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,d,a,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,d,a),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{top:0,bottom:r-1,maxY:A(h,r-1)+A(m,r-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:c-l-1,bottom:c-1,minY:A(h,c-l)+.5,maxY:A(h,c-1)+A(m,c-1)-.5});for(let p=0;p<d.length;p+=1){const g=d[p];for(let f=0;f<a.length;f+=1){const b=a[f];this.drawCellContent(e,t,g,b)}}}}drawFloatingColumns(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingLeftColumnCount:r,floatingRightColumnCount:l,floatingLeftWidth:a,floatingRightWidth:c,floatingColumns:d,gridX:h,maxX:m,columnCount:p,visibleRows:g,visibleColumnXs:f,visibleColumnWidths:b,width:C,height:w}=i;if(d.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,a),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,C-h-c,m)),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,a,w),e.clip(),this.drawGridLinesForItems(e,t,d,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,d,g),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{left:0,maxX:A(f,r-1)+A(b,r-1)}),l>0&&this.drawSelectedRanges(e,t,{left:p-l,right:p-1,minX:A(f,p-l)+.5,maxX:A(f,p-1)+A(b,p-1)});for(let S=0;S<d.length;S+=1){const I=d[S];for(let v=0;v<g.length;v+=1){const R=g[v];this.drawCellContent(e,t,I,R)}}}}drawFloatingBorders(e,t){const{metrics:n,theme:s}=t,{floatingTopRowCount:i,floatingBottomRowCount:o,floatingLeftColumnCount:r,floatingRightColumnCount:l,rowCount:a,columnCount:c,visibleRowYs:d,visibleColumnXs:h,visibleRowHeights:m,visibleColumnWidths:p,maxX:g,maxY:f}=n,{floatingDividerOuterColor:b,floatingDividerInnerColor:C}=s;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=C,i>0){const w=A(d,i-1)+A(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=A(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=A(h,r-1)+A(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=A(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}e.stroke()}drawGridBackground(e,t,n=!1){this.drawRowStripes(e,t),n&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);const{metrics:s}=t,{bottom:i,right:o,floatingBottomRowCount:r,floatingLeftColumnCount:l,floatingRightColumnCount:a,floatingTopRowCount:c,columnCount:d,rowCount:h,visibleRowHeights:m,visibleRowYs:p,visibleColumnXs:g,visibleColumnWidths:f,width:b,height:C}=s;this.drawSelectedRanges(e,t,{bottom:Math.min(i,h-r-1),right:Math.min(o,d-a-1),minX:l>0&&g.has(l+1)?A(g,l+1):-10,minY:c>0&&p.has(c+1)?A(p,c+1):-10,maxX:a>0&&g.has(d-a-1)?A(g,d-a-1)+A(f,d-a-1)-.5:b+10,maxY:r>0&&p.has(h-r-1)?A(p,h-r-1)+A(m,h-r-1)-.5:C+10})}drawRowStripes(e,t){const{metrics:n,theme:s}=t,{visibleRows:i}=n,{rowBackgroundColors:o}=s;!o||this.drawRowStripesForRows(e,t,i,o)}drawRowStripesForRows(e,t,n,s,i=0,o=t.metrics.maxX){const{theme:r,metrics:l,model:a}=t,{maxDepth:c,shadowBlur:d,shadowColor:h}=r,m=this.getCachedBackgroundColors(s,c),{visibleRowYs:p,visibleRowHeights:g}=l,f=new Map,b=[],C=[],w=(S,I)=>{const v=qe(a)?a.depthForRow(S):0,R=m[S%m.length],D=R[Math.min(v,R.length-1)];if(f.has(D)||f.set(D,[]),f.get(D).push(S),I!=null){const F=qe(a)?a.depthForRow(I):0;F<v?b.push(S):F>v&&C.push(I)}};for(let S=0;S<n.length;S+=1){const I=n[S],v=S>0?n[S-1]:void 0;w(I,v)}if(f.forEach((S,I)=>{e.fillStyle=I,e.beginPath();for(let v=0;v<S.length;v+=1){const R=S[v],D=A(p,R),F=A(g,R);e.rect(i,D,o,F)}e.fill()}),b.length>0){e.save();const S=this.getCachedColorWithAlpha(h,.15),I=this.getCachedColorWithAlpha(h,0),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let R=0;R<b.length;R+=1){const D=b[R],F=A(p,D);e.translate(0,F),e.fillRect(i,0,o,d),e.translate(0,-F)}e.restore()}if(C.length>0){e.save();const S=this.getCachedColorWithAlpha(h,0),I=this.getCachedColorWithAlpha(h,.15),v=e.createLinearGradient(0,0,0,d);v.addColorStop(0,S),v.addColorStop(1,I),e.fillStyle=v;for(let R=0;R<C.length;R+=1){const D=C[R],F=A(p,D),L=A(g,D),W=F+L-d;e.translate(0,W),e.fillRect(i,0,o,d),e.translate(0,-W)}e.restore()}}drawMouseColumnHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const r=U.getColumnAtX(n,o);if(r==null||!i.columnHoverBackgroundColor)return;const{visibleColumnWidths:l,visibleColumnXs:a,maxY:c}=o;if(s>c)return;const d=A(a,r),h=A(l,r);e.fillStyle=i.columnHoverBackgroundColor,e.fillRect(d,0,h,c)}drawMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const{maxX:r}=o;if(n>r||!i.rowHoverBackgroundColor)return;const l=U.getRowAtY(s,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}drawFloatingMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t,{maxX:r,floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c,rowFooterWidth:d}=o;if(n==null||s==null||n>r+d||!i.rowHoverBackgroundColor)return;const h=U.getRowAtY(s,o);h!=null&&(h<l||c-a<=h)&&this.drawMouseRowHoverForRow(e,t,h)}drawMouseRowHoverForRow(e,t,n){const{metrics:s,selectedRanges:i,theme:o}=t,{visibleRowHeights:r,visibleRowYs:l,maxX:a}=s,c=A(l,n),d=A(r,n);o.rowHoverBackgroundColor&&(e.fillStyle=o.rowHoverBackgroundColor);for(let h=0;h<i.length;h+=1){const{startRow:m,endRow:p}=i[h];if(m!=null&&p!=null&&m<=n&&p>=n){o.selectedRowHoverBackgroundColor&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,c,a,d)}drawGridLines(e,t){const{metrics:n,theme:s}=t,{visibleColumns:i,visibleRows:o}=n;this.drawGridLinesForItems(e,t,i,o,s.gridColumnColor,s.gridRowColor)}drawGridLinesForItems(e,t,n,s,i,o){!i&&!o||(e.lineWidth=1,e.beginPath(),i&&(e.strokeStyle=i,this.drawGridLinesForColumns(e,t,n)),o&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,s)),e.stroke())}drawGridLinesForColumns(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,maxY:o}=s;for(let r=0;r<n.length;r+=1){const l=n[r],a=A(i,l)+.5;e.moveTo(a,0),e.lineTo(a,o)}}drawGridLinesForRows(e,t,n){const{metrics:s}=t,{visibleRowYs:i,maxX:o}=s,r=o;for(let l=0;l<n.length;l+=1){const a=n[l],c=A(i,a)+.5;e.moveTo(.5,c),e.lineTo(r-.5,c)}}drawCellBackgrounds(e,t){const{metrics:n}=t,{visibleColumns:s,visibleRows:i}=n;this.drawCellBackgroundsForItems(e,t,s,i)}drawCellBackgroundsForItems(e,t,n,s){e.save();for(let i=0;i<n.length;i+=1){const o=n[i];for(let r=0;r<s.length;r+=1){const l=s[r],a=r+1<s.length?s[r+1]:void 0;this.drawCellBackground(e,t,o,l,a)}}e.restore()}drawCellBackground(e,t,n,s,i){const{metrics:o,model:r,theme:l}=t,{firstColumn:a,modelColumns:c,modelRows:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g}=o,f=A(d,s),b=A(c,n),C=r.backgroundColorForCell(b,f,l),w=n===a,S=qe(r)&&r.hasExpandableRows;if(C){const I=A(h,n)+1,v=A(p,s)+1,R=A(m,n)-1,D=A(g,s)-1;e.fillStyle=C,e.fillRect(I,v,R,D)}w&&S&&this.drawCellRowTreeDepthLines(e,t,s,i)}drawCellContents(e,t){const{metrics:n}=t,{visibleColumns:s}=n;for(let i=0;i<s.length;i+=1){const o=s[i];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,visibleColumnWidths:o,visibleRows:r,height:l}=s,a=A(i,n),c=A(o,n);e.save(),e.beginPath(),e.rect(a,0,c,l),e.clip();for(let d=0;d<r.length;d+=1){const h=r[d];this.drawCellContent(e,t,n,h)}e.restore()}getTextRenderMetrics(e,t,n,s){const{textAlign:i}=e,{metrics:o,model:r,theme:l}=t,{firstColumn:a,visibleColumnXs:c,visibleColumnWidths:d,visibleRowYs:h,visibleRowHeights:m}=o,{cellHorizontalPadding:p,treeDepthIndent:g,treeHorizontalPadding:f}=l,b=A(c,n),C=A(h,s),w=A(d,n),S=A(m,s),I=n===a;let v=0;qe(r)&&r.hasExpandableRows&&I&&(v=g*(r.depthForRow(s)+1)+f);const R=w-v;let D=b+p;const F=C+S*.5;return i==="right"?D=b+R-p:i==="center"&&(D=b+R*.5),D+=v,{width:R-p*2,x:D,y:F}}drawCellContent(e,t,n,s,i){var I;const{metrics:o,model:r,theme:l}=t,{firstColumn:a,fontWidths:c,modelColumns:d,modelRows:h,visibleRowHeights:m}=o,{textColor:p}=l,g=A(m,s),f=A(h,s),b=A(d,n),C=i!=null?i:r.textForCell(b,f),w=r.truncationCharForCell(b,f),S=n===a;if(C&&g>0){const v=r.textAlignForCell(b,f)||"left";e.textAlign=v;const R=r.colorForCell(b,f,l)||p;e.fillStyle=R;const{width:D,x:F,y:L}=this.getTextRenderMetrics(e,t,n,s),W=(I=c.get(e.font))!=null?I:an.DEFAULT_FONT_WIDTH,B=this.getCachedTruncatedString(e,C,D,W,w);B&&e.fillText(B,F,L)}S&&qe(r)&&r.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,s)}drawCellRowTreeMarker(e,t,n){const{metrics:s,model:i,mouseX:o,mouseY:r,theme:l}=t,{firstColumn:a,gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g,visibleRowTreeBoxes:f}=s,{treeMarkerColor:b,treeMarkerHoverColor:C}=l,w=A(h,a),S=A(m,a),I=A(p,n),v=A(g,n);if(!qe(i)||!i.isRowExpandable(n))return;const R=A(f,n),D=o!=null&&r!=null&&o>=c+w&&o<=c+w+S&&r>=d+I&&r<=d+I+v?C:b;this.drawTreeMarker(e,t,w,I,R,D,i.isRowExpanded(n))}drawTreeMarker(e,t,n,s,i,o,r){const{x1:l,y1:a,x2:c,y2:d}=i,h=r?"\u229F":"\u229E",m=n+(l+c)*.5+.5,p=s+(a+d)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(h,m,p)}drawCellRowTreeDepthLines(e,t,n,s){const{metrics:i,model:o,theme:r}=t;if(!qe(o))return;const l=o.depthForRow(n);if(l===0)return;const{firstColumn:a,visibleColumnXs:c,visibleRowYs:d,visibleRowHeights:h}=i,{treeDepthIndent:m,treeHorizontalPadding:p,treeLineColor:g}=r,f=A(c,a),b=A(d,n),C=A(h,n),w=s!==void 0?o.depthForRow(s):0,S=l>w?l-w:0;if(e.strokeStyle=g,e.lineWidth=1,l-S>0){e.beginPath();for(let I=0;I<l-S;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+C)}e.stroke()}if(S>0){e.beginPath();for(let I=l-S;I<l;I+=1){const v=f+I*m+m*.5+p+.5;e.moveTo(v,b),e.lineTo(v,b+Math.ceil(C/2)),e.moveTo(v-.5,b+Math.ceil(C/2)+.5),e.lineTo(v+m-.5,b+Math.ceil(C/2)+.5)}e.stroke()}}drawHeaders(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o,draggingColumnSeparator:r,isDragging:l,model:a}=t,{columnHeaderHeight:c,floatingColumns:d,gridX:h,width:m,visibleColumns:p,visibleColumnWidths:g,visibleColumnXs:f,floatingLeftColumnCount:b,floatingLeftWidth:C,floatingRightWidth:w,modelColumns:S,columnHeaderMaxDepth:I}=o;if(c<=0)return;const{headerHiddenSeparatorSize:v,headerHiddenSeparatorHoverColor:R,headerSeparatorColor:D,headerSeparatorHoverColor:F}=i,L=c*.5,W=c*(I-1)+c*.5-L*.5,B=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[p[0],p[p.length-1]],{minX:h+C,maxX:m-w}),B&&this.drawColumnHeadersForRange(e,t,[d[0],d[d.length-1]],{minX:h,maxX:h+C}),D){e.strokeStyle=D;const N=[...g.entries()].filter(([_,k])=>k===0).map(([_])=>_);e.beginPath(),e.fillStyle=D;for(let _=0;_<N.length;_+=1){const k=N[_],P=A(f,k),H=A(g,k),V=h+P+H+.5-v*.5;e.rect(V,W,v,L)}e.fill()}if(F){let{index:N,depth:_}=r!=null?r:{};if(N==null&&n!=null&&s!=null){const P=Zi.getColumnSeparator(U.getGridPointFromXY(n,s,o),o,a,i);N=P==null?void 0:P.index,_=P==null?void 0:P.depth}let k;if(N==null)k=!1;else{const P=S.get(N),H=S.get(N+1);P==null||H==null?k=!1:k=a.textForColumnHeader(P,_)!==a.textForColumnHeader(H,_)}if(k&&N!=null&&_!=null&&(!l||r!=null)){e.strokeStyle=F;const P=A(f,N),H=A(g,N),V=h+P+H+.5,G=p.indexOf(N),Q=G<p.length-1?p[G+1]:null,J=Q!=null?g.get(Q):null,re=H===0,Ce=J!=null&&J===0;re?(e.strokeStyle=R,e.fillStyle=R,e.fillRect(V,W,v*.5,L)):Ce&&(e.fillStyle=F,e.fillRect(V-v*.5,W,v*.5,L)),e.beginPath(),e.moveTo(V,(I-_-1)*c),e.lineTo(V,(I-_)*c-1),e.stroke()}}e.restore()}drawColumnHeadersForRange(e,t,n,s){const{model:i}=t,{columnHeaderMaxDepth:o}=i;if(o!==0)for(let r=0;r<=o;r+=1)this.drawColumnHeadersAtDepth(e,t,n,s,r)}drawColumnHeadersAtDepth(e,t,n,s,i){var D,F,L,W,B,N;const{metrics:o,model:r,theme:l}=t,{modelColumns:a,visibleColumnXs:c,gridX:d,calculatedColumnWidths:h,userColumnWidths:m,visibleColumnWidths:p,movedColumns:g}=o,{columnHeaderHeight:f,columnWidth:b}=l,{columnHeaderMaxDepth:C}=r,{minX:w,maxX:S}=s,I=S-w;if(C===0)return;const v=n[0],R=n[1];if(e.save(),e.translate(0,(C-i-1)*f),i===0){this.drawColumnHeader(e,t,"",w,S);for(let _=v;_<=R;_+=1)this.drawColumnHeaderAtIndex(e,t,_,s)}if(i>0){let _=v;for(;_<=R;){const{columnCount:k}=o,P=A(a,_),H=r.textForColumnHeader(P,i),V=r.colorForColumnHeader(P,i);let G=A(c,_)+d,Q=G+A(p,_);if(H!=null){let J=_-1;for(;J>=0&&(Q-G<I||G>w);){const ve=(D=a.get(J))!=null?D:U.getModelIndex(J,g);if(ve==null||r.textForColumnHeader(ve,i)!==H)break;G-=(L=(F=m.get(ve))!=null?F:h.get(ve))!=null?L:b,J-=1}let re=_+1;for(;re<k&&(Q-G<I||Q<S);){const ve=(W=a.get(re))!=null?W:U.getModelIndex(re,g);if(r.textForColumnHeader(ve,i)!==H)break;Q+=(N=(B=m.get(ve))!=null?B:h.get(ve))!=null?N:b,re+=1}_=re-1;const Ce=Q-G>=I;let de=G;Ce&&(Q<S?de=Q-I:G<w&&(de=w)),this.drawColumnHeader(e,t,H,de,Math.min(Q-G,I),{backgroundColor:V!=null?V:void 0},s)}_+=1}}e.restore()}drawColumnHeaderAtIndex(e,t,n,s){var g;const{metrics:i,model:o}=t,{modelColumns:r,visibleColumnWidths:l,visibleColumnXs:a,gridX:c}=i,d=A(l,n),h=A(a,n)+c,m=A(r,n),p=o.textForColumnHeader(m);p!=null&&this.drawColumnHeader(e,t,p,h,d,{backgroundColor:(g=o.colorForColumnHeader(m))!=null?g:void 0},s)}drawColumnHeader(e,t,n,s,i,o,r){if(i<=0)return;const{metrics:l,theme:a}=t,{headerHorizontalPadding:c,columnHeaderHeight:d,headerBackgroundColor:h,headerColor:m,headerSeparatorColor:p,black:g,white:f}=a,{fontWidths:b,width:C}=l,w=b.get(e.font)||an.DEFAULT_FONT_WIDTH,I=(i-c*2)/w,{backgroundColor:v=h,separatorColor:R=p}=o!=null?o:{};let{textColor:D=m}=o!=null?o:{};try{const re=this.getCachedColorIsDark(v),Ce=this.getCachedColorIsDark(D);re&&Ce?D=f:!re&&!Ce&&(D=g)}catch{}let{minX:F=0,maxX:L=C}=r!=null?r:{};e.save(),e.rect(F,0,L-F,d),e.clip(),v&&(e.fillStyle=v,e.fillRect(s,0,i,d)),R&&(e.strokeStyle=R,e.beginPath(),s>0&&(e.moveTo(s+.5,0),e.lineTo(s+.5,d)),e.moveTo(s+i+.5,0),e.lineTo(s+i+.5,d),e.moveTo(s,d-.5),e.lineTo(s+i,d-.5),e.stroke()),e.beginPath(),e.rect(s,0,i,d),e.clip(),e.fillStyle=D;let W=n;I<=0?W="":W.length>I&&(W=`${W.substring(0,I-1)}\u2026`);const B=W.length*w;let N=s+i*.5;const _=d*.5;F+=c,L-=c;const k=s+c,P=rt(k,F,L),H=s+i-c,G=rt(H,F,L)-P,Q=N-B*.5<F,J=N+B*.5>L;Q?B<G?N=F+B*.5:N=H-B*.5:J&&(B<G?N=L-B*.5:N=k+B*.5),e.textAlign="center",e.fillText(W,N,_),e.restore()}drawRowHeaders(e,t){const{mouseX:n,mouseY:s,metrics:i,theme:o,draggingRowSeparator:r}=t,{gridY:l,rowHeaderWidth:a,height:c,visibleRows:d,visibleRowHeights:h,visibleRowYs:m}=i;if(a<=0)return;const{headerBackgroundColor:p,headerColor:g,headerHiddenSeparatorSize:f,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:C,headerSeparatorHoverColor:w}=o,S=a*.5,I=a*.5-S*.5;if(e.save(),e.beginPath(),e.fillStyle=p,e.fillRect(0,0,a,c),C){e.strokeStyle=C,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(a,l+.5);const v=[];let R=!1;for(let D=0;D<d.length;D+=1){const F=d[D],L=A(m,F),W=A(h,F);if(W>0){const B=l+L+W+.5;e.moveTo(0,B),e.lineTo(a,B),R=!1}else R||(R=!0,v.push(F))}e.moveTo(a-.5,0),e.lineTo(a-.5,c),e.stroke(),e.beginPath(),e.fillStyle=C;for(let D=0;D<v.length;D+=1){const F=v[D],L=A(m,F),W=A(h,F),B=l+L+W+.5-f*.5;e.rect(I,B,S,f)}e.fill()}if(w){let{index:v=null}=r!=null?r:{};if(v==null&&n!=null&&s!=null&&(v=U.getRowSeparatorIndex(n,s,i,o)),v!=null){e.strokeStyle=w;const R=A(m,v),D=A(h,v),F=l+R+D+.5,L=d.indexOf(v),W=L<d.length-1?d[L+1]:null,B=W!=null?h.get(W):null,N=D===0,_=B!=null&&B===0;N?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(I,F,S,f*.5)):_&&(e.fillStyle=w,e.fillRect(I,F-f*.5,S,f*.5)),e.beginPath(),e.moveTo(.5,F),e.lineTo(a+.5,F),e.stroke()}}e.beginPath(),e.rect(0,l,a,c),e.clip(),e.fillStyle=g,e.textAlign="right";for(let v=0;v<d.length;v+=1){const R=d[v],D=A(h,R),F=A(m,R)+l;this.drawRowHeader(e,t,R,F,D)}e.restore()}drawRowHeader(e,t,n,s,i){if(i<=0)return;const{metrics:o,model:r,theme:l}=t,{modelRows:a,rowHeaderWidth:c}=o,d=A(a,n),h=c-l.cellHorizontalPadding,m=s+i*.5;e.fillText(r.textForRowHeader(d),h,m)}drawRowFooters(e,t){const{mouseX:n,mouseY:s,metrics:i,model:o,theme:r,draggingRowSeparator:l}=t,{gridY:a,gridX:c,maxX:d,modelRows:h,rowFooterWidth:m,height:p,verticalBarWidth:g,visibleRows:f,visibleRowHeights:b,visibleRowYs:C,width:w}=i;if(m<=0)return;const{cellHorizontalPadding:S,headerBackgroundColor:I,headerColor:v,headerHiddenSeparatorSize:R,headerHiddenSeparatorHoverColor:D,headerSeparatorColor:F,headerSeparatorHoverColor:L}=r,W=m*.5,B=m*.5-W*.5,N=Math.min(c+d,w-m-g);if(e.save(),e.beginPath(),e.fillStyle=I,e.fillRect(N,a,m,p),F){e.strokeStyle=F,e.beginPath(),e.moveTo(N,a+.5),e.lineTo(m,a+.5);const k=[];let P=!1;for(let H=0;H<f.length;H+=1){const V=f[H],G=A(C,V),Q=A(b,V);if(Q>0){const J=a+G+Q+.5;e.moveTo(N+.5,J),e.lineTo(N+m-.5,J),P=!1}else P||(P=!0,k.push(V))}e.moveTo(N+.5,a),e.lineTo(N+.5,p),e.stroke(),e.beginPath(),e.fillStyle=F;for(let H=0;H<k.length;H+=1){const V=k[H],G=A(C,V),Q=A(b,V),J=a+G+Q+.5-R*.5;e.rect(N+B,J,W,R)}e.fill()}if(L){let{index:k=null}=l!=null?l:{};if(k==null&&n!=null&&s!=null&&(k=U.getRowSeparatorIndex(n,s,i,r)),k!=null){e.strokeStyle=L;const P=A(C,k),H=A(b,k),V=a+P+H+.5,G=f.indexOf(k),Q=G<f.length-1?f[G+1]:null,J=Q!=null?b.get(Q):null,re=H===0,Ce=J!=null&&J===0;re?(e.strokeStyle=D,e.fillStyle=D,e.fillRect(B,V,W,R*.5)):Ce&&(e.fillStyle=L,e.fillRect(B,V-R*.5,W,R*.5)),e.beginPath(),e.moveTo(N+.5,V),e.lineTo(N+m+.5,V),e.stroke()}}e.beginPath(),e.rect(N,a,m,p),e.clip(),e.fillStyle=v,e.textAlign="left";const _=N+S;for(let k=0;k<f.length;k+=1){const P=f[k],H=A(b,P);if(H>0){const V=A(C,P)+a,G=A(h,P),Q=V+H*.5;e.fillText(o.textForRowFooter(G),_,Q)}}e.restore()}drawSelectedRanges(e,t,n={}){const{cursorColumn:s,cursorRow:i,draggingRow:o,draggingColumn:r,editingCell:l,metrics:a,model:c,selectedRanges:d,theme:h}=t,{visibleColumnWidths:m,visibleColumnXs:p,visibleRowHeights:g,visibleRowYs:f,width:b,height:C}=a,{left:w=a.left,top:S=a.top,right:I=a.right,bottom:v=a.bottom,minY:R=-10,maxY:D=C+10,minX:F=-10,maxX:L=b+10}=n;if(d.length===0)return;const W=Ae(c)&&c.isEditable&&l==null&&o==null&&r==null&&s!=null&&i!=null&&p.has(s)&&f.has(i);if(W){const B=A(p,s),N=A(f,i),_=A(m,s),k=A(g,i);e.save(),e.beginPath(),e.rect(0,0,b,C),e.rect(B,N,_,k),e.clip("evenodd")}e.beginPath();for(let B=0;B<d.length;B+=1){const N=d[B],_=N.startColumn!==null?N.startColumn:w,k=N.startRow!==null?N.startRow:S,P=N.endColumn!==null?N.endColumn:I,H=N.endRow!==null?N.endRow:v;if(H>=S&&v>=k&&P>=w&&I>=_){const V=_>=w&&p.has(_)?Math.round(A(p,_))+.5:F,G=k>=S&&f.has(k)?Math.max(Math.round(A(f,k))+.5,.5):R,Q=P<=I&&p.has(P)?Math.round(A(p,P)+A(m,P))-.5:L,J=H<=v&&f.has(H)?Math.round(A(f,H)+A(g,H))-.5:D;e.rect(V,G,Q-V,J-G)}e.fillStyle=h.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=h.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=h.selectionOutlineColor,e.lineWidth=1,e.stroke()}W&&s!=null&&i!=null&&(e.restore(),this.drawActiveCell(e,t,s,i))}drawActiveCell(e,t,n,s,i=an.ACTIVE_CELL_BORDER_WIDTH){const{metrics:o,theme:r}=t,{visibleColumnWidths:l,visibleColumnXs:a,visibleRowHeights:c,visibleRowYs:d}=o,h=A(a,n),m=A(d,s),p=A(l,n),g=A(c,s);let f=h-i*.5,b=m-i*.5,C=p+i,w=g+i;f<=0&&(C+=f-1,f=1),b<=0&&(w+=b-1,b=1);const{lineWidth:S}=e;e.beginPath(),e.lineWidth=i,e.strokeStyle=r.selectionOutlineColor,this.drawRoundedRect(e,f,b,C,w),e.stroke(),e.lineWidth=S}drawRoundedRect(e,t,n,s,i,o=an.DEFAULT_EDGE_RADIUS){e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+s-o,n),e.quadraticCurveTo(t+s,n,t+s,n+o),e.lineTo(t+s,n+i-o),e.quadraticCurveTo(t+s,n+i,t+s-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}drawDraggingColumn(e,t){var J;const{draggingColumn:n,metrics:s,mouseX:i,theme:o,model:r}=t;if(n==null||i==null)return;const{range:l,depth:a}=n,{gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,height:p,width:g,columnHeaderMaxDepth:f,columnHeaderHeight:b,movedColumns:C,modelColumns:w,floatingLeftWidth:S}=s,I=(J=w.get(l[0]))!=null?J:U.getModelIndex(l[0],C),v=r.getColumnHeaderGroup(I,a);if(a>0&&!v)return;const[R,D]=l,F=A(h,R),W=A(h,D)+A(m,D)-F,B=n.left,{backgroundColor:N,font:_,headerFont:k,reorderOffset:P,shadowBlur:H,shadowColor:V}=o,G=(f-a-1)*b;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(S,0,g,p),e.clip(),e.fillStyle=N,e.fillRect(F,G,W,p),e.restore(),e.translate(0,P),e.save(),e.shadowColor=V,e.shadowBlur=H,e.fillStyle=N,e.fillRect(n.left,G+P,n.width,p),e.restore(),e.beginPath(),e.rect(n.left,G,n.width+1,p),e.clip(),e.translate(B-F,0),e.font=k;const Q=[];for(let re=n.range[0];re<=n.range[1];re+=1)Q.push(re);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[Q[0],Q[Q.length-1]],{minX:F,maxX:g}),e.translate(0,d),e.font=_,this.drawGridBackground(e,t);for(let re=R;re<=D;re+=1)this.drawColumnCellContents(e,t,re);e.restore()}drawDraggingRow(e,t){const{draggingRow:n,draggingRowOffset:s,metrics:i,mouseY:o,theme:r}=t;if(n==null||o==null)return;const{gridX:l,gridY:a,visibleRowYs:c,visibleRowHeights:d,width:h}=i,m=A(c,n),p=A(d,n)+1,{backgroundColor:g,font:f,headerFont:b,reorderOffset:C,shadowBlur:w,shadowColor:S}=r;e.save(),e.translate(0,a),e.fillStyle=g,e.fillRect(0,m,h,p),e.translate(l+C,o-m-a-(s!=null?s:0)),e.save(),e.shadowColor=S,e.shadowBlur=w,e.fillStyle=g,e.fillRect(-l,m,h,p),e.restore(),e.beginPath(),e.rect(-l,m,h,p),e.clip(),e.font=f,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-a),e.font=b,this.drawRowHeaders(e,t),e.restore()}drawScrollBars(e,t){const{isDraggingHorizontalScrollBar:n,isDraggingVerticalScrollBar:s,isDragging:i,metrics:o,mouseX:r,mouseY:l,theme:a}=t;if(a.scrollBarSize<=0)return;const{rowHeaderWidth:c,columnHeaderHeight:d,width:h,height:m,handleHeight:p,handleWidth:g,scrollX:f,scrollY:b,hasHorizontalBar:C,hasVerticalBar:w,barWidth:S,barHeight:I}=o,{scrollBarBackgroundColor:v,scrollBarHoverBackgroundColor:R,scrollBarCasingColor:D,scrollBarCornerColor:F,scrollBarColor:L,scrollBarHoverColor:W,scrollBarActiveColor:B,scrollBarSize:N,scrollBarHoverSize:_,scrollBarCasingWidth:k,scrollBarSelectionTick:P,scrollBarSelectionTickColor:H,scrollBarActiveSelectionTickColor:V,autoSelectRow:G,autoSelectColumn:Q}=a,J=r!=null&&l!=null&&r<=h&&l<=m,re=s||w&&!n&&!i&&r!=null&&l!=null&&r>=h-_&&l<=I+d&&J,Ce=n||C&&!s&&!i&&!re&&r!=null&&l!=null&&l>=m-_&&r<=S-c&&J,de=Ce?_:N,ve=re?_:N;if(e.translate(c,d),C&&w&&(e.fillStyle=D,e.fillRect(h-c-N,m-d-N,N,N),e.fillStyle=F,e.fillRect(h-c-N+k,m-d-N+k,N-k,N-k)),C){const _e=f,Ke=m-d-de;if(e.fillStyle=D,e.fillRect(0,Ke,S,de-k),e.fillStyle=Ce?R:v,e.fillRect(0,Ke+k,S,de-k),n?e.fillStyle=B:Ce?e.fillStyle=W:e.fillStyle=L,e.fillRect(_e,Ke+k,g,de-k),!G&&P&&H!=null&&V!=null){e.fillStyle=H;const{selectedRanges:Dt,cursorColumn:Xe}=t,{lastLeft:Ze,columnCount:Le}=o,_n=[...Dt].filter(pe=>pe.startColumn!=null&&pe.endColumn!=null).map(pe=>[pe.startColumn,pe.endColumn]).sort(U.compareRanges),en=U.mergeSortedRanges(_n),nt=pe=>pe<=Ze?pe/Ze*(S-g):S-g+(pe-Ze)/(Le-Ze)*g;for(let pe=0;pe<en.length;pe+=1){const ze=en[pe],Ue=ze[0],ht=ze[1];if(Ue!=null&&ht!=null&&(Ue!==Xe||ht!==Xe)){const Mt=nt(Ue),Nt=Math.max(1,Math.round(nt(ht+1)-Mt)),ut=de-k;e.fillRect(Mt,Ke+k+Math.round(ut/3),Nt,Math.round(ut/3))}}if(Xe!=null){const pe=nt(Xe),ze=2,Ue=de-k;e.fillStyle=V,e.fillRect(pe,Ke+k,ze,Ue)}}}if(w){const _e=h-c-ve,Ke=b;if(e.fillStyle=D,e.fillRect(_e,0,ve-k,I),e.fillStyle=re?R:v,e.fillRect(_e+k,0,ve-k,I),s?e.fillStyle=B:re?e.fillStyle=W:e.fillStyle=L,e.fillRect(_e+k,Ke,ve-k,p),!Q&&P&&H!=null&&V!=null){const{selectedRanges:Dt,cursorRow:Xe}=t,{lastTop:Ze,rowCount:Le}=o,_t=pe=>pe<=Ze?pe/Ze*(I-p):I-p+(pe-Ze)/(Le-Ze)*p;e.fillStyle=H;const en=[...Dt].filter(pe=>pe.startRow!=null&&pe.endRow!=null).map(pe=>[pe.startRow,pe.endRow]).sort(U.compareRanges),nt=U.mergeSortedRanges(en);for(let pe=0;pe<nt.length;pe+=1){const ze=nt[pe],Ue=ze[0],ht=ze[1];if(Ue!=null&&ht!=null&&(Ue!==Xe||ht!==Xe)){const Mt=_t(Ue),Nt=ve-k,ut=Math.max(1,Math.round(_t(ht+1)-Mt));e.fillRect(_e+k+Math.round(Nt/3),Mt,Math.round(Nt/3),ut)}}if(Xe!=null){const pe=Math.round(_t(Xe)),ze=ve-k,Ue=2;e.fillStyle=V,e.fillRect(_e+k,pe,ze,Ue)}}}e.translate(-c,-d)}};let Rs=an;Rs.DEFAULT_FONT_WIDTH=10;Rs.DEFAULT_EDGE_RADIUS=2;Rs.ACTIVE_CELL_BORDER_WIDTH=2;const el=100;class iu extends je{constructor(){super(...arguments),this.hasExtendedFloating=!1}onDown(t,n,s){const{x:i,y:o,column:r,row:l}=t,{metrics:a}=n;if(!a)throw new Error("metrics not set");const{gridX:c,gridY:d,maxX:h,maxY:m}=a,p=i-c,g=o-d;if(p<0||g<0||r==null&&p>h||l==null&&g>m)return!1;const f=U.isModifierKeyDown(s),b=s.shiftKey;f||(b?n.trimSelectedRanges():n.clearSelectedRanges());const C=n.getTheme(),{autoSelectRow:w,autoSelectColumn:S}=C;return(r!==null||!S)&&(l!==null||!w)&&(n.focus(),n.moveCursorToPosition(r,l,b,!1,b&&f)),this.startPoint=t,this.hasExtendedFloating=!1,this.dragBounds=U.getScrollDragBounds(a,l,r),!0}onDrag(t,n){if(this.startPoint===void 0)return!1;this.stopTimer();const{row:s,column:i}=this.startPoint,{x:o,y:r}=t;let{row:l,column:a}=t;const{metrics:c}=n;if(!c)throw new Error("metrics not set");const{left:d,lastLeft:h,top:m,lastTop:p,columnWidth:g,rowHeight:f}=c,b=U.getScrollDragBounds(c,s,i);let C=0,w=0;if(d<h&&(o<b.x1?C=o-b.x1:o>b.x2&&(C=o-b.x2)),m<p&&(r<b.y1?w=r-b.y1:r>b.y2&&(w=r-b.y2)),C!==0||w!==0)this.startTimer(n,t,C>0?Math.ceil(C/g):Math.floor(C/g),w>0?Math.ceil(w/f):Math.floor(w/f));else if(l!=null&&a!=null){const{floatingTopRowCount:S,floatingBottomRowCount:I,floatingLeftColumnCount:v,floatingRightColumnCount:R,columnCount:D,rowCount:F,bottom:L,right:W,topVisible:B,bottomVisible:N,leftVisible:_,rightVisible:k}=c;this.hasExtendedFloating||(s!==null&&s<S&&l>=S?(l=S,this.hasExtendedFloating=!0):s!==null&&s>=F-I&&l<F-I&&(l=F-I-1,this.hasExtendedFloating=!0),i!==null&&i<v&&a>=v?(a=v,this.hasExtendedFloating=!0):i!==null&&i>=D-R&&a<D-R&&(a=D-R-1,this.hasExtendedFloating=!0)),s!==null&&!U.isFloatingRow(s,c)&&U.isFloatingRow(l,c)&&(s>l&&l<m?l=B-1:s<l&&l>L&&(l=N+1)),i!==null&&!U.isFloatingColumn(i,c)&&U.isFloatingColumn(a,c)&&(i>a&&a<d?a=_-1:i<a&&a>W&&(a=k+1)),n.moveCursorToPosition(a,l,!0,!0)}return!0}onUp(t,n){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),n.commitSelection()),!1}moveSelection(t,n,s,i){const{row:o,column:r}=n,{metrics:l}=t;if(!l)throw new Error("metrics not set");const{selectionEndRow:a,selectionEndColumn:c}=t.state;if(a==null||c==null)throw new Error("selection not set");const{rowCount:d,columnCount:h}=l,m=s<0&&r!=null?r:0,p=s>0&&r!=null?r:h-1,g=i<0&&o!=null?o:0,f=i>0&&o!=null?o:d-1;t.moveCursorToPosition(Math.min(Math.max(m,c+s),p),Math.min(Math.max(g,a+i),f),!0),this.lastTriggerTime=Date.now()}startTimer(t,n,s,i){this.stopTimer();const o=this.lastTriggerTime!=null?el-Math.min(el,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(t,n,s,i),this.startTimer(t,n,s,i)},o)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const tl=5,ou=1e3/60,vi=10;function bn(e,t,n,s){var S,I,v,R,D,F,L;const{modelColumns:i,movedColumns:o,visibleColumnXs:r,columnCount:l,visibleColumnWidths:a,userColumnWidths:c,calculatedColumnWidths:d,floatingLeftWidth:h,maxX:m}=n;if(t==null||e==null||e>l||e<0)return null;const p=(S=i.get(e))!=null?S:U.getModelIndex(e,o),g=s.getColumnHeaderGroup(p,t),f=g!=null;let b,C,w;if(g!=null){const[W,B]=g.getVisibleRange(o);b=(I=r.get(W))!=null?I:h,C=((v=r.get(B))!=null?v:m)+((R=a.get(B))!=null?R:0),w=[W,B]}else{const W=r.get(e);if(W==null)return null;b=W,C=b+((L=(F=(D=a.get(e))!=null?D:c.get(p))!=null?F:d.get(p))!=null?L:0),w=[e,e]}return{visibleIndex:e,modelIndex:p,left:b,right:C,width:C-b,isColumnGroup:f,range:w,depth:t}}class ru extends je{constructor(){super(...arguments),this.cursor=null,this.draggingColumn=null}setScrollInterval(t,n){this.scrollingInterval!=null&&n===this.scrollingDirection||(this.scrollingDirection=n,this.scrollingInterval=window.setInterval(()=>{var f,b;const{metrics:s}=t;if(!s)return;const{left:i,lastLeft:o,leftOffset:r,userColumnWidths:l,calculatedColumnWidths:a,movedColumns:c,visibleColumnWidths:d}=s;let h=i,m=r;if(n==="left")for(m-=vi;m<0;){h-=1;const C=U.getModelIndex(i-1,c),w=(f=l.get(C))!=null?f:a.get(C);w===void 0?m=0:m+=w,h<0&&(m=0,h=0)}else{m+=vi;let C=d.get(i);for(;C!==void 0&&m>C;){h+=1,m-=C;const w=U.getModelIndex(i+1,c);C=(b=l.get(w))!=null?b:a.get(w),h>o&&(m=0,h=o)}}const{mouseX:p,mouseY:g}=t.state;!s||p==null||g==null||(this.moveDraggingColumn(p,t,n==="left"?-vi:vi),t.setState({left:h,leftOffset:m}),(n==="left"&&h===0&&r===0||n==="right"&&h===o)&&this.clearScrollInterval())},ou))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(t,n){const{model:s}=n.props,{x:i,column:o,columnHeaderDepth:r}=t,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const a=bn(o,r,l,s);if(o==null||a==null||r==null||r>0&&!a.isColumnGroup)return!1;const{rowHeaderWidth:c}=l;return this.initialGridPoint=t,this.draggingColumn=null,this.cursor=null,a.modelIndex!=null&&r!=null&&s.isColumnMovable(a.modelIndex,r)&&(this.draggingOffset=i-a.left-c,this.initialOffset=this.draggingOffset),!1}onDrag(t,n,s){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;const{x:i,y:o}=t,{columnHeaderDepth:r}=this.initialGridPoint,{model:l}=n.props;let{draggingColumn:a}=this;const{metrics:c}=n;if(!c)throw new Error("Metrics not set");if(!a&&Math.abs(this.initialGridPoint.x-i)<tl&&Math.abs(this.initialGridPoint.y-o)<tl)return!1;if(a==null){const d=bn(this.initialGridPoint.column,r,c,l);if(!d||r==null||!l.isColumnMovable(d.modelIndex)||r>0&&!d.isColumnGroup||d.range[0]==null)return!1;a={range:d.range,depth:r,left:d.left,width:d.width};const h=bn(a.range[0],0,c,l),m=bn(a.range[1],0,c,l);if(!h||!m)return!1;this.draggingColumn=a,n.setState({draggingColumn:a,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(t.x,n,s.movementX),!0}moveDraggingColumn(t,n,s){var D,F,L,W,B;if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||s===0)return;if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+s||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+s?this.draggingOffset=this.initialOffset:this.draggingOffset+=s,this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}const{depth:i}=this.draggingColumn,{model:o}=n.props,{movedColumns:r}=n.state,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const{floatingLeftWidth:a,width:c,columnHeaderMaxDepth:d,visibleColumnXs:h}=l,m=s<0,p=bn(this.draggingColumn.range[0],i,l,o);if(!p)return;const g=t-this.draggingOffset,f=g+p.width;this.draggingColumn={...this.draggingColumn,left:g},n.setState({draggingColumn:this.draggingColumn});const b=bn(U.getColumnAtX(rt(m?g:f,a,c),l,!0),i,l,o),C=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);if(!b)return;if(C){const N=C.getVisibleRange(r);if(b.visibleIndex<N[0]){const _=this.moveColumn(p,N[0],r);this.draggingOffset=t-((D=h.get(N[0]))!=null?D:0),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:_});return}if(b.visibleIndex>N[1]){const _=this.moveColumn(p,N[1]-(p.range[1]-p.range[0]),r),{right:k=0}=(F=bn(N[1],0,l,o))!=null?F:{};this.draggingOffset=t-(k-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:_});return}}if(!o.isColumnMovable(b.modelIndex)){let N=b.visibleIndex;if(m)for(N+=1;N<p.visibleIndex&&!o.isColumnMovable(U.getModelIndex(N,r));)N+=1;else for(N-=1;N>p.visibleIndex&&!o.isColumnMovable(U.getModelIndex(N,r));)N-=1;if(N!==p.visibleIndex){m||(N-=p.range[1]-p.range[0]);const k=this.moveColumn(p,N,r);n.setState({movedColumns:k,draggingColumn:this.draggingColumn})}const _=bn(N,0,l,o);m?this.draggingOffset=t-((L=_==null?void 0:_.left)!=null?L:0):this.draggingOffset=t-(((W=_==null?void 0:_.right)!=null?W:0)-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}if(g<=a?this.setScrollInterval(n,"left"):f>c?this.setScrollInterval(n,"right"):this.clearScrollInterval(),b.visibleIndex===p.visibleIndex||m&&p.visibleIndex<b.visibleIndex||!m&&p.visibleIndex>b.visibleIndex)return;const w=b.left+b.width*.5,S=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);let I,v=((B=S==null?void 0:S.depth)!=null?B:d)-1;for(;v>=0&&I===void 0;)I=o.getColumnHeaderGroup(b.modelIndex,v),v-=1;let R;m&&g<w&&(!I||b.visibleIndex===I.getVisibleRange(r)[0])&&(R=this.moveColumn(p,b.range[0],r)),!m&&f>w&&(!I||b.visibleIndex===I.getVisibleRange(r)[1])&&(R=this.moveColumn(p,b.range[1]-(p.range[1]-p.range[0]),r)),R&&(this.draggingColumn={...this.draggingColumn,left:g},n.setState({movedColumns:R,draggingColumn:this.draggingColumn}))}moveColumn(t,n,s){const i=t.isColumnGroup?U.moveRange(t.range,n,s):U.moveItem(t.visibleIndex,n,s),o=n-t.range[0],r=[t.range[0]+o,t.range[1]+o];return this.draggingColumn&&(this.draggingColumn={...this.draggingColumn,range:r}),i}onUp(t,n){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,n.setState({draggingColumn:null,isDragging:!1}),!0):!1}}class rr extends je{constructor(){super(...arguments),this.cursor="default"}static getLeftWithOffsetFromRawLeft(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToColumn)return{left:Math.round(n),leftOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleColumnWidths.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleColumnWidth(r,d)}const c=a*l;return{left:r,leftOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barLeft:c,barWidth:d,height:h,hasHorizontalBar:m}=r;return m&&i>0&&a>=h-o&&a<h&&l>c&&l<c+d}getLeftWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{barWidth:o,handleWidth:r,lastLeft:l,barLeft:a,columnCount:c,scrollableContentWidth:d,scrollableViewportWidth:h}=s,m=i-a,p=rt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{left:0,leftOffset:p*(d-h)};const g=p*l;return rr.getLeftWithOffsetFromRawLeft(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{handleWidth:o,barLeft:r,scrollX:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;const{left:c,leftOffset:d}=this.getLeftWithOffset(t,n);n.setViewState({left:c,leftOffset:d,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(t,n){if(this.dragOffset!=null){const{left:s,leftOffset:i}=this.getLeftWithOffset(t,n);return n.setViewState({left:s,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(t,n){return this.isInScrollBar(t,n)}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class lu extends je{constructor(){super(...arguments),this.cursor="move"}onDown(t,n){const{model:s}=n.props,{x:i,y:o,row:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{columnHeaderHeight:a,rowHeaderWidth:c,visibleRowYs:d}=l;if(i<=c&&r!==null&&s.isRowMovable(r)){const h=A(d,r);this.draggingOffset=o-h-a,n.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(t,n){if(this.draggingOffset==null)return!1;const{model:s}=n.props;let{draggingRow:i}=n.state;const{mouseX:o,mouseY:r}=n.state;if(o==null||r==null)return!1;if(i==null){const{row:R}=n.getGridPointFromXY(o,r);if(R!=null&&!s.isRowMovable(R)||(i=R,n.setState({draggingRow:i,isDragging:!0}),i==null))return!1}const{metrics:l}=n;if(!l)throw new Error("metrics not set");const{top:a,lastTop:c,bottom:d,bottomVisible:h,rowCount:m,columnHeaderHeight:p,visibleRowHeights:g,visibleRowYs:f,height:b}=l;let C=p;if(a<i){const R=i-1;C=A(f,R)+A(g,R)*.5+p}let w=b;if(i<d){const R=i+1;w=A(f,R)+A(g,R)*.5+p}let{movedRows:S}=n.state;r<C&&i>0&&s.isRowMovable(i-1)?(S=U.moveItem(i,i-1,S),i-=1):w<r&&i<m-1&&s.isRowMovable(i+1)&&(S=U.moveItem(i,i+1,S),i+=1),n.setState({movedRows:S,draggingRow:i});const I=p+A(g,a)*.5,v=p+A(f,h)+A(g,h)*.5;return r<I&&a>0?n.setState({top:a-1}):r>v&&a<c&&n.setState({top:a+1}),!0}onUp(t,n){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,n.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}class lr extends pa{constructor(){super(...arguments),this.hiddenCursor="s-resize",this.defaultCursor="row-resize",this.pointProperty="y",this.userSizesProperty="userRowHeights",this.visibleOffsetProperty="visibleRowYs",this.visibleSizesProperty="visibleRowHeights",this.marginProperty="columnHeaderHeight",this.calculatedSizesProperty="calculatedRowHeights",this.modelIndexesProperty="modelRows",this.firstIndexProperty="firstRow",this.treePaddingProperty="treePaddingY",this.getHiddenItems=U.getHiddenRows,this.getNextShownItem=U.getNextShownRow,this.getSeparator=lr.getRowSeparator}static getRowSeparator(t,n,s,i){if(!i.allowRowResize)return null;const{x:o,y:r}=t,l=U.getRowSeparatorIndex(o,r,n,i);return l!=null?{index:l,depth:0}:null}setSize(t,n,s){t.setRowHeight(n,s)}resetSize(t,n){t.resetRowHeight(n)}updateSeparator(t,n){t.setState({draggingRowSeparator:n,isDragging:n!==null})}}class Li extends je{static isInTreeBox(t,n){const{column:s,row:i,x:o,y:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{gridX:a,gridY:c,firstColumn:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowHeights:p,visibleRowYs:g,visibleRowTreeBoxes:f}=l;if(s===d&&i!=null&&f.get(i)!=null&&o>a&&r>c){const b=A(h,s),C=A(m,s),w=A(g,i),S=A(p,i);if(o>=a+b&&o<=a+b+C&&r>=c+w&&r<=c+w+S)return!0}return!1}onDown(t,n){return Li.isInTreeBox(t,n)}onClick(t,n){if(Li.isInTreeBox(t,n)){const{row:s}=t;if(s!==null)return n.toggleRowExpanded(s),!0}return!1}}class au extends je{isInCorner(t,n){const s=n.getTheme(),{scrollBarSize:i}=s,{metrics:o}=n;if(!o)throw new Error("metrics not set");const{x:r,y:l}=t,{width:a,height:c,hasVerticalBar:d,hasHorizontalBar:h}=o;return i>0&&d&&h&&r>=a-i&&l>=c-i&&r<=a&&l<=c}onDown(t,n){return this.isInCorner(t,n)}onUp(t,n){return this.isInCorner(t,n)}onClick(t,n){return this.isInCorner(t,n)}}class ar extends je{constructor(){super(...arguments),this.cursor="default"}static getTopWithOffsetFromRawTop(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToRow)return{top:Math.round(n),topOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleRowHeights.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleRowHeight(r,d)}const c=a*l;return{top:r,topOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barTop:c,barHeight:d,width:h,hasVerticalBar:m}=r;return m&&i>0&&l>=h-o&&l<h&&a>c&&a<c+d}getTopWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{barHeight:o,handleHeight:r,lastTop:l,barTop:a,rowCount:c,scrollableContentHeight:d,scrollableViewportHeight:h}=s,m=i-a,p=rt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{top:0,topOffset:p*(d-h)};const g=p*l;return ar.getTopWithOffsetFromRawTop(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{handleHeight:o,barTop:r,scrollY:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;const{top:c,topOffset:d}=this.getTopWithOffset(t,n);n.setViewState({top:c,topOffset:d,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(t,n){return this.isInScrollBar(t,n)}onDrag(t,n){if(this.dragOffset!=null){const{top:s,topOffset:i}=this.getTopWithOffset(t,n);return n.setViewState({top:s,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class cu extends je{onDoubleClick({column:t,row:n},s){const{model:i}=s.props;return Ae(i)&&t!=null&&n!=null&&i.isEditableRange(j.makeCell(t,n))?(s.startEditing(t,n),!0):!1}}class hs{constructor(t=5e3){this.order=t}onDown(t,n){return!1}}class du extends hs{onDown(t,n){switch(t.key){case"a":if(U.isModifierKeyDown(t))return n.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,t,n);case"ArrowDown":return this.handleArrowMove(0,1,t,n);case"ArrowRight":return this.handleArrowMove(1,0,t,n);case"ArrowLeft":return this.handleArrowMove(-1,0,t,n);case"k":case"K":return U.isModifierKeyDown(t)?!1:this.handlePageUp(t,n);case"j":case"J":return U.isModifierKeyDown(t)?!1:this.handlePageDown(t,n);case"h":case"H":return U.isModifierKeyDown(t)?!1:(t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(0,n.state.cursorRow,t.shiftKey),!0);case"l":case"L":{if(U.isModifierKeyDown(t))return!1;const{model:s}=n.props,{columnCount:i}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(i-1,n.state.cursorRow,t.shiftKey),!0}case"PageDown":return this.handlePageDown(t,n);case"PageUp":return this.handlePageUp(t,n);case"Home":return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(U.isModifierKeyDown(t)?n.state.cursorColumn:0,U.isModifierKeyDown(t)?0:n.state.cursorRow,t.shiftKey,!0,!0),!0;case"End":{const{model:s}=n.props,{columnCount:i,rowCount:o}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(U.isModifierKeyDown(t)?n.state.cursorColumn:i-1,U.isModifierKeyDown(t)?o-1:n.state.cursorRow,t.shiftKey,!0,!0),!0}case"Escape":return n.clearSelectedRanges(),!0;case"Enter":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?j.SELECTION_DIRECTION.UP:j.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?j.SELECTION_DIRECTION.LEFT:j.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(t,n,s,i){const o=s.shiftKey,r=U.isModifierKeyDown(s);o?i.trimSelectedRanges():i.clearSelectedRanges();const{cursorRow:l,cursorColumn:a,selectionEndColumn:c,selectionEndRow:d}=i.state,h=o?c:a,m=o?d:l;if(r){const{model:p}=i.props,{columnCount:g,rowCount:f}=p,b=r&&o;let C=null,w=null;t<0?(C=0,w=m):t>0?(C=g-1,w=m):n<0?(C=h,w=0):n>0&&(C=h,w=f-1),C!=null&&w!=null&&i.moveCursorToPosition(C,w,o,!0,b)}else{if(!i.metrics)throw new Error("grid.metrics are not set");const{theme:p}=i.props,{autoSelectRow:g,autoSelectColumn:f}=p;if(g&&t!==0){const{lastLeft:b}=i.metrics;let{left:C}=i.state;C=rt(C+t,0,b),i.moveCursorToPosition(C,l,o,!1),i.setViewState({left:C})}else if(f&&n!==0){const{lastTop:b}=i.metrics;let{top:C}=i.state;C=rt(C+n,0,b),i.moveCursorToPosition(C,a,o,!1),i.setViewState({top:C})}else i.moveCursor(t,n,o)}return!0}handlePageUp(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{cursorColumn:i,selectionEndRow:o}=n.state,r=o,l=i;if(r==null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m}=c.getMetrics(a);let p=r-(d-h);p-=m?0:1,p=Math.max(p,0);const g=Math.max(p-(r-h),0);return n.moveCursorToPosition(l,p,s,!1),n.setViewState({top:g}),!0}handlePageDown(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{selectionEndRow:i,cursorColumn:o}=n.state,r=i,l=o;if(r===null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m,rowCount:p,lastTop:g}=c.getMetrics(a),f=p-1;let b=d-h+r;b+=m?0:1,b=Math.min(b,f);const C=Math.min(g,b-(r-h));return n.moveCursorToPosition(l,b,s,!1),n.setViewState({top:C}),!0}}class hu extends hs{onDown(t,n){switch(t.key){case"Enter":case" ":return this.handleExpandKey(t,n)}return!1}handleExpandKey(t,n){const{selectedRanges:s}=n.state;if(s.length===1){const i=s[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!n.metrics)throw new Error("grid.metrics not set");const{model:o}=n.props,{startRow:r,startColumn:l}=i;if(r!=null){const a=n.getModelRow(r);if((l===0||l==null)&&qe(o)&&o.isRowExpandable(a))return n.toggleRowExpanded(r),!0}}}return!1}}class uu extends hs{onDown(t,n){if(U.isModifierKeyDown(t))return!1;const{model:s}=n.props,{cursorColumn:i,cursorRow:o}=n.state;if(i==null||o==null||!Ae(s)||!s.isEditableRange(j.makeCell(i,o)))return!1;const r=i,l=o;return r==null||l==null?!1:t.key.length===1?(n.startEditing(r,l,!0,[1,1],t.key),!0):t.key==="F2"?(n.startEditing(r,l),!0):t.key==="Backspace"?(n.startEditing(r,l,!0,void 0,""),!0):t.key==="Delete"?(n.setValueForCell(r,l,""),!0):!1}}function mu(e){var s,i;const t=[],n=e.querySelectorAll("tr");for(let o=0;o<n.length;o+=1){const l=n[o].querySelectorAll("td"),a=[];for(let c=0;c<l.length;c+=1){const d=l[c];a.push((i=(s=d.textContent)==null?void 0:s.trim())!=null?i:"")}t.push(a)}return t}function pu(e){const t=[];return e.forEach(n=>{var i;const s=(i=n.textContent)!=null?i:"";s.length>0&&t.push(s.split(/\t|\u00a0\u00a0 \u00a0/))}),t}function gu(e){var s,i,o;const t=e.querySelector("table");if(t!=null)return mu(t);const n=(i=(s=e.textContent)==null?void 0:s.trim())!=null?i:"";if(n.length>0){const{childNodes:r}=e,l=n.includes(" "),a=n.includes("\xA0\xA0 \xA0");return l&&r.length!==0&&(r.length===1||r.length>1&&!((o=r[0].textContent)!=null&&o.includes(" ")))?n.split(`
|
|
2
2
|
`).map(c=>c.split(" ")):r.length>1||a?pu(e.childNodes):n}return null}class fu extends hs{onDown(t,n){switch(t.key){case"v":if(U.isModifierKeyDown(t)){const s=document.createElement("div");document.body.appendChild(s),s.setAttribute("contenteditable","true"),s.setAttribute("style",'clip-path: "inset(50%)"; height: 1px; width: 1px; margin: -1px; overflow: hidden; padding 0; position: absolute;');const i=()=>{s.removeEventListener("input",i),s.remove(),n.focus();const o=gu(s);o!=null&&n.pasteValue(o)};return s.addEventListener("input",i),s.focus(),{preventDefault:!1,stopPropagation:!0}}break}return!1}}const Cu=e=>{switch(e){case"ArrowDown":return Pt.DOWN;case"ArrowUp":return Pt.UP;case"ArrowLeft":return Pt.LEFT;case"ArrowRight":return Pt.RIGHT;default:return}},cr=({selectionRange:e=void 0,className:t="",disabled:n=!1,value:s="",isQuickEdit:i=!0,onChange:o=()=>{},onCancel:r=()=>{},onDone:l=()=>{},onContextMenu:a=()=>{},style:c={}})=>{const d=y.exports.useRef(null),h=y.exports.useRef(!1),[m]=y.exports.useState(s),[p,g]=y.exports.useState(!1),[f,b]=y.exports.useState(i),[C,w]=y.exports.useState(s);y.exports.useEffect(function(){const{current:N}=d;N!=null&&(N.focus(),e?N.setSelectionRange(e[0],e[1]):N.setSelectionRange(N.value.length,N.value.length))},[e]);const S=y.exports.useCallback(B=>{o(B)},[o]),I=y.exports.useCallback(B=>{const{value:N}=B.target;w(N),g(!0),S(N)},[S,w,g]),v=y.exports.useCallback(()=>{h.current=!0,p&&S(m),g(!1),r()},[m,p,r,S]),R=y.exports.useCallback(()=>{b(!1)},[b]),D=y.exports.useCallback((B,N=!1)=>{l(C,{direction:B,fillRange:N})},[l,C]),F=y.exports.useCallback(()=>{h.current||D(null)},[h,D]),L=y.exports.useCallback(B=>{switch(B.stopPropagation(),B.key){case"Escape":B.preventDefault(),v();break;case"Enter":if(B.preventDefault(),U.isModifierKeyDown(B))D(void 0,!0);else if(B.altKey){const N=`${C}
|
|
3
3
|
`;w(N),g(!0),S(N)}else D(B.shiftKey?Pt.UP:Pt.DOWN);break;case"Tab":B.preventDefault(),D(B.shiftKey?Pt.LEFT:Pt.RIGHT);break;case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":f&&(B.preventDefault(),D(Cu(B.key)));break}},[v,D,f,w,g,S,C]),W=y.exports.useCallback(B=>{a(B)},[a]);return u("textarea",{ref:d,className:$("grid-cell-input-field",t),value:C,onBlur:F,onChange:I,onKeyDown:L,onContextMenu:W,onClick:R,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:n,style:c})};cr.propTypes={selectionRange:M.exports.arrayOf(M.exports.number),className:M.exports.string,disabled:M.exports.bool,isQuickEdit:M.exports.bool,value:M.exports.string,onChange:M.exports.func,onCancel:M.exports.func,onDone:M.exports.func,onContextMenu:M.exports.func,style:M.exports.shape({})};cr.defaultProps={selectionRange:null,className:"",disabled:!1,value:"",isQuickEdit:!0,onChange:()=>{},onCancel:()=>{},onDone:()=>{},onContextMenu:()=>{},style:{}};const bu=Y.createContext({}),Zn=class extends y.exports.PureComponent{constructor(e){super(e),this.getCachedKeyHandlers=Ne(l=>[...l,...this.keyHandlers].sort((a,c)=>a.order-c.order)),this.getCachedMouseHandlers=Ne(l=>[...l,...this.mouseHandlers].sort((a,c)=>a.order-c.order)),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleEditCellCancel=this.handleEditCellCancel.bind(this),this.handleEditCellChange=this.handleEditCellChange.bind(this),this.handleEditCellCommit=this.handleEditCellCommit.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseDrag=this.handleMouseDrag.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleResize=this.handleResize.bind(this),this.handleWheel=this.handleWheel.bind(this);const{isStuckToBottom:t,isStuckToRight:n,metricCalculator:s,movedColumns:i,movedRows:o,renderer:r}=e;this.renderer=r||new Rs,this.metricCalculator=s||new js,this.canvas=null,this.canvasContext=null,this.animationFrame=null,this.prevMetrics=null,this.metrics=null,this.documentCursor=null,this.dragTimer=null,this.keyHandlers=[new uu(400),new fu(450),new du(500),new hu(900)],this.mouseHandlers=[new lr(100),new Zi(200),new lu(300),new ru(400),new cu(450),new ar(500),new rr(600),new au(700),new Li(800),new iu(900)],this.state={top:0,left:0,topOffset:0,leftOffset:0,draggingColumn:null,draggingRow:null,draggingRowOffset:null,draggingColumnSeparator:null,draggingRowSeparator:null,isDraggingHorizontalScrollBar:!1,isDraggingVerticalScrollBar:!1,isDragging:!1,mouseX:null,mouseY:null,movedColumns:i,movedRows:o,cursorRow:null,cursorColumn:null,selectionStartRow:null,selectionStartColumn:null,selectionEndRow:null,selectionEndColumn:null,selectedRanges:[],lastSelectedRanges:[],cursor:null,editingCell:null,isStuckToBottom:t,isStuckToRight:n}}static getScale(e){const t=window.devicePixelRatio||1,n=e,s=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;return t/s}static getCursorClassName(e){return e?`grid-cursor-${e}`:null}componentDidMount(){var e;this.initContext(),(e=this.canvas)==null||e.addEventListener("wheel",this.handleWheel,{passive:!1}),window.addEventListener("resize",this.handleResize),this.updateCanvasScale(),this.updateCanvas()}componentDidUpdate(e,t){const{isStickyBottom:n,isStickyRight:s,movedColumns:i,movedRows:o,onMovedColumnsChanged:r,onMoveColumnComplete:l,onMovedRowsChanged:a,onMoveRowComplete:c}=this.props,{isStickyBottom:d,isStickyRight:h,movedColumns:m,movedRows:p}=e,{movedColumns:g,movedRows:f}=t,{draggingColumn:b,draggingRow:C,movedColumns:w,movedRows:S}=this.state;if(m!==i&&this.setState({movedColumns:i}),p!==o&&this.setState({movedRows:o}),g!==w&&r(w),t.draggingColumn!=null&&b==null&&l(w),f!==S&&a(S),t.draggingRow!=null&&C==null&&c(S),n!==d&&this.setState({isStuckToBottom:!1}),s!==h&&this.setState({isStuckToRight:!1}),this.updateMetrics(),this.requestUpdateCanvas(),!this.metrics||!this.prevMetrics)return;const{bottomVisible:I,rightVisible:v,rowCount:R,columnCount:D,top:F,left:L,height:W,width:B}=this.metrics,{rowCount:N,columnCount:_,height:k,width:P}=this.prevMetrics,H=this.getMetricState();if(N!==R||W!==k){const V=this.metricCalculator.getLastTop(H),{isStuckToBottom:G}=this.state;(G&&I<R-1&&I>0||F>V)&&this.setState({top:V})}if(_!==D||B!==P){const V=this.metricCalculator.getLastLeft(H),{isStuckToRight:G}=this.state;(G&&v<D-1&&v>0||L>V)&&this.setState({left:V})}this.validateSelection()&&this.checkSelectionChange(t)}componentWillUnmount(){var e;this.animationFrame!=null&&cancelAnimationFrame(this.animationFrame),(e=this.canvas)==null||e.removeEventListener("wheel",this.handleWheel),window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("resize",this.handleResize),this.stopDragTimer()}getTheme(){const{theme:e}=this.props;return Zn.getTheme(this.context,e)}getGridPointFromEvent(e){Qr(this.canvas);const t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return this.getGridPointFromXY(n,s)}getGridPointFromXY(e,t){if(!this.metrics)throw new Error("metrics must be set");return U.getGridPointFromXY(e,t,this.metrics)}getMetricState(e=this.state){const t=this.getTheme(),{model:n,stateOverride:s}=this.props;if(!this.canvasContext||!this.canvas)throw new Error("Canvas and context must be defined to get metrics");const i=this.canvasContext,o=this.canvas.clientWidth,r=this.canvas.clientHeight,{left:l,top:a,leftOffset:c,topOffset:d,movedColumns:h,movedRows:m,isDraggingHorizontalScrollBar:p,isDraggingVerticalScrollBar:g,draggingColumn:f}=e;return{left:l,top:a,leftOffset:c,topOffset:d,width:o,height:r,context:i,theme:t,model:n,movedColumns:h,movedRows:m,isDraggingHorizontalScrollBar:p,isDraggingVerticalScrollBar:g,draggingColumn:f,...s}}getKeyHandlers(){const{keyHandlers:e}=this.props;return this.getCachedKeyHandlers(e)}getMouseHandlers(){const{mouseHandlers:e}=this.props;return this.getCachedMouseHandlers(e)}getModelColumn(e){var n,s;const t=(s=(n=this.metrics)==null?void 0:n.modelColumns)==null?void 0:s.get(e);if(t===void 0)throw new Error(`Unable to get ModelIndex for column ${e}`);return t}getModelRow(e){var n,s;const t=(s=(n=this.metrics)==null?void 0:n.modelRows)==null?void 0:s.get(e);if(t===void 0)throw new Error(`Unable to get ModelIndex for row ${e}`);return t}toggleRowExpanded(e){const t=this.getModelRow(e),{model:n}=this.props;qe(n)&&n.isRowExpandable(t)&&n.setRowExpanded(t,!n.isRowExpanded(t)),this.clearSelectedRanges(),this.commitSelection(),this.moveCursorToPosition(0,e),this.commitSelection(),this.setState({isStuckToBottom:!1})}setSelectedRanges(e){const{model:t}=this.props,{columnCount:n,rowCount:s}=t,{cursorRow:i,cursorColumn:o,selectedRanges:r}=this.state;if(this.setState({selectedRanges:e,lastSelectedRanges:r}),e.length>0){const l=j.boundedRange(e[0],n,s);let a=i,c=o;l.containsCell(o,i)||({row:a,column:c}=l.startCell()),this.setState({selectionStartColumn:l.startColumn,selectionStartRow:l.startRow,selectionEndColumn:l.endColumn,selectionEndRow:l.endRow,cursorColumn:c,cursorRow:a})}}initContext(){const{canvas:e}=this,{canvasOptions:t}=this.props;if(!e)throw new Error("Canvas not set");this.canvasContext=e.getContext("2d",t)}requestUpdateCanvas(){this.animationFrame==null&&(this.animationFrame=requestAnimationFrame(()=>{if(this.animationFrame=null,!this.metrics)throw new Error("Metrics not set");this.updateCanvas(this.metrics)}))}updateCanvas(e=this.updateMetrics()){this.updateCanvasScale();const{onViewChanged:t}=this.props;t(e),this.drawCanvas(e)}updateCanvasScale(){const{canvas:e,canvasContext:t}=this;if(!e)throw new Error("canvas not set");if(!t)throw new Error("canvasContext not set");if(!e.parentElement)throw new Error("Canvas has no parent element");const n=Zn.getScale(t),s=e.parentElement.getBoundingClientRect(),i=Math.floor(s.width),o=Math.floor(s.height);e.style.width=`${i}px`,e.style.height=`${o}px`,e.width=i*n,e.height=o*n,t.scale(n,n)}updateMetrics(e=this.state){this.prevMetrics=this.metrics;const{metricCalculator:t}=this,n=this.getMetricState(e);return this.metrics=t.getMetrics(n),this.metrics}checkSelectionChange(e){const{selectedRanges:t}=e,{selectedRanges:n}=this.state;if(n!==t){const{onSelectionChanged:s}=this.props;s(n)}}validateSelection(){const{model:e}=this.props,{selectedRanges:t}=this.state,{columnCount:n,rowCount:s}=e;for(let i=0;i<t.length;i+=1){const o=t[i];if(o.endColumn!=null&&o.endColumn>=n||o.endRow!=null&&o.endRow>=s)return this.setState({selectedRanges:[],lastSelectedRanges:[]}),!1}return!0}clearSelectedRanges(){const{selectedRanges:e}=this.state;this.setState({selectedRanges:[],lastSelectedRanges:e})}trimSelectedRanges(){const{selectedRanges:e}=this.state;e.length>0&&this.setState({selectedRanges:e.slice(e.length-1)})}beginSelection(e,t){this.setState({selectionStartColumn:e,selectionStartRow:t,selectionEndColumn:e,selectionEndRow:t,cursorColumn:e,cursorRow:t})}moveSelection(e,t,n=!1,s=!1){this.setState(i=>{var g,f,b,C;const{selectedRanges:o,selectionStartRow:r,selectionStartColumn:l}=i,{theme:a}=this.props,{autoSelectRow:c,autoSelectColumn:d}=a;if(n&&o.length>0){const w=o[o.length-1];let S=null,I=null,v=null,R=null;s?(S=c?null:Math.min(e!=null?e:0,(g=w.startColumn)!=null?g:0),I=d?null:Math.min(t!=null?t:0,(f=w.startRow)!=null?f:0),v=c?null:Math.max(e!=null?e:0,(b=w.endColumn)!=null?b:0),R=d?null:Math.max(t!=null?t:0,(C=w.endRow)!=null?C:0)):(S=w.startColumn,I=w.startRow,(l!=null||r!=null)&&(c||(S=l),d||(I=r)),v=c?null:e,R=d?null:t);const D=j.makeNormalized(S,I,v,R);if(w.equals(D))return null;const F=[...o];return F[F.length-1]=D,{selectedRanges:F,selectionEndColumn:e,selectionEndRow:t}}const h=[...o],m=c?null:e,p=d?null:t;return h.push(j.makeNormalized(m,p,m,p)),{selectedRanges:h,selectionEndColumn:e,selectionEndRow:t}})}commitSelection(){this.setState(e=>{const{theme:t}=this.props,{autoSelectRow:n}=t,{selectedRanges:s,lastSelectedRanges:i,cursorRow:o,cursorColumn:r}=e;if(s.length===1&&(n?j.rowCount(s)===1:j.cellCount(s)===1)&&j.rangeArraysEqual(s,i))return{selectedRanges:[],lastSelectedRanges:[],cursorColumn:r,cursorRow:o};let l=s.slice();if(l.length>1){const d=l[l.length-1];for(let h=0;h<l.length-1;h+=1){const m=l[h];if(m.contains(d)){const p=m.subtract(d);l.pop(),l.splice(h,1),l=l.concat(p);break}}l=j.consolidate(l)}let a=r,c=o;if(!j.containsCell(l,r,o)){const{model:d}=this.props,{columnCount:h,rowCount:m}=d,p=j.nextCell(j.boundedRanges(s,h,m));p!=null?{column:a,row:c}=p:(a=null,c=null)}return{cursorRow:c,cursorColumn:a,selectedRanges:l,lastSelectedRanges:s}})}setFocusRow(e){var h;if(!this.metrics||!this.prevMetrics)return;const{gridY:t,height:n,lastTop:s,userRowHeights:i,rowHeight:o}=this.metrics,r=n-t,l=Math.round(r/2)+((h=i.get(e))!=null?h:o),a=this.getMetricState(),c=this.metricCalculator.getLastTop(a,e+1,l);this.setState({top:Math.min(s,c),selectedRanges:[new j(null,e,null,e)]});const{cursorColumn:d}=this.state;this.moveCursorToPosition(d,e,!1,!1)}selectAll(){const{model:e,theme:t}=this.props,{autoSelectRow:n,autoSelectColumn:s}=t,i=s?null:0,o=s?null:e.rowCount-1,r=n?null:0,l=n?null:e.columnCount-1;this.setSelectedRanges([new j(r,i,l,o)])}moveCursor(e,t,n){const{cursorRow:s,cursorColumn:i,selectionEndColumn:o,selectionEndRow:r}=this.state,l=n?o:i,a=n?r:s;if(a===null||l===null){const{left:c,top:d}=this.state;this.moveCursorToPosition(c,d,n)}else{const{model:c}=this.props,{columnCount:d,rowCount:h}=c,m=rt(l+e,0,d-1),p=rt(a+t,0,h-1);this.moveCursorToPosition(m,p,n)}}moveCursorInDirection(e=j.SELECTION_DIRECTION.DOWN){var c;const{model:t}=this.props,{columnCount:n,rowCount:s}=t,{cursorRow:i,cursorColumn:o,selectedRanges:r}=this.state,l=r.length>0?r:[j.makeCell(o,i)];let a=null;if(l.length===1&&j.cellCount(l)===1){const d=new j(0,0,n-1,s-1);a=(c=d.nextCell(o,i,e))!=null?c:d.startCell(e)}else a=j.nextCell(j.boundedRanges(l,n,s),o,i,e);if(a!=null){const{column:d,row:h}=a;this.setState({cursorColumn:d,cursorRow:h}),j.containsCell(r,d,h)||this.setState({selectedRanges:[j.makeCell(d,h)],selectionStartColumn:d,selectionStartRow:h,selectionEndColumn:d,selectionEndRow:h}),this.moveViewToCell(a.column,a.row)}}moveCursorToPosition(e,t,n=!1,s=!0,i=!1){n||this.beginSelection(e,t),this.moveSelection(e,t,n,i),s&&this.moveViewToCell(e,t)}moveViewToCell(e,t){if(!this.metrics)throw new Error("metrics not set");const{metricCalculator:n}=this,{bottomVisible:s,rightVisible:i,topVisible:o,leftVisible:r}=this.metrics,l=this.getMetricState(this.state);let{top:a,left:c,topOffset:d,leftOffset:h}=this.state;t!=null&&!U.isFloatingRow(t,this.metrics)&&(t<o?(a=n.getTopForTopVisible(l,t),d=0):t>s&&(a=n.getTopForBottomVisible(l,t),d=0)),e!=null&&!U.isFloatingColumn(e,this.metrics)&&(e<r?(c=n.getLeftForLeftVisible(l,e),h=0):e>i&&(c=n.getLeftForRightVisible(l,e),h=0)),this.setViewState({top:a,left:c,topOffset:d,leftOffset:h})}setViewState(e,t=!1){if(!this.metrics)throw new Error("metrics not set");const{isStickyBottom:n,isStickyRight:s}=this.props,{top:i,left:o}=e,{lastTop:r,lastLeft:l}=this.metrics;i!=null&&this.setState({isStuckToBottom:n&&i>=r}),o!=null&&this.setState({isStuckToRight:s&&o>=l}),this.setState(e),t&&this.forceUpdate()}startEditing(e,t,n=!1,s,i){const{model:o}=this.props;if(!Ae(o))throw new Error("model is not editable");const r=this.getModelColumn(e),l=this.getModelRow(t),a={column:e,row:t,selectionRange:s,value:i!==void 0?i:o.editValueForCell(r,l),isQuickEdit:n};this.setState({editingCell:a,cursorColumn:e,cursorRow:t}),this.moveViewToCell(e,t)}isValidForCell(e,t,n){const{model:s}=this.props,i=this.getModelColumn(e),o=this.getModelRow(t);return Ae(s)&&s.isValidForCell(i,o,n)}async pasteValue(e){const{model:t}=this.props,{movedColumns:n,movedRows:s,selectedRanges:i}=this.state;try{if(jr(t),!t.isEditable||!i.every(h=>t.isEditableRange(h)))throw new So("Can't paste in to read-only area.");if(i.length<=0)throw new So("Select an area to paste to.");if(typeof e=="string"){const h=[],m=U.getModelRanges(i,n,s);j.forEachCell(m,(p,g)=>{h.push({column:p,row:g,text:e})}),await t.setValues(h);return}const o=e.length,r=e[0].length,{columnCount:l,rowCount:a}=t;let c=i;if(c.every(h=>{var m,p;return j.cellCount([h])===1&&((m=h.startColumn)!=null?m:0)+r<=l&&((p=h.startRow)!=null?p:0)+o<=a})&&(c=c.map(h=>{var m,p;return new j(h.startColumn,h.startRow,((m=h.startColumn)!=null?m:0)+r-1,((p=h.startRow)!=null?p:0)+o-1)}),this.setSelectedRanges(c)),!c.every(h=>j.rowCount([h])===o&&j.columnCount([h])===r))throw new So("Copy and paste area are not same size.");const d=[];c.forEach(h=>{var m,p;for(let g=0;g<r;g+=1)for(let f=0;f<o;f+=1)d.push({column:((m=h.startColumn)!=null?m:0)+g,row:((p=h.startRow)!=null?p:0)+f,text:e[f][g]})}),await t.setValues(d)}catch(o){const{onError:r}=this.props;r(o instanceof Error?o:new Error(`${o}`))}}setValueForCell(e,t,n){const{model:s}=this.props;jr(s);const i=this.getModelColumn(e),o=this.getModelRow(t);return s.isValidForCell(i,o,n)?(s.setValueForCell(i,o,n),!0):!1}setValueForRanges(e,t){const{model:n}=this.props,{movedColumns:s,movedRows:i}=this.state,o=U.getModelRanges(e,s,i);Ae(n)&&n.setValueForRanges(o,t)}isSelected(e,t){var s,i;const{selectedRanges:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o],l=r.startRow===null||r.startRow<=e&&e<=((s=r.endRow)!=null?s:0),a=r.startColumn===null||r.startColumn<=t&&t<=((i=r.endColumn)!=null?i:0);if(l&&a)return!0}return!1}addDocumentCursor(e=null){this.documentCursor!==Zn.getCursorClassName(e)&&(this.documentCursor&&document.documentElement.classList.remove(this.documentCursor),this.documentCursor=Zn.getCursorClassName(e),this.documentCursor&&document.documentElement.classList.add(this.documentCursor),document.documentElement.classList.add("grid-block-events"))}removeDocumentCursor(){this.documentCursor&&(document.documentElement.classList.remove(this.documentCursor),document.documentElement.classList.remove("grid-block-events"),this.documentCursor=null)}startDragTimer(e){this.stopDragTimer();const t=new MouseEvent("custom",e.nativeEvent);this.dragTimer=setTimeout(()=>{this.handleMouseDrag(t)},Zn.dragTimeout)}stopDragTimer(){this.dragTimer&&(clearTimeout(this.dragTimer),this.dragTimer=null)}drawCanvas(e=this.updateMetrics()){if(!this.canvas)throw new Error("canvas is not set");if(!this.canvasContext)throw new Error("context not set");const{left:t,top:n,cursorColumn:s,cursorRow:i,draggingColumn:o,draggingColumnSeparator:r,draggingRow:l,draggingRowOffset:a,draggingRowSeparator:c,editingCell:d,isDraggingHorizontalScrollBar:h,isDraggingVerticalScrollBar:m,isDragging:p,mouseX:g,mouseY:f,selectedRanges:b}=this.state,{model:C,stateOverride:w}=this.props,{renderer:S}=this,I=this.canvasContext,v=this.getTheme(),R=this.canvas.clientWidth,D=this.canvas.clientHeight,F={left:t,top:n,width:R,height:D,context:I,theme:v,model:C,metrics:e,mouseX:g,mouseY:f,selectedRanges:b,draggingColumn:o,draggingColumnSeparator:r,draggingRow:l,draggingRowOffset:a,draggingRowSeparator:c,editingCell:d,isDraggingHorizontalScrollBar:h,isDraggingVerticalScrollBar:m,isDragging:p,cursorColumn:s,cursorRow:i,...w};I.save(),S.drawCanvas(F),I.restore()}focus(){var e;(e=this.canvas)==null||e.focus()}isFocused(){return document.activeElement===this.canvas}handleClick(e){var s;const t=this.getGridPointFromEvent(e),n=this.getMouseHandlers();for(let i=0;i<n.length;i+=1)if(n[i].onClick(t,this,e)){e.stopPropagation(),e.preventDefault();break}(s=this.canvas)==null||s.focus()}handleContextMenu(e){const t=this.getGridPointFromEvent(e),n=this.getMouseHandlers();for(let s=0;s<n.length;s+=1)if(n[s].onContextMenu(t,this,e)){e.stopPropagation(),e.preventDefault();break}}handleKeyDown(e){var n,s;const t=this.getKeyHandlers();for(let i=0;i<t.length;i+=1){const r=t[i].onDown(e,this);if(r){const l=r;((n=l==null?void 0:l.stopPropagation)==null||n)&&e.stopPropagation(),((s=l==null?void 0:l.preventDefault)==null||s)&&e.preventDefault();break}}}notifyMouseHandlers(e,t,n=!0,s=!1){var l,a;const i=this.getGridPointFromEvent(t),o=this.getMouseHandlers();let r=null;for(let c=0;c<o.length;c+=1){const d=o[c],h=d[e]&&d[e](i,this,t);if(h){d.cursor!=null&&({cursor:r}=d,s&&this.addDocumentCursor(r));const m=h;((l=m==null?void 0:m.stopPropagation)==null||l)&&t.stopPropagation(),((a=m==null?void 0:m.preventDefault)==null||a)&&t.preventDefault();break}}if(this.setState({cursor:r}),n){const{x:c,y:d}=i;this.setState({mouseX:c,mouseY:d})}}handleMouseDown(e){window.addEventListener("mousemove",this.handleMouseDrag,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onDown",e),this.startDragTimer(e))}handleDoubleClick(e){this.notifyMouseHandlers("onDoubleClick",e)}handleMouseMove(e){this.notifyMouseHandlers("onMove",e)}handleMouseLeave(e){this.notifyMouseHandlers("onLeave",e,!1),this.setState({mouseX:null,mouseY:null})}handleMouseDrag(e){this.setState({isDragging:!0}),this.notifyMouseHandlers("onDrag",e,!0,!0),this.stopDragTimer()}handleMouseUp(e){window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onUp",e,!1),this.stopDragTimer(),this.removeDocumentCursor())}handleResize(){if(this.updateCanvasScale(),this.updateCanvas(),!this.metrics)throw new Error("metrics not set");const{left:e,top:t}=this.state,{lastLeft:n,lastTop:s}=this.metrics;e>n&&this.setState({left:n,leftOffset:0}),t>s&&this.setState({top:s,topOffset:0}),this.forceUpdate()}handleWheel(e){var v,R,D,F;if(this.notifyMouseHandlers("onWheel",e),e.defaultPrevented)return;const{metricCalculator:t,metrics:n}=this,s=this.getMetricState();if(!n)throw new Error("metrics not set");const{lastTop:i,lastLeft:o,columnCount:r,rowCount:l,scrollableContentWidth:a,scrollableViewportWidth:c,scrollableContentHeight:d,scrollableViewportHeight:h,hasHorizontalBar:m,hasVerticalBar:p}=n;let{top:g,left:f,topOffset:b,leftOffset:C}=n;const w=this.getTheme();let{deltaX:S,deltaY:I}=U.getScrollDelta(e,n.barWidth,n.barHeight,n.rowHeight,n.rowHeight);for(;m&&S!==0;){if(C+=S,S=0,r>1){if(C>0&&f>=o||C<0&&f<=0){C=0;break}}else{if(C<=0){C=0;break}const L=a-c;if(C>=L){C=L;break}}if(C>0){const L=(v=n.visibleColumnWidths.get(f))!=null?v:t.getVisibleColumnWidth(f,s);C>=L?(S=C-L,C=0,f+=1):w.scrollSnapToColumn&&r>1&&(C=0,f+=1)}else if(C<0){const L=(R=n.visibleColumnWidths.get(f-1))!=null?R:t.getVisibleColumnWidth(f-1,s);Math.abs(C)<=L&&w.scrollSnapToColumn&&r>1?(C=0,f-=1):(S=C+L,C=0,f-=1)}}for(;p&&I!==0;){if(b+=I,I=0,l>1){if(b>0&&g>=i||b<0&&g<=0){b=0;break}}else{if(b<=0){b=0;break}const L=d-h;if(b>=L){b=L;break}}if(b>0){const L=(D=n.visibleRowHeights.get(g))!=null?D:t.getVisibleRowHeight(g,s);b>=L?(I=b-L,b=0,g+=1):w.scrollSnapToRow&&l>1&&(b=0,g+=1)}else if(b<0){const L=(F=n.visibleRowHeights.get(g-1))!=null?F:t.getVisibleRowHeight(g-1,s);Math.abs(b)<=L&&w.scrollSnapToRow&&l>1?(b=0,g-=1):(I=b+L,b=0,g-=1)}}this.setViewState({top:g,left:f,leftOffset:C,topOffset:b}),e.stopPropagation(),e.preventDefault()}handleEditCellCancel(){this.setState({editingCell:null}),this.focus()}handleEditCellChange(e){this.setState(({editingCell:t})=>{try{return Qr(t),{editingCell:{...t,value:e}}}catch(n){const{onError:s}=this.props;return s(n instanceof Error?n:new Error(`${n}`)),null}})}handleEditCellCommit(e,{direction:t=Pt.DOWN,fillRange:n=!1}={}){const{editingCell:s,selectedRanges:i}=this.state;if(!s)throw new Error("editingCell not set");const{column:o,row:r}=s;if(!this.isValidForCell(o,r,e)){t===null&&this.setState({editingCell:null});return}n?this.setValueForRanges(i,e):this.setValueForCell(o,r,e),t!==null&&this.moveCursorInDirection(t),this.setState({editingCell:null}),this.focus()}renderInputField(){const{model:e}=this.props,{editingCell:t}=this.state,{metrics:n}=this;if(t==null||n==null||!Ae(e))return null;const{selectionRange:s,value:i,isQuickEdit:o}=t,{column:r,row:l}=t,{gridX:a,gridY:c,visibleColumnXs:d,visibleRowYs:h,visibleColumnWidths:m,visibleRowHeights:p}=n,g=d.get(r),f=h.get(l),b=m.get(r),C=p.get(l),w=g!=null&&f!=null&&b!=null&&C!=null?{position:"absolute",left:a+g,top:c+f,width:b,height:C}:{opacity:0},S=this.getModelColumn(r),I=this.getModelRow(l),v=S!=null&&I!=null?{textAlign:e.textAlignForCell(S,I)}:void 0,R=e.isValidForCell(S,I,i);return u("div",{style:w,children:u(cr,{selectionRange:s,className:$({error:!R}),onCancel:this.handleEditCellCancel,onChange:this.handleEditCellChange,onDone:this.handleEditCellCommit,isQuickEdit:o,style:v,value:i},`${r},${l}`)})}render(){const{cursor:e}=this.state;return T(Fe,{children:[u("canvas",{className:$("grid-canvas",Zn.getCursorClassName(e)),ref:t=>{this.canvas=t},onClick:this.handleClick,onContextMenu:this.handleContextMenu,onDoubleClick:this.handleDoubleClick,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,tabIndex:0,children:"Your browser does not support HTML canvas. Update your browser?"}),this.renderInputField()]})}};let Fs=Zn;Fs.contextType=bu;Fs.defaultProps={canvasOptions:{alpha:!1},isStickyBottom:!1,isStickyRight:!1,isStuckToBottom:!1,isStuckToRight:!1,keyHandlers:[],mouseHandlers:[],movedColumns:[],movedRows:[],onError:()=>{},onSelectionChanged:()=>{},onMovedColumnsChanged:e=>{},onMoveColumnComplete:()=>{},onMovedRowsChanged:()=>{},onMoveRowComplete:()=>{},onViewChanged:()=>{},stateOverride:{},theme:{autoSelectColumn:!1,autoSelectRow:!1}};Fs.pixelsPerLine=100/3;Fs.dragTimeout=1e3;Fs.getTheme=Ne((e,t)=>({...tu,...e,...t}));class ga extends Wo{get floatingTopRowCount(){return 0}get floatingBottomRowCount(){return 0}get floatingLeftColumnCount(){return 0}get floatingRightColumnCount(){return 0}get columnHeaderMaxDepth(){return 1}truncationCharForCell(t,n){}textAlignForCell(t,n){return"left"}colorForCell(t,n,s){return s.textColor}backgroundColorForCell(t,n,s){return null}colorForColumnHeader(t,n=0){return null}textForRowHeader(t){return""}textForRowFooter(t){return""}isColumnMovable(t,n=0){return!0}isRowMovable(t){return!0}getColumnHeaderGroup(t,n){}getColumnHeaderParentGroup(t,n){}}class wu extends ga{constructor({rowCount:t=1e9,columnCount:n=100,floatingTopRowCount:s=0,floatingBottomRowCount:i=0,floatingLeftColumnCount:o=0,floatingRightColumnCount:r=0,isEditable:l=!1,editedData:a=[]}={}){super(),this.numRows=t,this.numColumns=n,this.floatingTop=s,this.floatingBottom=i,this.floatingLeft=o,this.floatingRight=r,this.editable=l,this.editedData=a}get rowCount(){return this.numRows}get columnCount(){return this.numColumns}get floatingTopRowCount(){return this.floatingTop}get floatingBottomRowCount(){return this.floatingBottom}get floatingLeftColumnCount(){return this.floatingLeft}get floatingRightColumnCount(){return this.floatingRight}get isEditable(){return this.editable}textForCell(t,n){var s,i;return(i=(s=this.editedData[t])==null?void 0:s[n])!=null?i:`${t},${n}`}colorForCell(t,n,s){return s.textColor}textForColumnHeader(t,n=0){return`${t}`}textForRowHeader(t){return`${t}`}textForRowFooter(t){return`${t}`}async setValueForCell(t,n,s){this.editedData[t]==null&&(this.editedData[t]=[]),this.editedData[t][n]=`${s}`}async setValueForRanges(t,n){j.forEachCell(t,(s,i)=>{this.setValueForCell(s,i,n)})}async setValues(t){var n,s;for(let i=0;i<t.length;i+=1){const o=t[i];this.setValueForCell((n=o.column)!=null?n:o.x,(s=o.row)!=null?s:o.y,o.text)}}editValueForCell(t,n){return this.textForCell(t,n)}isValidForCell(t,n,s){return!0}isEditableRange(t){return this.isEditable}delete(t){throw new Error("Method not implemented.")}}const Jn=class extends wu{constructor({rowCount:e=Jn.DEFAULT_ROW_COUNT,columnCount:t=Jn.DEFAULT_COLUMN_COUNT,children:n=new Map,childRowCount:s=Math.ceil(Math.max(Jn.MIN_CHILD_ROW_COUNT,e*Jn.DEFAULT_CHILD_ROW_COUNT_FACTOR)),maxDepth:i=Jn.MAX_DEPTH}={}){super({rowCount:e,columnCount:t}),this.getCachedModelRowOffset=St((o,r)=>{let l=null,a=r;const c=[...o].sort((d,h)=>d[0]-h[0]);for(let d=0;d<c.length;d+=1){const[h,m]=c[d];if(a<=h)break;const p=m.rowCount;if(a<=h+p){l=h,a=a-h-1;break}a-=p}return{key:l,offsetRow:a}}),this.getCachedTextForRowHeader=St((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return`${l}.${c.textForRowHeader(a)}`}return`${a}`}),this.getCachedTextForCell=St((o,r,l)=>{const{key:a,offsetRow:c}=this.getCachedModelRowOffset(o,l);if(a!=null){const d=o.get(a);if(d!==void 0)return`${a}.${d.textForCell(r,c)}`}return`${r},${c}`}),this.getCachedIsRowExpandable=St((o,r,l)=>this.getCachedDepthForRow(o,r)<l),this.getCachedIsRowExpanded=St((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return c.isRowExpanded(a)}return o.has(a)}),this.getCachedDepthForRow=St((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return c.depthForRow(a)+1}return 0}),this.children=n,this.childRowCount=s,this.maxDepth=i}textForCell(e,t){return this.getCachedTextForCell(this.children,e,t)}textForRowHeader(e){return this.getCachedTextForRowHeader(this.children,e)}isRowMovable(e){return!1}get hasExpandableRows(){return!0}get floatingBottomRowCount(){return 0}isRowExpandable(e){return this.getCachedIsRowExpandable(this.children,e,this.maxDepth)}isRowExpanded(e){return this.getCachedIsRowExpanded(this.children,e)}setRowExpanded(e,t){const{key:n,offsetRow:s}=this.getCachedModelRowOffset(this.children,e),i=new Map(this.children);if(n!=null){const o=this.children.get(n);if(o!==void 0){const{rowCount:r}=o;o.setRowExpanded(s,t),this.numRows+=o.rowCount-r}}else if(t){const o=new Jn({rowCount:this.childRowCount,columnCount:this.numColumns});i.set(s,o),this.numRows+=o.rowCount}else{const o=i.get(s);o!==void 0&&(this.numRows-=o.rowCount,i.delete(s))}this.children=i}depthForRow(e){return this.getCachedDepthForRow(this.children,e)}};let Zs=Jn;Zs.DEFAULT_ROW_COUNT=1e9;Zs.DEFAULT_COLUMN_COUNT=100;Zs.DEFAULT_CHILD_ROW_COUNT_FACTOR=.01;Zs.MIN_CHILD_ROW_COUNT=10;Zs.MAX_DEPTH=10;class he extends ga{constructor(){super(),this.listenerCount=0}addEventListener(t,n,s){super.addEventListener(t,n,s),this.listenerCount+=1,this.listenerCount===1&&this.startListening()}removeEventListener(t,n,s){super.removeEventListener(t,n,s),this.listenerCount-=1,this.listenerCount===0&&this.stopListening()}startListening(){}stopListening(){}get originalColumns(){return this.columns}get movedColumns(){return[]}get movedRows(){return[]}get layoutHints(){return null}get frontColumns(){return[]}get backColumns(){return[]}get frozenColumns(){return[]}isColumnFrozen(t){return!1}get isFilterRequired(){return!1}get isReversible(){return!0}get isColumnStatisticsAvailable(){return!1}get description(){return""}get isCustomColumnsAvailable(){return!1}get isFormatColumnsAvailable(){return!1}get isExportAvailable(){return!1}get isValuesTableAvailable(){return!1}get isChartBuilderAvailable(){return!1}get isRollupAvailable(){return!1}get isSelectDistinctAvailable(){return!1}get isTotalsAvailable(){return!1}isFilterable(t){return!1}close(){}isRowMovable(){return!1}}he.EVENT=Object.freeze({UPDATED:"UPDATED",FORMATTER_UPDATED:"FORMATTER_UPDATED",REQUEST_FAILED:"REQUEST_FAILED",COLUMNS_CHANGED:"COLUMNS_CHANGED",TABLE_CHANGED:"TABLE_CHANGED",FILTERS_CHANGED:"FILTERS_CHANGED",SORTS_CHANGED:"SORTS_CHANGED",DISCONNECT:"DISCONNECT",RECONNECT:"RECONNECT",TOTALS_UPDATED:"TOTALS_UPDATED",PENDING_DATA_UPDATED:"PENDING_DATA_UPDATED"});const Ss=class extends y.exports.Component{constructor(e){super(e),this.getInput=Ne((t,n)=>t.find(s=>s.eventKey===n)),this.getInputIndex=Ne((t,n)=>t.findIndex(s=>s.eventKey===n)),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleSaveClick=this.handleSaveClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleCustomColumnUpdated=this.handleCustomColumnUpdated.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.resetRequestFailed=this.resetRequestFailed.bind(this),this.handleEditorTabNavigation=this.handleEditorTabNavigation.bind(this),this.state={inputs:[],isCustomColumnApplying:!1,errorMessage:null,hasRequestFailed:!1,isSuccessShowing:!1},this.container=null,this.successButtonTimer=null}static makeCustomColumnInputEventKey(){return jt.generate()}static createCustomColumnInput(){return{eventKey:jt.generate(),name:"",formula:""}}componentDidMount(){const{customColumns:e}=this.props;this.parseCustomColumns(e),this.startListening()}componentWillUnmount(){this.stopListening(),this.messageTimer&&clearTimeout(this.messageTimer),this.successButtonTimer&&clearTimeout(this.successButtonTimer)}resetErrorMessage(){this.setState({errorMessage:null})}startListening(){const{model:e}=this.props;e.addEventListener(he.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.addEventListener(he.EVENT.UPDATED,this.handleCustomColumnUpdated),e.addEventListener(he.EVENT.REQUEST_FAILED,this.handleRequestFailed)}stopListening(){const{model:e}=this.props;e.removeEventListener(he.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.removeEventListener(he.EVENT.UPDATED,this.handleCustomColumnUpdated),e.removeEventListener(he.EVENT.REQUEST_FAILED,this.handleRequestFailed)}parseCustomColumns(e){if(e.length>0){const t=e.map(n=>{const s=n.split(/=(.+)/,2);return{eventKey:Ss.makeCustomColumnInputEventKey(),name:s[0],formula:s[1]}});this.setState({inputs:t})}else this.setState({inputs:[Ss.createCustomColumnInput()]})}handleAddColumnClick(){const{inputs:e}=this.state,t=[...e];t.push(Ss.createCustomColumnInput()),this.setState({inputs:t})}handleDeleteColumn(e){const{inputs:t}=this.state,n=this.getInputIndex(t,e),s=[...t];s.splice(n,1),s.length===0&&s.push(Ss.createCustomColumnInput()),this.setState({inputs:s})}handleInputChange(e,t,n){const{inputs:s}=this.state,i=this.getInputIndex(s,e),r={...this.getInput(s,e)};r[t]=n;const l=[...s];l.splice(i,1,r),this.setState({inputs:l})}handleCustomColumnUpdated(){const{isCustomColumnApplying:e}=this.state;!e||this.setState({isCustomColumnApplying:!1,isSuccessShowing:!0},()=>{this.successButtonTimer=setTimeout(()=>this.setState({isSuccessShowing:!1}),Ss.SUCCESS_SHOW_DURATION)})}handleRequestFailed(e){const t=e,{isCustomColumnApplying:n}=this.state;!n||this.setState({isCustomColumnApplying:!1,errorMessage:T(Fe,{children:[T("p",{children:[u(q,{icon:as})," Failed to apply custom columns."]}),T("div",{className:"error-box",children:[t.detail.errorMessage,u("br",{}),"Table configuration:"," ",JSON.stringify(t.detail.configuration)]})]}),hasRequestFailed:!0})}handleDragEnd(e){if(dt.stopDragging(),!e.destination)return;const{inputs:t}=this.state,n=e.source.index,s=e.destination.index,i=[...t],o=t[n];i.splice(n,1),i.splice(s,0,o),this.setState({inputs:i})}handleEditorTabNavigation(e,t){var s,i,o;const{inputs:n}=this.state;if(t){((s=this.container)==null?void 0:s.querySelectorAll(".btn-drag-handle")[e]).focus();return}if(e===n.length-1)((i=this.container)==null?void 0:i.querySelectorAll(".btn-add-column")[e]).focus();else{const r=e+1;((o=this.container)==null?void 0:o.querySelectorAll(".custom-column-input")[r]).focus()}}handleSaveClick(){const{onSave:e}=this.props,{inputs:t,isCustomColumnApplying:n}=this.state;if(n)return;const s=[];t.forEach(i=>{const{name:o,formula:r}=i;o&&r&&s.push(`${o}=${r}`)}),this.resetErrorMessage(),this.setState({isCustomColumnApplying:!0}),e(s)}resetRequestFailed(){this.setState(({hasRequestFailed:e})=>e?{hasRequestFailed:!1}:null)}renderInputs(){const{inputs:e,hasRequestFailed:t}=this.state;return e.map((n,s)=>{const{eventKey:i,name:o,formula:r}=n;return u(or,{inputIndex:s,eventKey:i,name:o,formula:r,onChange:this.handleInputChange,onDeleteColumn:this.handleDeleteColumn,onTabInEditor:this.handleEditorTabNavigation,invalid:t},i)})}renderSaveButton(){const{inputs:e,isCustomColumnApplying:t,isSuccessShowing:n}=this.state,s=e.length>1?"Save Columns":"Save Column";return T("button",{type:"button",className:$("btn btn-apply",{"btn-spinner":t},n?"btn-success":"btn-primary"),disabled:n||t,onClick:this.handleSaveClick,children:[t&&T("span",{children:[u(Ht,{}),u("span",{className:"btn-normal-content",children:"Applying"}),u("span",{className:"btn-hover-content",children:"Applying"})]}),!n&&!t&&s,n&&T(Fe,{children:[u(q,{icon:Hl})," Success"]})]})}render(){const{onCancel:e}=this.props,{errorMessage:t}=this.state;return T("div",{role:"presentation",className:"custom-column-builder-container",ref:n=>{this.container=n},onClick:this.resetRequestFailed,onFocus:this.resetRequestFailed,children:[u("div",{className:"section-title",children:"Custom Column Name and Formula"}),u("hr",{}),u(Qs,{onDragStart:dt.startDragging,onDragEnd:this.handleDragEnd,children:u(Ys,{droppableId:"droppable-custom-columns",children:(n,s)=>T("div",{ref:n.innerRef,...n.droppableProps,className:$("droppable-container",{dragging:s.draggingFromThisWith}),children:[this.renderInputs(),n.placeholder]})})}),u("div",{className:"pt-1 px-3",children:T("button",{type:"button",className:"btn btn-link btn-add-column",onClick:this.handleAddColumnClick,children:[u(q,{icon:Ds}),"Add Another Column"]})}),T("div",{className:"custom-column-builder-footer",children:[t&&u("div",{className:"error-message",children:t}),T("div",{className:"d-flex justify-content-end",children:[u("button",{type:"button",className:"btn btn-outline-primary mr-2",onClick:e,children:"Cancel"}),this.renderSaveButton()]})]})]})}};let dr=Ss;dr.SUCCESS_SHOW_DURATION=750;dr.defaultProps={customColumns:[],onSave:()=>{},onCancel:()=>{}};var be=(e=>(e.ADVANCED_SETTINGS="ADVANCED_SETTINGS",e.AGGREGATIONS="AGGREGATIONS",e.AGGREGATION_EDIT="AGGREGATIONS_EDIT",e.CHART_BUILDER="CHART_BUILDER",e.CUSTOM_COLUMN_BUILDER="CUSTOM_COLUMN_BUILDER",e.QUICK_FILTERS="QUICK_FILTERS",e.ROLLUP_ROWS="ROLLUP_ROWS",e.SEARCH_BAR="SEARCH_BAR",e.SELECT_DISTINCT="SELECT_DISTINCT",e.TABLE_EXPORTER="TABLE_EXPORTER",e.VISIBILITY_ORDERING_BUILDER="VISIBILITY_ORDERING_BUILDER",e.CONDITIONAL_FORMATTING="CONDITIONAL_FORMATTING",e.CONDITIONAL_FORMATTING_EDIT="CONDITIONAL_FORMATTING_EDIT",e.GOTO="GOTO",e))(be||{});const Hs=ne.module("RollupRows"),Su=150,Ti="grouped-rollup-rows",Ei="ungrouped-rollup-rows",kt=class extends y.exports.Component{constructor(e){super(e),this.search=Tt(o=>{const r=this.getSortedUngroupedColumns(),l=[];let a=null;for(let c=0;c<r.length;c+=1)r[c].name.toLowerCase().includes(o.toLowerCase())&&(a==null&&(a=c),l.push([c,c]));O(a),this.setState({ungroupedSelectedRanges:l}),l.length>0&&this.ungroupedList.current&&this.ungroupedList.current.scrollToItem(a)},Su),this.getCachedUngroupedColumns=ue((o,r)=>o.filter(l=>kt.isGroupable(l)&&!r.find(a=>a===l.name))),this.getCachedSortedColumns=ue((o,r)=>r==null?[...o]:x.sortColumns(o,r===kt.SORT.ASCENDING)),this.search=this.search.bind(this),this.handleDeleteClicked=this.handleDeleteClicked.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUngroupedSelect=this.handleUngroupedSelect.bind(this),this.handleUngroupedSelectionChange=this.handleUngroupedSelectionChange.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupedSelectionChange=this.handleGroupedSelectionChange.bind(this),this.handleShowConstituentsChange=this.handleShowConstituentsChange.bind(this),this.handleShowNonAggregatedColumnsChange=this.handleShowNonAggregatedColumnsChange.bind(this),this.handleSortAscending=this.handleSortAscending.bind(this),this.handleSortDescending=this.handleSortDescending.bind(this),this.renderGroupedItem=this.renderGroupedItem.bind(this),this.ungroupedList=Y.createRef(),this.groupedList=Y.createRef();const{config:t}=e,{columns:n=[],showConstituents:s=!0,showNonAggregatedColumns:i=!0}=t!=null?t:{};this.state={ungroupedSelectedRanges:[],columns:n,groupedSelectedRanges:[],searchFilter:"",showConstituents:s,showNonAggregatedColumns:i,dragSource:null,sort:null}}static renderColumn({item:e,isClone:t,selectedCount:n}){const s=e&&e.name,i=t?`${n}`:void 0,o=t?"item-list-item-clone":"";return Ct.renderTextItem({text:s,badgeText:i,className:o})}static addGroupings(e,t,n=e.length){if(t==null||t.length===0)return e;let s=n;const i=e.filter((o,r)=>t.includes(o)?(r<s&&(s-=1),!1):!0);return i.splice(s,0,...t),i}static isGroupable(e){return!x.isDecimalType(e.type)}componentDidUpdate(e,t){const{config:n}=this.props,{columns:s,showConstituents:i,showNonAggregatedColumns:o}=this.state;n!==e.config?this.updateFromConfig():(s!==t.columns||i!==t.showConstituents||o!==t.showNonAggregatedColumns)&&(n==null||s!==n.columns||i!==n.showConstituents||o!==n.showNonAggregatedColumns)&&this.sendChange()}componentWillUnmount(){this.search.cancel()}handleSearchChange(e){const t=e.target.value;if(this.setState({searchFilter:t}),!t){this.search.cancel(),this.resetSelection();return}this.search(t)}handleSortAscending(){this.setState(({sort:e})=>({sort:e===kt.SORT.ASCENDING?null:kt.SORT.ASCENDING}))}handleSortDescending(){this.setState(({sort:e})=>({sort:e===kt.SORT.DESCENDING?null:kt.SORT.DESCENDING}))}resetSelection(){this.setState({ungroupedSelectedRanges:[],groupedSelectedRanges:[]})}handleDragStart(e){Hs.debug("handleDragStart",e),document.documentElement.classList.add("drag-pointer-events-none"),this.setState({dragSource:e.source})}handleDragEnd(e){Hs.debug("handleDragEnd",e),document.documentElement.classList.remove("drag-pointer-events-none"),this.setState({dragSource:null});const{destination:t,source:n}=e;if(t==null||n==null)return;if(t.droppableId===Ei){this.setState(({groupedSelectedRanges:o,columns:r})=>{const l=[...r];return dt.reorder(l,o,[],0),{columns:l,ungroupedSelectedRanges:[],groupedSelectedRanges:[]}});return}const s=n.droppableId===Ti;let i=t.index;s&&n.index<t.index&&(i+=1),this.setState(({columns:o,ungroupedSelectedRanges:r,groupedSelectedRanges:l})=>{const a=[...o],c=s?a:this.getSortedUngroupedColumns().map(g=>g.name),d=s?l:r,h=dt.reorder(c,d,a,i),m=s?dt.adjustDestinationIndex(i,l):i,p=[[m,m+h.length-1]];return{columns:a,ungroupedSelectedRanges:[],groupedSelectedRanges:p}}),this.resetSelection()}handleUngroupedSelect(e){Hs.debug("handleUngroupedSelect"),this.setState(({columns:t})=>({columns:kt.addGroupings(t,[this.getSortedUngroupedColumns()[e].name]),ungroupedSelectedRanges:[],groupedSelectedRanges:[]}))}handleUngroupedSelectionChange(e){Hs.debug2("handleUngroupedSelectionChange",e),this.setState(({ungroupedSelectedRanges:t})=>e===t?null:{ungroupedSelectedRanges:e,groupedSelectedRanges:[]})}handleGroupedSelectionChange(e){Hs.debug2("handleGroupedSelectedRanges",e),this.setState(({groupedSelectedRanges:t})=>e===t?null:{groupedSelectedRanges:e,ungroupedSelectedRanges:[]})}handleDeleteClicked(e){this.setState(({columns:t})=>{const n=t.slice();return n.splice(e,1),{columns:n}})}handleShowConstituentsChange(){this.setState(({showConstituents:e})=>({showConstituents:!e}))}handleShowNonAggregatedColumnsChange(){this.setState(({showNonAggregatedColumns:e})=>({showNonAggregatedColumns:!e}))}updateFromConfig(){const{config:e}=this.props,{columns:t=[],showConstituents:n=!0,showNonAggregatedColumns:s=!0}=e!=null?e:{};this.setState({columns:t,showConstituents:n,showNonAggregatedColumns:s})}sendChange(){const{onChange:e}=this.props,{columns:t,showConstituents:n,showNonAggregatedColumns:s}=this.state;e({columns:t,showConstituents:n,showNonAggregatedColumns:s})}getUngroupedColumns(){const{model:e}=this.props,{columns:t}=this.state,{originalColumns:n}=e;return this.getCachedUngroupedColumns(n,t)}getSortedUngroupedColumns(){const{sort:e}=this.state,t=this.getUngroupedColumns();return this.getCachedSortedColumns(t,e)}renderGroupedItem({item:e,itemIndex:t,isClone:n,selectedCount:s}){const o=`${n?"":"\xA0\xA0".repeat(t)}${e}`,r=n?`${s}`:void 0,l=n?"item-list-item-clone":"";return T(Fe,{children:[Ct.renderTextItem({text:o,badgeText:r,className:l}),!n&&u(De,{kind:"ghost",className:"btn btn-link btn-link-icon btn-delete-grouping float-right",onClick:()=>this.handleDeleteClicked(t),children:u(q,{icon:Ln})})]})}render(){const{columns:e,dragSource:t,searchFilter:n,groupedSelectedRanges:s,ungroupedSelectedRanges:i,showConstituents:o,showNonAggregatedColumns:r,sort:l}=this.state,a=this.getSortedUngroupedColumns();let c=e.length*Ct.DEFAULT_ROW_HEIGHT;(t==null?void 0:t.droppableId)===Ei&&(c+=Ct.DEFAULT_ROW_HEIGHT);const d=a.length*Ct.DEFAULT_ROW_HEIGHT+10,h=Math.min(3*Ct.DEFAULT_ROW_HEIGHT,d);return u("div",{role:"menu",className:$("rollup-rows",{"is-dragging":t!=null}),tabIndex:0,children:T(Qs,{onDragEnd:this.handleDragEnd,onDragStart:this.handleDragStart,children:[T("div",{className:"rollup-rows-group-by",children:[u("div",{className:"section-title",children:"Group By"}),e.length===0&&u(Ys,{isDropDisabled:!0,droppableId:"placeholder",children:(m,p)=>u("div",{className:$("placeholder","text-muted",{"is-dragging-from-this":p.draggingFromThisWith,"is-dragging-over":p.isDraggingOver,"is-dropping":p.draggingOverWith}),ref:m.innerRef,...m.droppableProps,children:"Create rollup by dragging columns here, from the available columns list below."})}),e.length>0&&u(Ct,{draggingItemClassName:"rollup-rows-dragging-grouped-item",draggablePrefix:Ti,droppableId:Ti,itemCount:e.length,items:e,offset:0,onSelectionChange:this.handleGroupedSelectionChange,ref:this.groupedList,renderItem:this.renderGroupedItem,selectedRanges:s,style:{height:c},isMultiSelect:!0})]}),T("div",{className:"rollup-rows-available-columns",children:[u("div",{className:"section-title",children:"Available Grouping Columns"}),T("div",{className:"top-menu",children:[u(Hn,{className:"w-100",value:n,matchCount:n?i.length:void 0,placeholder:"Find column...",onChange:this.handleSearchChange}),T(De,{kind:"ghost",className:$("btn-link btn-link-icon",{active:l===kt.SORT.ASCENDING}),onClick:this.handleSortAscending,children:[u(q,{icon:Ko}),u(me,{children:"Sort ascending"})]}),T(De,{kind:"ghost",className:$("btn-link btn-link-icon",{active:l===kt.SORT.DESCENDING}),onClick:this.handleSortDescending,children:[u(q,{icon:Xo}),u(me,{children:"Sort descending"})]})]}),u(Ct,{className:"rollup-available-grouping-columns",draggablePrefix:Ei,droppableId:Ei,itemCount:a.length,items:a,renderItem:kt.renderColumn,offset:0,onSelect:this.handleUngroupedSelect,onSelectionChange:this.handleUngroupedSelectionChange,ref:this.ungroupedList,selectedRanges:i,style:{maxHeight:d,minHeight:h},isDropDisabled:(t==null?void 0:t.droppableId)!==Ti,isMultiSelect:!0}),T("div",{className:"bottom-menu",children:[u("div",{className:"label",children:"Show:"}),u(It,{checked:o,onChange:this.handleShowConstituentsChange,children:"Constituents"}),u(It,{checked:r,onChange:this.handleShowNonAggregatedColumnsChange,children:"Non-Aggregated Columns"})]})]})]})})}};let hr=kt;hr.SORT=Object.freeze({ASCENDING:"ASCENDING",DESCENDING:"DESCENDING"});hr.defaultProps={config:null,onChange:()=>{}};const Re=class extends y.exports.Component{static getDateString(){return E.i18n.DateTimeFormat.format(Re.FILENAME_DATE_FORMAT,new Date)}constructor(e){super(e),this.handleDownloadClick=this.handleDownloadClick.bind(this),this.handleDownloadOptionChanged=this.handleDownloadOptionChanged.bind(this),this.handleCustomizedDownloadOptionChanged=this.handleCustomizedDownloadOptionChanged.bind(this),this.handleCustomizedDownloadRowsChanged=this.handleCustomizedDownloadRowsChanged.bind(this);const{name:t}=e;this.state={fileName:`${t}-${Re.getDateString()}.csv`,downloadOption:Re.DOWNLOAD_OPTIONS.ALL_ROWS,customizedDownloadOption:Re.CUSTOMIZED_ROWS_OPTIONS.FIRST,customizedDownloadRows:Re.DEFAULT_DOWNLOAD_ROWS,errorMessage:null,id:jt.generate()}}getSnapshotRanges(){const{model:e,selectedRanges:t}=this.props,{downloadOption:n,customizedDownloadOption:s,customizedDownloadRows:i}=this.state,{rowCount:o}=e;let r=[];switch(n){case Re.DOWNLOAD_OPTIONS.ALL_ROWS:r.push(new j(null,0,null,o-1));break;case Re.DOWNLOAD_OPTIONS.SELECTED_ROWS:r=[...t].sort((l,a)=>l.startRow&&a.startRow?l.startRow-a.startRow:0);break;case Re.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS:switch(s){case Re.CUSTOMIZED_ROWS_OPTIONS.FIRST:r.push(new j(null,0,null,Math.min(i-1,o-1)));break;case Re.CUSTOMIZED_ROWS_OPTIONS.LAST:r.push(new j(null,Math.max(0,o-i),null,o-1));break}break}return r}resetDownloadState(){this.setState({errorMessage:null})}handleDownloadClick(){const{model:e,isDownloading:t,onDownloadStart:n,onDownload:s,onCancel:i}=this.props,{fileName:o}=this.state;if(t){i();return}this.resetDownloadState();const r=this.getSnapshotRanges();this.validateOptionInput()&&(n(),e.export().then(l=>{const a=l.setViewport(0,0);a.getViewportData().then(()=>{s(o,l,a,r)})}))}handleDownloadOptionChanged(e){this.setState({downloadOption:e.target.value})}handleCustomizedDownloadOptionChanged(e){this.setState({customizedDownloadOption:e.target.value})}handleCustomizedDownloadRowsChanged(e){this.setState({customizedDownloadRows:parseInt(e.target.value,10)})}validateOptionInput(){const{selectedRanges:e}=this.props,{downloadOption:t,customizedDownloadRows:n}=this.state;return t===Re.DOWNLOAD_OPTIONS.SELECTED_ROWS&&e.length===0?(this.setState({errorMessage:T("p",{children:[u(q,{icon:as})," No rows selected. Please select some rows in the table."]})}),!1):t===Re.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS&&n<=0?(this.setState({errorMessage:T("p",{children:[u(q,{icon:as})," Number of rows to output must be greater than 0"]})}),!1):!0}render(){const{model:e,isDownloading:t,tableDownloadProgress:n,tableDownloadEstimatedTime:s,selectedRanges:i,tableDownloadStatus:o}=this.props,{fileName:r,downloadOption:l,customizedDownloadOption:a,customizedDownloadRows:c,errorMessage:d,id:h}=this.state,{rowCount:m}=e;return T("div",{className:"table-csv-exporter",children:[u("div",{className:"section-title",children:"Download Rows"}),u("div",{className:"form-group",children:T(tr,{onChange:this.handleDownloadOptionChanged,value:l,disabled:t,children:[T(gn,{value:Re.DOWNLOAD_OPTIONS.ALL_ROWS,"data-testid":"radio-csv-exporter-download-all",children:["All Rows",u("span",{className:"text-muted ml-2",children:`(${m.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")} rows)`})]}),T(gn,{value:Re.DOWNLOAD_OPTIONS.SELECTED_ROWS,"data-testid":"radio-csv-exporter-only-selected",children:["Only Selected Rows",u("span",{className:"text-muted ml-2",children:i.length>0?`(${j.rowCount(i).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")} rows)`:null})]}),u(gn,{value:Re.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS,"data-testid":"radio-csv-exporter-customized-rows",children:T("div",{className:"radio-input-row",role:"presentation",onClick:()=>{this.setState({downloadOption:Re.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS})},children:[T("select",{value:a,"data-testid":"select-csv-exporter-customized-rows",className:"custom-select",disabled:t,onChange:this.handleCustomizedDownloadOptionChanged,children:[u("option",{value:"FIRST",children:"First"}),u("option",{value:"LAST",children:"Last"})]}),u("input",{type:"number",className:"form-control",id:`customizedRows-${h}`,"data-testid":"input-csv-exporter-customized-rows",name:`customizedRows-${h}`,placeholder:"100",value:c,disabled:t,onChange:this.handleCustomizedDownloadRowsChanged}),u("div",{children:"Rows"})]})})]})}),T("div",{className:"form-group",children:[u("label",{htmlFor:`customizedRows-${h}`,children:"File Name"}),u("input",{type:"text",className:"form-control",id:`filename-${h}`,"data-testid":"input-csv-exporter-file-name",name:`filename-${h}`,value:r,onChange:p=>{this.setState({fileName:p.target.value})},disabled:t})]}),T("div",{className:"section-footer flex-column",children:[d&&u("div",{className:"error-message",children:d}),o&&T("div",{className:"download-status",children:[(o===Re.DOWNLOAD_STATUS.DOWNLOADING||o===Re.DOWNLOAD_STATUS.INITIATING)&&T(Fe,{children:[o===Re.DOWNLOAD_STATUS.INITIATING&&u("div",{className:"text-muted",children:"Starting Download..."}),o===Re.DOWNLOAD_STATUS.DOWNLOADING&&T("div",{className:"text-muted d-flex justify-content-between",children:[u("span",{children:s||s===0?`Estimated time: ${Xt.formatElapsedTime(s)}`:null}),u("span",{children:`${n}%`})]})]}),o===Re.DOWNLOAD_STATUS.FINISHED&&u("div",{className:"text-muted text-right",children:"Download Completed"}),o===Re.DOWNLOAD_STATUS.CANCELED&&u("div",{className:"text-muted",children:"Download Canceled"}),(o===Re.DOWNLOAD_STATUS.DOWNLOADING||o===Re.DOWNLOAD_STATUS.INITIATING)&&u("div",{className:"progress",children:u("div",{className:"progress-bar progress-bar-striped progress-bar-animated",style:{width:`${n}%`}})}),o===Re.DOWNLOAD_STATUS.FINISHED&&u("div",{className:"progress",children:u("div",{className:"progress-bar bg-success",style:{width:`${n}%`}})})]}),T("button",{type:"button","data-testid":"btn-csv-exporter-download",className:$("btn btn-primary btn-downloading",{"btn-spinner btn-cancelable":t}),onClick:this.handleDownloadClick,children:[t&&T("span",{children:[u(Ht,{}),u("span",{className:"btn-normal-content",children:"Downloading"}),u("span",{className:"btn-hover-content",children:"Cancel"})]}),!t&&"Download"]})]})]})}};let wt=Re;wt.FILENAME_DATE_FORMAT="yyyy-MM-dd-HHmmss";wt.DOWNLOAD_STATUS={INITIATING:"INITIATING",DOWNLOADING:"DOWNLOADING",FINISHED:"FINISHED",CANCELED:"CANCELED"};wt.DOWNLOAD_OPTIONS={ALL_ROWS:"ALL_ROWS",SELECTED_ROWS:"SELECTED_ROWS",CUSTOMIZED_ROWS:"CUSTOMIZED_ROWS"};wt.CUSTOMIZED_ROWS_OPTIONS={FIRST:"FIRST",LAST:"LAST"};wt.DEFAULT_DOWNLOAD_ROWS=100;wt.defaultProps={onDownloadStart:()=>{},isDownloading:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:null,selectedRanges:[]};const rn=ne.module("TableSaver");function vu(e){return e.added!==void 0}function Tu(e){if(!vu(e))throw new Error("event is not UpdateEventData")}const Mn=class extends y.exports.PureComponent{constructor(e){super(e),this.WritableStream=window.WritableStream||Mr,this.getCachedCustomColumnFormatFlag=St(rs.isCustomColumnFormatDefined,{max:1e4}),this.handlePortMessage=this.handlePortMessage.bind(this),this.handleSnapshotResolved=this.handleSnapshotResolved.bind(this),this.handleDownloadTimeout=this.handleDownloadTimeout.bind(this),this.state={},this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.WritableStream=window.WritableStream||Mr,this.iframes=[],this.useBlobFallback=!1}static csvEscapeString(e){return`"${e.replace(/"/g,'""')}"`}componentDidMount(){const{getDownloadWorker:e}=this.props;e().then(t=>{rn.info("found active service worker"),this.sw=t,this.sw.postMessage("ping")}).catch(t=>{rn.warn("Download csv is not optimized.",t),this.useBlobFallback=!0})}componentWillUnmount(){this.iframes.length>0&&this.iframes.forEach(e=>{e.remove()}),this.streamTimeout&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout&&clearTimeout(this.snapshotHandlerTimeout)}createWriterStream(e){const t=this.useBlobFallback,n=[];let s=null;t&&(s=TextEncoder.prototype.encode.bind(new TextEncoder));const{fileName:i}=this,o={};return t?(o.write=r=>{O(s),r.header!==void 0&&n.push(s(r.header)),r.rows!==void 0&&n.push(s(r.rows))},o.close=()=>{O(i);const r=new Blob(n,{type:"application/octet-stream; charset=utf-8"}),l=document.createElement("a");l.href=URL.createObjectURL(r),l.download=i,l.click()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}):(o.write=r=>{e.postMessage(r)},o.close=()=>{e.postMessage({end:!0}),e.close()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}),new this.WritableStream(o)}startDownload(e,t,n,s){const{isDownloading:i}=this.props;if(i)return;this.downloadStartTime=Date.now(),rn.info(`start downloading ${e}`),this.table=t,this.columns=t.columns,this.tableSubscription=n,this.gridRanges=s;const o=encodeURIComponent(e.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A"),r=new MessageChannel;if(this.port=r.port1,this.fileName=e,this.fileWriter=this.createWriterStream(this.port).getWriter(),this.useBlobFallback){this.writeCsvTable();return}this.sw&&this.sw.postMessage({encodedFileName:o},[r.port2]),this.port.onmessage=this.handlePortMessage}finishDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.close();const{onDownloadCompleted:e}=this.props;e(),this.resetTableSaver(),this.downloadStartTime&&rn.info(`download finished, total elapsed time ${(Date.now()-this.downloadStartTime)/1e3} seconds`)}cancelDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.abort(),this.cancelableSnapshots.forEach(t=>{t&&(t.catch(()=>null),t.cancel())});const{onDownloadCanceled:e}=this.props;e(),this.resetTableSaver()}resetTableSaver(){this.table=void 0,this.tableSubscription=void 0,this.columns=void 0,this.chunkRows=void 0,this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout!=null&&clearTimeout(this.snapshotHandlerTimeout),this.streamTimeout=void 0,this.snapshotHandlerTimeout=void 0}handleDownloadTimeout(){rn.info("download canceled"),this.cancelDownload()}writeTableHeader(){var t;let e="";if(this.columns)for(let n=0;n<this.columns.length;n+=1)e+=this.columns[n].name,e+=n===this.columns.length-1?`
|
|
4
4
|
`:",";(t=this.fileWriter)==null||t.write({header:e}).then(()=>null)}startWriteTableBody(){this.columns&&this.gridRanges&&(this.chunkRows=Math.floor(Mn.DOWNLOAD_CELL_CHUNK/this.columns.length),this.rangedSnapshotsTotal=this.gridRanges.map(e=>(O(e.endRow),O(e.startRow),O(this.chunkRows),Math.ceil((e.endRow-e.startRow+1)/this.chunkRows))),this.snapshotsTotal=this.rangedSnapshotsTotal.reduce((e,t)=>e+t),rn.info("start writing table, total snapshots: ",this.snapshotsTotal),this.makeSnapshot(Math.min(Mn.SNAPSHOT_BUFFER_SIZE,this.snapshotsTotal)))}writeCsvTable(){this.writeTableHeader(),this.startWriteTableBody()}writeSnapshot(e,t,n){if(this.currentSnapshotIndex===e&&this.fileWriter){for(;this.snapshotsBuffer.has(this.currentSnapshotIndex);){const s=this.snapshotsBuffer.get(this.currentSnapshotIndex);O(s),this.fileWriter.write({rows:this.convertSnapshotIntoCsv(s)}),this.snapshotsBuffer.delete(this.currentSnapshotIndex),this.currentSnapshotIndex+=1,this.updateDownloadProgress(e)}if(this.snapshotsTotal&&this.currentSnapshotIndex>=this.snapshotsTotal){this.finishDownload();return}}this.snapshotCounter&&this.snapshotsTotal&&this.snapshotCounter<this.snapshotsTotal&&(rn.debug2(`
|
|
@@ -29,4 +29,4 @@ ${t}`):s.setValue(`${t}`);const o=s.getLineCount(),r=s.getLineLength(o)+1;this.e
|
|
|
29
29
|
`&&(e+=`
|
|
30
30
|
`)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,st.bufferTimeout))}stopFlushTimer(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0)}updateDimensions(){this.editor&&this.editor.layout()}handleClearClick(){this.clearLogs()}clearLogs(){this.messages=[],this.refreshLogText()}handleFlushTimeout(){this.stopFlushTimer(),this.flush()}handleLogMessage(e){this.messages.push(e),this.editor&&this.isLogItemVisible(e)&&this.queue(e)}handleMenuItemClick(e){this.toggleLogLevel(e)}handleResetClick(){this.resetLogLevels()}handleResize(){this.updateDimensions()}handleToggleAllClick(){this.toggleAll()}render(){const e={placement:"bottom-end"},{shownLogLevels:t}=this.state,n=this.getMenuActions(t);return T("div",{className:"log-pane h-100 w-100",children:[T("div",{className:"log-pane-menu",children:[T("button",{type:"button",className:"btn btn-link btn-link-icon btn-clear-logs",onClick:this.handleClearClick,children:[u(q,{icon:Od}),u(me,{children:"Clear log"})]}),T("button",{type:"button",className:"btn btn-link btn-link-icon btn-overflow",children:[u(q,{icon:nd}),u(me,{children:"Log Settings"}),u(On,{actions:n,popperClassName:"log-level-menu-popper",popperOptions:e})]})]}),u("div",{className:"log-pane-editor h-100 w-100",ref:s=>{this.editorContainer=s}})]})}};let ei=st;ei.DefaultLogLevels=[Ye.STDOUT,Ye.ERROR,Ye.FATAL,Ye.STDERR,Ye.WARN];ei.AllLogLevels=[Ye.INFO,Ye.STDOUT,Ye.ERROR,Ye.FATAL,Ye.STDERR,Ye.WARN,Ye.DEBUG,Ye.TRACE];ei.bufferTimeout=16;ei.maxLogSize=131072;ei.truncateSize=65536;Ai.register([oc,rc,lc,ac,cc,dc]);const Zp=typeof Co=="function"?Co(Ai):Co.default(Ai),hn=class{constructor(){this.listeners=[],this.isDownsamplingDisabled=!1}getData(){return[]}getDefaultTitle(){return""}getLayout(){return{}}getFilterColumnMap(){return new Map}isFilterRequired(){return!1}setFilter(e){}close(){}setFormatter(e){this.formatter=e}setDownsamplingDisabled(e){this.isDownsamplingDisabled=e}setDimensions(e){this.rect=e}setTitle(e){this.title=e}subscribe(e){this.listeners.push(e)}unsubscribe(e){this.listeners=this.listeners.filter(t=>t!==e)}fireEvent(e){for(let t=0;t<this.listeners.length;t+=1)this.listeners[t](e)}fireUpdate(e){this.fireEvent(new CustomEvent(hn.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(hn.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(hn.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(hn.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(hn.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(hn.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(hn.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(hn.EVENT_LOADFINISHED))}};let Qe=hn;Qe.EVENT_UPDATED="ChartModel.EVENT_UPDATED";Qe.EVENT_DISCONNECT="ChartModel.EVENT_DISCONNECT";Qe.EVENT_RECONNECT="ChartModel.EVENT_RECONNECT";Qe.EVENT_DOWNSAMPLESTARTED="ChartModel.EVENT_DOWNSAMPLESTARTED";Qe.EVENT_DOWNSAMPLEFINISHED="ChartModel.EVENT_DOWNSAMPLEFINISHED";Qe.EVENT_DOWNSAMPLEFAILED="ChartModel.EVENT_DOWNSAMPLEFAILED";Qe.EVENT_DOWNSAMPLENEEDED="ChartModel.EVENT_DOWNSAMPLENEEDED";Qe.EVENT_LOADFINISHED="ChartModel.EVENT_LOADFINISHED";const Jp="#76d9e4 #9edc6f #fcd65b #aa9af4 #f37e3f #f95d84 #f0f0ee",eg="#403e41",tg="#5b5a5c",ng="#c0bfbf",sg="#4878ea",ig="rgba(91, 90, 92, 0.7)",Je={"paper-bgcolor":"#2d2a2e","plot-bgcolor":"#322f33","title-color":"#f0f0ee",colorway:Jp,gridcolor:eg,linecolor:tg,zerolinecolor:ng,activecolor:sg,rangebgcolor:ig,"area-color":"#76d9e4","trend-color":"#d5f0c1","line-color":"#9edc6f","error-band-line-color":"white","error-band-fill-color":"rgba(213, 240, 193, 0.1)","ohlc-increasing":"#9edc6f","ohlc-decreasing":"#f95d84"},ts=Object.freeze({paper_bgcolor:Je["paper-bgcolor"],plot_bgcolor:Je["plot-bgcolor"],title_color:Je["title-color"],colorway:Je.colorway,gridcolor:Je.gridcolor,linecolor:Je.linecolor,zerolinecolor:Je.zerolinecolor,activecolor:Je.activecolor,rangebgcolor:Je.rangebgcolor,area_color:Je["area-color"],trend_color:Je["trend-color"],line_color:Je["line-color"],error_band_line_color:Je["error-band-line-color"],error_band_fill_color:Je["error-band-fill-color"],ohlc_increasing:Je["ohlc-increasing"],ohlc_decreasing:Je["ohlc-decreasing"]}),Mi=ne.module("ChartUtils"),En=Object.freeze(E.calendar.DayOfWeek.values()),Sl="io.deephaven.time.DateTime",og=36e5,rg=1e6;function lg(e){return e.asDate!==void 0}function ag(e){return e.asNumber!==void 0}function vl(e){return e.dhTimeZone!==void 0}function cg(e){return e!=null&&e.range&&!e.autorange}const Z=class{static getPlotlyChartType(e,t){switch(e){case E.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case E.plot.SeriesPlotStyle.LINE:return"scatter";case E.plot.SeriesPlotStyle.BAR:case E.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case E.plot.SeriesPlotStyle.PIE:return"pie";case E.plot.SeriesPlotStyle.TREEMAP:return"treemap";case E.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case E.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}static getPlotlyChartMode(e){switch(e){case E.plot.SeriesPlotStyle.SCATTER:return"markers";case E.plot.SeriesPlotStyle.LINE:return"lines";default:return}}static getPlotlyProperty(e,t){switch(e){case E.plot.SeriesPlotStyle.PIE:switch(t){case E.plot.SourceType.X:return"labels";case E.plot.SourceType.Y:return"values"}break;case E.plot.SeriesPlotStyle.OHLC:switch(t){case E.plot.SourceType.TIME:return"x"}break;case E.plot.SeriesPlotStyle.TREEMAP:switch(t){case E.plot.SourceType.X:return"ids";case E.plot.SourceType.Y:return"values";case E.plot.SourceType.LABEL:return"labels";case E.plot.SourceType.PARENT:return"parents";case E.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case E.plot.SourceType.X:return"x";case E.plot.SourceType.Y:return"y";case E.plot.SourceType.Z:return"z";case E.plot.SourceType.X_LOW:return"xLow";case E.plot.SourceType.X_HIGH:return"xHigh";case E.plot.SourceType.Y_LOW:return"yLow";case E.plot.SourceType.Y_HIGH:return"yHigh";case E.plot.SourceType.TIME:return"time";case E.plot.SourceType.OPEN:return"open";case E.plot.SourceType.HIGH:return"high";case E.plot.SourceType.LOW:return"low";case E.plot.SourceType.CLOSE:return"close";case E.plot.SourceType.SHAPE:return"shape";case E.plot.SourceType.SIZE:return"size";case E.plot.SourceType.LABEL:return"label";case E.plot.SourceType.COLOR:return"color";case E.plot.SourceType.PARENT:return"parent";case E.plot.SourceType.HOVER_TEXT:return"hovertext";case E.plot.SourceType.TEXT:return"text";default:throw new Error(`Unrecognized source type: ${t}`)}}static getPlotlySeriesOrientation(e){var n,s;const{sources:t}=e;return t.length===2&&((s=(n=t[0])==null?void 0:n.axis)==null?void 0:s.type)===E.plot.AxisType.Y?Z.ORIENTATION.HORIZONTAL:Z.ORIENTATION.VERTICAL}static getPlotlyErrorBars(e,t,n){const s=n.map((o,r)=>o-e[r]),i=t.map((o,r)=>e[r]-o);return{type:"data",symmetric:!1,array:s,arrayminus:i}}static getPlotlyDateFormat(e,t,n){const s=n==null?void 0:n.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z","");let i;const o=e==null?void 0:e.getColumnTypeFormatter(t);return o!=null&&vl(o)&&o.dhTimeZone!=null&&o.showTimeZone&&(i=E.i18n.DateTimeFormat.format(" z",new Date,o.dhTimeZone)),{tickformat:s,ticksuffix:i,automargin:!0}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,n){if(!n)return null;const i=n.split(";")[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);O(i);const[,o,r,l,,a,c,d,h,m]=i,p=l.replace(",","").length,f=r.indexOf(",")>=0||l.indexOf(",")>=0?",":"",C=h||(d?"e":"f"),w=a.length+c.length,I=`0${p}${f}.${w}${C}`,v=Z.convertNumberPrefix(o),R=Z.convertNumberPrefix(m);return{tickformat:I,tickprefix:v,ticksuffix:R,automargin:!0}}static getPlotlyAxisFormat(e,t=null){const{axis:n,columnType:s}=e,{formatPattern:i}=n;let o=null;return x.isDateType(s)?(o=Z.getPlotlyDateFormat(t,s,i),o=Z.addTickSpacing(o,n,!0)):x.isNumberType(s)&&(o=Z.getPlotlyNumberFormat(t,s,i),o=Z.addTickSpacing(o,n,!1)),n.formatType===E.plot.AxisFormatType.CATEGORY&&(o?o.type="category":o={type:"category",tickformat:void 0,ticksuffix:void 0}),o}static addTickSpacing(e,t,n){const{gapBetweenMajorTicks:s}=t;if(s>0){const i=e||{};let o=s;return n&&(o=s/rg),t.log&&(o=Math.log(o)),i.tickmode="linear",i.dtick=o,i}return e}static getSourceForAxis(e,t){for(let n=0;n<e.series.length;n+=1){const s=e.series[n];for(let i=0;i<s.sources.length;i+=1){const o=s.sources[i];if(o.axis===t)return o}}return null}static getSeriesVisibility(e,t){var n;return(n=t==null?void 0:t.hiddenSeries)!=null&&n.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,n,s=Z.ORIENTATION.VERTICAL){return{type:e,mode:t,name:n,orientation:s}}static makeSeriesDataFromSeries(e,t,n,s=ts){const{name:i,plotStyle:o,lineColor:r,shapeColor:l,sources:a}=e,c=a.some(g=>{var f;return(f=g.axis)==null?void 0:f.businessCalendar}),d=Z.getChartType(o,c),h=Z.getPlotlyChartMode(o),m=Z.getPlotlySeriesOrientation(e),p=Z.makeSeriesData(d,h,i,m);return Z.addSourcesToSeriesData(p,o,a,t),Z.addStylingToSeriesData(p,o,s,r,l,n),p}static addSourcesToSeriesData(e,t,n,s){const i=e;for(let o=0;o<n.length;o+=1){const r=n[o],{axis:l,type:a}=r,c=Z.getPlotlyProperty(t,a);yl(i,c,[]);const d=l?Z.getAxisPropertyName(l.type):null;if(d!=null){const h=s.get(l.type);if(h){const m=h.indexOf(l),p=m>0?`${m+1}`:"";i[`${d}axis`]=`${d}${p}`}}}}static addStylingToSeriesData(e,t,n=ts,s=null,i=null,o=null){const r=e;r.marker={line:{}},r.line={width:1},t===E.plot.SeriesPlotStyle.AREA?r.fill="tozeroy":t===E.plot.SeriesPlotStyle.STACKED_AREA?r.stackgroup="stack":t===E.plot.SeriesPlotStyle.STEP?r.line.shape="hv":t===E.plot.SeriesPlotStyle.HISTOGRAM?(r.width=[],Object.assign(r.marker.line,{color:n.paper_bgcolor,width:1})):t===E.plot.SeriesPlotStyle.OHLC?(r.increasing={line:{color:n.ohlc_increasing}},r.decreasing={line:{color:n.ohlc_decreasing}}):t===E.plot.SeriesPlotStyle.PIE?(r.textinfo="label+percent",r.outsidetextfont={color:n.title_color}):t===E.plot.SeriesPlotStyle.TREEMAP&&(r.hoverinfo="text",r.textinfo="label+text",r.tiling={packing:"squarify",pad:0},r.textposition="middle center",r.outsidetextfont={color:n.title_color}),s!=null&&(t===E.plot.SeriesPlotStyle.BAR?r.marker.color=s:r.line.color=s),i!=null&&(r.marker.color=i),o!=null&&t!==E.plot.SeriesPlotStyle.PIE&&(r.visible=o)}static getAxisFormats(e,t){const n=new Map,s={tickformat:null,ticksuffix:null},{charts:i}=e;for(let o=0;o<i.length;o+=1){const r=i[o],l=Z.groupArray(r.axes,"type");for(let a=0;a<r.series.length;a+=1){const c=r.series[a],{sources:d}=c,h=d.filter(m=>m.axis);for(let m=0;m<h.length;m+=1){const p=h[m],{axis:g}=p,{type:f}=g,b=l.get(f);O(b);const C=b.indexOf(g),w=Z.getAxisPropertyName(f);if(w!=null){const S=Z.getAxisLayoutProperty(w,C);if(n.has(S))Mi.debug(`${S} already added.`);else{Mi.debug(`Adding ${S} to axisFormats.`);const I=Z.getPlotlyAxisFormat(p,t);if(I===null)n.set(S,s);else{n.set(S,I);const{businessCalendar:v}=g;if(v){const R=[],{businessPeriods:D,businessDays:F,holidays:L,timeZone:W}=v,B=t==null?void 0:t.getColumnTypeFormatter(Sl);let N;vl(B)&&(N=B.dhTimeZone);const _=N?(W.standardOffset-N.standardOffset)/60:0;L.length>0&&R.push(...Z.createRangeBreakValuesFromHolidays(L,W,N)),D.forEach(k=>R.push({pattern:"hour",bounds:[Z.periodToDecimal(k.close)+_,Z.periodToDecimal(k.open)+_]})),F.length<En.length&&Z.createBoundsFromDays(F).forEach(k=>R.push({pattern:"day of week",bounds:k})),I.rangebreaks=R}if(n.size===r.axes.length)return n}}}}}}return n}static getChartType(e,t){switch(e){case E.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return Z.getPlotlyChartType(e,t)}}static getAxisPropertyName(e){switch(e){case E.plot.AxisType.X:return"x";case E.plot.AxisType.Y:return"y";default:return null}}static getAxisSide(e){switch(e){case E.plot.AxisPosition.BOTTOM:return"bottom";case E.plot.AxisPosition.TOP:return"top";case E.plot.AxisPosition.LEFT:return"left";case E.plot.AxisPosition.RIGHT:return"right";default:return}}static getChartForSeries(e,t){const{charts:n}=e;for(let s=0;s<n.length;s+=1){const i=n[s];for(let o=0;o<i.series.length;o+=1)if(t===i.series[o])return i}return null}static getLayoutRanges(e){const t={},n=Object.keys(e).filter(s=>s.indexOf("axis")>=0);for(let s=0;s<n.length;s+=1){const i=n[s],o=e[i];cg(o)&&(t[i]=[...o.range])}return t}static updateLayoutAxes(e,t,n=0,s=0,i=null,o=ts){const r=n>0?Math.max(Z.MIN_AXIS_SIZE,Math.min(Z.AXIS_SIZE_PX/s,Z.MAX_AXIS_SIZE)):Z.DEFAULT_AXIS_SIZE,l=s>0?Math.max(Z.MIN_AXIS_SIZE,Math.min(Z.AXIS_SIZE_PX/n,Z.MAX_AXIS_SIZE)):Z.DEFAULT_AXIS_SIZE,a={left:0,bottom:0,top:1,right:1},c=Z.groupArray(t,"position");(c.get(E.plot.AxisPosition.RIGHT)||[]).length>0&&(n>0?a.right=1-Math.max(0,Math.min(Z.LEGEND_WIDTH_PX/n,Z.MAX_LEGEND_SIZE)):a.right=1-Z.DEFAULT_AXIS_SIZE);const h=e,m=Z.groupArray(t,"type"),p=[...m.keys()];for(let g=0;g<p.length;g+=1){const f=p[g],b=Z.getAxisPropertyName(f);if(b!=null){const C=m.get(f),S=f===E.plot.AxisType.Y?s:n;O(C);let I=0;for(I=0;I<C.length;I+=1){const R=C[I],D=Z.getAxisLayoutProperty(b,I);h[D]==null&&(h[D]=Z.makeLayoutAxis(f,o));const F=h[D];if(F!=null){Z.updateLayoutAxis(F,R,I,c,r,l,a);const{range:L,autorange:W}=F;if(i&&L&&!W){const B=i(R),[N,_]=B(L);Mi.debug("Setting downsample range",S,N,_),R.range(S,N,_)}else R.range(S)}}let v=Z.getAxisLayoutProperty(b,I);for(;h[v]!=null;)delete h[v],I+=1,v=Z.getAxisLayoutProperty(b,I)}}}static getAxisLayoutProperty(e,t){const n=t>0?`${t+1}`:"";return`${e!=null?e:""}axis${n}`}static updateLayoutAxis(e,t,n,s,i,o,r){var h,m,p;const a=t.type===E.plot.AxisType.Y?o:i,c=e,d=(h=t.label)!=null?h:"";if(c.title!==void 0&&typeof c.title!="string"?c.title.text=d:c.title={text:d},t.log&&(c.type="log"),c.side=Z.getAxisSide(t.position),n>0){c.overlaying=(m=Z.getAxisPropertyName(t.type))!=null?m:void 0;const g=(p=s.get(t.position))!=null?p:[],f=g.indexOf(t);f>0&&(c.anchor="free",t.position===E.plot.AxisPosition.RIGHT?c.position=r.right+(f-g.length+1)*a:t.position===E.plot.AxisPosition.TOP?c.position=r.top+(f-g.length+1)*a:t.position===E.plot.AxisPosition.BOTTOM?c.position=r.bottom+(g.length-f+1)*a:t.position===E.plot.AxisPosition.LEFT&&(c.position=r.left+(g.length-f+1)*a))}else if(t.type===E.plot.AxisType.X){const g=s.get(E.plot.AxisPosition.LEFT)||[],f=s.get(E.plot.AxisPosition.RIGHT)||[],b=Math.max(r.left,r.left+(g.length-1)*o),C=Math.min(r.right-(f.length-1)*o,r.right);c.domain=[b,C]}else if(t.type===E.plot.AxisType.Y){const g=s.get(E.plot.AxisPosition.BOTTOM)||[],f=s.get(E.plot.AxisPosition.TOP)||[],b=Math.max(r.bottom,r.bottom+(g.length-1)*i),C=Math.min(r.top-(f.length-1)*i,r.top);c.domain=[b,C]}}static periodToDecimal(e){const t=e.split(":");return Number(t[0])+Number(t[1])/60}static createBoundsFromDays(e){const t=e.map(o=>En.indexOf(o)),n=En.filter(o=>!e.includes(o)).map(o=>En.indexOf(o)),s=new Set;n.forEach(o=>{for(let r=o+1;r<o+En.length;r+=1){const l=r%En.length;if(t.includes(l)){s.add(l);break}}});const i=[];return s.forEach(o=>{for(let r=o-1;r>o-En.length;r-=1){const l=r<0?r+En.length:r;if(t.includes(l)){const a=(l+1)%7;i.push([a,o]);break}}}),i}static createRangeBreakValuesFromHolidays(e,t,n){const s=[],i=[];return e.forEach(o=>{o.businessPeriods.length>0?i.push(...Z.createPartialHoliday(o,t,n)):s.push(Z.createFullHoliday(o,t,n))}),[{values:s},...i]}static createFullHoliday(e,t,n){return Z.adjustDateForTimeZone(`${e.date.toString()} 00:00:00.000000`,t,n)}static createPartialHoliday(e,t,n){const s=e.date.toString(),i=["00:00"];e.businessPeriods.forEach(r=>{i.push(r.open),i.push(r.close)}),i.push("24:00");const o=[];for(let r=0;r<i.length;r+=2){const l=i[r],a=i[r+1];if(l!==a){const c=[Z.adjustDateForTimeZone(`${s} ${l}:00.000000`,t,n)],d=og*(Z.periodToDecimal(a)-Z.periodToDecimal(l));o.push({values:c,dvalue:d})}}return o}static adjustDateForTimeZone(e,t,n){return n&&n.standardOffset!==t.standardOffset?Z.unwrapValue(Z.wrapValue(e,Sl,t),n):e}static groupArray(e,t){return e.reduce((n,s)=>{const i=s[t],o=n.get(i)||[];return o.push(s),n.set(i,o),n},new Map)}static unwrapValue(e,t){if(e!=null){if(lg(e))return E.i18n.DateTimeFormat.format(Z.DATE_FORMAT,e,t);if(ag(e))return e.asNumber()}return e}static wrapValue(e,t,n=null){if(x.isDateType(t)&&typeof e=="string"){const s=e,i=Z.DATE_FORMAT.substr(0,e.length),o=E.i18n.DateTimeFormat.parse(i,s);if(!n)return o;const r=`${i} Z`,l=E.i18n.DateTimeFormat.format("Z",o,n),a=E.i18n.DateTimeFormat.parse(r,`${s} ${l}`),c=E.i18n.DateTimeFormat.format("Z",a,n);return E.i18n.DateTimeFormat.parse(r,`${s} ${c}`)}return e}static makeLayoutAxis(e,t=ts){const n={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}}};return e===E.plot.AxisType.X?Object.assign(n,{showgrid:!0}):e===E.plot.AxisType.Y&&Object.assign(n,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),n}static getColorwayFromTheme(e=ts){let t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):Mi.warn(`Unable to handle colorway property: ${e.colorway}`)),t}static makeDefaultLayout(e=ts){const t={...e,autosize:!0,colorway:Z.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif"},title:{font:{color:e.title_color},yanchor:"top",pad:{...Z.DEFAULT_TITLE_PADDING},y:1},legend:{font:{color:e.title_color}},margin:{...Z.DEFAULT_MARGIN},xaxis:Z.makeLayoutAxis(E.plot.AxisType.X,e),yaxis:Z.makeLayoutAxis(E.plot.AxisType.Y,e)};return t.datarevision=0,t}static hydrateSettings(e){return{...e,type:E.plot.SeriesPlotStyle[e.type]}}static titleFromSettings(e){const{series:t,xAxis:n,title:s=`${t.join(", ")} by ${n}`}=e;return s}static makeFigureSettings(e,t){const{series:n,xAxis:s,type:i}=e,o=Z.titleFromSettings(e),r={formatType:`${E.plot.AxisFormatType.NUMBER}`,type:`${E.plot.AxisType.X}`,position:`${E.plot.AxisPosition.BOTTOM}`},l={formatType:`${E.plot.AxisFormatType.NUMBER}`,type:`${E.plot.AxisType.Y}`,position:`${E.plot.AxisPosition.LEFT}`};return{charts:[{chartType:`${E.plot.ChartType.XY}`,axes:[r,l],series:n.map(a=>({plotStyle:`${i}`,name:a,dataSources:[{type:`${E.plot.SourceType.X}`,columnName:s,axis:r,table:t},{type:`${E.plot.SourceType.Y}`,columnName:a,axis:l,table:t}]}))}],title:o}}};let Ee=Z;Ee.DEFAULT_AXIS_SIZE=.15;Ee.MIN_AXIS_SIZE=.025;Ee.MAX_AXIS_SIZE=.2;Ee.AXIS_SIZE_PX=75;Ee.LEGEND_WIDTH_PX=50;Ee.MAX_LEGEND_SIZE=.25;Ee.ORIENTATION=Object.freeze({HORIZONTAL:"h",VERTICAL:"v"});Ee.DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSS";Ee.DEFAULT_MARGIN=Object.freeze({l:60,r:50,t:30,b:60,pad:0});Ee.DEFAULT_TITLE_PADDING=Object.freeze({t:8});Ee.SUBTITLE_LINE_HEIGHT=25;const yn=ne.module("Chart"),Gs=class extends y.exports.Component{constructor(e){super(e),this.getCachedConfig=Ne((t,n,s,i)=>{const o=[];if(t&&o.push({name:`Downsampling failed: ${t}`,click:()=>{},icon:Gs.convertIcon(Ul),attr:"fill-warning"}),n||s||i||t){const r=Gs.downsampleButtonTitle(s,i),l=Gs.downsampleButtonAttr(s,i),a=s?Ll:Rd;o.push({name:r,icon:Gs.convertIcon(a),click:this.handleDownsampleClick,attr:l})}return{displaylogo:!1,displayModeBar:s||t?!0:"hover",modeBarButtons:[o,["toImage"],["zoom2d","pan2d"],["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]]}}),this.handleAfterPlot=this.handleAfterPlot.bind(this),this.handleDownsampleClick=this.handleDownsampleClick.bind(this),this.handleModelEvent=this.handleModelEvent.bind(this),this.handlePlotUpdate=this.handlePlotUpdate.bind(this),this.handleRelayout=this.handleRelayout.bind(this),this.handleRestyle=this.handleRestyle.bind(this),this.plot=Y.createRef(),this.plotWrapper=Y.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,this.state={data:null,downsamplingError:null,isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,layout:{datarevision:0},revision:0}}static convertIcon(e){const[t,,,,n]=e.icon,s=`${n}`;return{width:t,path:s,ascent:t,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"}componentDidMount(){this.updateDimensions(),this.updateModelDimensions(),this.initData(),this.initFormatter();const{isActive:e}=this.props;e&&this.subscribe()}componentDidUpdate(e){const{isActive:t,settings:n}=this.props;this.updateFormatterSettings(n),t!==e.isActive&&(t?this.subscribe():this.unsubscribe())}componentWillUnmount(){this.unsubscribe()}getPlotRect(){var e,t;return(t=(e=this.plotWrapper.current)==null?void 0:e.getBoundingClientRect())!=null?t:null}initData(){const{model:e}=this.props,{layout:t}=this.state;this.setState({data:e.getData(),layout:{...t,...e.getLayout()}})}subscribe(){if(this.isSubscribed)return;const{model:e}=this.props;if(!this.rect||this.rect.width===0||this.rect.height===0){yn.debug2("Delaying subscription until model dimensions are set");return}e.subscribe(this.handleModelEvent),this.isSubscribed=!0}unsubscribe(){if(!this.isSubscribed)return;const{model:e}=this.props;e.unsubscribe(this.handleModelEvent),this.isSubscribed=!1}handleAfterPlot(){this.plot.current}handleDownsampleClick(){this.setState(({isDownsamplingDisabled:e})=>({downsamplingError:null,isDownsampleInProgress:!1,isDownsampleFinished:!1,isDownsamplingDisabled:!e}),()=>{const{model:e}=this.props,{isDownsamplingDisabled:t}=this.state;e.setDownsamplingDisabled(t)})}handleModelEvent(e){const{type:t,detail:n}=e;switch(yn.debug2("Received data update",t,n),t){case Qe.EVENT_UPDATED:{this.currentSeries+=1,this.setState(i=>{const{layout:o,revision:r}=i;return typeof o.datarevision=="number"&&(o.datarevision+=1),{data:n,layout:o,revision:r+1}});const{onUpdate:s}=this.props;s({isLoading:!this.isLoadedFired});break}case Qe.EVENT_LOADFINISHED:{const{onUpdate:s}=this.props;this.isLoadedFired=!0,s({isLoading:!1});break}case Qe.EVENT_DISCONNECT:{const{onDisconnect:s}=this.props;s();break}case Qe.EVENT_RECONNECT:{const{onReconnect:s}=this.props;s();break}case Qe.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case Qe.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case Qe.EVENT_DOWNSAMPLENEEDED:case Qe.EVENT_DOWNSAMPLEFAILED:{const s=n.message?n.message:n;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:s});const{onError:i}=this.props;i(new Error(s));break}default:yn.debug("Unknown event type",t,e)}}handlePlotUpdate(e){const{layout:t}=e,n=Ee.getLayoutRanges(t);!ct(n,this.ranges)&&(this.ranges=n,this.updateModelDimensions(!0))}handleRelayout(e){if(yn.debug("handleRelayout",e),e.hiddenlabels!=null){const{onSettingsChanged:t}=this.props,n=[...e.hiddenlabels];t({hiddenSeries:n})}this.updateModelDimensions()}handleRestyle([e,t]){if(yn.debug("handleRestyle",e,t),Object.keys(e).includes("visible")){const{data:n}=this.state,{onSettingsChanged:s}=this.props;if(n!=null){const i=n.reduce((o,{name:r,visible:l})=>r!=null&&l==="legendonly"?[...o,r]:o,[]);s({hiddenSeries:i})}}}updateModelDimensions(e=!1){const t=this.getPlotRect();if(!t){yn.warn("Unable to get plotting rect");return}if(!this.rect||this.rect.width!==t.width||this.rect.height!==t.height||e){this.rect=t;const{isActive:s,model:i}=this.props;i.setDimensions(t),s&&this.subscribe()}}initFormatter(){const{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){const t=rs.getColumnFormats(e),n=rs.getDateTimeFormatterOptions(e),{decimalFormatOptions:s={},integerFormatOptions:i={}}=e;(!ct(this.columnFormats,t)||!ct(this.dateTimeFormatterOptions,n)||!ct(this.decimalFormatOptions,s)||!ct(this.integerFormatOptions,i))&&(this.columnFormats=rs.getColumnFormats(e),this.dateTimeFormatterOptions=n,this.decimalFormatOptions=s,this.integerFormatOptions=i,this.updateFormatter())}updateFormatter(){const e=new Qt(this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions),{model:t}=this.props;t.setFormatter(e)}updateDimensions(){const e=this.getPlotRect();this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&Ai.relayout(this.plot.current.el,{autosize:!0}).catch(t=>{yn.debug("Unable to resize, promise rejected",t)})}render(){const{data:e,downsamplingError:t,isDownsampleFinished:n,isDownsampleInProgress:s,isDownsamplingDisabled:i,layout:o,revision:r}=this.state,l=this.getCachedConfig(t,n,s,i),a=e!=null;return u("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:a&&u(Zp,{ref:this.plot,data:e,layout:o,revision:r,config:l,onAfterPlot:this.handleAfterPlot,onError:yn.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}})})}};let dg=Gs;dg.defaultProps={isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:kn.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}};const et=ne.module("FigureChartModel"),Ya=class extends Qe{constructor(e,t={},n=ts){super(),this.addPendingSeries=Tt(()=>{const{pendingSeries:s}=this;for(let i=0;i<s.length;i+=1){const o=s[i];this.addSeries(o),o.subscribe()}this.pendingSeries=[]},Ya.ADD_SERIES_DEBOUNCE),this.getTimeZone=ue((s,i)=>{if(i!=null){const o=i.getColumnTypeFormatter(s);if(o!=null)return o.dhTimeZone}return null}),this.getValueTranslator=ue((s,i)=>{const o=this.getTimeZone(s,i);return r=>Ee.unwrapValue(r,o)}),this.getValueParser=ue((s,i)=>{const o=this.getTimeZone(s,i);return r=>Ee.wrapValue(r,s,o)}),this.getRangeParser=ue((s,i)=>o=>{let[r,l]=o;const a=this.getValueParser(s,i);return r=a(r),l=a(l),[r,l]}),this.getAxisRangeParser=ue((s,i)=>o=>{const r=Ee.getSourceForAxis(s,o);return r?this.getRangeParser(r.columnType,i):l=>l}),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.figure=e,this.settings=t,this.theme=n,this.data=[],this.layout=Ee.makeDefaultLayout(n),this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){return this.figure.charts.length>0?this.figure.charts[0].title:""}initAllSeries(){this.oneClicks=[],this.filterColumnMap.clear();const{charts:e}=this.figure,t=[];for(let i=0;i<e.length;i+=1){const o=e[i];for(let r=0;r<o.series.length;r+=1){const l=o.series[r];t.push(l.name),this.addSeries(l)}}const s=[...this.seriesDataMap.keys()].filter(i=>t.indexOf(i)<0);for(let i=0;i<s.length;i+=1){const o=s[i];this.seriesDataMap.delete(o)}this.seriesToProcess=new Set([...this.seriesDataMap.keys()])}addSeries(e){const t=Ee.getChartForSeries(this.figure,e);if(t==null){et.error("Unable to find matching chart for series",e);return}const n=Ee.groupArray(t.axes,"type"),s=Ee.makeSeriesDataFromSeries(e,n,Ee.getSeriesVisibility(e.name,this.settings),this.theme);if(this.seriesDataMap.set(e.name,s),this.data=[...this.seriesDataMap.values()],e.plotStyle===E.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===E.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=Ee.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===E.plot.SeriesPlotStyle.PIE,e.oneClick){const{oneClick:i}=e,{columns:o}=i;for(let r=0;r<o.length;r+=1)this.filterColumnMap.set(o[r].name,o[r]);this.oneClicks.push(i)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){et.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?E.plot.DownsampleOptions.DISABLE:E.plot.DownsampleOptions.DEFAULT)}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){this.figure.addEventListener(E.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(E.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(E.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(E.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(E.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(E.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(E.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(E.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(E.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){this.figure.removeEventListener(E.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(E.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(E.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(E.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(E.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(E.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(E.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(E.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(E.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){et.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){et.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){et.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){et.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){const{detail:t}=e,{series:n}=t;et.debug2("handleFigureUpdated",n);for(let i=0;i<n.length;i+=1){const o=n[i];et.debug2("handleFigureUpdated updating series",o.name);const{sources:r}=o;for(let l=0;l<r.length;l+=1){const a=r[l],{columnType:c,type:d}=a,h=this.getValueTranslator(c,this.formatter),m=t.getArray(o,d,h);this.setDataArrayForSeries(o,d,m)}this.seriesToProcess.delete(o.name),this.seriesToProcess.size===0&&this.fireLoadFinished(),this.cleanSeries(o)}const{data:s}=this;this.fireUpdate(s)}handleRequestFailed(e){et.error("Request failed",e)}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){et.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){et.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){const{detail:t}=e;et.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var s,i;super.setTitle(e);const t=(i=(s=(e!=null?e:"").match(/<br>/g))==null?void 0:s.length)!=null?i:0,n=Ee.DEFAULT_MARGIN.t+t*Ee.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=n:this.layout.margin={t:n},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title={...this.layout.title},this.layout.title.text=e,this.layout.title.pad={...this.layout.title.pad},this.layout.title.pad.t=Ee.DEFAULT_TITLE_PADDING.t+t*Ee.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,n,s;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((t=(e=this.layout.margin)==null?void 0:e.l)!=null?t:0)-((s=(n=this.layout.margin)==null?void 0:n.r)!=null?s:0),0)}getPlotHeight(){var e,t,n,s;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((t=(e=this.layout.margin)==null?void 0:e.t)!=null?t:0)-((s=(n=this.layout.margin)==null?void 0:n.b)!=null?s:0),0)}updateAxisPositions(){const e=this.getPlotWidth(),t=this.getPlotHeight();for(let n=0;n<this.figure.charts.length;n+=1){const s=this.figure.charts[n],i=this.getAxisRangeParser(s,this.formatter);Ee.updateLayoutAxes(this.layout,s.axes,e,t,i,this.theme)}}updateLayoutFormats(){if(!this.formatter)return;Ee.getAxisFormats(this.figure,this.formatter).forEach((t,n)=>{et.debug(`Assigning ${n}`,this.layout[n],t),this.layout[n]!=null?Object.assign(this.layout[n],t):et.debug(`Ignoring null layout.${n}`)})}setDataArrayForSeries(e,t,n){const{name:s,plotStyle:i}=e,o=this.seriesDataMap.get(s),r=Ee.getPlotlyProperty(i,t);o&&yl(o,r,n)}cleanSeries(e){const{name:t,plotStyle:n}=e,s=this.seriesDataMap.get(t);if(s!=null){if(n===E.plot.SeriesPlotStyle.HISTOGRAM){const{xLow:i,xHigh:o}=s;if(i&&o&&i.length===o.length){const r=[];for(let l=0;l<i.length;l+=1)r.push(o[l]-i[l]);s.width=r}}else if(n===E.plot.SeriesPlotStyle.LINE){const{x:i,xLow:o,xHigh:r,y:l,yLow:a,yHigh:c}=s;o&&r&&o!==i&&(s.error_x=Ee.getPlotlyErrorBars(i,o,r)),a&&c&&a!==l&&(s.error_y=Ee.getPlotlyErrorBars(l,a,c))}else if(n===E.plot.SeriesPlotStyle.TREEMAP){const{ids:i,labels:o}=s;i!==void 0&&o===void 0&&(s.labels=i)}}}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){return new Map(this.filterColumnMap)}isFilterRequired(){return this.oneClicks.find(e=>e.requireAllFiltersToDisplay)!=null}setFilter(e){if(this.oneClicks.length===0){et.warn("Trying to set a filter, but no one click!");return}et.debug("setFilter",e);for(let t=0;t<this.oneClicks.length;t+=1){const n=this.oneClicks[t],{columns:s}=n;new Set([...e.keys(),...this.lastFilter.keys()]).forEach(o=>{const r=e.get(o);this.lastFilter.get(o)!==r&&s.find(l=>l.name===o)!=null&&n.setValueForColumn(o,r)})}this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}};let hg=Ya;hg.ADD_SERIES_DEBOUNCE=50;function ug({text:e,isOpen:t,onClose:n}){const[s,i]=y.exports.useState(!1),[o,r]=y.exports.useState(0),[l,a]=y.exports.useState(!1),[c,d]=y.exports.useState(!1),[h,m]=y.exports.useState(!1),p=y.exports.useRef(),g=y.exports.useRef(null),[f,b]=y.exports.useState(!1);y.exports.useEffect(function(){if(!!t){try{JSON.parse(e),m(!0)}catch{m(!1)}d(!1)}},[t,e]),y.exports.useEffect(function(){p.current&&p.current.layout()},[o]),y.exports.useEffect(function(){p.current&&p.current.updateOptions({lineNumbers:l?"on":"off"})},[l]),y.exports.useEffect(()=>(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(!1)},1e3),()=>{g.current&&clearTimeout(g.current)}),[f]);function C(){var D,F;Se.copyToClipboard((F=(D=p.current)==null?void 0:D.getValue())!=null?F:e).then(()=>{b(!0)})}function w(){a(!l)}function S(){var F;const D=(F=p.current)==null?void 0:F.getModel();!h||!D||(c?(D.setValue(e),d(!1)):(D.setValue(JSON.stringify(JSON.parse(e),void 0,2)),d(!0)),I())}function I(){var F,L;const D=p.current;!D||a(((L=(F=D.getModel())==null?void 0:F.getLineCount())!=null?L:0)>1)}function v(){s&&(p.current=void 0,n())}function R(D){p.current=D,D.onDidContentSizeChange(({contentHeight:F})=>r(F)),I()}return!t&&!s?null:T(zc,{isOpen:t,centered:!0,keyboard:!0,toggle:v,onOpened:()=>i(!0),onClosed:()=>{i(!1),r(0)},className:"theme-bg-dark cell-overflow-modal",children:[T(Gc,{toggle:n,children:[u("h5",{className:"overflow-modal-title",children:"Cell Contents"}),u(De,{kind:"inline",icon:f?Pl:xl,tooltip:f?"Copied contents":"Copy contents",onClick:C}),u(De,{kind:"inline",active:l,icon:rd,tooltip:"Toggle line numbers",onClick:w}),h&&u(De,{kind:"inline",icon:sd,active:c,tooltip:"Format as JSON",onClick:S})]}),u($c,{style:{height:o},children:u(Cr,{onEditorInitialized:R,settings:{value:e,readOnly:!0,wordWrap:"on",language:h?"typescript":"plaintext",folding:h,padding:{bottom:16},lineNumbers:l?"on":"off",overviewRulerLanes:0,renderLineHighlight:"none",find:{seedSearchStringFromSelection:"never"}}})})]})}const mg="###,##0",pg=({gotoRow:e,gotoRowError:t,onSubmit:n,isShown:s,onEntering:i,onEntered:o,onExiting:r,onExited:l,model:a,onGotoRowNumberChanged:c,onClose:d})=>{const h=y.exports.useRef(null),m="Row number",{rowCount:p}=a;return y.exports.useEffect(()=>{var g;document.activeElement!==h.current&&((g=h.current)==null||g.select())},[e]),u(eo,{isShown:s,className:$("goto-row"),onEntering:i,onEntered:()=>{var g;o(),(g=h.current)==null||g.select()},onExiting:r,onExited:l,children:T(Fe,{children:[T("div",{className:"goto-row-wrapper",children:[u("div",{className:"goto-row-text",children:"Go to row"}),u("div",{className:"goto-row-input",children:u("input",{ref:h,type:"number",onKeyDown:g=>{g.key==="Enter"&&(g.stopPropagation(),g.preventDefault(),n())},className:$("form-control",{"is-invalid":t!==""}),placeholder:m,onChange:g=>{c(g)},value:e})}),T("div",{className:"goto-row-text",children:["of ",dh.i18n.NumberFormat.format(mg,p)]}),t&&u("div",{className:"goto-row-error text-danger",children:t})]}),u("div",{className:"goto-row-close",children:u(De,{kind:"ghost",onClick:d,children:u(q,{icon:Gi,style:{marginRight:"0"}})})})]})})},oe=ne.module("IrisGrid"),gg=500,fg=250,Cg=250,Qa=Object.freeze({aggregations:[],showOnTop:!1});function Tl({advancedFilters:e,aggregationSettings:t,customColumns:n,quickFilters:s,reverseType:i,rollupConfig:o,searchFilter:r,selectDistinctColumns:l,sorts:a}){return e.size===0&&t.aggregations.length===0&&n.length===0&&s.size===0&&i===x.REVERSE_TYPE.NONE&&o==null&&r==null&&l.length===0&&a.length===0}const ns=class extends y.exports.Component{constructor(e){super(e),this.getAdvancedMenuOpenedHandler=ue(P=>this.handleAdvancedMenuOpened.bind(this,P),{max:100}),this.getCachedAdvancedFilterMenuActions=ue((P,H,V,G,Q)=>u(pr,{model:P,column:H,onFilterChange:this.handleAdvancedFilterChange,onSortChange:this.handleAdvancedFilterSortChange,onDone:this.handleAdvancedFilterDone,options:V,sortDirection:G,formatter:Q}),{max:50}),this.getCachedOptionItems=ue((P,H,V,G,Q,J,re,Ce,de,ve,_e,Ke,Dt,Xe,Ze)=>{const Le=[];return P&&Le.push({type:be.CHART_BUILDER,title:"Chart Builder",icon:Id}),Le.push({type:be.VISIBILITY_ORDERING_BUILDER,title:"Column Visibility & Ordering",icon:ko}),V&&Le.push({type:be.CONDITIONAL_FORMATTING,title:"Conditional Formatting",icon:Ol}),H&&Le.push({type:be.CUSTOM_COLUMN_BUILDER,title:"Manage Custom Columns",icon:pd}),G&&Le.push({type:be.ROLLUP_ROWS,title:"Rollup Rows",icon:Ad}),Q&&Le.push({type:be.AGGREGATIONS,title:"Aggregate Columns",icon:gd}),J&&Le.push({type:be.SELECT_DISTINCT,title:"Select Distinct Values",icon:md}),re&&Dt&&Le.push({type:be.TABLE_EXPORTER,title:"Download CSV",icon:Jc}),Le.push({type:be.ADVANCED_SETTINGS,title:"Advanced Settings",icon:fd}),Le.push({type:be.QUICK_FILTERS,title:"Quick Filters",subtitle:Ce.shortcut.getDisplayText(),icon:ki,isOn:_e,onChange:Ce.action}),Xe&&Le.push({type:be.SEARCH_BAR,title:"Search Bar",subtitle:de.shortcut.getDisplayText(),icon:_l,isOn:Ke,onChange:de.action}),Le.push({type:be.GOTO,title:"Go to",subtitle:ve.shortcut.getDisplayText(),icon:ud,isOn:Ze,onChange:ve.action}),Le},{max:1}),this.getCachedHiddenColumns=ue(P=>P,{max:1,normalizer:([P])=>P.join()}),this.getAggregationMap=ue((P,H)=>{const V={};return H.forEach(({operation:G,selected:Q,invert:J})=>{V[G]=Fn.getOperationColumnNames(P,G,Q,J)}),V}),this.getOperationMap=ue((P,H)=>{const V={};return H.filter(G=>!Fn.isRollupOperation(G.operation)).forEach(({operation:G,selected:Q,invert:J})=>{Fn.getOperationColumnNames(P,G,Q,J).forEach(re=>{var de;const Ce=[...(de=V[re])!=null?de:[],G];V[re]=Ce})}),V}),this.getOperationOrder=ue(P=>P.map(H=>H.operation).filter(H=>!Fn.isRollupOperation(H))),this.getCachedFormatColumns=ue((P,H)=>Zu(P,H)),this.getCachedModelColumns=ue((P,H)=>P.columns),this.getCachedPreviewFormatColumns=ue((P,H,V,G)=>{if(oe.debug("getCachedPreviewFormatColumns",H,V,G),V!==void 0&&G!==void 0){const Q=[...H];return Q[G]=V,this.getCachedFormatColumns(P,Q)}return this.getCachedFormatColumns(P,H)}),this.getModelRollupConfig=ue((P,H,V)=>te.getModelRollupConfig(P,H,V)),this.getModelTotalsConfig=ue((P,H,V)=>{var Ce,de,ve;const{aggregations:G,showOnTop:Q}=V;if(((de=(Ce=H==null?void 0:H.columns)==null?void 0:Ce.length)!=null?de:0)>0||((ve=G==null?void 0:G.length)!=null?ve:0)===0)return null;const J=this.getOperationMap(P,G),re=this.getOperationOrder(G);return{operationMap:J,operationOrder:re,showOnTop:Q}}),this.getCachedStateOverride=ue((P,H,V,G,Q,J,re,Ce,de,ve)=>({hoverSelectColumn:P,isFilterBarShown:H,isSelectingColumn:V,loadingScrimProgress:G,quickFilters:Q,advancedFilters:J,sorts:re,reverseType:Ce,rollupConfig:de,isMenuShown:ve}),{max:1}),this.getCachedFilter=ue((P,H,V,G,Q)=>[...P!=null?P:[],...G!=null?G:[],...te.getFiltersFromFilterMap(H),...te.getFiltersFromFilterMap(V),...Q!=null?Q:[]],{max:1}),this.getCachedTheme=ue((P,H)=>({...Ra,...P,autoSelectRow:!H}),{max:1}),this.getAlwaysFetchColumns=ue((P,H,V,G,Q,J)=>{const re=[];for(let de=0;de<G;de+=1)re.push(H[U.getModelIndex(de,V)].name);for(let de=0;de<Q;de+=1)re.push(H[U.getModelIndex(H.length-1-de,V)].name);if(J)for(let de=J[0];de<=J[1];de+=1)re.push(H[U.getModelIndex(de,V)].name);return[...new Set([...P,...re])]}),this.updateSearchFilter=Tt((P,H,V,G)=>{const Q=Ii.createSearchFilter(P,H,V,G);this.setState({searchFilter:Q})},fg),this.handleConditionalFormatEditorUpdate=Tt(P=>{this.setState({conditionalFormatPreview:P})},Cg),this.handleDownloadProgressUpdate=Xs((P,H)=>{const{tableDownloadStatus:V}=this.state;V===wt.DOWNLOAD_STATUS.DOWNLOADING&&this.setState({tableDownloadProgress:P,tableDownloadEstimatedTime:H})},gg),this.getOverflowButtonTooltip=ue(P=>{if(P==null)return null;const H={position:"absolute",...P,pointerEvents:"none"};return u("div",{style:H,children:u(me,{options:{placement:"left",modifiers:{flip:{behavior:["left","right"]}}},ref:this.handleTooltipRef,children:"View full contents"},Date.now())})}),this.handleAdvancedFilterChange=this.handleAdvancedFilterChange.bind(this),this.handleAdvancedFilterSortChange=this.handleAdvancedFilterSortChange.bind(this),this.handleAdvancedFilterDone=this.handleAdvancedFilterDone.bind(this),this.handleAdvancedMenuOpened=this.handleAdvancedMenuOpened.bind(this),this.handleGotoRowOpened=this.handleGotoRowOpened.bind(this),this.handleGotoRowClosed=this.handleGotoRowClosed.bind(this),this.handleAdvancedMenuClosed=this.handleAdvancedMenuClosed.bind(this),this.handleAggregationChange=this.handleAggregationChange.bind(this),this.handleAggregationsChange=this.handleAggregationsChange.bind(this),this.handleAggregationEdit=this.handleAggregationEdit.bind(this),this.handleAnimationLoop=this.handleAnimationLoop.bind(this),this.handleAnimationStart=this.handleAnimationStart.bind(this),this.handleAnimationEnd=this.handleAnimationEnd.bind(this),this.handleChartChange=this.handleChartChange.bind(this),this.handleChartCreate=this.handleChartCreate.bind(this),this.handleGridError=this.handleGridError.bind(this),this.handleFilterBarChange=this.handleFilterBarChange.bind(this),this.handleFilterBarDone=this.handleFilterBarDone.bind(this),this.handleFilterBarTab=this.handleFilterBarTab.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleMenu=this.handleMenu.bind(this),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleMenuSelect=this.handleMenuSelect.bind(this),this.handleMenuBack=this.handleMenuBack.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleSelectionChanged=this.handleSelectionChanged.bind(this),this.handleMovedColumnsChanged=this.handleMovedColumnsChanged.bind(this),this.handleUpdate=this.handleUpdate.bind(this),this.handleTooltipRef=this.handleTooltipRef.bind(this),this.handleViewChanged=this.handleViewChanged.bind(this),this.handleFormatSelection=this.handleFormatSelection.bind(this),this.handleConditionalFormatCreate=this.handleConditionalFormatCreate.bind(this),this.handleConditionalFormatEdit=this.handleConditionalFormatEdit.bind(this),this.handleConditionalFormatsChange=this.handleConditionalFormatsChange.bind(this),this.handleConditionalFormatEditorSave=this.handleConditionalFormatEditorSave.bind(this),this.handleConditionalFormatEditorCancel=this.handleConditionalFormatEditorCancel.bind(this),this.handleUpdateCustomColumns=this.handleUpdateCustomColumns.bind(this),this.handleCustomColumnsChanged=this.handleCustomColumnsChanged.bind(this),this.handleSelectDistinctChanged=this.handleSelectDistinctChanged.bind(this),this.handlePendingDataUpdated=this.handlePendingDataUpdated.bind(this),this.handlePendingCommitClicked=this.handlePendingCommitClicked.bind(this),this.handlePendingDiscardClicked=this.handlePendingDiscardClicked.bind(this),this.handleGotoRowSelectedRowNumberSubmit=this.handleGotoRowSelectedRowNumberSubmit.bind(this),this.focusRowInGrid=this.focusRowInGrid.bind(this),this.handleDownloadTable=this.handleDownloadTable.bind(this),this.handleDownloadTableStart=this.handleDownloadTableStart.bind(this),this.handleCancelDownloadTable=this.handleCancelDownloadTable.bind(this),this.handleDownloadCanceled=this.handleDownloadCanceled.bind(this),this.handleDownloadCompleted=this.handleDownloadCompleted.bind(this),this.handlePartitionAppend=this.handlePartitionAppend.bind(this),this.handlePartitionChange=this.handlePartitionChange.bind(this),this.handlePartitionFetchAll=this.handlePartitionFetchAll.bind(this),this.handlePartitionDone=this.handlePartitionDone.bind(this),this.handleColumnVisibilityChanged=this.handleColumnVisibilityChanged.bind(this),this.handleCrossColumnSearch=this.handleCrossColumnSearch.bind(this),this.handleRollupChange=this.handleRollupChange.bind(this),this.handleOverflowClose=this.handleOverflowClose.bind(this),this.getColumnBoundingRect=this.getColumnBoundingRect.bind(this),this.handleGotoRowSelectedRowNumberChanged=this.handleGotoRowSelectedRowNumberChanged.bind(this),this.grid=null,this.gridWrapper=null,this.lastLoadedConfig=null,this.pending=new Yi,this.globalColumnFormats=[],this.decimalFormatOptions={},this.integerFormatOptions={},this.truncateNumbersWithPound=!1,this.renderer=new Ks,this.tableSaver=null,this.crossColumnRef=Y.createRef(),this.isAnimating=!1,this.filterInputRef=Y.createRef(),this.toggleFilterBarAction={action:()=>this.toggleFilterBar(),shortcut:Lt.TABLE.TOGGLE_QUICK_FILTER},this.toggleSearchBarAction={action:()=>this.toggleSearchBar(),shortcut:Lt.TABLE.TOGGLE_SEARCH},this.toggleGotoRowAction={action:()=>this.toggleGotoRow(),shortcut:Lt.TABLE.GOTO_ROW},this.discardAction={action:()=>{const{model:P}=this.props;Ae(P)&&P.isEditable&&P.pendingDataMap.size>0&&this.discardPending().catch(oe.error)},shortcut:Lt.INPUT_TABLE.DISCARD},this.commitAction={action:()=>{const{model:P}=this.props;Ae(P)&&P.isEditable&&P.pendingDataMap.size>0&&P.pendingDataErrors.size===0&&this.commitPending().catch(oe.error)},shortcut:Lt.INPUT_TABLE.COMMIT},this.contextActions=[this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,this.discardAction,this.commitAction];const{aggregationSettings:t,conditionalFormats:n,customColumnFormatMap:s,isFilterBarShown:i,isSelectingPartition:o,model:r,movedColumns:l,movedRows:a,partition:c,partitionColumn:d,rollupConfig:h,userColumnWidths:m,userRowHeights:p,showSearchBar:g,searchValue:f,selectedSearchColumns:b,invertSearchColumns:C,advancedFilters:w,quickFilters:S,selectDistinctColumns:I,pendingDataMap:v,canCopy:R,frozenColumns:D}=e,F=[new rm(this),new lm(this)];R&&F.push(new sm(this));const L=[new am(this),new cm(this),new dm(this),new pm(this),new mm(this),new Cn(this),new um(this),new gm(this)],W=l.length>0?l:r.movedColumns,B=a.length>0?a:r.movedRows,N=new bm({userColumnWidths:new Map(m),userRowHeights:new Map(p),movedColumns:W}),_=b!=null?b:[],k=Ii.createSearchFilter(f,_,r.columns,C);this.state={isFilterBarShown:i,isSelectingPartition:o,focusedFilterBarColumn:null,metricCalculator:N,metrics:void 0,keyHandlers:F,mouseHandlers:L,partition:c,partitionColumn:d,partitionTable:null,partitionFilters:[],quickFilters:S?new Map(S):new Map,advancedFilters:new Map(w),shownAdvancedFilter:null,hoverAdvancedFilter:null,sorts:[],reverseType:x.REVERSE_TYPE.NONE,customColumns:[],selectDistinctColumns:I,selectedRanges:[],copyOperation:null,loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1,movedColumns:W,movedRows:B,shownColumnTooltip:null,formatter:new Qt,isMenuShown:!1,customColumnFormatMap:new Map(s),conditionalFormats:n,conditionalFormatEditIndex:null,conditionalFormatPreview:void 0,hoverSelectColumn:null,isTableDownloading:!1,isReady:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:0,showSearchBar:g,searchFilter:k,searchValue:f,selectedSearchColumns:_,invertSearchColumns:C,rollupConfig:h,rollupSelectedColumns:[],aggregationSettings:t,selectedAggregation:null,openOptions:[],pendingRowCount:0,pendingDataMap:v!=null?v:new Map,pendingDataErrors:new Map,pendingSavePromise:null,pendingSaveError:null,toastMessage:null,frozenColumns:D,showOverflowModal:!1,overflowText:"",overflowButtonTooltipProps:null,isGotoRowShown:!1,gotoRow:"",gotoRowError:""}}static makeQuickFilter(e,t,n){try{return x.makeQuickFilter(e,t,n)}catch(s){oe.error("Error creating quick filter",s)}return null}componentDidMount(){const{partitionColumn:e,model:t}=this.props,n=e||t.columns.find(s=>s.isPartitionColumn);t.isFilterRequired&&t.isValuesTableAvailable&&n!=null?this.loadPartitionsTable(n):this.initState(),this.startListening(t)}componentDidUpdate(e){var d;const{inputFilters:t,isSelectingColumn:n,settings:s,model:i,customFilters:o,sorts:r}=this.props;i!==e.model&&(this.stopListening(e.model),this.startListening(i));const l=t!==e.inputFilters?t.filter(h=>!e.inputFilters.includes(h)):[];if(l.length>0){const{advancedSettings:h}=this.props,m=(d=h.get(cs.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS))!=null?d:!1;m&&(this.clearGridInputField(),this.clearCrossColumSearch()),this.startLoading("Filtering...",!0),this.applyInputFilters(l,m)}n!==e.isSelectingColumn&&this.resetColumnSelection(),s!==e.settings&&this.updateFormatterSettings(s),o!==e.customFilters&&this.startLoading("Filtering...",!0),r!==e.sorts&&this.updateSorts(r);const{loadingScrimStartTime:a,loadingScrimFinishTime:c}=this;a!=null&&c!=null&&window.requestAnimationFrame(()=>{const h=Date.now(),m=h-a,p=c-a,g=Math.min(m/p,1);c<h&&(this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0),this.setState(f=>f.loadingScrimProgress==null?(oe.debug2("Ignoring scrim update because loading cancelled."),null):{loadingScrimProgress:g})}),this.sendStateChange()}componentWillUnmount(){const{model:e}=this.props;this.stopListening(e),this.pending.cancel(),this.updateSearchFilter.cancel(),this.loadingTimer&&clearTimeout(this.loadingTimer),this.handleDownloadProgressUpdate.cancel(),this.animationFrame&&cancelAnimationFrame(this.animationFrame)}getValueForCell(e,t,n=!1){const{model:s}=this.props,i=this.getModelColumn(e),o=this.getModelRow(t);return n&&i!=null&&o!=null?s.valueForCell(i,o):n?null:i!=null&&o!=null?s.textForCell(i,o):""}getModelColumn(e){const{metrics:t}=this.state;O(t);const{modelColumns:n}=t;return n==null?null:e!=null?n.get(e):null}getModelRow(e){const{metrics:t}=this.state;O(t);const{modelRows:n}=t;return n==null?null:e!=null?n.get(e):null}getTheme(){var n;const{model:e,theme:t}=this.props;return this.getCachedTheme(t,(n=Ae(e)&&e.isEditable)!=null?n:!1)}getVisibleColumn(e){const{movedColumns:t}=this.state;return U.getVisibleIndex(e,t)}applyInputFilters(e,t=!1){const{model:n}=this.props,{advancedFilters:s,quickFilters:i}=this.state,o=t?new Map:new Map(s),r=t?new Map:new Map(i);let l=t&&s.size>0;e.forEach(({name:a,type:c,value:d})=>{const h=n.columns.findIndex(({name:m,type:p})=>m===a&&p===c);h>=0?(l=o.delete(h)||l,l=this.applyQuickFilter(h,d,r)||l):oe.error("Unable to find column for inputFilter",a,c,d)}),l&&this.setState({quickFilters:r,advancedFilters:o})}applyQuickFilter(e,t,n){const{model:s}=this.props,{formatter:i}=s,o=s.columns[e];if(t!=null&&`${t}`.trim().length>0){const r=n.get(e);if(r!=null){const{text:l}=r;if(l===t)return oe.debug2("Ignoring change to existing filter"),!1}return n.set(e,{text:t,filter:ns.makeQuickFilter(o,t,i.timeZone)}),!0}return n.delete(e)}setAdvancedFilterMap(e){this.setState({advancedFilters:e})}setAdvancedFilter(e,t,n){oe.debug("Setting advanced filter",e,t),this.startLoading("Filtering...",!0),this.setState(({advancedFilters:s})=>{const i=new Map(s);return t==null?i.delete(e):i.set(e,{filter:t,options:n}),{advancedFilters:i}})}setQuickFilter(e,t,n){oe.debug("Setting quick filter",e,t,n),this.startLoading("Filtering...",!0),this.setState(({quickFilters:s})=>{const i=new Map(s);return i.set(e,{filter:t,text:n}),{quickFilters:i}})}setFilterMap(e){var i;oe.debug("setFilterMap",e);const{advancedSettings:t}=this.props;((i=t.get(cs.LINK_CHANGE_CLEARS_ALL_FILTERS))!=null?i:!1)&&this.clearAllFilters();const{model:s}=this.props;e.forEach(({columnType:o,text:r,value:l},a)=>{const c=s.columns.find(h=>h.name===a&&h.type===o);if(c==null)return;const d=s.getColumnIndexByName(c.name);if(O(d),l===null)this.setQuickFilter(d,c.filter().isNull(),"=null");else{const h=x.isTextType(o)?E.FilterValue.ofString(l):E.FilterValue.ofNumber(l);this.setQuickFilter(d,c.filter().eq(h),`${r}`)}})}removeColumnFilter(e){this.startLoading("Filtering...",!0),this.setState(({advancedFilters:t,quickFilters:n})=>{const s=t?new Map(t):new Map,i=n?new Map(n):new Map;return i.delete(e),s.delete(e),{quickFilters:i,advancedFilters:s}})}clearAllFilters(){oe.debug("Clearing all filters");const{advancedFilters:e,quickFilters:t,searchFilter:n}=this.state;t.size===0&&e.size===0&&n===null||(this.clearGridInputField(),this.startLoading("Clearing Filters...",!0),this.setState({quickFilters:new Map,advancedFilters:new Map,searchValue:"",searchFilter:void 0}))}clearCrossColumSearch(){oe.debug("Clearing cross-column search"),this.setState({searchValue:"",searchFilter:void 0})}clearGridInputField(){this.filterInputRef.current!=null&&this.filterInputRef.current.setValue("")}rebuildFilters(){oe.debug("Rebuilding filters");const{model:e}=this.props,{advancedFilters:t,quickFilters:n}=this.state,{columns:s,formatter:i}=e,o=new Map,r=new Map;t.forEach((l,a)=>{const{options:c}=l,d=s[a],h=x.makeAdvancedFilter(d,c,i.timeZone);o.set(a,{options:c,filter:h})}),n.forEach((l,a)=>{const{text:c}=l,d=s[a];r.set(a,{text:c,filter:ns.makeQuickFilter(d,c,i.timeZone)})}),this.startLoading("Rebuilding filters...",!0),this.setState({quickFilters:r,advancedFilters:o})}setFilters({quickFilters:e,advancedFilters:t}){this.setState({quickFilters:e,advancedFilters:t})}updateFormatterSettings(e,t=!0){var m,p,g;const n=rs.getColumnFormats(e),s=rs.getDateTimeFormatterOptions(e),i=(m=e==null?void 0:e.defaultDecimalFormatOptions)!=null?m:{},o=(p=e==null?void 0:e.defaultIntegerFormatOptions)!=null?p:{},r=(g=e==null?void 0:e.truncateNumbersWithPound)!=null?g:!1,l=!ct(this.globalColumnFormats,n),a=!ct(this.dateTimeFormatterOptions,s),c=!ct(this.decimalFormatOptions,e==null?void 0:e.defaultDecimalFormatOptions),d=!ct(this.integerFormatOptions,o),h=this.truncateNumbersWithPound!==r;(l||a||c||d||h)&&(this.globalColumnFormats=n,this.dateTimeFormatterOptions=s,this.decimalFormatOptions=i,this.integerFormatOptions=o,this.truncateNumbersWithPound=r,this.updateFormatter({},t),a&&t&&this.rebuildFilters())}updateFormatter(e,t=!0){var r;const{customColumnFormatMap:n}=this.state,s={customColumnFormatMap:n,...e},i=[...(r=this.globalColumnFormats)!=null?r:[],...s.customColumnFormatMap.values()],o=new Qt(i,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions,this.truncateNumbersWithPound);oe.debug("updateFormatter",this.globalColumnFormats,i),this.setState({...s,formatter:o},()=>{t&&this.grid&&this.grid.forceUpdate()})}initFormatter(){const{settings:e}=this.props;this.updateFormatterSettings(e)}initState(){const{applyInputFiltersOnInit:e,inputFilters:t,sorts:n,model:s,reverseType:i,customColumns:o,searchValue:r,selectedSearchColumns:l,invertSearchColumns:a}=this.props,c=l!=null?l:[],d=Ii.createSearchFilter(r,c,s.columns,a);if(e){const h=t.filter(m=>m.value!=null);this.applyInputFilters(h)}this.setState({sorts:n,reverseType:i,customColumns:o,isReady:!0,searchFilter:d}),this.initFormatter()}async loadPartitionsTable(e){const{model:t}=this.props;this.setState({isSelectingPartition:!0});try{const n=await this.pending.add(t.valuesTable(e),r=>r.close()),s=n.columns[0],i=s.sort().desc();n.applySort([i]),n.setViewport(0,0,[s]);const o=await this.pending.add(n.getViewportData());if(o.rows.length>0){const l=o.rows[0].get(s);this.updatePartition(l,e),this.setState({isSelectingPartition:!0})}else oe.info("Table does not have any data, just fetching all"),this.setState({isSelectingPartition:!1}),this.handlePartitionFetchAll();this.setState({partitionTable:n,partitionColumn:e},()=>{this.initState()})}catch(n){this.handleTableLoadError(n)}}updatePartition(e,t){const s=[t.filter().eq(E.FilterValue.ofString(e))];this.setState({partition:e,partitionFilters:s})}copyCell(e,t,n=!1){const{canCopy:s}=this.props;if(s){const i=String(this.getValueForCell(e,t,n));Se.copyToClipboard(i).catch(o=>oe.error("Unable to copy cell",o))}else oe.error("Attempted to copyCell for user without copy permission.")}copyRanges(e,t=!1,n=!0,s){const{model:i,canCopy:o}=this.props,{metricCalculator:r,movedColumns:l}=this.state,a=r.getUserColumnWidths();if(o){const c={ranges:j.boundedRanges(e,i.columnCount,i.rowCount),includeHeaders:t,formatValues:n,movedColumns:l,userColumnWidths:a,error:s};this.setState({copyOperation:c})}else oe.error("Attempted copyRanges for user without copy permission.")}startLoading(e,t=!1){var s,i;this.setState({loadingText:e});const n=this.getTheme();if(t&&this.grid&&(this.grid.clearSelectedRanges(),this.grid.setViewState({top:0},!0)),this.loadingScrimStartTime==null){const{minScrimTransitionTime:o,maxScrimTransitionTime:r}=n;O(o),O(r);const l=(i=(s=this.gridWrapper)==null?void 0:s.getBoundingClientRect().height)!=null?i:0,a=Math.max(o,Math.min(l/2,r));this.loadingScrimStartTime=Date.now(),this.loadingScrimFinishTime=this.loadingScrimStartTime+a,this.setState({loadingScrimProgress:0}),this.loadingTimer=setTimeout(()=>{this.setState({loadingSpinnerShown:!0})},ns.loadingSpinnerDelay)}}stopLoading(){this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0,this.setState({loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1}),this.loadingTimer!=null&&(clearTimeout(this.loadingTimer),this.loadingTimer=void 0)}rollback(){if(this.lastLoadedConfig){oe.debug("loading last loading config",this.lastLoadedConfig);const{advancedFilters:e,aggregationSettings:t,customColumns:n,quickFilters:s,reverseType:i,rollupConfig:o,searchFilter:r,selectDistinctColumns:l,sorts:a}=this.lastLoadedConfig;this.lastLoadedConfig=null,this.setState({advancedFilters:e,aggregationSettings:t,customColumns:n,quickFilters:s,reverseType:i,rollupConfig:o,searchFilter:r,selectDistinctColumns:l,sorts:a})}else oe.debug("remove all sorts, filters, and custom columns"),this.setState({advancedFilters:new Map,aggregationSettings:Qa,customColumns:[],quickFilters:new Map,reverseType:x.REVERSE_TYPE.NONE,rollupConfig:void 0,selectDistinctColumns:[],sorts:[]})}canRollback(){return this.lastLoadedConfig!=null||!Tl(this.state)}startListening(e){e.addEventListener(he.EVENT.UPDATED,this.handleUpdate),e.addEventListener(he.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.addEventListener(he.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.addEventListener(he.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated)}stopListening(e){e.removeEventListener(he.EVENT.UPDATED,this.handleUpdate),e.removeEventListener(he.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.removeEventListener(he.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.removeEventListener(he.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated)}focus(){var e;(e=this.grid)==null||e.focus()}focusFilterBar(e){var d,h,m;const{model:t}=this.props,{columnCount:n}=t,s=this.getModelColumn(e);if(e==null||s==null||e<0||n<=e||!t.isFilterable(s)){this.setState({focusedFilterBarColumn:null});return}const{metricCalculator:i,metrics:o}=this.state;O(o);const{gridX:r,left:l,rightVisible:a,lastLeft:c}=o;if(e<l)(d=this.grid)==null||d.setViewState({left:e},!0);else if(a<e){const p=(h=this.grid)==null?void 0:h.getMetricState();O(p);const g=i.getLastLeft(p,e,r);(m=this.grid)==null||m.setViewState({left:Math.min(g,c)},!0)}this.lastFocusedFilterBarColumn=e,this.setState({focusedFilterBarColumn:e,isFilterBarShown:!0})}hideColumnByVisibleIndex(e){var s;const{metricCalculator:t,movedColumns:n}=this.state;t.setColumnWidth(U.getModelIndex(e,n),0),(s=this.grid)==null||s.forceUpdate()}freezeColumnByColumnName(e){const{frozenColumns:t,movedColumns:n}=this.state,{model:s}=this.props;oe.debug2("freezing column",e);const i=t==null?new Set(s.frozenColumns):new Set(t);i.add(e);const o=s.getColumnIndexByName(e);O(o);const r=U.getVisibleIndex(o,n),l=U.moveItem(r,i.size-1,n);this.setState({frozenColumns:[...i],movedColumns:l})}unFreezeColumnByColumnName(e){const{frozenColumns:t,movedColumns:n}=this.state,{model:s}=this.props;oe.debug2("unfreezing column",e);const i=t==null?new Set(s.frozenColumns):new Set(t);i.delete(e);const o=s.getColumnIndexByName(e);O(o);const r=U.getVisibleIndex(o,n),l=U.moveItem(r,i.size+s.frontColumns.length,n);this.setState({frozenColumns:[...i],movedColumns:l})}handleColumnVisibilityChanged(e,t){var s;const{metricCalculator:n}=this.state;t===ds.VISIBILITY_OPTIONS.SHOW?e.forEach(i=>{n.resetColumnWidth(i)}):e.forEach(i=>{n.setColumnWidth(i,0)}),(s=this.grid)==null||s.forceUpdate()}handleCrossColumnSearch(e,t,n){const{model:s}=this.props;this.updateSearchFilter(e,t,s.columns,n),this.setState({searchValue:e,selectedSearchColumns:t,invertSearchColumns:n})}handleAnimationLoop(){var e,t;(e=this.grid)==null||e.updateCanvasScale(),(t=this.grid)==null||t.updateCanvas(),this.isAnimating&&(this.animationFrame=requestAnimationFrame(this.handleAnimationLoop))}handleAnimationStart(){oe.debug2("handleAnimationStart"),this.isAnimating=!0,this.animationFrame=requestAnimationFrame(this.handleAnimationLoop)}handleAnimationEnd(){oe.debug2("handleAnimationEnd"),this.isAnimating=!1}handlePartitionAppend(e){const{onPartitionAppend:t}=this.props,{partitionColumn:n}=this.state;t(n,e)}handlePartitionChange(e){const{partitionColumn:t}=this.state;this.updatePartition(e,t)}handlePartitionFetchAll(){this.setState({partitionFilters:[],isSelectingPartition:!1})}handlePartitionDone(){this.setState({isSelectingPartition:!1})}handleTableLoadError(e){if(He.isCanceled(e))return;oe.error(e);const{onError:t}=this.props;t(e)}showAllColumns(){var s;const{metricCalculator:e}=this.state,n=[...e.getUserColumnWidths().entries()];for(let i=0;i<n.length;i+=1){const[o,r]=n[i];r===0&&e.resetColumnWidth(o)}(s=this.grid)==null||s.forceUpdate()}toggleSort(e,t){oe.info("Toggling sort for column",e);const{model:n}=this.props,{sorts:s}=this.state,i=this.getModelColumn(e);O(i);const o=x.toggleSortForColumn(s,n.columns,i,t);this.updateSorts(o)}updateSorts(e){var t;this.startLoading("Sorting..."),this.setState({sorts:e}),(t=this.grid)==null||t.forceUpdate()}sortColumn(e,t=x.sortDirection.none,n=!1,s=!1){var r;O(e);const{model:i}=this.props,o=x.sortColumn(i.sort,i.columns,e,t,n,s);this.startLoading("Sorting..."),this.setState({sorts:o}),(r=this.grid)==null||r.forceUpdate()}reverse(e){var t;this.startLoading("Reversing..."),this.setState({reverseType:e}),(t=this.grid)==null||t.forceUpdate()}isReversible(){const{model:e}=this.props;return e.isReversible}toggleFilterBar(e=this.lastFocusedFilterBarColumn){var n;let{isFilterBarShown:t}=this.state;if(t=!t,this.setState({isFilterBarShown:t}),t)if(e!=null)this.focusFilterBar(e);else{let s=0;const{model:i}=this.props,{columnCount:o}=i;for(let r=0;r<o;r+=1){const l=this.getModelColumn(r);if(l!=null){const a=i.columns[l];if(a!=null&&x.isTextType(a.type)){s=r;break}}}this.focusFilterBar(s)}else(n=this.grid)==null||n.focus()}isTableSearchAvailable(){var s,i,o;const{model:e,canToggleSearch:t}=this.props,n=(s=e==null?void 0:e.layoutHints)==null?void 0:s.searchDisplayMode;return n===((i=E.SearchDisplayMode)==null?void 0:i.SEARCH_DISPLAY_HIDE)?!1:n===((o=E.SearchDisplayMode)==null?void 0:o.SEARCH_DISPLAY_SHOW)?!0:t}toggleSearchBar(){const{showSearchBar:e}=this.state;if(!this.isTableSearchAvailable())return;const t=!e;this.setState({showSearchBar:t},()=>{var n,s,i;t&&((n=this.crossColumnRef)==null?void 0:n.current)?(s=this.crossColumnRef)==null||s.current.focus():(i=this.grid)==null||i.focus()})}toggleGotoRow(e=""){const{isGotoRowShown:t}=this.state;if(e){this.setState({isGotoRowShown:!0,gotoRow:e,gotoRowError:""});return}this.setState({isGotoRowShown:!t,gotoRow:"",gotoRowError:""})}async commitPending(){var s,i;const{model:e}=this.props;if(!Ae(e)||!e.isEditable)throw new Error("Cannot save, table is not editable");const{pendingSavePromise:t}=this.state;if(t!=null)throw new Error("Save already in progress");if((s=document==null?void 0:document.activeElement)!=null&&s.classList.contains("grid-cell-input-field")){if(document.activeElement.classList.contains("error"))throw new Wd("Current input is invalid");(i=this.grid)==null||i.focus()}const n=this.pending.add(e.commitPending()).then(()=>{this.setState({pendingSaveError:null,pendingSavePromise:null})}).catch(o=>{He.isCanceled(o)||this.setState({pendingSaveError:o,pendingSavePromise:null})});return this.setState({pendingSavePromise:n}),n}async discardPending(){const{pendingSavePromise:e}=this.state;if(e!=null)throw new Error("Cannot cancel a save in progress");this.setState({pendingSavePromise:null,pendingSaveError:null,pendingDataMap:new Map,pendingDataErrors:new Map})}selectColumn(e){const{onColumnSelected:t}=this.props;t(e)}selectData(e,t){const{model:n}=this.props,{columns:s}=n,i={};for(let r=0;r<s.length;r+=1){const l=s[r],{name:a,type:c}=l,d=n.valueForCell(r,t),h=n.textForCell(r,t);i[a]={value:d,text:h,type:c}}const{onDataSelected:o}=this.props;o(t,i)}handleAdvancedFilterChange(e,t,n){const{model:s}=this.props,i=s.getColumnIndexByName(e.name);O(i),this.setAdvancedFilter(i,t,n)}handleAdvancedFilterSortChange(e,t,n=!1){var a;const{model:s}=this.props,i=s.getColumnIndexByName(e.name);O(i);const o=x.getSortForColumn(s.sort,i);let r=null;(o==null||o.direction!==t)&&(t===x.sortDirection.descending?r=e.sort().desc():r=e.sort().asc());const l=x.setSortForColumn(s.sort,i,r,n);oe.info("Setting table sorts",l),this.startLoading("Sorting..."),this.setState({sorts:l}),(a=this.grid)==null||a.forceUpdate()}handleAdvancedFilterDone(){var e;(e=this.grid)==null||e.focus()}handleAdvancedMenuOpened(e){this.setState({shownAdvancedFilter:e})}handleGotoRowOpened(){this.setState({isGotoRowShown:!0})}handleGotoRowClosed(){this.setState({isGotoRowShown:!1})}handleAdvancedMenuClosed(e){var s,i;const{focusedFilterBarColumn:t,isFilterBarShown:n}=this.state;n&&t===e&&((s=this.filterInputRef)==null?void 0:s.current)!==null?((i=this.filterInputRef)==null||i.current.focus(),this.setState({shownAdvancedFilter:null})):this.setState({focusedFilterBarColumn:null,shownAdvancedFilter:null})}handleCancel(){this.rollback()}handleChartChange(){}handleChartCreate(e){const{model:t,onCreateChart:n}=this.props;n(e,t)}handleGridError(e){oe.warn("Grid Error",e),this.setState({toastMessage:u("div",{className:"error-message",children:`${e}`})})}handleFilterBarChange(e){this.startLoading("Filtering...",!0),this.setState(({focusedFilterBarColumn:t,quickFilters:n})=>{const s=new Map(n);if(t!=null){const i=this.getModelColumn(t);O(i),this.applyQuickFilter(i,e,s)}return{quickFilters:s}})}handleFilterBarDone(e=!0,t=!0){var n;e&&((n=this.grid)==null||n.focus()),t&&this.setState({focusedFilterBarColumn:null})}handleFilterBarTab(e){const{focusedFilterBarColumn:t}=this.state;O(t),e?this.focusFilterBar(t-1):this.focusFilterBar(t+1)}handleFormatSelection(e,t){const{model:n}=this.props,s=n.columns[e],{customColumnFormatMap:i}=this.state,o=new Map(i);if(t!=null){const r=x.getNormalizedType(s.type);O(r);const l=Qt.makeColumnFormattingRule(r,s.name,t);o.set(s.name,l)}else o.delete(s.name);this.updateFormatter({customColumnFormatMap:o})}handleMenu(e){e.stopPropagation(),this.setState({isMenuShown:!0})}handleMenuClose(){this.setState({isMenuShown:!1,openOptions:[]})}handleMenuBack(){this.setState(({openOptions:e})=>{const t=[...e];return t.pop(),{openOptions:t}})}handleMenuSelect(e){this.setState(({openOptions:t})=>({openOptions:[...t,e]}))}handleRequestFailed(e){const t=e;if(oe.error("request failed:",t.detail),this.stopLoading(),this.canRollback())this.startLoading("Rolling back changes...",!0),this.rollback();else{oe.error("Table failed and unable to rollback");const{onError:n}=this.props;n(new Error(`Error displaying table: ${t.detail}`))}}handleUpdate(){var d;this.stopLoading(),oe.debug2("Received model update");const{advancedFilters:e,aggregationSettings:t,customColumns:n,quickFilters:s,reverseType:i,rollupConfig:o,searchFilter:r,selectDistinctColumns:l,sorts:a}=this.state,c={advancedFilters:e,aggregationSettings:t,customColumns:n,quickFilters:s,reverseType:i,rollupConfig:o,searchFilter:r,selectDistinctColumns:l,sorts:a};Tl(c)?this.lastLoadedConfig=null:this.lastLoadedConfig=c,(d=this.grid)==null||d.forceUpdate()}handleViewChanged(e){var i,o;const{model:t}=this.props,{selectionEndRow:n=0}=(o=(i=this.grid)==null?void 0:i.state)!=null?o:{};let s=0;if(Ae(t)&&t.isEditable){O(e);const{bottomViewport:r}=e,l=t.rowCount-t.floatingBottomRowCount;n===l-1?s=t.pendingRowCount+1:n===l-2?s=t.pendingRowCount:s=Math.max(0,r-(t.rowCount-t.pendingRowCount)-t.floatingTopRowCount-t.floatingBottomRowCount-1)}this.setState({metrics:e,pendingRowCount:s})}handleSelectionChanged(e){O(e);const{onSelectionChanged:t}=this.props,{copyOperation:n}=this.state;this.setState({selectedRanges:e}),n!=null&&this.setState({copyOperation:null}),t(e)}handleMovedColumnsChanged(e,t=()=>null){this.setState({movedColumns:e},t)}handleTooltipRef(e){e&&e.startTimer(),this.tooltip=e}handleConditionalFormatsChange(e){oe.debug("Updated conditional formats",e),this.setState({conditionalFormats:e})}handleConditionalFormatCreate(){oe.debug("Create new conditional format");const{openOptions:e,conditionalFormats:t}=this.state;this.setState({openOptions:[...e,{type:be.CONDITIONAL_FORMATTING_EDIT,title:"Create Formatting Rule"}],conditionalFormatEditIndex:t.length,conditionalFormatPreview:void 0})}handleConditionalFormatEdit(e){oe.debug("Edit conditional format",e);const{openOptions:t,conditionalFormats:n}=this.state;this.setState({openOptions:[...t,{type:be.CONDITIONAL_FORMATTING_EDIT,title:"Edit Formatting Rule"}],conditionalFormatEditIndex:e,conditionalFormatPreview:{...n[e]}})}handleConditionalFormatEditorSave(e){oe.debug("Save conditional format changes",e),this.setState(t=>{if(t.conditionalFormatEditIndex===null)return oe.debug("Invalid format index"),null;const n=[...t.conditionalFormats];return n[t.conditionalFormatEditIndex]=e,{conditionalFormats:n}},()=>{this.handleMenuBack()})}handleConditionalFormatEditorCancel(){this.handleMenuBack(),this.setState({conditionalFormatEditIndex:null})}handleUpdateCustomColumns(e){oe.info("handleUpdateCustomColumns:",e);const{model:t}=this.props,{movedColumns:n,sorts:s,quickFilters:i,advancedFilters:o,selectDistinctColumns:r}=this.state,{columns:l}=t,a=t.customColumns.map(d=>`${d}`),c=te.getRemovedCustomColumnNames(a,e);if(c.length>0){const d=te.removeSortsInColumns(s,c),h=te.removeFiltersInColumns(l,i,c),m=te.removeFiltersInColumns(l,o,c),p=te.removeColumnFromMovedColumns(l,n,c),g=te.removeColumnsFromSelectDistinctColumns(r,c);d.length!==s.length&&(oe.debug("removing sorts from removed custom columns..."),this.setState({sorts:d})),(h.size!==i.size||m.size!==o.size)&&(oe.debug("removing filters from removed custom columns..."),this.setState({quickFilters:h,advancedFilters:m})),ct(n,p)||(oe.debug("change moved columns for removed custom columns",p),this.setState({movedColumns:p})),ct(r,g)||(oe.debug("change selectDistinct columns for removed custom columns",p),this.setState({selectDistinctColumns:g}))}this.setState({customColumns:e}),this.startLoading("Applying custom columns...")}handleCustomColumnsChanged(){var t;oe.debug("custom columns changed");const{isReady:e}=this.state;e?(this.stopLoading(),(t=this.grid)==null||t.forceUpdate()):this.initState()}handlePendingCommitClicked(){return this.commitPending()}handlePendingDiscardClicked(){return this.discardPending()}handlePendingDataUpdated(){var s;oe.debug("pending data updated");const{model:e}=this.props,{pendingDataMap:t,pendingDataErrors:n}=e;this.setState({pendingDataMap:t,pendingDataErrors:n,pendingSaveError:null}),(s=this.grid)==null||s.forceUpdate()}handleAggregationsChange(e){oe.debug("handleAggregationsChange",e),this.startLoading(`Aggregating ${e.aggregations.map(t=>t.operation).join(", ")}...`),this.setState({aggregationSettings:e})}handleAggregationChange(e){oe.debug("handleAggregationChange",e),this.startLoading(`Aggregating ${e.operation}...`),this.setState(({aggregationSettings:t})=>({selectedAggregation:e,aggregationSettings:{...t,aggregations:t.aggregations.map(n=>n.operation===e.operation?e:n)}}))}handleAggregationEdit(e){oe.debug("handleAggregationEdit",e);const{openOptions:t}=this.state;this.setState({openOptions:[...t,{type:be.AGGREGATION_EDIT,title:`Edit Columns to ${e.operation}`}],selectedAggregation:e})}handleRollupChange(e){var t,n;oe.info("Rollup change",e),this.resetGridViewState(),this.showAllColumns(),this.clearAllFilters(),this.startLoading(`Grouping by columns ${(n=(t=e==null?void 0:e.columns)==null?void 0:t.join(", "))!=null?n:""}...`),this.setState({rollupConfig:e,movedColumns:[],sorts:[],reverseType:x.REVERSE_TYPE.NONE,selectDistinctColumns:[]})}handleSelectDistinctChanged(e){oe.debug("SelectDistinct change",e),this.resetGridViewState(),this.showAllColumns(),this.clearAllFilters(),this.startLoading(`Selecting distinct values in ${e.length>0?e.join(", "):""}...`),this.setState({selectDistinctColumns:e,movedColumns:[],sorts:[],reverseType:x.REVERSE_TYPE.NONE})}handleDownloadTableStart(){const{canDownloadCsv:e}=this.props;e?this.setState({isTableDownloading:!0,tableDownloadProgress:0,tableDownloadEstimatedTime:null,tableDownloadStatus:wt.DOWNLOAD_STATUS.INITIATING}):oe.error("Attempted to handleDownloadTableStart for user without download CSV permission.")}handleDownloadTable(e,t,n,s){const{canDownloadCsv:i}=this.props;i?(oe.info("start table downloading",e,t,n,s),this.setState(()=>(this.tableSaver&&this.tableSaver.startDownload(e,t,n,s),{tableDownloadStatus:wt.DOWNLOAD_STATUS.DOWNLOADING}))):oe.error("Attempted to handleDownloadTable for user without download CSV permission.")}handleCancelDownloadTable(){var e;(e=this.tableSaver)==null||e.cancelDownload(),this.setState({isTableDownloading:!1})}handleDownloadCompleted(){this.setState({isTableDownloading:!1,tableDownloadProgress:100,tableDownloadStatus:wt.DOWNLOAD_STATUS.FINISHED})}handleDownloadCanceled(){this.setState({isTableDownloading:!1,tableDownloadProgress:0,tableDownloadStatus:wt.DOWNLOAD_STATUS.CANCELED})}deleteRanges(e){const{model:t}=this.props;this.pending.add(t.delete(e)).catch(n=>{He.isCanceled(n)||oe.error("Unable to delete ranges",e,n)})}resetColumnSelection(){if(this.grid==null)return;const{isSelectingColumn:e}=this.props;if(e){const{columnAllowedCursor:t}=this.props;this.grid.setState({cursor:t})}else this.grid.setState({cursor:null}),this.setState({hoverSelectColumn:null})}resetGridViewState(e=!0){!this.grid||(this.grid.clearSelectedRanges(),this.grid.setViewState({left:0,top:0,topOffset:0,leftOffset:0},e))}sendStateChange(){if(!this.grid)return;const{state:e}=this,{state:t}=this.grid,{onStateChange:n}=this.props;n(e,t)}handleOverflowClose(){this.setState({showOverflowModal:!1})}getColumnBoundingRect(){var m;const{metrics:e,shownColumnTooltip:t}=this.state;O(e),O(t);const n=(m=this.gridWrapper)==null?void 0:m.getBoundingClientRect(),s=20;O(n);const{columnHeaderHeight:i,visibleColumnXs:o,visibleColumnWidths:r,width:l,columnHeaderMaxDepth:a}=e,c=o.get(t),d=r.get(t);O(c),O(d);const h=n.left+rt(c+d/2,s,l-s);return{top:n.top+(a-1)*i,left:n.left+rt(c+d/2,s,l-s),bottom:n.top+a*i,right:n.left+rt(c+d/2,s,l-s)+1,width:1,height:i,x:h,y:n.top,toJSON:()=>{throw new Error("not implemented")}}}handleGotoRowSelectedRowNumberSubmit(){const{gotoRow:e}=this.state;this.focusRowInGrid(e)}focusRowInGrid(e){var i,o,r;const{model:t}=this.props,{rowCount:n}=t;if(this.setState({gotoRow:e}),e===""){this.setState({gotoRowError:""});return}const s=parseInt(e,10);s>n||s<-n?this.setState({gotoRowError:"Invalid row index"}):s===0?(this.setState({gotoRowError:""}),(i=this.grid)==null||i.setFocusRow(0)):s<0?(this.setState({gotoRowError:""}),(o=this.grid)==null||o.setFocusRow(s+n)):((r=this.grid)==null||r.setFocusRow(s-1),this.setState({gotoRowError:""}))}handleGotoRowSelectedRowNumberChanged(e){const t=e.target.value;this.focusRowInGrid(t)}getColumnTooltip(e,t,n){const{columnHeaderHeight:s,columnHeaderMaxDepth:i,visibleColumnXs:o,visibleColumnWidths:r,width:l}=t,a=o.get(e),c=r.get(e);if(a==null||c==null)return null;const d=Math.max(0,a);let h=c;a+c>l?h=l-a:a<0&&(h=c-Math.abs(a));const m={position:"absolute",top:(i-1)*s,left:d,width:h,height:s,pointerEvents:"none"},p={clientWidth:1,clientHeight:s,getBoundingClientRect:this.getColumnBoundingRect},g={placement:"bottom",modifiers:{flip:{behavior:["bottom","top"]}}},f=this.getModelColumn(e);if(f==null)return null;const b=n.columns[f];return b==null?null:u("div",{style:m,children:u(me,{timeout:400,interactive:!0,options:g,ref:this.handleTooltipRef,referenceObject:p,onExited:()=>{this.setState({shownColumnTooltip:null})},children:u(Ia,{model:n,column:b,onStatistics:()=>{var C;(C=this.tooltip)==null||C.update()}})},b.name)})}render(){var Be,ms,Sr,vr,Tr,Er,yr,Rr,Ir;const{children:e,customFilters:t,getDownloadWorker:n,isSelectingColumn:s,isStuckToBottom:i,isStuckToRight:o,model:r,name:l,onlyFetchVisibleColumns:a,alwaysFetchColumns:c,advancedSettings:d,onAdvancedSettingsChange:h,canDownloadCsv:m,onCreateChart:p}=this.props,{metricCalculator:g,metrics:f,isFilterBarShown:b,isSelectingPartition:C,isMenuShown:w,isReady:S,copyOperation:I,focusedFilterBarColumn:v,loadingText:R,loadingScrimProgress:D,loadingSpinnerShown:F,keyHandlers:L,mouseHandlers:W,shownColumnTooltip:B,hoverAdvancedFilter:N,shownAdvancedFilter:_,hoverSelectColumn:k,quickFilters:P,advancedFilters:H,partition:V,partitionFilters:G,partitionTable:Q,partitionColumn:J,searchFilter:re,selectDistinctColumns:Ce,movedColumns:de,movedRows:ve,formatter:_e,conditionalFormats:Ke,conditionalFormatPreview:Dt,conditionalFormatEditIndex:Xe,sorts:Ze,reverseType:Le,customColumns:_t,selectedRanges:_n,isTableDownloading:en,tableDownloadStatus:nt,tableDownloadProgress:pe,tableDownloadEstimatedTime:ze,showSearchBar:Ue,searchValue:ht,selectedSearchColumns:Mt,invertSearchColumns:Nt,aggregationSettings:ut,selectedAggregation:Vn,rollupConfig:Ft,openOptions:xt,pendingSavePromise:Un,pendingSaveError:io,pendingRowCount:oo,pendingDataErrors:ro,pendingDataMap:ni,toastMessage:si,frozenColumns:ii,showOverflowModal:oi,overflowText:ri,overflowButtonTooltipProps:li,isGotoRowShown:ai,gotoRow:lo,gotoRowError:ao}=this.state;if(!S)return null;const Bn=this.getTheme(),co=this.getCachedFilter(t,P,H,G,re),us=g.getUserColumnWidths(),As=this.getCachedStateOverride(k,b,s,D,P,H,Ze,Le,Ft,w),ci=f?f.top:0,di=f?f.bottomViewport:0;let ks=null,Ls=null;a&&(ks=f?f.left:0,Ls=f?f.right:0);const ho=f!=null&&f.width>0&&f.height>0,uo=((ms=(Be=Ft==null?void 0:Ft.columns)==null?void 0:Be.length)!=null?ms:0)>0;let hi=null;const mo=f?Math.min(Math.max(ns.minDebounce,Math.round(f.rowCount/200)),ns.maxDebounce):ns.maxDebounce;if(b&&v!=null&&f!=null){const{gridX:xe,gridY:mt,visibleColumnXs:Vt,visibleColumnWidths:Wn}=f,zn=Vt.get(v),Ut=Wn.get(v);if(zn!=null&&Ut!=null){const pt=xe+zn,lt=mt-((Sr=Bn.filterBarHeight)!=null?Sr:0),tn=Ut+1,$n=((vr=Bn.filterBarHeight)!=null?vr:0)-1,Gn={top:lt,left:pt,minWidth:tn,height:$n};let ps="",nn=!0;const qn=this.getModelColumn(v);O(qn);const Kn=P.get(qn),Ps=H.get(qn);Kn!=null&&(ps=Kn.text,nn=Kn.filter!=null);const Xn=P.size!==0||H.size!==0;hi=u(va,{ref:this.filterInputRef,style:Gn,className:$({error:!nn,active:ps!==""||Ps!=null,"iris-grid-has-filter":Xn}),isAdvancedFilterSet:Ps!=null,onAdvancedFiltersTriggered:()=>{this.setState({shownAdvancedFilter:v})},onChange:this.handleFilterBarChange,onDone:this.handleFilterBarDone,onTab:this.handleFilterBarTab,onContextMenu:(Tr=this.grid)==null?void 0:Tr.handleContextMenu,debounceMs:mo,value:ps},v)}}let ui=null;if(R!=null){const xe=u("div",{className:"iris-grid-loading-status",children:R}),mt=u(lh,{show:F}),Vt=u("button",{type:"button",onClick:this.handleCancel,className:$("btn btn-secondary btn-cancelable iris-grid-btn-cancel",{show:F}),children:"Cancel"}),Wn=f?f.gridY:0;ui=T("div",{className:"iris-grid-loading",style:{top:Wn},children:[xe,mt,Vt]})}let mi=null;B!=null&&f&&(mi=this.getColumnTooltip(B,f,r),(Er=this.tooltip)==null||Er.update());const pi=[];if(f&&b){const{gridX:xe,gridY:mt,visibleColumns:Vt,visibleColumnXs:Wn,visibleColumnWidths:zn}=f,{filterBarHeight:Ut}=Bn;for(let pt=0;pt<Vt.length;pt+=1){const lt=Vt[pt],tn=Wn.get(lt),$n=zn.get(lt),Gn=this.getModelColumn(lt);if(Gn!=null&&r.isFilterable(Gn)&&tn!=null&&$n!=null&&$n>0){const nn=xe+tn+$n-24,qn=mt-(Ut!=null?Ut:0)+2,Kn={position:"absolute",top:qn,left:nn},Xn=H.get(Gn)!=null,Ci=lt===N||lt===v||Xn,fo=u("div",{className:$("advanced-filter-button-container",{hidden:!Ci}),style:Kn,children:Ci&&u("button",{type:"button",className:$("btn btn-link btn-link-icon advanced-filter-button",{"filter-set":Xn}),onClick:()=>{this.setState({shownAdvancedFilter:lt})},onContextMenu:Za=>{var Dr;(Dr=this.grid)==null||Dr.handleContextMenu(Za)},onMouseEnter:()=>{this.setState({hoverAdvancedFilter:lt})},onMouseLeave:()=>{this.setState({hoverAdvancedFilter:null})},children:T("div",{className:"fa-layers",children:[u(q,{icon:qo,className:"filter-solid"}),u(q,{icon:ki,className:"filter-light"})]})})},lt);pi.push(fo)}}}const gi=[];if(f){const{gridX:xe,visibleColumns:mt,visibleColumnXs:Vt,visibleColumnWidths:Wn,columnHeaderHeight:zn}=f;for(let Ut=0;Ut<mt.length;Ut+=1){const pt=mt[Ut],lt=Vt.get(pt),tn=Wn.get(pt);if(lt!=null&&tn!=null&&tn>0){const $n=xe+lt,Gn=xe+lt+tn-20,ps=b?{position:"absolute",top:zn,left:Gn,width:20,height:Bn.filterBarHeight}:{position:"absolute",top:0,left:$n,width:tn,height:zn},nn=this.getModelColumn(pt);if(nn!=null){const qn=r.columns[nn],Kn=H.get(nn),{options:Ps}=Kn||{},Xn=x.getSortForColumn(r.sort,nn),Ci=Xn?Xn.direction:null,fo=u("div",{className:"advanced-filter-menu-container",style:ps,children:u(fn,{className:"advanced-filter-menu-popper",onEntered:this.getAdvancedMenuOpenedHandler(pt),onExited:()=>{this.handleAdvancedMenuClosed(pt)},isShown:_===pt,interactive:!0,closeOnBlur:!0,children:this.getCachedAdvancedFilterMenuActions(r,qn,Ps,Ci,_e)})},pt);gi.push(fo)}}}}const fi=this.getCachedOptionItems(p!==void 0&&r.isChartBuilderAvailable,r.isCustomColumnsAvailable,r.isFormatColumnsAvailable,r.isRollupAvailable,r.isTotalsAvailable,r.isSelectDistinctAvailable,r.isExportAvailable,this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,b,Ue,m,this.isTableSearchAvailable(),ai),po=xt.map(xe=>{switch(xe.type){case be.CHART_BUILDER:return u(da,{model:r,onChange:this.handleChartChange,onSubmit:this.handleChartCreate},be.CHART_BUILDER);case be.VISIBILITY_ORDERING_BUILDER:return u(ds,{model:r,movedColumns:de,userColumnWidths:us,onColumnVisibilityChanged:this.handleColumnVisibilityChanged,onMovedColumnsChanged:this.handleMovedColumnsChanged},be.VISIBILITY_ORDERING_BUILDER);case be.CONDITIONAL_FORMATTING:return u(Nm,{rules:Ke,onChange:this.handleConditionalFormatsChange,onCreate:this.handleConditionalFormatCreate,onSelect:this.handleConditionalFormatEdit});case be.CONDITIONAL_FORMATTING_EDIT:return O(r.columns),O(this.handleConditionalFormatEditorUpdate),u(np,{columns:r.columns,rule:Dt,onUpdate:this.handleConditionalFormatEditorUpdate,onSave:this.handleConditionalFormatEditorSave,onCancel:this.handleConditionalFormatEditorCancel});case be.CUSTOM_COLUMN_BUILDER:return u(dr,{model:r,customColumns:_t,onSave:this.handleUpdateCustomColumns,onCancel:this.handleMenuBack},be.CUSTOM_COLUMN_BUILDER);case be.ROLLUP_ROWS:return u(hr,{model:r,onChange:this.handleRollupChange,config:Ft},be.ROLLUP_ROWS);case be.AGGREGATIONS:return u($h,{settings:ut,isRollup:uo,onChange:this.handleAggregationsChange,onEdit:this.handleAggregationEdit});case be.AGGREGATION_EDIT:return Vn&&u(qh,{aggregation:Vn,columns:r.originalColumns,onChange:this.handleAggregationChange});case be.TABLE_EXPORTER:return u(wt,{model:r,name:l,isDownloading:en,tableDownloadStatus:nt,tableDownloadProgress:pe,tableDownloadEstimatedTime:ze!=null?ze:void 0,onDownload:this.handleDownloadTable,onDownloadStart:this.handleDownloadTableStart,onCancel:this.handleCancelDownloadTable,selectedRanges:_n},be.TABLE_EXPORTER);case be.SELECT_DISTINCT:return u(Na,{model:r,selectDistinctColumns:Ce,onChange:this.handleSelectDistinctChanged});case be.ADVANCED_SETTINGS:return u(gr,{items:d,onChange:h});default:throw Error(`Unexpected option type ${xe.type}`)}}),go=this.getCachedHiddenColumns(te.getHiddenColumns(us));return T("div",{className:"iris-grid",role:"presentation",children:[T("div",{className:"iris-grid-column",children:[e&&u("div",{className:"iris-grid-bar",children:e}),u(ot,{in:C,timeout:Rt.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"iris-grid-partition-selector-wrapper iris-grid-bar iris-grid-bar-primary",children:Q&&J&&u(Ma,{table:Q,getFormattedString:(xe,mt,Vt)=>r.displayString(xe,mt,Vt),columnName:J.name,partition:V,onChange:this.handlePartitionChange,onFetchAll:this.handlePartitionFetchAll,onAppend:this.handlePartitionAppend,onDone:this.handlePartitionDone})})}),u(ot,{in:Ue,timeout:Rt.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"iris-grid-bar",children:u(Ii,{value:ht,selectedColumns:Mt,invertSelection:Nt,onChange:this.handleCrossColumnSearch,columns:r.columns,ref:this.crossColumnRef})})}),T("div",{className:"grid-wrapper",ref:xe=>{this.gridWrapper=xe},children:[u(Fs,{ref:xe=>{this.grid=xe},isStickyBottom:!Ae(r)||!r.isEditable,isStuckToBottom:i,isStuckToRight:o,metricCalculator:g,model:r,keyHandlers:L,mouseHandlers:W,movedColumns:de,movedRows:ve,onError:this.handleGridError,onViewChanged:this.handleViewChanged,onSelectionChanged:this.handleSelectionChanged,onMovedColumnsChanged:this.handleMovedColumnsChanged,renderer:this.renderer,stateOverride:As,theme:Bn}),u(ug,{isOpen:oi,text:ri,onClose:this.handleOverflowClose}),ho&&u(ya,{model:r,modelColumns:r.columns,top:ci,bottom:di,left:ks,right:Ls,filter:co,formatter:_e,sorts:Ze,reverseType:Le,movedColumns:de,customColumns:_t,hiddenColumns:go,alwaysFetchColumns:this.getAlwaysFetchColumns(c,r.columns,de,r.floatingLeftColumnCount,r.floatingRightColumnCount,(Rr=(yr=this.grid)==null?void 0:yr.state.draggingColumn)==null?void 0:Rr.range),formatColumns:this.getCachedPreviewFormatColumns(this.getCachedModelColumns(r,_t),Ke,Dt,((Ir=xt[xt.length-1])==null?void 0:Ir.type)===be.CONDITIONAL_FORMATTING_EDIT&&Xe!=null?Xe:void 0),rollupConfig:this.getModelRollupConfig(r.originalColumns,Ft,ut),totalsConfig:this.getModelTotalsConfig(r.columns,Ft,ut),selectDistinctColumns:Ce,pendingRowCount:oo,pendingDataMap:ni,frozenColumns:ii}),!w&&u("div",{className:"grid-settings-button",children:u("button",{type:"button","data-testid":`btn-iris-grid-settings-button-${l}`,className:"btn btn-link btn-link-icon",onClick:this.handleMenu,children:u(q,{icon:ad,transform:"up-1"})})}),hi,ui,pi,mi,gi,li&&this.getOverflowButtonTooltip(li)]}),u(pg,{model:r,isShown:ai,gotoRow:lo,gotoRowError:ao,onSubmit:this.handleGotoRowSelectedRowNumberSubmit,onGotoRowNumberChanged:this.handleGotoRowSelectedRowNumberChanged,onClose:this.handleGotoRowClosed,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:()=>{this.handleAnimationStart(),this.focus()},onExited:this.handleAnimationEnd}),u(nm,{error:io,isSaving:Un!=null,saveTooltip:`Commit (${this.commitAction.shortcut.getDisplayText()})`,discardTooltip:`Discard (${this.discardAction.shortcut.getDisplayText()})`,pendingDataErrors:ro,pendingDataMap:ni,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,onSave:this.handlePendingCommitClicked,onDiscard:this.handlePendingDiscardClicked}),u(Cm,{children:si}),u(Os,{model:r,copyOperation:I!=null?I:void 0,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd}),u(xs,{ref:xe=>{this.tableSaver=xe},getDownloadWorker:n,onDownloadCompleted:this.handleDownloadCompleted,onDownloadCanceled:this.handleDownloadCanceled,onDownloadProgressUpdate:this.handleDownloadProgressUpdate,isDownloading:nt===wt.DOWNLOAD_STATUS.DOWNLOADING,formatter:_e})]}),u(ot,{in:w,timeout:Rt.transitionMidMs,classNames:"slide-left",onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"table-sidebar",children:T(uh,{children:[u($r,{title:"Table Options",onClose:this.handleMenuClose,children:u(oa,{onSelect:xe=>this.handleMenuSelect(fi[xe]),items:fi})}),po.map((xe,mt)=>u($r,{title:xt[mt].title,onBack:this.handleMenuBack,onClose:this.handleMenuClose,children:xe},xt[mt].type))]})})}),u(se,{actions:this.contextActions})]})}};let ti=ns;ti.minDebounce=150;ti.maxDebounce=500;ti.loadingSpinnerDelay=800;ti.defaultProps={children:null,advancedFilters:new Map,advancedSettings:new Map,alwaysFetchColumns:[],conditionalFormats:[],customColumnFormatMap:new Map,isFilterBarShown:!1,applyInputFiltersOnInit:!1,movedColumns:[],movedRows:[],inputFilters:[],customFilters:[],onCreateChart:void 0,onColumnSelected:()=>{},onDataSelected:()=>{},onError:()=>{},onStateChange:()=>{},onPartitionAppend:()=>{},onAdvancedSettingsChange:()=>{},partition:null,partitionColumn:null,quickFilters:new Map,selectDistinctColumns:[],sorts:[],reverseType:x.REVERSE_TYPE.NONE,customColumns:[],aggregationSettings:Qa,rollupConfig:void 0,userColumnWidths:new Map,userRowHeights:new Map,onSelectionChanged:()=>{},isSelectingColumn:!1,isSelectingPartition:!1,isStuckToBottom:!1,isStuckToRight:!1,columnSelectionValidator:null,columnAllowedCursor:null,columnNotAllowedCursor:null,name:"table",onlyFetchVisibleColumns:!0,showSearchBar:!1,searchValue:"",selectedSearchColumns:null,invertSearchColumns:!0,onContextMenu:()=>{},pendingDataMap:new Map,getDownloadWorker:void 0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:kn.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,truncateNumbersWithPound:!1,formatter:[],decimalFormatOptions:M.exports.shape({defaultFormatString:M.exports.string}),integerFormatOptions:M.exports.shape({defaultFormatString:M.exports.string})},canCopy:!0,canDownloadCsv:!0,frozenColumns:null,theme:Ra,canToggleSearch:!0};class bg extends Error{constructor(t,n){super(`${n} can't be empty (on pending row ${t+1})`),this.isMissingKey=!0,this.rowIndex=t,this.columnName=n}}const wg=ne.module("ColumnHeaderGroup");function El(e){return e instanceof ja}class ja{constructor({name:t,children:n,color:s,depth:i,childIndexes:o}){this.getVisibleRange=Ne(r=>{const l=this.childIndexes.flat(),a=U.getVisibleIndexes(l,r),c=Math.min(...a),d=Math.max(...a);return d-c!==l.length-1&&wg.warn(`Column header group ${this.name} is not contiguous`),[c,d]}),this.name=t,this.children=n,this.color=s,this.depth=i,this.childIndexes=o}}const Pe=ne.module("IrisGridTableModel"),Sg=150,vg=0;function Ni(e){return e.table!==void 0}const Uo=class extends he{constructor(e,t=new Qt,n=null){super(),this.pendingNewRowCount=0,this.columnHeaderGroupMap=new Map,this.columnHeaderParentMap=new Map,this._columnHeaderMaxDepth=null,this._columnHeaderGroups=[],this.getMemoizedColumnMap=Ne(s=>{const i=new Map;return s.forEach(o=>i.set(o.name,o)),i}),this.getColumnIndicesByNameMap=Ne(s=>{const i=new Map;return s.forEach(({name:o},r)=>i.set(o,r)),i}),this.setViewport=Xs((s,i,o)=>{if(i<s){Pe.error("Invalid viewport",s,i);return}const{viewport:r}=this;if(r!=null&&r.top===s&&r.bottom===i&&r.columns===o){Pe.debug2("Ignoring duplicate viewport",r);return}this.viewport={top:s,bottom:i,columns:o},Pe.debug2("setViewport",this.viewport),this.applyViewport()},Sg),this.applyViewport=Xs(()=>{if(!this.viewport)return;Pe.debug2("applyViewport",this.viewport);const{top:s,bottom:i,columns:o}=this.viewport,[r,l]=this.getCachedViewportRowRange(s,i);this.applyBufferedViewport(r,l,o)},vg,{leading:!1}),this.getCachedFormattedString=St((s,i,o,r,l)=>s.getFormattedString(i,o,r,l),{max:1e4}),this.getCachedCustomColumnFormatFlag=St(rs.isCustomColumnFormatDefined,{max:1e4}),this.getCachedViewportRowRange=Ne((s,i)=>{const o=i-s,r=Math.max(0,s-o*Uo.ROW_BUFFER_PAGES),l=i+o*Uo.ROW_BUFFER_PAGES;return[r,l]}),this.getCachedPendingErrors=Ne((s,i,o)=>{const r=new Map;return s.forEach((l,a)=>{var d;const{data:c}=l;for(let h=0;h<o;h+=1)c.has(h)||(r.has(a)||r.set(a,[]),(d=r.get(a))==null||d.push(new bg(a,i[h].name)))}),r}),this.handleTableDisconnect=this.handleTableDisconnect.bind(this),this.handleTableReconnect=this.handleTableReconnect.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this),this.handleTotalsUpdate=this.handleTotalsUpdate.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleCustomColumnsChanged=this.handleCustomColumnsChanged.bind(this),this.irisFormatter=t,this.inputTable=n,this.subscription=null,this.table=e,this.viewport=null,this.viewportData=null,this.formattedStringData=[],this.pendingStringData=[],this.isSaveInProgress=!1,this.totalsTable=null,this.totalsTablePromise=null,this.totals=null,this.totalsDataMap=null,this.pendingNewDataMap=new Map,this.pendingNewDataErrors=null,this.pendingNewRowCount=0}export(){throw new Error("Method not implemented.")}columnStatistics(e){throw new Error("Method not implemented.")}get customColumns(){return[]}set customColumns(e){throw new Error("Method not implemented.")}get formatColumns(){return[]}set formatColumns(e){throw new Error("Method not implemented.")}updateFrozenColumns(e){throw new Error("Method not implemented.")}get rollupConfig(){throw new Error("Method not implemented.")}set rollupConfig(e){throw new Error("Method not implemented.")}get selectDistinctColumns(){throw new Error("Method not implemented.")}set selectDistinctColumns(e){throw new Error("Method not implemented.")}get columns(){return this.table.columns}close(){this.table.close(),this.totalsTable!==null&&this.totalsTable.close(),this.totalsTablePromise!==null&&this.totalsTablePromise.cancel()}startListening(){super.startListening(),this.table.addEventListener(E.Table.EVENT_DISCONNECT,this.handleTableDisconnect),this.table.addEventListener(E.Table.EVENT_RECONNECT,this.handleTableReconnect),this.table.addEventListener(E.Table.EVENT_UPDATED,this.handleTableUpdate),this.table.addEventListener(E.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed),this.table.addEventListener(E.Table.EVENT_CUSTOMCOLUMNSCHANGED,this.handleCustomColumnsChanged),this.totalsTable!=null&&this.addTotalsListeners(this.totalsTable),this.applyViewport()}stopListening(){super.stopListening(),this.table.removeEventListener(E.Table.EVENT_DISCONNECT,this.handleTableDisconnect),this.table.removeEventListener(E.Table.EVENT_RECONNECT,this.handleTableReconnect),this.table.removeEventListener(E.Table.EVENT_UPDATED,this.handleTableUpdate),this.table.removeEventListener(E.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed),this.table.removeEventListener(E.Table.EVENT_CUSTOMCOLUMNSCHANGED,this.handleCustomColumnsChanged),this.totalsTable!=null&&this.removeTotalsListeners(this.totalsTable),this.closeSubscription()}addTotalsListeners(e){e.addEventListener(E.Table.EVENT_UPDATED,this.handleTotalsUpdate),e.setViewport(0,0)}removeTotalsListeners(e){e.removeEventListener(E.Table.EVENT_UPDATED,this.handleTotalsUpdate)}handleTableDisconnect(){this.dispatchEvent(new ye(he.EVENT.DISCONNECT))}handleTableReconnect(){this.dispatchEvent(new ye(he.EVENT.RECONNECT))}handleTableUpdate(e){this.copyViewportData(e.detail),this.dispatchEvent(new ye(he.EVENT.UPDATED))}handleTotalsUpdate(e){this.copyTotalsData(e.detail),this.dispatchEvent(new ye(he.EVENT.UPDATED))}handleRequestFailed(e){this.dispatchEvent(new ye(he.EVENT.REQUEST_FAILED,e))}handleCustomColumnsChanged(){this.dispatchEvent(new ye(he.EVENT.COLUMNS_CHANGED,{detail:this.columns}))}get rowCount(){var e,t,n;return this.table.size+this.pendingNewRowCount+((n=(t=(e=this.totals)==null?void 0:e.operationOrder)==null?void 0:t.length)!=null?n:0)}get pendingDataErrors(){var e,t;return this.getCachedPendingErrors(this.pendingNewDataMap,this.columns,(t=(e=this.inputTable)==null?void 0:e.keyColumns.length)!=null?t:0)}get pendingDataMap(){return this.pendingNewDataMap}set pendingDataMap(e){e!==this.pendingNewDataMap&&(e.forEach((t,n)=>{if(!te.isValidIndex(n))throw new Error(`Invalid rowIndex ${n}`);const{data:s}=t;s.forEach((i,o)=>{if(!te.isValidIndex(o))throw new Error(`Invalid columnIndex ${o}`)})}),this.pendingNewDataMap=e,this.pendingNewRowCount=Math.max(this.pendingNewRowCount,this.maxPendingDataRow),this.formattedStringData=[],this.dispatchEvent(new ye(he.EVENT.PENDING_DATA_UPDATED)))}get pendingRowCount(){return this.pendingNewRowCount}set pendingRowCount(e){e!==this.pendingNewRowCount&&(this.pendingNewRowCount=Math.max(0,e,this.maxPendingDataRow),this.dispatchEvent(new ye(he.EVENT.UPDATED)))}get maxPendingDataRow(){return this.pendingNewDataMap.size>0?Math.max(...this.pendingNewDataMap.keys())+1:0}get columnCount(){return this.columns.length}get floatingBottomRowCount(){var e,t,n,s;return(e=this.totals)!=null&&e.showOnTop?0:(s=(n=(t=this.totals)==null?void 0:t.operationOrder)==null?void 0:n.length)!=null?s:0}get floatingTopRowCount(){var e,t,n,s;return(e=this.totals)!=null&&e.showOnTop&&(s=(n=(t=this.totals)==null?void 0:t.operationOrder)==null?void 0:n.length)!=null?s:0}get isChartBuilderAvailable(){return!0}get isTotalsAvailable(){return this.table.getTotalsTable!=null}get isEditable(){return!this.isSaveInProgress&&this.inputTable!=null}cacheFormattedValue(e,t,n){this.formattedStringData[e]==null&&(this.formattedStringData[e]=[]),this.formattedStringData[e][t]=n}cachePendingValue(e,t,n){this.pendingStringData[e]==null&&(this.pendingStringData[e]=[]),this.pendingStringData[e][t]=n}clearPendingValue(e,t){const n=this.pendingStringData[e];n!=null&&delete n[t]}textValueForCell(e,t){var n,s,i;if(((n=this.pendingStringData[e])==null?void 0:n[t])!==void 0)return this.pendingStringData[e][t];if(((s=this.formattedStringData[e])==null?void 0:s[t])===void 0){const o=this.valueForCell(e,t);if(o==null)return null;const r=(i=this.totalsColumn(e,t))!=null?i:this.columns[e],l=this.getCachedCustomColumnFormatFlag(this.formatter,r.name,r.type);let a;if(!l){const d=this.formatForCell(e,t);(d==null?void 0:d.formatString)!=null&&(a=d)}const c=this.displayString(o,r.type,r.name,a);this.cacheFormattedValue(e,t,c)}return this.formattedStringData[e][t]}textForCell(e,t){const n=this.textValueForCell(e,t);if(n==null&&this.isKeyColumn(e)){const s=this.pendingRow(t);if(s!=null&&this.pendingDataMap.has(s))return"*"}return n!=null?n:""}truncationCharForCell(e){const t=this.columns[e],{type:n}=t;if(x.isNumberType(n)&&this.formatter.truncateNumbersWithPound)return"#"}colorForCell(e,t,n){var i;const s=this.dataForCell(e,t);if(s){const{format:o,value:r}=s;if(r==null||r==="")return O(n.nullStringColor),n.nullStringColor;if(o&&o.color)return o.color;if(this.isPendingRow(t))return O(n.pendingTextColor),n.pendingTextColor;if(r!=null){const l=(i=this.totalsColumn(e,t))!=null?i:this.columns[e];if(x.isDateType(l.type)||l.name==="Date")return O(n.dateColor),n.dateColor;if(x.isNumberType(l.type))return r>0?(O(n.positiveNumberColor),n.positiveNumberColor):r<0?(O(n.negativeNumberColor),n.negativeNumberColor):(O(n.zeroNumberColor),n.zeroNumberColor)}}else if(this.isPendingRow(t)&&this.isKeyColumn(e))return O(n.errorTextColor),n.errorTextColor;return n.textColor}backgroundColorForCell(e,t){var n,s;return(s=(n=this.formatForCell(e,t))==null?void 0:n.backgroundColor)!=null?s:null}textAlignForCell(e){const t=this.columns[e],{type:n}=t;return x.isNumberType(n)?"right":x.isDateType(n)||t.name==="Date"?"center":"left"}textForColumnHeader(e,t=0){var n,s;return(s=(n=this.columnAtDepth(e,t))==null?void 0:n.name)!=null?s:void 0}colorForColumnHeader(e,t=0){var s;const n=this.columnAtDepth(e,t);return El(n)&&(s=n.color)!=null?s:null}getColumnHeaderGroup(e,t){const n=this.columnAtDepth(e,t);if(El(n))return n}getColumnHeaderParentGroup(e,t){var n,s;return this.columnHeaderParentMap.get((s=(n=this.columnAtDepth(e,t))==null?void 0:n.name)!=null?s:"")}columnAtDepth(e,t=0){var o;if(t===0)return this.columns[e];const n=(o=this.columns[e])==null?void 0:o.name;let s=this.columnHeaderParentMap.get(n);if(!s)return;let i=s.depth;for(;i<t;){if(s=this.columnHeaderParentMap.get(s.name),!s)return;i=s.depth}if(s.depth===t)return s}textForRowFooter(e){const t=this.totalsRow(e);return t!=null&&this.totals?this.totals.operationOrder[t]:""}get movedColumns(){var i;let e=[];const t=(o,r)=>{const l=this.getColumnIndexByName(o);if(l==null)throw new Error(`Unknown layout hint column: ${o}`);const a=U.getVisibleIndex(l,e);e=U.moveItem(a,r,e)},n=(o,r)=>{const l=this.columnHeaderGroupMap.get(o);if(!l)throw new Error(`Unknown layout hint group: ${o}`);const a=l.getVisibleRange(e);e=U.moveRange(a,r,e)};if(this.frontColumns.length||this.backColumns.length||this.frozenColumns.length){const o=new Set;let r=0;this.frozenColumns.forEach(a=>{if(o.has(a))throw new Error(`Column specified in multiple layout hints: ${a}`);t(a,r),r+=1}),this.frontColumns.forEach(a=>{if(o.has(a))throw new Error(`Column specified in multiple layout hints: ${a}`);t(a,r),r+=1});let l=this.columnMap.size-1;this.backColumns.forEach(a=>{if(o.has(a))throw new Error(`Column specified in multiple layout hints: ${a}`);t(a,l),l-=1})}const s=(i=this.layoutHints)==null?void 0:i.columnGroups;if(s){this.setColumnHeaderGroups(s);const o=[...this.columnHeaderGroupMap.values()];o.sort((r,l)=>r.depth-l.depth),o.forEach(r=>{const l=r.children[0],a=this.getColumnIndexByName(l);let c;if(a!=null)c=U.getVisibleIndex(a,e);else{const d=this.columnHeaderGroupMap.get(l);if(!d)throw new Error(`Unknown column ${l} in group ${r.name}`);[,c]=d.getVisibleRange(e)}for(let d=1;d<r.children.length;d+=1){const h=r.children[d],m=this.columnHeaderGroupMap.get(h),p=this.getColumnIndexByName(h);if(m){const f=m.getVisibleRange(e)[0]<c?c-m.childIndexes.length+1:c+1;n(h,f),c=f+m.childIndexes.length-1}else if(p){const f=U.getVisibleIndex(p,e)<c?c:c+1;t(h,f),c=f}}})}return e}get columnMap(){return this.getMemoizedColumnMap(this.table.columns)}get columnHeaderMaxDepth(){var e,t;return this._columnHeaderMaxDepth==null&&this.setColumnHeaderGroups((e=this.layoutHints)==null?void 0:e.columnGroups),(t=this._columnHeaderMaxDepth)!=null?t:1}set columnHeaderMaxDepth(e){this._columnHeaderMaxDepth=e}setColumnHeaderGroups(e){if(e===this._columnHeaderGroups||(this._columnHeaderGroups=e!=null?e:[],this.columnHeaderMaxDepth=1,this.columnHeaderParentMap=new Map,this.columnHeaderGroupMap=new Map,!e||e.length===0))return;const t=new Map(e.map(o=>[o.name,o])),n=new Set,s=o=>{const{name:r}=o;if(this.getColumnIndexByName(r)!=null)throw new Error(`Column header group has same name as column: ${r}`);const l=this.columnHeaderGroupMap.get(r);if(l)return l;const a=[];let c=1;o.children.forEach(h=>{if(n.has(h))throw new Error(`Column group child ${h} specified in multiple groups`);n.add(h);const m=t.get(h),p=this.getColumnIndexByName(h);if(m){const g=s(m);a.push(g.childIndexes.flat()),c=Math.max(c,g.depth+1)}else if(p!=null)a.push(p),c=Math.max(c,1);else throw new Error(`Unknown child ${h} in group ${r}`)});const d=new ja({...o,depth:c,childIndexes:a});return this.columnHeaderGroupMap.set(r,d),o.children.forEach(h=>this.columnHeaderParentMap.set(h,d)),this.columnHeaderMaxDepth=Math.max(this.columnHeaderMaxDepth,d.depth+1),d},i=new Set;e.forEach(o=>{const{name:r}=o;if(i.has(r))throw new Error(`Duplicate column group name: ${r}`);i.add(r),s(o)})}get groupedColumns(){return[]}row(e){var l,a,c,d,h,m,p,g,f,b,C,w,S,I;const t=(c=(a=(l=this.totals)==null?void 0:l.operationOrder)==null?void 0:a.length)!=null?c:0,n=(h=(d=this.totals)==null?void 0:d.showOnTop)!=null?h:!1,s=this.totalsRow(e);if(s!=null){const v=(m=this.totals)==null?void 0:m.operationOrder[s];return O(v),(g=(p=this.totalsDataMap)==null?void 0:p.get(v))!=null?g:null}const i=this.pendingRow(e);if(i!=null)return(f=this.pendingNewDataMap.get(i))!=null?f:null;const o=(C=(b=this.viewportData)==null?void 0:b.offset)!=null?C:0,r=(n?e-t:e)-o;return(I=(S=(w=this.viewportData)==null?void 0:w.rows)==null?void 0:S[r])!=null?I:null}totalsColumn(e,t){var r,l,a,c;const n=this.totalsRow(t);if(n==null)return null;const s=(r=this.totals)==null?void 0:r.operationOrder[n],i=(a=(l=this.totals)==null?void 0:l.defaultOperation)!=null?a:we.SUM,o=this.columns[e];return(c=this.totalsTable)==null?void 0:c.columns.find(d=>{var h;return d.name===`${o.name}__${s}`||(s===i||((h=this.totals)==null?void 0:h.operationOrder.length)===1)&&d.name===o.name})}totalsRow(e){var i,o,r,l,a;const t=(r=(o=(i=this.totals)==null?void 0:i.operationOrder)==null?void 0:o.length)!=null?r:0,s=((a=(l=this.totals)==null?void 0:l.showOnTop)!=null?a:!1)?e:e-this.table.size;return s>=0&&s<t?s:null}pendingRow(e){const t=e-this.floatingTopRowCount-this.table.size;return t>=0&&t<this.pendingNewRowCount?t:null}isTotalsRow(e){return this.totalsRow(e)!=null}isPendingRow(e){return this.pendingRow(e)!=null}dataForCell(e,t){var n;return(n=this.row(t))==null?void 0:n.data.get(e)}formatForCell(e,t){var n;return(n=this.dataForCell(e,t))==null?void 0:n.format}valueForCell(e,t){var s;const n=this.dataForCell(e,t);if(n)return(s=n.value)!=null?s:null}copyViewportData(e){if(!e){Pe.warn("invalid data!");return}this.viewportData=this.extractViewportData(e),this.formattedStringData=[]}copyTotalsData(e){var l,a,c,d,h;if(!e){Pe.warn("invalid data!");return}const{columns:t,rows:n}=e;if(n.length!==1){Pe.error("Unexpected number of rows received for totals table, ignoring update");return}const s=new Map,i=n[0],o=(a=(l=this.totals)==null?void 0:l.defaultOperation)!=null?a:we.SUM,r=(c=this.totals)==null?void 0:c.operationMap;for(let m=0;m<t.length;m+=1){const p=t[m],[g,f=(h=(d=r==null?void 0:r[g])==null?void 0:d[0])!=null?h:o]=p.name.split("__");s.has(f)||s.set(f,{data:new Map});const{data:b}=s.get(f),C=this.columns.findIndex(w=>w.name===g);b.set(C,{value:i.get(p),format:i.getFormat(p)})}Pe.debug2("copyTotalsData",s),this.totalsDataMap=s,this.formattedStringData=[]}getColumnIndexByName(e){return this.getColumnIndicesByNameMap(this.columns).get(e)}extractViewportData(e){const t={offset:e.offset,rows:[]},{columns:n}=e;for(let s=0;s<e.rows.length;s+=1){const i=e.rows[s],o=this.extractViewportRow(i,n);t.rows.push(o)}return t}extractViewportRow(e,t){const n=new Map;for(let s=0;s<t.length;s+=1){const i=t[s],o=this.getColumnIndexByName(i.name);O(o),n.set(o,{value:e.get(i),format:e.getFormat(i)})}return{data:n}}closeSubscription(){Pe.debug2("closeSubscription",this.subscription),this.subscription&&(this.subscription.close(),this.subscription=null),this.setViewport.cancel(),this.applyViewport.cancel()}get filter(){return this.table.filter}set filter(e){this.closeSubscription(),this.table.applyFilter(e),this.applyViewport()}get formatter(){return this.irisFormatter}set formatter(e){this.irisFormatter=e,this.formattedStringData=[],this.dispatchEvent(new ye(he.EVENT.FORMATTER_UPDATED))}displayString(e,t,n="",s){return this.getCachedFormattedString(this.formatter,e,t,n,s)}get sort(){return this.table.sort}set sort(e){this.closeSubscription(),this.table.applySort(e),this.applyViewport()}set totalsConfig(e){if(Pe.debug("set totalsConfig",e),e!==this.totals){if(this.totals=e,this.formattedStringData=[],this.totalsTablePromise!=null&&this.totalsTablePromise.cancel(),this.setTotalsTable(null),e==null){this.dispatchEvent(new ye(he.EVENT.UPDATED));return}this.totalsTablePromise=He.makeCancelable(this.table.getTotalsTable(e),t=>t.close()),this.totalsTablePromise.then(t=>{this.totalsTablePromise=null,this.setTotalsTable(t)}).catch(t=>{He.isCanceled(t)||(Pe.error("Unable to set next totalsTable",t),this.totalsTablePromise=null,this.dispatchEvent(new ye(he.EVENT.REQUEST_FAILED,{detail:t})))})}}setTotalsTable(e){Pe.debug("setTotalsTable",e),this.totalsTable!==null&&(this.listenerCount>0&&this.removeTotalsListeners(this.totalsTable),this.totalsTable.close()),this.totalsTable=e,this.totalsDataMap=null,this.listenerCount>0&&this.totalsTable!=null&&this.addTotalsListeners(this.totalsTable)}applyBufferedViewport(e,t,n){Pe.debug2("applyBufferedViewport",e,t,n),this.subscription==null?(Pe.debug2("applyBufferedViewport creating new subscription"),this.subscription=this.table.setViewport(e,t,n)):(Pe.debug2("applyBufferedViewport using existing subscription"),this.subscription.setViewport(e,t,n))}async snapshot(e,t=!1,n=s=>s){if(this.subscription==null)throw new Error("No subscription available");const s=j.consolidate(e);if(!te.isValidSnapshotRanges(s))throw new Error(`Invalid snapshot ranges ${e}`);const i=new Set,o=[],r=new Set;for(let h=0;h<s.length;h+=1){const m=s[h];O(m.endRow),O(m.startRow);for(let p=m.startRow;p<=m.endRow&&p<this.floatingTopRowCount;p+=1)i.add(p);m.endRow>=this.floatingTopRowCount&&m.startRow<=this.floatingTopRowCount+this.table.size&&o.push(new j(m.startColumn,Math.min(Math.max(0,m.startRow-this.floatingTopRowCount)),m.endColumn,Math.min(Math.max(0,m.endRow-this.floatingTopRowCount),this.table.size-this.floatingTopRowCount)));for(let p=Math.max(m.startRow,this.floatingTopRowCount+this.table.size);p<=m.endRow&&p<this.floatingTopRowCount+this.table.size+this.floatingBottomRowCount;p+=1)r.add(p)}const l=te.columnsFromRanges(s,this.columns),a=[];t&&a.push(l.map(h=>h.name));const c=[...i].sort();for(let h=0;h<c.length;h+=1){const m=c[h],p=l.map(g=>{const f=this.getColumnIndexByName(g.name);return O(f),n(this.valueForCell(f,m),g)});t&&p.push(this.textForRowFooter(m)),a.push(p)}if(o.length>0){const h=te.rangeSetFromRanges(o),m=await this.subscription.snapshot(h,l);a.push(...m.rows.map(p=>l.map(g=>n(p.get(g),g))))}const d=[...r].sort();for(let h=0;h<d.length;h+=1){const m=d[h],p=l.map(g=>{const f=this.getColumnIndexByName(g.name);return O(f),n(this.valueForCell(f,m),g)});t&&p.push(this.textForRowFooter(m)),a.push(p)}return a}async textSnapshot(e,t=!1,n=s=>`${s}`){return Pe.debug2("textSnapshot",e,t),(await this.snapshot(e,t,n)).map(i=>i.join(" ")).join(`
|
|
31
31
|
`)}async valuesTable(e){let t=null;try{return t=await this.table.copy(),t.applyFilter([]),t.applySort([]),t.selectDistinct([e])}finally{t!=null&&t.close()}}isColumnMovable(e,t){if(e<0||e>=this.columnCount)return!1;if(t>0)return!0;const n=this.columns[e].name;return this.frontColumns.includes(n)||this.backColumns.includes(n)||this.frozenColumns.includes(n)||!n?!1:!this.isKeyColumn(e)}isKeyColumn(e){var t,n;return e<((n=(t=this.inputTable)==null?void 0:t.keyColumns.length)!=null?n:0)}isRowMovable(){return!1}isEditableRange(e){return this.inputTable!=null&&j.isBounded(e)&&(this.isPendingRow(e.startRow)&&this.isPendingRow(e.endRow)||e.startColumn>=this.inputTable.keyColumns.length&&e.endColumn>=this.inputTable.keyColumns.length)&&e.startRow>=this.floatingTopRowCount&&e.startRow<this.floatingTopRowCount+this.table.size+this.pendingRowCount&&e.endRow<this.floatingTopRowCount+this.table.size+this.pendingRowCount}isDeletableRange(e){return this.inputTable!=null&&e.startRow!=null&&e.endRow!=null&&e.startRow>=this.floatingTopRowCount&&e.startRow<this.floatingTopRowCount+this.table.size+this.pendingRowCount&&e.endRow<this.floatingTopRowCount+this.table.size+this.pendingRowCount}isEditableRanges(e){return e.every(t=>this.isEditableRange(t))}isDeletableRanges(e){return e.every(t=>this.isDeletableRange(t))}getTableAreaRange(){return new j(null,this.floatingTopRowCount,null,this.floatingTopRowCount+this.table.size-1)}getPendingAreaRange(){return new j(null,this.floatingTopRowCount+this.table.size,null,this.floatingTopRowCount+this.table.size+this.pendingNewRowCount-1)}async setValueForCell(e,t,n){return this.setValueForRanges([new j(e,t,e,t)],n)}async setValueForRanges(e,t){var n;if(!this.isEditableRanges(e))throw new Error(`Uneditable ranges ${e}`);try{const s=new Set,i=[];j.forEachCell(e,(c,d)=>{const h=this.columns[c];if(s.add(h),i[c]===void 0){const m=x.makeValue(h.type,t,this.formatter.timeZone);i[c]=m!=null?this.displayString(m,h.type,h.name):null}this.cachePendingValue(c,d,i[c])});const o=this.getPendingAreaRange(),r=e.map(c=>j.intersection(o,c)).filter(c=>c!=null).map(c=>(O(c),j.offset(c,0,-(this.floatingTopRowCount+this.table.size))));if(r.length>0){const c=new Map(this.pendingNewDataMap);j.forEachCell(r,(d,h)=>{c.has(h)||c.set(h,{data:new Map});const m=this.columns[d],p=c.get(h);O(p);const{data:g}=p,f=new Map(g),b=x.makeValue(m.type,t,this.formatter.timeZone);b!=null?f.set(d,{value:b}):f.delete(d),f.size>0?c.set(h,{...p,data:f}):c.delete(h)}),this.pendingDataMap=c}this.dispatchEvent(new ye(he.EVENT.UPDATED));const l=this.getTableAreaRange(),a=e.map(c=>j.intersection(l,c)).filter(c=>c!=null);if(a.length>0){const d=(await this.snapshot(a.map(m=>{var p,g;return new j(null,(p=m==null?void 0:m.startRow)!=null?p:null,null,(g=m==null?void 0:m.endRow)!=null?g:null)}))).map(m=>{const p={};for(let g=0;g<this.columns.length;g+=1)p[this.columns[g].name]=m[g];return s.forEach(g=>{p[g.name]=x.makeValue(g.type,t,this.formatter.timeZone)}),p}),h=await((n=this.inputTable)==null?void 0:n.addRows(d));Pe.debug("setValueForRanges(",e,",",t,") set tableRanges",a,"result",h)}j.forEachCell(e,(c,d)=>{const h=i[c];O(h),this.cacheFormattedValue(c,d,h)})}catch(s){Pe.error("Unable to set ranges",e,t,s)}finally{j.forEachCell(e,(s,i)=>{this.clearPendingValue(s,i)})}}async setValues(e=[]){var t;if(Pe.debug("setValues(",e,")"),!e.every(n=>{var s,i;return this.isEditableRange(j.makeCell((s=n.column)!=null?s:n.x,(i=n.row)!=null?i:n.y))}))throw new Error(`Uneditable ranges ${e}`);try{const n=new Map(this.pendingNewDataMap);e.forEach(l=>{var f,b;const{text:a}=l,c=(f=l.column)!=null?f:l.x,d=(b=l.row)!=null?b:l.y,h=this.columns[c],m=x.makeValue(h.type,a,this.formatter.timeZone),p=m!=null?this.displayString(m,h.type,h.name):null;this.cachePendingValue(c,d,p);const g=this.pendingRow(d);if(g!=null){n.has(g)||n.set(g,{data:new Map});const C=n.get(g);O(C);const{data:w}=C,S=new Map(w);m!=null?S.set(c,{value:m}):S.delete(c),S.size>0?n.set(g,{...C,data:S}):n.delete(g)}}),this.pendingDataMap=n,this.dispatchEvent(new ye(he.EVENT.UPDATED));const s=e.reduce((l,a)=>{var d,h;const c=(d=a.row)!=null?d:a.y;return l.has(c)||l.set(c,[]),(h=l.get(c))==null||h.push(a),l},new Map),i=j.consolidate(e.map(l=>{var a,c;return j.makeCell((a=l.column)!=null?a:l.x,(c=l.row)!=null?c:l.y)})),o=this.getTableAreaRange(),r=i.map(l=>j.intersection(o,l)).filter(l=>l!=null);if(r.length>0){const a=(await this.snapshot(r.map(d=>(O(d),new j(null,d.startRow,null,d.endRow))))).map((d,h)=>{let m=null,p=h;for(let b=0;b<r.length;b+=1){const C=r[b];O(C);const w=j.rowCount([C]);if(p<w){O(C.startRow),m=C.startRow+p;break}p-=w}const g={};for(let b=0;b<this.columns.length;b+=1)g[this.columns[b].name]=d[b];O(m);const f=s.get(m);return f!=null&&f.forEach(b=>{var w;const C=this.columns[(w=b.column)!=null?w:b.x];g[C.name]=x.makeValue(C.type,b.text,this.formatter.timeZone)}),g});Pe.info("setValues setting tableRanges",r);const c=await((t=this.inputTable)==null?void 0:t.addRows(a));Pe.info("setValues set tableRanges",r,"SUCCESS",c)}e.forEach(l=>{var g,f;const{text:a}=l,c=(g=l.column)!=null?g:l.x,d=(f=l.row)!=null?f:l.y,h=this.columns[c],m=x.makeValue(h.type,a,this.formatter.timeZone),p=m!=null?this.displayString(m,h.type,h.name):null;this.cacheFormattedValue(c,d,p)})}finally{e.forEach(n=>{this.clearPendingValue(n.column,n.row)})}}async commitPending(){var e,t,n;if(this.pendingNewDataMap.size<=0)throw new Error("No pending changes to commit");try{this.isSaveInProgress=!0;const s=[];this.pendingNewDataMap.forEach(o=>{const r={};o.data.forEach(({value:l},a)=>{const c=this.columns[a];r[c.name]=l}),s.push(r)});const i=await((e=this.inputTable)==null?void 0:e.addRows(s));Pe.debug("commitPending()",this.pendingNewDataMap,"result",i),this.pendingNewDataMap=new Map,this.pendingNewDataErrors=new Map,this.pendingNewRowCount=Math.max(0,((n=(t=this.viewport)==null?void 0:t.bottom)!=null?n:0)-this.table.size),this.formattedStringData=[],this.dispatchEvent(new ye(he.EVENT.PENDING_DATA_UPDATED))}finally{this.isSaveInProgress=!1}}editValueForCell(e,t){return this.textValueForCell(e,t)}async delete(e){if(!this.isDeletableRanges(e))throw new Error(`Undeletable ranges ${e}`);O(this.inputTable);const{keyColumns:t}=this.inputTable;if(t.length===0)throw new Error("No key columns to allow deletion");const n=this.getPendingAreaRange(),s=e.map(d=>j.intersection(n,d)).filter(d=>d!=null).map(d=>(O(d),j.offset(d,0,-(this.floatingTopRowCount+this.table.size))));if(s.length>0){const d=new Map(this.pendingNewDataMap);for(let h=0;h<s.length;h+=1){const m=s[h];O(m.startRow),O(m.endRow);for(let p=m.startRow;p<=m.endRow;p+=1)d.delete(p)}this.pendingNewDataMap=d,this.formattedStringData=[],this.dispatchEvent(new ye(he.EVENT.PENDING_DATA_UPDATED)),this.dispatchEvent(new ye(he.EVENT.UPDATED))}const i=this.getTableAreaRange(),o=e.map(d=>j.intersection(i,d)).filter(d=>d!=null);if(o.length<=0)return;const[r,l]=await Promise.all([this.snapshot(o.map(d=>(O(d),new j(0,d.startRow,t.length-1,d.endRow)))),this.table.copy()]),c=r.map(d=>{const h=[];for(let m=0;m<t.length;m+=1){const p=t[m],g=d[m],f=x.makeFilterRawValue(p.type,g),b=p.filter().eq(f);h.push(b)}return h.reduce((m,p)=>m?m.and(p):p)}).reduce((d,h)=>d?d.or(h):h);l.applyFilter([c]),l.close()}isValidForCell(e,t,n){try{const s=this.columns[e];return x.makeValue(s.type,n,this.formatter.timeZone),!0}catch{return!1}}};let wr=Uo;wr.ROW_BUFFER_PAGES=1;const Rn=ne.module("IrisGridTableModel"),Fo=Object.freeze([]);class Tg extends wr{constructor(t,n=new Qt,s=null){super(t,n,s),this.getMemoizedFrontColumns=Ne(i=>i!=null?i:Fo),this.getMemoizedBackColumns=Ne(i=>i!=null?i:Fo),this.getMemoizedFrozenColumns=Ne((i,o)=>{var r;return(r=o!=null?o:i)!=null?r:Fo}),this.getCachedFilterableColumnSet=Ne(i=>new Set(i.map((o,r)=>r))),this.customColumnList=[],this.formatColumnList=[]}get isExportAvailable(){return this.table.freeze!=null}get isColumnStatisticsAvailable(){return this.table.getColumnStatistics!=null}get isValuesTableAvailable(){return this.table.selectDistinct!=null&&this.table.copy!=null}get isRollupAvailable(){return this.table.rollup!=null}get isSelectDistinctAvailable(){return this.table.selectDistinct!=null}get isCustomColumnsAvailable(){return this.table.applyCustomColumns!=null}get isFormatColumnsAvailable(){return this.table.applyCustomColumns!=null}get frontColumns(){var t;return this.getMemoizedFrontColumns((t=this.layoutHints)==null?void 0:t.frontColumns)}get backColumns(){var t;return this.getMemoizedBackColumns((t=this.layoutHints)==null?void 0:t.backColumns)}get frozenColumns(){var t;return this.getMemoizedFrozenColumns((t=this.layoutHints)==null?void 0:t.frozenColumns,this.userFrozenColumns)}get layoutHints(){return this.table.layoutHints}get floatingLeftColumnCount(){return this.frozenColumns.length}get description(){return this.table.description}get customColumns(){return this.customColumnList}set customColumns(t){if(Rn.debug2("set customColumns",t,this.customColumnList,t===this.customColumnList),this.customColumnList.length===0&&t.length===0){Rn.debug("Ignore empty initial customColumns"),this.customColumnList=t;return}if(this.customColumnList===t){Rn.debug("Ignore same customColumns");return}this.closeSubscription(),this.customColumnList=t,this.table.applyCustomColumns([...t,...this.formatColumns]),this.applyViewport()}get formatColumns(){return this.formatColumnList}set formatColumns(t){if(Rn.debug2("set formatColumns",t,this.formatColumnList,t===this.formatColumnList),this.formatColumnList.length===0&&t.length===0){Rn.debug("Ignore empty initial formatColumns"),this.formatColumnList=t;return}if(this.formatColumnList===t){Rn.debug("Ignore same formatColumns");return}this.closeSubscription(),this.formatColumnList=t,this.table.applyCustomColumns([...this.customColumns,...t]),this.applyViewport()}updateFrozenColumns(t){this.userFrozenColumns=t,this.dispatchEvent(new ye(he.EVENT.TABLE_CHANGED,{detail:this.table}))}set totalsConfig(t){if(Rn.debug("set totalsConfig",t),t!==this.totals){if(this.totals=t,this.formattedStringData=[],this.totalsTablePromise!=null&&this.totalsTablePromise.cancel(),this.setTotalsTable(null),t==null){this.dispatchEvent(new ye(he.EVENT.UPDATED));return}this.totalsTablePromise=He.makeCancelable(this.table.getTotalsTable(t),n=>n.close()),this.totalsTablePromise.then(n=>{this.totalsTablePromise=null,this.setTotalsTable(n)}).catch(n=>{He.isCanceled(n)||(Rn.error("Unable to set next totalsTable",n),this.totalsTablePromise=null,this.dispatchEvent(new ye(he.EVENT.REQUEST_FAILED,{detail:n})))})}}get isFilterRequired(){return this.table.isUncoalesced}isFilterable(t){return this.getCachedFilterableColumnSet(this.columns).has(t)}async export(){return this.table.freeze()}columnStatistics(t){return this.table.getColumnStatistics(t)}isColumnMovable(t){const n=this.columns[t].name;return this.frontColumns.includes(n)||this.backColumns.includes(n)||this.frozenColumns.includes(n)?!1:!this.isKeyColumn(t)}isColumnFrozen(t){return this.frozenColumns.includes(this.columns[t].name)}async delete(t){var h;if(!this.isDeletableRanges(t))throw new Error(`Undeletable ranges ${t}`);O(this.inputTable);const{keyColumns:n}=this.inputTable;if(n.length===0)throw new Error("No key columns to allow deletion");const s=this.getPendingAreaRange(),i=t.map(m=>j.intersection(s,m)).filter(m=>m!=null).map(m=>(O(m),j.offset(m,0,-(this.floatingTopRowCount+this.table.size))));if(i.length>0){const m=new Map(super.pendingDataMap);for(let p=0;p<i.length;p+=1){const g=i[p];O(g.startRow),O(g.endRow);for(let f=g.startRow;f<=g.endRow;f+=1)m.delete(f)}super.pendingDataMap=m,this.formattedStringData=[],this.dispatchEvent(new ye(he.EVENT.PENDING_DATA_UPDATED)),this.dispatchEvent(new ye(he.EVENT.UPDATED))}const o=this.getTableAreaRange(),r=t.map(m=>j.intersection(o,m)).filter(m=>m!=null);if(r.length<=0)return;const[l,a]=await Promise.all([this.snapshot(r.map(m=>(O(m),new j(0,m.startRow,n.length-1,m.endRow)))),this.table.copy()]),d=l.map(m=>{const p=[];for(let g=0;g<n.length;g+=1){const f=n[g],b=m[g],C=x.makeFilterRawValue(f.type,b),w=f.filter().eq(C);p.push(w)}return p.reduce((g,f)=>g?g.and(f):f)}).reduce((m,p)=>m?m.or(p):p);a.applyFilter([d]),await((h=this.inputTable)==null?void 0:h.deleteTable(a)),a.close()}}class Eg extends wr{constructor(){super(...arguments),this.getCachedFilterableColumnSet=Ne((t,n)=>new Set(((n==null?void 0:n.length)>0?n:t).map(s=>t.findIndex(i=>s.name===i.name))))}applyBufferedViewport(t,n,s){this.table.setViewport(t,n,s)}textForCell(t,n){const s=this.columns[t],i=this.row(n);if(i!=null&&s!=null&&!i.hasChildren&&s.constituentType!=null){const o=this.valueForCell(t,n);return this.displayString(o,s.constituentType,s.name)}return super.textForCell(t,n)}extractViewportRow(t,n){const{isExpanded:s,hasChildren:i,depth:o}=t;return{...super.extractViewportRow(t,n),isExpanded:s,hasChildren:i,depth:o}}async snapshot(t,n,s){var l,a,c,d;O(this.viewport),O(this.viewportData);const{columns:i}=this.viewport,o=[];n&&o.push(i.map(h=>h.name));const r=new j(0,(l=this.viewportData)==null?void 0:l.offset,i.length,((a=this.viewportData)==null?void 0:a.offset)+((c=this.viewportData)==null?void 0:c.rows.length));for(let h=0;h<t.length;h+=1){const m=j.intersection(r,t[h]);O(m),O(m.startRow),O(m.endRow);for(let p=m.startRow;p<=m.endRow;p+=1){const g=[],f=this.viewportData.rows[p-this.viewportData.offset];O(m.startColumn),O(m.endColumn);for(let b=m.startColumn;b<=m.endColumn;b+=1)O(s),g.push(s((d=f.data.get(b))==null?void 0:d.value,this.columns[b]));o.push(g)}}return o}get groupedColumns(){return[]}get hasExpandableRows(){return!0}get isChartBuilderAvailable(){return!1}get isSelectDistinctAvailable(){return!1}get isReversible(){return!1}isFilterable(t){return this.getCachedFilterableColumnSet(this.columns,this.groupedColumns).has(t)}isColumnMovable(t){return t>=this.groupedColumns.length}isRowExpandable(t){var s;const n=this.row(t);return(s=n==null?void 0:n.hasChildren)!=null?s:!1}isRowExpanded(t){var s;const n=this.row(t);return(s=n==null?void 0:n.isExpanded)!=null?s:!1}setRowExpanded(t,n){this.table.setExpanded(t,n)}depthForRow(t){var s;const n=this.row(t);return((s=n==null?void 0:n.depth)!=null?s:1)-1}}const In=ne.module("IrisGridProxyModel");function xo(e,t,n){return x.isTreeTable(e)?new Eg(e,t):new Tg(e,t,n)}class yg extends he{constructor(t,n=new Qt,s=null){super(),this.textForCell=(...o)=>this.model.textForCell(...o),this.truncationCharForCell=(...o)=>this.model.truncationCharForCell(...o),this.textAlignForCell=(...o)=>this.model.textAlignForCell(...o),this.colorForCell=(...o)=>this.model.colorForCell(...o),this.backgroundColorForCell=(...o)=>this.model.backgroundColorForCell(...o),this.textForColumnHeader=(...o)=>this.model.textForColumnHeader(...o),this.colorForColumnHeader=(...o)=>this.model.colorForColumnHeader(...o),this.textForRowHeader=(...o)=>this.model.textForRowHeader(...o),this.textForRowFooter=(...o)=>this.model.textForRowFooter(...o),this.isRowMovable=(...o)=>this.model.isRowMovable(...o),this.isColumnMovable=(...o)=>this.model.isColumnMovable(...o),this.isRowExpandable=(...o)=>qe(this.model)?this.model.isRowExpandable(...o):!1,this.isRowExpanded=(...o)=>qe(this.model)?this.model.isRowExpanded(...o):!1,this.setRowExpanded=(...o)=>{if(qe(this.model))return this.model.setRowExpanded(...o);throw Error("Function setRowExpanded does not exist on IrisGridTableModel")},this.depthForRow=(...o)=>qe(this.model)?this.model.depthForRow(...o):0,this.getColumnHeaderGroup=(...o)=>this.model.getColumnHeaderGroup(...o),this.getColumnHeaderParentGroup=(...o)=>this.model.getColumnHeaderParentGroup(...o),this.formatForCell=(...o)=>this.model.formatForCell(...o),this.valueForCell=(...o)=>this.model.valueForCell(...o),this.displayString=(...o)=>this.model.displayString(...o),this.isEditableRange=(...o)=>(Ae(this.model)&&this.model.isEditableRange(...o),!1),this.isFilterable=(...o)=>this.model.isFilterable(...o),this.setViewport=(o,r,l)=>this.model.setViewport(o,r,l),this.snapshot=(...o)=>this.model.snapshot(...o),this.textSnapshot=(...o)=>this.model.textSnapshot(...o),this.valuesTable=(...o)=>this.model.valuesTable(...o),this.editValueForCell=(...o)=>(Ae(this.model)&&this.model.editValueForCell(...o),""),this.setValueForCell=(...o)=>(Ae(this.model)&&this.model.setValueForCell(...o),Promise.resolve()),this.setValueForRanges=(...o)=>(Ae(this.model)&&this.model.setValueForRanges(...o),Promise.resolve()),this.setValues=(...o)=>Ae(this.model)?this.model.setValues(...o):Promise.resolve(),this.isValidForCell=(...o)=>Ae(this.model)?this.model.isValidForCell(...o):!1,this.delete=(...o)=>this.model.delete(...o),this.commitPending=(...o)=>this.model.commitPending(...o),this.handleModelEvent=this.handleModelEvent.bind(this);const i=xo(t,n,s);this.originalModel=i,this.model=i,this.modelPromise=null,this.rollup=null,this.selectDistinct=[]}close(){this.originalModel.close(),this.model!==this.originalModel&&this.model.close(),this.modelPromise!=null&&this.modelPromise.cancel()}handleModelEvent(t){In.debug2("handleModelEvent",t);const{detail:n,type:s}=t;this.dispatchEvent(new ye(s,{detail:n}))}setModel(t){In.debug("setModel",t);const n=this.model;n!==this.originalModel&&n.close(),this.model=t,this.listenerCount>0&&this.addListeners(t),this.dispatchEvent(new ye(he.EVENT.COLUMNS_CHANGED,{detail:t.columns})),Ni(t)&&this.dispatchEvent(new ye(he.EVENT.TABLE_CHANGED,{detail:t.table}))}setNextModel(t){In.debug2("setNextModel"),this.modelPromise&&this.modelPromise.cancel(),this.listenerCount>0&&this.removeListeners(this.model),this.modelPromise=He.makeCancelable(t,n=>n.close()),this.modelPromise.then(n=>{this.modelPromise=null,this.setModel(n)}).catch(n=>{if(He.isCanceled(n)){In.debug2("setNextModel cancelled");return}In.error("Unable to set next model",n),this.modelPromise=null,this.dispatchEvent(new ye(he.EVENT.REQUEST_FAILED,{detail:n}))})}startListening(){super.startListening(),this.addListeners(this.model)}stopListening(){super.stopListening(),this.removeListeners(this.model)}addListeners(t){const n=Object.keys(he.EVENT);for(let s=0;s<n.length;s+=1)t.addEventListener(n[s],this.handleModelEvent)}removeListeners(t){const n=Object.keys(he.EVENT);for(let s=0;s<n.length;s+=1)t.removeEventListener(n[s],this.handleModelEvent)}get rowCount(){return this.model.rowCount}get columnCount(){return this.model.columnCount}get floatingTopRowCount(){return this.model.floatingTopRowCount}get floatingBottomRowCount(){return this.model.floatingBottomRowCount}get floatingLeftColumnCount(){return this.model.floatingLeftColumnCount}get floatingRightColumnCount(){return this.model.floatingRightColumnCount}isColumnFrozen(t){return this.model.isColumnFrozen(t)}get hasExpandableRows(){return qe(this.model)?this.model.hasExpandableRows:!1}get isExportAvailable(){return this.model.isExportAvailable}get isColumnStatisticsAvailable(){return this.model.isColumnStatisticsAvailable}get isValuesTableAvailable(){return this.model.isValuesTableAvailable}get isCustomColumnsAvailable(){return this.model.isCustomColumnsAvailable&&!(this.isSelectDistinctAvailable&&this.selectDistinctColumns.length>0)}get isFormatColumnsAvailable(){return this.model.isFormatColumnsAvailable}get isChartBuilderAvailable(){return this.model.isChartBuilderAvailable}get isRollupAvailable(){return(this.originalModel.isRollupAvailable||this.rollup!=null)&&this.selectDistinct.length===0}get isSelectDistinctAvailable(){return(this.originalModel.isSelectDistinctAvailable||this.selectDistinct.length>0)&&this.rollup==null}get isTotalsAvailable(){return this.model.isTotalsAvailable}get isReversible(){return this.model.isReversible}get columns(){return this.model.columns}get movedColumns(){return this.model.movedColumns}get movedRows(){return this.model.movedRows}get layoutHints(){return this.model.layoutHints}get frontColumns(){return this.model.frontColumns}get backColumns(){return this.model.backColumns}get frozenColumns(){return this.model.frozenColumns}get columnHeaderMaxDepth(){return this.model.columnHeaderMaxDepth}updateFrozenColumns(t){return this.model.updateFrozenColumns(t)}get originalColumns(){return this.originalModel.columns}get groupedColumns(){return this.model.groupedColumns}get description(){return this.model.description}get filter(){return this.model.filter}set filter(t){this.model.filter=t}get formatter(){return this.model.formatter}set formatter(t){this.model.formatter=t}get sort(){return this.model.sort}set sort(t){this.model.sort=t}get customColumns(){return this.model.customColumns}set customColumns(t){this.model.customColumns=t}get formatColumns(){return this.model.formatColumns}set formatColumns(t){this.model.formatColumns=t}get rollupConfig(){return this.rollup}set rollupConfig(t){if(In.debug("set rollupConfig",t),!this.isRollupAvailable)throw new Error("Rollup Rows are not available");if(ct(t,this.rollup))return;this.rollup=t;let n=Promise.resolve(this.originalModel);Ni(this.originalModel)&&t!=null&&(n=this.originalModel.table.rollup(t).then(s=>xo(s,this.formatter))),this.setNextModel(n)}get selectDistinctColumns(){return this.selectDistinct}set selectDistinctColumns(t){if(In.debug("set selectDistinctColumns",t),!this.isSelectDistinctAvailable)throw new Error("Select distinct is not available");if(t===this.selectDistinctColumns||t.length===0&&this.selectDistinctColumns.length===0){In.debug("Ignore same selectDistinctColumns",t);return}this.selectDistinct=t;const n=t.map(i=>this.originalColumns.find(o=>o.name===i)).filter(i=>i!=null);let s=Promise.resolve(this.originalModel);Ni(this.originalModel)&&n.length>0&&(s=this.originalModel.table.selectDistinct(n).then(i=>xo(i,this.formatter))),this.setNextModel(s)}get table(){if(Ni(this.model))return this.model.table}get totalsConfig(){return this.model.totalsConfig}set totalsConfig(t){this.model.totalsConfig=t}get isFilterRequired(){return this.model.isFilterRequired}get isEditable(){return Ae(this.model)&&this.model.isEditable}export(){if(x.isTreeTable(this.model))throw new Error("TreeTable has no 'export' property");return this.model.export()}columnStatistics(t){if(x.isTreeTable(this.model))throw new Error("TreeTable has no 'columnStatistics' function");return this.model.columnStatistics(t)}get pendingDataMap(){return this.model.pendingDataMap}set pendingDataMap(t){this.model.pendingDataMap=t}get pendingRowCount(){return this.model.pendingRowCount}set pendingRowCount(t){this.model.pendingRowCount=t}get pendingDataErrors(){return this.model.pendingDataErrors}getColumnIndexByName(t){return this.model.getColumnIndexByName(t)}}class Rg{static async makeModel(t,n=new Qt){let s=null;return!x.isTreeTable(t)&&t.hasInputTable&&(s=await t.inputTable()),new yg(t,n,s)}}ne.setLogLevel(parseInt("2",10));const Ts=ne.module("EmbedGrid.App");async function Ig(e,t){Ts.info(`Fetching table ${t}...`);const n={name:t,type:E.VariableType.TABLE};return e.getObject(n)}function Dg(){const[e,t]=y.exports.useState(),[n,s]=y.exports.useState(),[i,o]=y.exports.useState(),[r,l]=y.exports.useState(),[a,c]=y.exports.useState(!0),d=y.exports.useMemo(()=>new URLSearchParams(window.location.search),[]),h=d.get("canCopy")!=null,m=d.get("canDownloadCsv")!=null;y.exports.useEffect(function(){async function f(){try{const b=d.get("name");if(!b)throw new Error("No name param provided");const C=new URL("/jsapi",`${window.location}`),w=`${C.protocol}//${C.host}`;Ts.debug("Starting connection...");const S=new E.IdeConnection(w);Ts.debug("Loading table",b,"...");const I=await Ig(S,b);Ts.debug("Creating model...");const v=await Rg.makeModel(I);t(v),Ts.debug("Table successfully loaded!")}catch(b){Ts.error("Unable to load table",b),s(`${b}`)}c(!1)}f()},[d]),y.exports.useEffect(function(){function f(b){const{command:C,value:w}=b.data;switch(C){case"filter":{const I=w.map(({name:v,value:R})=>{const D=e==null?void 0:e.columns.find(F=>F.name===v);if(D==null)throw new Error(`Could not find column named ${v}`);return{name:v,value:R,type:x.getNormalizedType(D.type)}});o(I);break}case"sort":{const I=w.map(({name:v,direction:R})=>{const D=e==null?void 0:e.columns.find(F=>F.name===v);if(D==null)throw new Error(`Could not find column named ${v}`);return R==="DESC"?D.sort().desc():D.sort().asc()});l(I);break}}}return window.addEventListener("message",f),()=>{window.removeEventListener("message",f)}},[e]);const p=e!=null;return T("div",{className:"App",children:[p&&u(ti,{canCopy:h,canDownloadCsv:m,model:e,inputFilters:i,sorts:r}),!p&&u(sa,{isLoaded:p,isLoading:a,errorMessage:n!=null?n:null}),u(zd,{})]})}Bo.render(u(Dg,{}),document.getElementById("root"));
|
|
32
|
-
//# sourceMappingURL=index.
|
|
32
|
+
//# sourceMappingURL=index.7db3b411.js.map
|