@deephaven/embed-grid 0.37.4-relative-links.2 → 0.37.4-relative-base.6

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,3 +1,3 @@
1
- var Vt=Object.defineProperty;var Bt=(r,n,e)=>n in r?Vt(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var u=(r,n,e)=>(Bt(r,typeof n!="symbol"?n+"":n,e),e);import{r as S,p as M,a as v,V as Kt,j as d,C as He,c as D,R as Ht,F as oe,s as Ze,m as Z,W as Wt,X as qt,P as Gt,h as zt,Y as Qt,E as Ct}from"./vendor-80145ba5.js";import{T as We,L as U,ag as yt,a as Zt,a8 as Xt,i as Jt,ah as _t,ai as Yt,A as en,aj as tn,S as nn,af as sn,aa as an}from"./index-bb4ab651.js";class qe extends S.Component{constructor(e){super(e);u(this,"element");u(this,"container");u(this,"rAF");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=v.createRef(),this.rAF=0;const{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){const{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){let{popper:e}=this.state;const{closeOnBlur:t,referenceObject:s}=this.props;if(e||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}},...i},document.body.appendChild(this.element);let a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new Kt(s||a,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){const o=this.element.firstElementChild;o instanceof HTMLElement&&o.focus()}}),this.setState({popper:e})}destroyPopper(e=!0){cancelAnimationFrame(this.rAF);const{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){const{onEntered:e}=this.props;e()}handleExit(){const{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){const{className:e,children:t,timeout:s,interactive:i,closeOnBlur:a}=this.props,{show:o}=this.state;return d.jsx(He,{in:o,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:d.jsx("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:D("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:d.jsxs("div",{className:"popper-content",children:[t,d.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:e}=this.state,{"data-testid":t}=this.props;return d.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Ht.createPortal(this.renderContent(),this.element)})}}u(qe,"propTypes",{children:M.node.isRequired,options:M.shape({}),className:M.string,timeout:M.number,onEntered:M.func,onExited:M.func,isShown:M.bool,closeOnBlur:M.bool,interactive:M.bool,referenceObject:M.shape({}),"data-testid":M.string}),u(qe,"defaultProps",{options:{},className:"",timeout:We.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const Xe=qe,on=U.module("Tooltip"),K=class extends S.Component{constructor(e){super(e);u(this,"container");u(this,"popper");u(this,"parent");u(this,"timer");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=v.createRef(),this.popper=v.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){K.shownTooltipCount-=1,K.shownTooltipCount===0&&(K.lastHiddenTime=Date.now())}static handleShown(){K.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:s}=t,{isShown:i}=this.state;i!==s&&(i?K.handleShown():K.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&K.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){on.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,s=e.clientY,{isShown:i}=this.state;if(!this.popper.current||!this.parent)return;const a=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&s>=a.top&&s<=a.top+a.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&s>=o.top&&s<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let s=e;(K.shownTooltipCount>0||Date.now()-K.lastHiddenTime<K.triggerReshowThreshold)&&(s=t),this.timer=window.setTimeout(this.handleTimeout,s)}stopTimer(){this.timer!=null&&(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:s}=this.props;s&&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,referenceObject:s,popperClassName:i,"data-testid":a,onEntered:o}=this.props,{isShown:l}=this.state;let{options:c}=this.props;return c={placement:"bottom",...c},d.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:d.jsx(Xe,{className:D(i),options:c,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:s,children:d.jsxs("div",{className:"tooltip-content",children:[" ",l&&t]})})})}};let ee=K;u(ee,"defaultTimeout",500),u(ee,"defaultReshowTimeout",100),u(ee,"triggerReshowThreshold",300),u(ee,"shownTooltipCount",0),u(ee,"lastHiddenTime",Date.now()),u(ee,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:K.defaultReshowTimeout,timeout:K.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const Tt=ee,rn=["primary","secondary","tertiary","success","danger","inline","ghost"],ln=["group-end"];function cn(r,n){switch(r){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 D("btn-link",{"btn-link-icon":n,"btn-link-icon-only":n})}}function un(r){switch(r){case"group-end":return D("pl-2","pr-3")}}const Pe=v.forwardRef((r,n)=>{const{kind:e,variant:t,type:s,tooltip:i,icon:a,disabled:o=!1,active:l,onClick:c,onContextMenu:h,onMouseDown:p,onMouseUp:g,onMouseEnter:C,onMouseLeave:x,onKeyDown:F,className:A,style:w,children:O,tabIndex:N,"data-testid":H,"aria-label":q}=r,X=Boolean(a&&O==null),_=cn(e,X);let re;t&&(re=un(t));let he;a&&(he=v.isValidElement(a)?a:d.jsx(oe,{icon:a}));let Me;i!==void 0&&(Me=typeof i=="string"?d.jsx(Tt,{children:i}):i);let we=q;q===void 0&&X&&i!=null&&typeof i=="string"&&(we=i);const Ee=d.jsxs("button",{"data-testid":H,ref:n,type:s,className:D("btn",_,re,{active:l},A),onClick:c,onContextMenu:h,onMouseUp:g,onMouseDown:p,onMouseEnter:C,onMouseLeave:x,onKeyDown:F,style:w,disabled:o,tabIndex:N,"aria-label":we,children:[a&&he,O,i!=null&&!o&&Me]});return o?d.jsxs("span",{className:"btn-disabled-wrapper",children:[Ee,i!==void 0&&Me]}):Ee});Pe.displayName="Button";Pe.propTypes={kind:M.oneOf(rn).isRequired,variant:M.oneOf(ln),type:M.oneOf(["submit","reset","button"]),tooltip(r){const{tooltip:n,icon:e,children:t}=r;return n===void 0&&e!=null&&t==null?new Error("Tooltip is required for icon only buttons"):null},icon(r){const{children:n,icon:e}=r;return e==null&&n==null?new Error("Icon is required if no children are provided"):n==null&&!v.isValidElement(e)&&(e==null||e.iconName===""||e.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:M.bool,active:M.bool,onClick(r){const{onClick:n,type:e}=r;return e==="button"&&typeof n!="function"?new Error("type button requires an onClick function"):n!==void 0&&typeof n!="function"?new Error("onClick must be a function"):null},onContextMenu:M.func,onMouseUp:M.func,onMouseDown:M.func,onMouseEnter:M.func,onMouseLeave:M.func,onKeyDown:M.func,tabIndex:M.number,children:M.node,className:M.string,style:M.object,"data-testid":M.string};Pe.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const Ge=Pe;function Be(r){return r.then!==void 0}const ce=class{static disableAllActions(){ce.actionsDisabled=!0}static enableAllActions(){ce.actionsDisabled=!1}static isContextActionEvent(n){return Array.isArray(n.contextActions)}static compareActions(n,e){return n.group!==e.group?(n.group??0)>(e.group??0)?1:-1:n.order!==e.order?(n.order??0)>(e.order??0)?1:-1:n.title!==e.title?(n.title??"")>(e.title??"")?1:-1:n!==e?n>e?1:-1:0}static sortActions(n){if(n==null||!Array.isArray(n))return[];const e=n.slice();return e.sort(ce.compareActions),e}static isMacPlatform(){const{platform:n}=window.navigator;return n.startsWith("Mac")}static getModifierKey(){return ce.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(n){const e=ce.getModifierKey();return n[e]}static getMenuItems(n,e=!0){let t=[],s=n;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const a=s[i];let o;typeof a=="function"?o=a():o=a,o!=null&&(o instanceof Promise?e&&t.push(o):Array.isArray(o)?t=t.concat(o):t.push(o))}return t=t.filter(i=>i.title!==void 0||i.then!=null||i.menuElement),t}static getNextMenuItem(n,e,t){let s=n;s<0&&e<0&&(s=t.length);for(let i=1;i<t.length+1;i+=1){const a=(s+e*i+t.length)%t.length,o=t[a];if(!(o instanceof Promise)&&o.disabled!==!0)return a}return n}};let De=ce;u(De,"actionsDisabled",!1);const R=De,rt=U.module("GlobalContextAction");class dn extends S.Component{constructor(n){super(n),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(n){const e=n;e.contextActions==null&&(e.contextActions=[]);const{action:t}=this.props;t.title==null&&!t.menuElement||(e.contextActions==null&&(e.contextActions=[]),e.contextActions.push(t),rt.debug("Received context menu event at global action! Menu items are now: ",e.contextActions))}handleKeyDown(n){var t;const{action:e}=this.props;!R.actionsDisabled&&e.shortcut!==void 0&&e.shortcut.matchesEvent(n)&&(rt.debug("Global hotkey matched!",n),(t=e.action)==null||t.call(e,n),n.preventDefault(),n.stopPropagation())}render(){return null}}const hn=dn;class pn extends S.Component{render(){const{actions:n,"data-testid":e}=this.props,t=[];for(let s=0;s<n.length;s+=1){const i=n[s],{shortcut:a}=i;if(i.title!=null||i.menuElement||a){const o=d.jsx(hn,{action:i,"data-testid":e},`${i.title}.${a==null?void 0:a.id}`);t.push(o)}}return t}}const mn=pn;const xe=U.module("ContextActions");class It extends S.Component{constructor(e){super(e);u(this,"container");this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=v.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(e,t,s,i){if(i.length===0)return;const a=new MouseEvent("contextmenu",{clientX:t,clientY:s,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};const t=e.actions.filter(i=>!Be(i)&&typeof i!="function"&&i.isGlobal),s=e.actions.filter(i=>!Be(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:s}}componentDidMount(){var e;(e=this.container.current)!=null&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!=null&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){const{ignoreClassNames:t=[]}=this.props;if(t.length>0){let i=e.target;for(;i!=null;){const{classList:a}=i,o=t.find(l=>a.contains(l));if(o!==void 0){xe.debug2(`Contextmenu event ignored based on the target className "${o}"`);return}i=i.parentElement}}if(R.isContextActionEvent(e)||(e.contextActions=[]),!R.isContextActionEvent(e))return;const{actions:s}=this.props;if(s!=null){let i=s;Array.isArray(i)&&(i=i.filter(a=>Be(a)||typeof a=="function"||a.isGlobal===void 0||!a.isGlobal)),e.contextActions=e.contextActions.concat(i)}xe.debug("Received context menu event! Menu items are now: ",e.contextActions)}handleKeyDown(e){var s;const{keyboardActions:t}=this.state;for(let i=0;i<t.length;i+=1){const a=t[i];!R.actionsDisabled&&a.shortcut!=null&&a.shortcut.matchesEvent(e)&&(xe.debug("Context hotkey matched!",e),(s=a.action)==null||s.call(a,e),e.stopPropagation(),e.preventDefault(),xe.debug2("Matched hotkey returned false, key event not consumed"))}}render(){const{"data-testid":e}=this.props,{globalActions:t}=this.state;return d.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:d.jsx(mn,{actions:t})})}}u(It,"groups",{default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const ps=It,Je=v.forwardRef((r,n)=>{var A;function e(w){const{menuItem:O,onMenuItemClick:N}=r;N(O,w)}function t(w){const{menuItem:O,onMenuItemMouseMove:N}=r;N(O,w)}function s(w){const{menuItem:O,onMenuItemContextMenu:N}=r;N(O,w)}function i(w,O,N){if(typeof w.type=="string")return w;const{closeMenu:H,menuItem:q,isKeyboardSelected:X,isMouseSelected:_,"data-testid":re}=r,he={menuItem:q,closeMenu:H,isKeyboardSelected:X,isMouseSelected:_,iconElement:O,displayShortcut:N,"data-testid":re};return v.cloneElement(w,{forwardedProps:he})}const{children:a,menuItem:o,isKeyboardSelected:l=!1,isMouseSelected:c=!1,"data-testid":h}=r,p=(A=o.shortcut)==null?void 0:A.getDisplayText();let g=null;if(o.icon){const w=o.icon;if(v.isValidElement(w))g=w;else{let O;o.iconColor!=null&&(o.disabled===void 0||!o.disabled)&&(O={color:o.iconColor}),g=d.jsx(oe,{icon:w,style:O})}}let C=null;const x=Boolean(a);o.actions&&(C=d.jsx(oe,{icon:yt}));let F=null;if(o.menuElement)F=d.jsx("div",{className:"custom-menu-item",onMouseMove:t,children:i(o.menuElement,g,p)});else{const w=o.disabled,O=o.iconOutline;F=d.jsx("button",{type:"button",className:D("btn-context-menu",{disabled:w},{active:(x||c)&&(w===void 0||!w)},{"keyboard-active":l&&(w===void 0||!w)}),onClick:e,onMouseMove:t,onContextMenu:s,title:o.description??"",children:d.jsxs("div",{className:"btn-context-menu-wrapper",children:[d.jsx("span",{className:D("icon",{outline:O}),children:g}),d.jsx("span",{className:"title",children:o.title}),p!==void 0&&d.jsx("span",{className:"shortcut",children:p}),C&&d.jsx("span",{className:D("submenu-indicator",{disabled:w}),children:C})]})})}return d.jsxs("div",{className:"context-menu-item",ref:n,"data-testid":h,children:[a,F]})});Je.displayName="ContextMenuItem";Je.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const vt=Je,ms=Object.freeze([]),fs=new Map,gs=()=>{};class fn extends Error{constructor(){super(...arguments);u(this,"isCanceled",!0)}}const lt=fn;async function gn(r){const{clipboard:n}=navigator;if(n!==void 0)try{return navigator.clipboard.writeText(r)}catch{return ct(r)}ct(r)}function ct(r){const n=document.activeElement,e=document.createElement("textarea");e.value=r,document.body.appendChild(e),e.focus(),e.select();const t=document.execCommand("copy");if(document.body.removeChild(e),n instanceof HTMLElement&&n.focus(),!t)throw new Error("Unable to execute copy command")}class wt extends CustomEvent{constructor(n,e){super(n,e)}}class bn extends Error{constructor(){super(...arguments);u(this,"isTimeout",!0)}}const _e=bn;class ze{static makeCancelable(n,e){let t=!1,s,i;const a=new Promise((o,l)=>{i=l,Promise.resolve(n).then(c=>{t?e&&e(c):(s=c,o(c))}).catch(c=>l(c))});return a.cancel=()=>{t=!0,i(new lt),s!=null&&e&&e(s)},a}static isCanceled(n){return n instanceof lt}static isTimedOut(n){return n instanceof _e}static withTimeout(n,e){return new Promise((t,s)=>{setTimeout(()=>{try{t(e())}catch(i){s(i)}},n)})}}function bs(r){if(r==null)throw new Error("Value is null or undefined")}function Ss(r,n,e=void 0){const t=r.get(n)??e;if(t!==void 0)return t;throw new Error(`Missing value for key ${n}`)}class Ye{static isValidRange(n){return n!=null&&n.length===2&&Number.isInteger(n[0])&&Number.isInteger(n[1])&&n[0]<=n[1]}static validateRange(n){if(!Ye.isValidRange(n))throw new Error(`Invalid range! ${n}`)}static isSelected(n,e){for(let t=0;t<n.length;t+=1){const s=n[t],i=s[0],a=s[1];if(i<=e&&e<=a)return!0}return!1}static selectRange(n,e){let[t,s]=e;const i=[...n];for(let a=i.length-1;a>=0;a-=1){const o=i[a],l=o[0],c=o[1];if(l<=t&&s<=c)return i;t<=c&&l<=s&&(t=Math.min(t,l),s=Math.max(s,c),i.splice(a,1))}return i.push([t,s]),i}static deselectRange(n,e){const[t,s]=e,i=[...n];for(let a=i.length-1;a>=0;a-=1){const o=i[a],l=o[0],c=o[1];if(!(s<l||c<t))if(l<t&&s<c){i[a]=[l,t-1],i.splice(a+1,0,[s+1,c]);break}else t<=l&&c<=s?i.splice(a,1):l<t?i[a]=[l,t-1]:i[a]=[s+1,c]}return i}static count(n){return n.reduce((e,t)=>e+(t[1]-t[0]+1),0)}static getItemsInRanges(n,e){return e.reduce((t,s)=>{const i=[...t];for(let a=s[0];a<=s[1];a+=1)i.push(n[a]);return i},[])}}const ne=Ye;class Sn{static join(n,e="and"){if(n==null||n.length===0)return"";if(n.length===1)return n[0];if(n.length===2)return`${n[0]} ${e} ${n[1]}`;const t=n.slice(0,n.length-1).join(", "),s=n[n.length-1];return`${t}, ${e} ${s}`}static toLower(n,e=!0){if(n==null){if(e)return"";throw new Error("Null string passed in to TextUtils.toLower")}return n.toLowerCase()}static sort(n,e,t=!0){return n<e?t?-1:1:n>e?t?1:-1:0}}const Mn=Sn,st=class{static formatElapsedTime(n){if(typeof n!="number"||!Number.isInteger(n))throw new Error(`${n} is not a number that can be expressed as a formatted time`);const e=Math.floor(n/3600),t=Math.floor(n%3600/60),s=n%60;return`${e>0?`${e}h `:""}${t>0||e>0?`${t}m `:""}${n>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(n){if(typeof n!="number"||!Number.isInteger(n)||n<0)throw new Error(`${n} is not a number that can be expressed as a formatted time`);const e=String(Math.floor(n/(60*60))).padStart(2,"0"),t=n%(60*60),s=String(Math.floor(t/60)).padStart(2,"0"),i=t%60,a=String(Math.ceil(i)).padStart(2,"0");return`${e}:${s}:${a}`}static isTimeString(n){return new RegExp(st.TIME_PATTERN).test(n)}static parseTime(n){if(n==null||typeof n!="string")throw new Error(`${n} is not a valid string`);const e=n.split(":");if(e.length!==3)throw new Error(`${n} is not a time string that can be parsed`);return Number(e[0])*60*60+Number(e[1])*60+Number(e[2])}};let Ce=st;u(Ce,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"),u(Ce,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const Ms=Ce,ut=U.module("ContextMenu"),Le=class extends S.PureComponent{constructor(e){super(e);u(this,"container");u(this,"oldFocus");u(this,"activeSubMenuRef");u(this,"subMenuTimer");u(this,"rAF");u(this,"initialPosition");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=v.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=v.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 a,o;const{actions:s}=this.props,{activeSubMenu:i}=this.state;i!==t.activeSubMenu&&(i==null?(a=this.container.current)==null||a.focus():this.setActiveSubMenuPosition()),e.actions!==s&&(this.initMenu(),(this.container.current==null||!this.container.current.contains(document.activeElement))&&((o=this.container.current)==null||o.focus())),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse!==void 0&&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:s}=this.props,i=R.getMenuItems(s),a=[];for(let o=i.length-1;o>=0;o-=1){const l=i[o];l instanceof Promise?this.initMenuPromise(l):a.push(l)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:R.sortActions(a)})}initMenuPromise(e){const t=ze.makeCancelable(e);this.setState(s=>({pendingItems:s.pendingItems.concat(t)})),t.then(s=>{this.setState(i=>{const a=i.pendingItems.indexOf(t);if(a>=0){const o=i.pendingItems.slice();return o.splice(a,1),{menuItems:R.sortActions(i.menuItems.concat(s)),pendingItems:o}}return null})},s=>{ze.isCanceled(s)||(this.setState(i=>{const a=i.pendingItems.indexOf(t);if(a>=0){const o=i.pendingItems.slice();return o.splice(a,1),{pendingItems:o}}return null}),ut.error(s))})}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 C,x;const{options:e,updatePosition:t,subMenuParentWidth:s,subMenuParentHeight:i,top:a,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition!=null&&e.doNotVerifyPosition)return;let{top:l,left:c}=this.initialPosition;const{width:h,height:p}=((C=this.container.current)==null?void 0:C.getBoundingClientRect())??{width:0,height:0},g=(((x=this.container.current)==null?void 0:x.scrollHeight)??0)>window.innerHeight;p===0||h===0||(l+p>window.innerHeight&&(l-p-i>0?l-=p-i:l=window.innerHeight-p),c+h>window.innerWidth&&(c=c-h-s),(o!==c||a!==l)&&(this.setState({hasOverflow:g}),t(l,c)))}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){ut.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,s=!1;for(;t&&!s;)s=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;s||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,s=this.getKeyboardIndex();let i=s,a=!1;if(e.key==="Enter"||e.key===" "){s>=0&&s<t.length&&this.handleMenuItemClick(t[s],e);return}if(e.key==="ArrowRight"?s>=0&&s<=t.length?a=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=R.getNextMenuItem(i,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(i=R.getNextMenuItem(i,1,t)),a){this.openSubMenu(s),e.preventDefault(),e.stopPropagation();return}s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:s}=this.state,i=t[e].actions?e:null;s!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),s(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:s}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(s.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,s=t.indexOf(e);this.setMouseIndex(s),s>=0&&s<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:s}=this.props,{activeSubMenu:i,hasOverflow:a,keyboardIndex:o,menuItems:l,mouseIndex:c,pendingItems:h,subMenuTop:p,subMenuLeft:g,subMenuParentWidth:C,subMenuParentHeight:x}=this.state;for(let N=0;N<l.length;N+=1){const H=l[N];N>0&&H.group!==l[N-1].group&&e.push(d.jsx("hr",{},`${N}.separator`));const q=d.jsx(vt,{ref:i===N?this.activeSubMenuRef:null,isKeyboardSelected:o===N,isMouseSelected:c===N,menuItem:H,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},N);e.push(q)}let F=null;h.length>0&&(F=d.jsx("div",{className:"loading",children:d.jsx(Zt,{})}));const{menuStyle:A,"data-testid":w}=this.props,O=i!==null&&p!==null&&g!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:D({"has-overflow":a},"context-menu-container"),style:{top:t,left:s,...A},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Le.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":w,children:[e,F]}),O&&i!==null&&p!==null&&g!==null&&d.jsx(Le,{actions:l[i].actions||[],closeMenu:this.handleCloseSubMenu,top:p,left:g,updatePosition:(N,H)=>{this.setState({subMenuTop:N,subMenuLeft:H})},subMenuParentWidth:C,subMenuParentHeight:x},`sub-${i}`)]})}};let Fe=Le;u(Fe,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const Cn=Fe;class yn extends S.Component{constructor(e){super(e);u(this,"container");u(this,"openMenu");this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=v.createRef(),this.openMenu=v.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!=null&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!=null&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(!R.isContextActionEvent(e)||!this.container.current||e.metaKey||e.ctrlKey)return;const t=R.getMenuItems(e.contextActions),s=this.container.current.getBoundingClientRect(),i=e.clientY-s.top,a=e.clientX-s.left;if(t.length===0){if(e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{const o=document.elementFromPoint(a,i),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});o==null||o.dispatchEvent(l)});return}return}e.preventDefault(),this.setState({actions:t,top:i,left:a})}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){let e=null;const{"data-testid":t}=this.props,{actions:s,top:i,left:a}=this.state;return s&&(e=d.jsx(Cn,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:a,updatePosition:(o,l)=>{this.setState({top:o,left:l})},"data-testid":t})),d.jsx("div",{className:D("context-menu-root",{active:s}),ref:this.container,children:e})}}const Cs=yn;function et(r,n="No value available in context. Was code wrapped in a provider?"){const e=S.useContext(r);if(e==null)throw new Error(n);return e}function Tn(r){const n=S.useRef();return S.useEffect(function(){n.current=r}),n.current}function Et(r){const n=S.useRef(null);return S.useEffect(function(){r&&(typeof r=="function"?r(n.current):r.current=n.current)}),n}const In=3500,vn=U.module("useCopyToClipboard");function wn(){const[r,n]=S.useState(!1),e=S.useRef(null),t=S.useCallback(s=>{gn(s).then(()=>{n(!0)}).catch(i=>vn.error(`Unable to copy ${s}`,`
1
+ var Vt=Object.defineProperty;var Bt=(r,n,e)=>n in r?Vt(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var u=(r,n,e)=>(Bt(r,typeof n!="symbol"?n+"":n,e),e);import{r as S,p as M,a as v,V as Kt,j as d,C as He,c as D,R as Ht,F as oe,s as Ze,m as Z,W as Wt,X as qt,P as Gt,h as zt,Y as Qt,E as Ct}from"./vendor-80145ba5.js";import{T as We,L as U,ag as yt,a as Zt,a8 as Xt,i as Jt,ah as _t,ai as Yt,A as en,aj as tn,S as nn,af as sn,aa as an}from"./index-04b032d1.js";class qe extends S.Component{constructor(e){super(e);u(this,"element");u(this,"container");u(this,"rAF");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=v.createRef(),this.rAF=0;const{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){const{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){let{popper:e}=this.state;const{closeOnBlur:t,referenceObject:s}=this.props;if(e||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}},...i},document.body.appendChild(this.element);let a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new Kt(s||a,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){const o=this.element.firstElementChild;o instanceof HTMLElement&&o.focus()}}),this.setState({popper:e})}destroyPopper(e=!0){cancelAnimationFrame(this.rAF);const{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){const{onEntered:e}=this.props;e()}handleExit(){const{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){const{className:e,children:t,timeout:s,interactive:i,closeOnBlur:a}=this.props,{show:o}=this.state;return d.jsx(He,{in:o,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:d.jsx("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:D("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:d.jsxs("div",{className:"popper-content",children:[t,d.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:e}=this.state,{"data-testid":t}=this.props;return d.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Ht.createPortal(this.renderContent(),this.element)})}}u(qe,"propTypes",{children:M.node.isRequired,options:M.shape({}),className:M.string,timeout:M.number,onEntered:M.func,onExited:M.func,isShown:M.bool,closeOnBlur:M.bool,interactive:M.bool,referenceObject:M.shape({}),"data-testid":M.string}),u(qe,"defaultProps",{options:{},className:"",timeout:We.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const Xe=qe,on=U.module("Tooltip"),K=class extends S.Component{constructor(e){super(e);u(this,"container");u(this,"popper");u(this,"parent");u(this,"timer");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=v.createRef(),this.popper=v.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){K.shownTooltipCount-=1,K.shownTooltipCount===0&&(K.lastHiddenTime=Date.now())}static handleShown(){K.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:s}=t,{isShown:i}=this.state;i!==s&&(i?K.handleShown():K.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&K.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){on.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,s=e.clientY,{isShown:i}=this.state;if(!this.popper.current||!this.parent)return;const a=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&s>=a.top&&s<=a.top+a.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&s>=o.top&&s<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let s=e;(K.shownTooltipCount>0||Date.now()-K.lastHiddenTime<K.triggerReshowThreshold)&&(s=t),this.timer=window.setTimeout(this.handleTimeout,s)}stopTimer(){this.timer!=null&&(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:s}=this.props;s&&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,referenceObject:s,popperClassName:i,"data-testid":a,onEntered:o}=this.props,{isShown:l}=this.state;let{options:c}=this.props;return c={placement:"bottom",...c},d.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:d.jsx(Xe,{className:D(i),options:c,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:s,children:d.jsxs("div",{className:"tooltip-content",children:[" ",l&&t]})})})}};let ee=K;u(ee,"defaultTimeout",500),u(ee,"defaultReshowTimeout",100),u(ee,"triggerReshowThreshold",300),u(ee,"shownTooltipCount",0),u(ee,"lastHiddenTime",Date.now()),u(ee,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:K.defaultReshowTimeout,timeout:K.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const Tt=ee,rn=["primary","secondary","tertiary","success","danger","inline","ghost"],ln=["group-end"];function cn(r,n){switch(r){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 D("btn-link",{"btn-link-icon":n,"btn-link-icon-only":n})}}function un(r){switch(r){case"group-end":return D("pl-2","pr-3")}}const Pe=v.forwardRef((r,n)=>{const{kind:e,variant:t,type:s,tooltip:i,icon:a,disabled:o=!1,active:l,onClick:c,onContextMenu:h,onMouseDown:p,onMouseUp:g,onMouseEnter:C,onMouseLeave:x,onKeyDown:F,className:A,style:w,children:O,tabIndex:N,"data-testid":H,"aria-label":q}=r,X=Boolean(a&&O==null),_=cn(e,X);let re;t&&(re=un(t));let he;a&&(he=v.isValidElement(a)?a:d.jsx(oe,{icon:a}));let Me;i!==void 0&&(Me=typeof i=="string"?d.jsx(Tt,{children:i}):i);let we=q;q===void 0&&X&&i!=null&&typeof i=="string"&&(we=i);const Ee=d.jsxs("button",{"data-testid":H,ref:n,type:s,className:D("btn",_,re,{active:l},A),onClick:c,onContextMenu:h,onMouseUp:g,onMouseDown:p,onMouseEnter:C,onMouseLeave:x,onKeyDown:F,style:w,disabled:o,tabIndex:N,"aria-label":we,children:[a&&he,O,i!=null&&!o&&Me]});return o?d.jsxs("span",{className:"btn-disabled-wrapper",children:[Ee,i!==void 0&&Me]}):Ee});Pe.displayName="Button";Pe.propTypes={kind:M.oneOf(rn).isRequired,variant:M.oneOf(ln),type:M.oneOf(["submit","reset","button"]),tooltip(r){const{tooltip:n,icon:e,children:t}=r;return n===void 0&&e!=null&&t==null?new Error("Tooltip is required for icon only buttons"):null},icon(r){const{children:n,icon:e}=r;return e==null&&n==null?new Error("Icon is required if no children are provided"):n==null&&!v.isValidElement(e)&&(e==null||e.iconName===""||e.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:M.bool,active:M.bool,onClick(r){const{onClick:n,type:e}=r;return e==="button"&&typeof n!="function"?new Error("type button requires an onClick function"):n!==void 0&&typeof n!="function"?new Error("onClick must be a function"):null},onContextMenu:M.func,onMouseUp:M.func,onMouseDown:M.func,onMouseEnter:M.func,onMouseLeave:M.func,onKeyDown:M.func,tabIndex:M.number,children:M.node,className:M.string,style:M.object,"data-testid":M.string};Pe.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const Ge=Pe;function Be(r){return r.then!==void 0}const ce=class{static disableAllActions(){ce.actionsDisabled=!0}static enableAllActions(){ce.actionsDisabled=!1}static isContextActionEvent(n){return Array.isArray(n.contextActions)}static compareActions(n,e){return n.group!==e.group?(n.group??0)>(e.group??0)?1:-1:n.order!==e.order?(n.order??0)>(e.order??0)?1:-1:n.title!==e.title?(n.title??"")>(e.title??"")?1:-1:n!==e?n>e?1:-1:0}static sortActions(n){if(n==null||!Array.isArray(n))return[];const e=n.slice();return e.sort(ce.compareActions),e}static isMacPlatform(){const{platform:n}=window.navigator;return n.startsWith("Mac")}static getModifierKey(){return ce.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(n){const e=ce.getModifierKey();return n[e]}static getMenuItems(n,e=!0){let t=[],s=n;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const a=s[i];let o;typeof a=="function"?o=a():o=a,o!=null&&(o instanceof Promise?e&&t.push(o):Array.isArray(o)?t=t.concat(o):t.push(o))}return t=t.filter(i=>i.title!==void 0||i.then!=null||i.menuElement),t}static getNextMenuItem(n,e,t){let s=n;s<0&&e<0&&(s=t.length);for(let i=1;i<t.length+1;i+=1){const a=(s+e*i+t.length)%t.length,o=t[a];if(!(o instanceof Promise)&&o.disabled!==!0)return a}return n}};let De=ce;u(De,"actionsDisabled",!1);const R=De,rt=U.module("GlobalContextAction");class dn extends S.Component{constructor(n){super(n),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(n){const e=n;e.contextActions==null&&(e.contextActions=[]);const{action:t}=this.props;t.title==null&&!t.menuElement||(e.contextActions==null&&(e.contextActions=[]),e.contextActions.push(t),rt.debug("Received context menu event at global action! Menu items are now: ",e.contextActions))}handleKeyDown(n){var t;const{action:e}=this.props;!R.actionsDisabled&&e.shortcut!==void 0&&e.shortcut.matchesEvent(n)&&(rt.debug("Global hotkey matched!",n),(t=e.action)==null||t.call(e,n),n.preventDefault(),n.stopPropagation())}render(){return null}}const hn=dn;class pn extends S.Component{render(){const{actions:n,"data-testid":e}=this.props,t=[];for(let s=0;s<n.length;s+=1){const i=n[s],{shortcut:a}=i;if(i.title!=null||i.menuElement||a){const o=d.jsx(hn,{action:i,"data-testid":e},`${i.title}.${a==null?void 0:a.id}`);t.push(o)}}return t}}const mn=pn;const xe=U.module("ContextActions");class It extends S.Component{constructor(e){super(e);u(this,"container");this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=v.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(e,t,s,i){if(i.length===0)return;const a=new MouseEvent("contextmenu",{clientX:t,clientY:s,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};const t=e.actions.filter(i=>!Be(i)&&typeof i!="function"&&i.isGlobal),s=e.actions.filter(i=>!Be(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:s}}componentDidMount(){var e;(e=this.container.current)!=null&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!=null&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){const{ignoreClassNames:t=[]}=this.props;if(t.length>0){let i=e.target;for(;i!=null;){const{classList:a}=i,o=t.find(l=>a.contains(l));if(o!==void 0){xe.debug2(`Contextmenu event ignored based on the target className "${o}"`);return}i=i.parentElement}}if(R.isContextActionEvent(e)||(e.contextActions=[]),!R.isContextActionEvent(e))return;const{actions:s}=this.props;if(s!=null){let i=s;Array.isArray(i)&&(i=i.filter(a=>Be(a)||typeof a=="function"||a.isGlobal===void 0||!a.isGlobal)),e.contextActions=e.contextActions.concat(i)}xe.debug("Received context menu event! Menu items are now: ",e.contextActions)}handleKeyDown(e){var s;const{keyboardActions:t}=this.state;for(let i=0;i<t.length;i+=1){const a=t[i];!R.actionsDisabled&&a.shortcut!=null&&a.shortcut.matchesEvent(e)&&(xe.debug("Context hotkey matched!",e),(s=a.action)==null||s.call(a,e),e.stopPropagation(),e.preventDefault(),xe.debug2("Matched hotkey returned false, key event not consumed"))}}render(){const{"data-testid":e}=this.props,{globalActions:t}=this.state;return d.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:d.jsx(mn,{actions:t})})}}u(It,"groups",{default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const ps=It,Je=v.forwardRef((r,n)=>{var A;function e(w){const{menuItem:O,onMenuItemClick:N}=r;N(O,w)}function t(w){const{menuItem:O,onMenuItemMouseMove:N}=r;N(O,w)}function s(w){const{menuItem:O,onMenuItemContextMenu:N}=r;N(O,w)}function i(w,O,N){if(typeof w.type=="string")return w;const{closeMenu:H,menuItem:q,isKeyboardSelected:X,isMouseSelected:_,"data-testid":re}=r,he={menuItem:q,closeMenu:H,isKeyboardSelected:X,isMouseSelected:_,iconElement:O,displayShortcut:N,"data-testid":re};return v.cloneElement(w,{forwardedProps:he})}const{children:a,menuItem:o,isKeyboardSelected:l=!1,isMouseSelected:c=!1,"data-testid":h}=r,p=(A=o.shortcut)==null?void 0:A.getDisplayText();let g=null;if(o.icon){const w=o.icon;if(v.isValidElement(w))g=w;else{let O;o.iconColor!=null&&(o.disabled===void 0||!o.disabled)&&(O={color:o.iconColor}),g=d.jsx(oe,{icon:w,style:O})}}let C=null;const x=Boolean(a);o.actions&&(C=d.jsx(oe,{icon:yt}));let F=null;if(o.menuElement)F=d.jsx("div",{className:"custom-menu-item",onMouseMove:t,children:i(o.menuElement,g,p)});else{const w=o.disabled,O=o.iconOutline;F=d.jsx("button",{type:"button",className:D("btn-context-menu",{disabled:w},{active:(x||c)&&(w===void 0||!w)},{"keyboard-active":l&&(w===void 0||!w)}),onClick:e,onMouseMove:t,onContextMenu:s,title:o.description??"",children:d.jsxs("div",{className:"btn-context-menu-wrapper",children:[d.jsx("span",{className:D("icon",{outline:O}),children:g}),d.jsx("span",{className:"title",children:o.title}),p!==void 0&&d.jsx("span",{className:"shortcut",children:p}),C&&d.jsx("span",{className:D("submenu-indicator",{disabled:w}),children:C})]})})}return d.jsxs("div",{className:"context-menu-item",ref:n,"data-testid":h,children:[a,F]})});Je.displayName="ContextMenuItem";Je.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const vt=Je,ms=Object.freeze([]),fs=new Map,gs=()=>{};class fn extends Error{constructor(){super(...arguments);u(this,"isCanceled",!0)}}const lt=fn;async function gn(r){const{clipboard:n}=navigator;if(n!==void 0)try{return navigator.clipboard.writeText(r)}catch{return ct(r)}ct(r)}function ct(r){const n=document.activeElement,e=document.createElement("textarea");e.value=r,document.body.appendChild(e),e.focus(),e.select();const t=document.execCommand("copy");if(document.body.removeChild(e),n instanceof HTMLElement&&n.focus(),!t)throw new Error("Unable to execute copy command")}class wt extends CustomEvent{constructor(n,e){super(n,e)}}class bn extends Error{constructor(){super(...arguments);u(this,"isTimeout",!0)}}const _e=bn;class ze{static makeCancelable(n,e){let t=!1,s,i;const a=new Promise((o,l)=>{i=l,Promise.resolve(n).then(c=>{t?e&&e(c):(s=c,o(c))}).catch(c=>l(c))});return a.cancel=()=>{t=!0,i(new lt),s!=null&&e&&e(s)},a}static isCanceled(n){return n instanceof lt}static isTimedOut(n){return n instanceof _e}static withTimeout(n,e){return new Promise((t,s)=>{setTimeout(()=>{try{t(e())}catch(i){s(i)}},n)})}}function bs(r){if(r==null)throw new Error("Value is null or undefined")}function Ss(r,n,e=void 0){const t=r.get(n)??e;if(t!==void 0)return t;throw new Error(`Missing value for key ${n}`)}class Ye{static isValidRange(n){return n!=null&&n.length===2&&Number.isInteger(n[0])&&Number.isInteger(n[1])&&n[0]<=n[1]}static validateRange(n){if(!Ye.isValidRange(n))throw new Error(`Invalid range! ${n}`)}static isSelected(n,e){for(let t=0;t<n.length;t+=1){const s=n[t],i=s[0],a=s[1];if(i<=e&&e<=a)return!0}return!1}static selectRange(n,e){let[t,s]=e;const i=[...n];for(let a=i.length-1;a>=0;a-=1){const o=i[a],l=o[0],c=o[1];if(l<=t&&s<=c)return i;t<=c&&l<=s&&(t=Math.min(t,l),s=Math.max(s,c),i.splice(a,1))}return i.push([t,s]),i}static deselectRange(n,e){const[t,s]=e,i=[...n];for(let a=i.length-1;a>=0;a-=1){const o=i[a],l=o[0],c=o[1];if(!(s<l||c<t))if(l<t&&s<c){i[a]=[l,t-1],i.splice(a+1,0,[s+1,c]);break}else t<=l&&c<=s?i.splice(a,1):l<t?i[a]=[l,t-1]:i[a]=[s+1,c]}return i}static count(n){return n.reduce((e,t)=>e+(t[1]-t[0]+1),0)}static getItemsInRanges(n,e){return e.reduce((t,s)=>{const i=[...t];for(let a=s[0];a<=s[1];a+=1)i.push(n[a]);return i},[])}}const ne=Ye;class Sn{static join(n,e="and"){if(n==null||n.length===0)return"";if(n.length===1)return n[0];if(n.length===2)return`${n[0]} ${e} ${n[1]}`;const t=n.slice(0,n.length-1).join(", "),s=n[n.length-1];return`${t}, ${e} ${s}`}static toLower(n,e=!0){if(n==null){if(e)return"";throw new Error("Null string passed in to TextUtils.toLower")}return n.toLowerCase()}static sort(n,e,t=!0){return n<e?t?-1:1:n>e?t?1:-1:0}}const Mn=Sn,st=class{static formatElapsedTime(n){if(typeof n!="number"||!Number.isInteger(n))throw new Error(`${n} is not a number that can be expressed as a formatted time`);const e=Math.floor(n/3600),t=Math.floor(n%3600/60),s=n%60;return`${e>0?`${e}h `:""}${t>0||e>0?`${t}m `:""}${n>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(n){if(typeof n!="number"||!Number.isInteger(n)||n<0)throw new Error(`${n} is not a number that can be expressed as a formatted time`);const e=String(Math.floor(n/(60*60))).padStart(2,"0"),t=n%(60*60),s=String(Math.floor(t/60)).padStart(2,"0"),i=t%60,a=String(Math.ceil(i)).padStart(2,"0");return`${e}:${s}:${a}`}static isTimeString(n){return new RegExp(st.TIME_PATTERN).test(n)}static parseTime(n){if(n==null||typeof n!="string")throw new Error(`${n} is not a valid string`);const e=n.split(":");if(e.length!==3)throw new Error(`${n} is not a time string that can be parsed`);return Number(e[0])*60*60+Number(e[1])*60+Number(e[2])}};let Ce=st;u(Ce,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"),u(Ce,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const Ms=Ce,ut=U.module("ContextMenu"),Le=class extends S.PureComponent{constructor(e){super(e);u(this,"container");u(this,"oldFocus");u(this,"activeSubMenuRef");u(this,"subMenuTimer");u(this,"rAF");u(this,"initialPosition");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=v.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=v.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 a,o;const{actions:s}=this.props,{activeSubMenu:i}=this.state;i!==t.activeSubMenu&&(i==null?(a=this.container.current)==null||a.focus():this.setActiveSubMenuPosition()),e.actions!==s&&(this.initMenu(),(this.container.current==null||!this.container.current.contains(document.activeElement))&&((o=this.container.current)==null||o.focus())),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse!==void 0&&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:s}=this.props,i=R.getMenuItems(s),a=[];for(let o=i.length-1;o>=0;o-=1){const l=i[o];l instanceof Promise?this.initMenuPromise(l):a.push(l)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:R.sortActions(a)})}initMenuPromise(e){const t=ze.makeCancelable(e);this.setState(s=>({pendingItems:s.pendingItems.concat(t)})),t.then(s=>{this.setState(i=>{const a=i.pendingItems.indexOf(t);if(a>=0){const o=i.pendingItems.slice();return o.splice(a,1),{menuItems:R.sortActions(i.menuItems.concat(s)),pendingItems:o}}return null})},s=>{ze.isCanceled(s)||(this.setState(i=>{const a=i.pendingItems.indexOf(t);if(a>=0){const o=i.pendingItems.slice();return o.splice(a,1),{pendingItems:o}}return null}),ut.error(s))})}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 C,x;const{options:e,updatePosition:t,subMenuParentWidth:s,subMenuParentHeight:i,top:a,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition!=null&&e.doNotVerifyPosition)return;let{top:l,left:c}=this.initialPosition;const{width:h,height:p}=((C=this.container.current)==null?void 0:C.getBoundingClientRect())??{width:0,height:0},g=(((x=this.container.current)==null?void 0:x.scrollHeight)??0)>window.innerHeight;p===0||h===0||(l+p>window.innerHeight&&(l-p-i>0?l-=p-i:l=window.innerHeight-p),c+h>window.innerWidth&&(c=c-h-s),(o!==c||a!==l)&&(this.setState({hasOverflow:g}),t(l,c)))}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){ut.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,s=!1;for(;t&&!s;)s=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;s||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,s=this.getKeyboardIndex();let i=s,a=!1;if(e.key==="Enter"||e.key===" "){s>=0&&s<t.length&&this.handleMenuItemClick(t[s],e);return}if(e.key==="ArrowRight"?s>=0&&s<=t.length?a=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=R.getNextMenuItem(i,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(i=R.getNextMenuItem(i,1,t)),a){this.openSubMenu(s),e.preventDefault(),e.stopPropagation();return}s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:s}=this.state,i=t[e].actions?e:null;s!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),s(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:s}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(s.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,s=t.indexOf(e);this.setMouseIndex(s),s>=0&&s<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:s}=this.props,{activeSubMenu:i,hasOverflow:a,keyboardIndex:o,menuItems:l,mouseIndex:c,pendingItems:h,subMenuTop:p,subMenuLeft:g,subMenuParentWidth:C,subMenuParentHeight:x}=this.state;for(let N=0;N<l.length;N+=1){const H=l[N];N>0&&H.group!==l[N-1].group&&e.push(d.jsx("hr",{},`${N}.separator`));const q=d.jsx(vt,{ref:i===N?this.activeSubMenuRef:null,isKeyboardSelected:o===N,isMouseSelected:c===N,menuItem:H,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},N);e.push(q)}let F=null;h.length>0&&(F=d.jsx("div",{className:"loading",children:d.jsx(Zt,{})}));const{menuStyle:A,"data-testid":w}=this.props,O=i!==null&&p!==null&&g!==null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:D({"has-overflow":a},"context-menu-container"),style:{top:t,left:s,...A},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Le.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":w,children:[e,F]}),O&&i!==null&&p!==null&&g!==null&&d.jsx(Le,{actions:l[i].actions||[],closeMenu:this.handleCloseSubMenu,top:p,left:g,updatePosition:(N,H)=>{this.setState({subMenuTop:N,subMenuLeft:H})},subMenuParentWidth:C,subMenuParentHeight:x},`sub-${i}`)]})}};let Fe=Le;u(Fe,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const Cn=Fe;class yn extends S.Component{constructor(e){super(e);u(this,"container");u(this,"openMenu");this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=v.createRef(),this.openMenu=v.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!=null&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!=null&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(!R.isContextActionEvent(e)||!this.container.current||e.metaKey||e.ctrlKey)return;const t=R.getMenuItems(e.contextActions),s=this.container.current.getBoundingClientRect(),i=e.clientY-s.top,a=e.clientX-s.left;if(t.length===0){if(e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{const o=document.elementFromPoint(a,i),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});o==null||o.dispatchEvent(l)});return}return}e.preventDefault(),this.setState({actions:t,top:i,left:a})}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){let e=null;const{"data-testid":t}=this.props,{actions:s,top:i,left:a}=this.state;return s&&(e=d.jsx(Cn,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:a,updatePosition:(o,l)=>{this.setState({top:o,left:l})},"data-testid":t})),d.jsx("div",{className:D("context-menu-root",{active:s}),ref:this.container,children:e})}}const Cs=yn;function et(r,n="No value available in context. Was code wrapped in a provider?"){const e=S.useContext(r);if(e==null)throw new Error(n);return e}function Tn(r){const n=S.useRef();return S.useEffect(function(){n.current=r}),n.current}function Et(r){const n=S.useRef(null);return S.useEffect(function(){r&&(typeof r=="function"?r(n.current):r.current=n.current)}),n}const In=3500,vn=U.module("useCopyToClipboard");function wn(){const[r,n]=S.useState(!1),e=S.useRef(null),t=S.useCallback(s=>{gn(s).then(()=>{n(!0)}).catch(i=>vn.error(`Unable to copy ${s}`,`
2
2
  `,i))},[]);return S.useEffect(()=>(e.current&&clearTimeout(e.current),r&&(e.current=setTimeout(()=>{n(!1)},In)),()=>{e.current&&clearTimeout(e.current)}),[r]),[r,t]}const $e=v.forwardRef((r,n)=>{const{checked:e=!1,children:t,className:s,disabled:i,inputClassName:a,isInvalid:o,labelClassName:l,name:c,onChange:h,"data-testid":p}=r,[g]=S.useState(Ze()),C=Et(n);S.useEffect(function(){C.current&&(C.current.indeterminate=e===null)},[C,e]);const x=S.useCallback(F=>{C.current&&(C.current.indeterminate=e===null),h&&h(F)},[C,e,h]);return d.jsxs("div",{className:D("custom-control custom-checkbox",s),children:[d.jsx("input",{type:"checkbox",ref:C,checked:e??!1,className:D("custom-control-input",a,{"is-invalid":o}),disabled:i,id:g,name:c,onChange:x,"data-testid":p}),d.jsx("label",{className:D("custom-control-label",l),htmlFor:g,children:t})]})});$e.displayName="Checkbox";$e.propTypes={checked:(r,n)=>{const{[n]:e}=r;return e!==null&&typeof e!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:M.node.isRequired,className:M.string,disabled:M.bool,inputClassName:M.string,isInvalid:M.bool,labelClassName:M.string,name:M.string,onChange:M.func,"data-testid":M.string};$e.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const En=$e;class xt extends S.PureComponent{constructor(e){super(e);u(this,"inputField");this.inputField=v.createRef()}focus(){var e;(e=this.inputField.current)==null||e.focus()}render(){const{value:e,placeholder:t,onBlur:s,onChange:i,className:a,disabled:o,matchCount:l,id:c,onKeyDown:h,"data-testid":p}=this.props;return d.jsxs("div",{className:D("search-group",a),children:[d.jsx("input",{type:"search",value:e,onBlur:s,onChange:i,onKeyDown:h,className:"form-control",disabled:o,placeholder:t,ref:this.inputField,id:c,"data-testid":p}),l!=null&&d.jsx("span",{className:"search-match",children:l}),d.jsx("span",{className:"search-icon",children:d.jsx(oe,{icon:Xt})})]})}}u(xt,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0});const xn=xt;var Nt=(r=>(r.UP="UP",r.DOWN="DOWN",r))(Nt||{});const Se=class extends S.Component{constructor(e){super(e);u(this,"popper");u(this,"cbContainer");u(this,"toggleButton");u(this,"menuContainer");u(this,"input");u(this,"searchInput");u(this,"getCachedFilteredOptions",Z((e,t)=>e.filter(s=>s.title.toLowerCase().indexOf(t.toLowerCase())>=0||s.value.toLowerCase().indexOf(t.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=v.createRef(),this.cbContainer=v.createRef(),this.toggleButton=v.createRef(),this.menuContainer=v.createRef(),this.input=v.createRef(),this.searchInput=v.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 l,c;const{filter:t,filteredOptions:s,keyboardOptionIndex:i}=this.state,{options:a}=this.props,o=t?s:a;switch(e.key){case"Enter":((l=o[i])==null?void 0:l.value)!=null&&this.updateInputValue(o[i].value),this.closeMenu(),(c=this.input.current)==null||c.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Se.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Se.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&i===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:s,keyboardOptionIndex:i}=this.state,{options:a}=this.props,l=(t?s:a).length;let c=0;switch(e){case Se.MENU_NAVIGATION_DIRECTION.UP:c=-1;break;case Se.MENU_NAVIGATION_DIRECTION.DOWN:c=1;break}c!==0&&this.setState({keyboardOptionIndex:(i+c+l)%l})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:s}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?s||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var l;const t=Number(e.currentTarget.value),{filter:s,filteredOptions:i}=this.state,{options:a}=this.props,o=s?i:a;this.updateInputValue(o[t].value),this.closeMenu(),(l=this.input.current)==null||l.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var a;const{options:t}=this.props,s=e.target.value,i=this.getCachedFilteredOptions(t,s);this.setState({filter:s,filteredOptions:i,keyboardOptionIndex:0}),(a=this.popper.current)==null||a.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.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,s;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(s=this.popper.current)==null||s.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:s}=this.state,{options:i}=this.props,o=(t?s:i).findIndex(l=>l.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:s}=this.state;return d.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:s},onBlur:this.handleMenuBlur,children:[d.jsx("div",{className:"cb-search-input-container",children:d.jsx(xn,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),d.jsx("div",{className:"cb-options-container",children:d.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:s,filteredOptions:i}=this.state;return(s?i:e).map((o,l)=>{const c=`option-${l}-${o.value}`;return d.jsx("button",{type:"button",value:l,className:D("cb-option-btn",{"keyboard-active":t===l}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},c)})}render(){const{options:e,inputPlaceholder:t,disabled:s,className:i,defaultValue:a,spellCheck:o,"data-testid":l}=this.props,{value:c}=this.state;let{popperOptions:h}=this.props;return h={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...h},d.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[d.jsx("input",{value:c||a,className:D("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:s,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":l!==void 0?`${l}-input`:void 0}),d.jsx("div",{className:"input-group-append cb-dropdown",children:d.jsxs("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:s,"data-testid":l!==void 0?`${l}-btn`:void 0,children:[d.jsx(oe,{icon:Jt}),d.jsx(Xe,{ref:this.popper,options:h,className:D("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let le=Se;u(le,"MENU_NAVIGATION_DIRECTION",Nt),u(le,"DROP_DOWN_MENU_HEIGHT",200),u(le,"propTypes",{options:M.arrayOf(M.shape({title:M.string.isRequired,value:M.string.isRequired})).isRequired,popperOptions:M.shape({title:M.string.isRequired,value:M.string.isRequired}),onChange:M.func,inputPlaceholder:M.string,searchPlaceholder:M.string,disabled:M.bool,className:M.string,defaultValue:M.string,spellCheck:M.bool,onEnter:M.func,"data-testid":M.string}),u(le,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const ys=le;function Ts({copy:r,kind:n="ghost",tooltip:e="Copy",className:t,"data-testid":s,children:i}){const[a,o]=wn();return d.jsx(Ge,{kind:n,className:t,"data-testid":s,icon:a?_t:Yt,tooltip:a?"Copied":e,onClick:()=>{o(typeof r=="function"?r():r)},children:i})}function Dt(r,n,e){return r.substring(0,n)+e+r.substring(n+1)}function Nn(r,n,e){return r.length<e?`${r}${n.substring(r.length,e)}`:r}function dt(r,n){let{length:e}=r;for(let t=r.length-1;t>=0&&n[t]===r[t];t-=1)e=t;return r.substring(0,e)}const G=U.module("MaskedInput"),pe={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},Ne=" ",Ft=v.forwardRef((r,n)=>{const{className:e,example:t,getNextSegmentValue:s=(I,T,b)=>b,getPreferredReplacementString:i=Dt,onChange:a=()=>!1,onSelect:o=()=>!1,onSubmit:l,pattern:c,placeholder:h,selection:p,value:g,onFocus:C=()=>!1,onBlur:x=()=>!1,"data-testid":F}=r,A=Et(n),w=S.useMemo(()=>Array.isArray(t)?t:[t],[t]),O=S.useMemo(()=>w[0].replace(/[a-zA-Z0-9]/g,Ne),[w]);S.useEffect(function(){var T;if(p!=null){G.debug("setting selection...",p);const{selectionStart:b,selectionEnd:E,selectionDirection:L}=p;(T=A.current)==null||T.setSelectionRange(b,E,L),G.debug("selection set!")}},[p,A]);const N=S.useCallback(I=>{let T=I,b=I;const E=w.length>0?w[0]:g;for(let k=T-1;k>=0&&/[a-zA-Z0-9]/g.test(E.charAt(k));k-=1)T=k;for(let k=b;k<E.length&&/[a-zA-Z0-9]/g.test(E.charAt(k));k+=1)b=k+1;const L=T===b?pe.NONE:pe.BACKWARD;return{selectionStart:T,selectionEnd:b,selectionDirection:L}},[w,g]);function H(I,T,b=I.length){let E="";for(let L=0;L<b;L+=1)I.charAt(L)!==Ne?E=E.concat(I[L]):E=E.concat(T[L]);return E=E.concat(T.substring(b)),E}function q(I,T=I.length){const b=new RegExp(`^${c}$`);if(b.test(I))return!0;for(let E=0;E<w.length;E+=1){const L=H(I,w[E],T);if(b.test(L))return!0}return!1}function X(I){const T=N(I),b=T.selectionEnd+1;return b>=g.length?T:N(b)}function _(I){const T=N(I),b=T.selectionStart-1;return b<=0?T:N(b)}function re(I,T){const b=N(I),E=g.substring(b.selectionStart,b.selectionEnd),L=s(b,T,E,g),k=g.substring(0,b.selectionStart)+L+g.substring(b.selectionEnd);q(k,b.selectionEnd)&&(a(k),o(b))}const he=S.useCallback(I=>{const{selectionStart:T=0,selectionEnd:b=0,selectionDirection:E="none"}=I.target;if(T===null||b===null||E===null){G.error("Selection attempted on non-text input element",I.target);return}if(G.debug2("handleSelect",T,b,E),!(p!=null&&T===p.selectionStart&&b===p.selectionEnd)){if(p!=null&&T===g.length&&b===g.length&&I.nativeEvent.type!=="mouseup"){o({...p});return}if(T===b){const L=N(T);G.debug("Selection segment from ",T,b,"=>",L),o(L)}else o({selectionStart:T,selectionEnd:b,selectionDirection:E})}},[N,o,p,g]),Me=S.useCallback(I=>{if(!A.current)return;G.debug("handleSelectCapture",I);const T=A.current.selectionStart??0;T===g.length&&p!=null&&T!==p.selectionStart&&(I.preventDefault(),I.stopPropagation())},[A,p,g]);function we(I){if(I.preventDefault(),I.stopPropagation(),!A.current)return;const{key:T}=I,{selectionStart:b=0,selectionEnd:E=0}=A.current;if(b===null||E===null){G.error("Selection arrow nvaigation attempted on non-text input element",I.target);return}T==="ArrowLeft"?o(_(b)):T==="ArrowRight"?o(X(E)):T==="ArrowUp"?re(b,-1):T==="ArrowDown"&&re(b,1)}function Ee(I){if(!A.current)return;G.debug("handleKeyDown",I);const{key:T}=I,{selectionStart:b=0,selectionEnd:E=0}=A.current;if(b===null||E===null){G.error("Selection key event on non-text input element",I.target);return}if(T==="Enter"){l==null||l(I);return}if(T.startsWith("Arrow")){we(I);return}if(T==="Delete"||T==="Backspace"){if(I.preventDefault(),I.stopPropagation(),E>=dt(g,O).length){const k=g.substring(0,b===E?b-1:b),J=dt(k,O);J!==g&&(a(J),o({selectionStart:J.length,selectionEnd:J.length,selectionDirection:pe.NONE}));return}if(b!==E){const k=g.substring(0,b)+g.substring(b,E).replace(/[a-zA-Z0-9]/g,Ne)+g.substring(E);G.debug("Range ",b,E,"deleted, setting value",k),a(k),o({selectionStart:b,selectionEnd:b,selectionDirection:pe.NONE})}else if(b>0)for(let k=b-1;k>=0;k-=1){const J=g.substring(0,k)+g.substring(k,b).replace(/[a-zA-Z0-9]/g,Ne)+g.substring(b);if(J!==g){a(J),o({selectionStart:k,selectionEnd:k,selectionDirection:pe.NONE});return}}return}if(I.altKey||I.metaKey||I.ctrlKey||T.length>1)return;I.preventDefault(),I.stopPropagation();const L=Array.from(new Set([T,T.toUpperCase(),T.toLowerCase()]));for(let k=0;k<L.length;k+=1){const J=L[k],jt=/[a-zA-Z0-9]/g.test(J)?w[0].length-1:b;for(let te=b;te<=jt;te+=1){const Ut=Nn(g,w[0],te+1),je=i(Ut,te,J,b,E);if(q(je,te+1)){const at=N(te),Ue=te+1;let Ve={selectionStart:Ue,selectionEnd:Ue,selectionDirection:pe.NONE};if(Ue>=at.selectionEnd){const ot=X(te);ot.selectionStart!==at.selectionStart&&(Ve=ot)}G.debug("handleKeyDown",T,"=>",je,Ve),a(je),o(Ve);return}}}}return d.jsx("input",{ref:A,className:D("form-control masked-input",e),type:"text",pattern:c,placeholder:h,value:g,onChange:()=>{},onKeyDown:Ee,onSelect:he,onSelectCapture:Me,onFocus:C,onBlur:x,"data-testid":F})});Ft.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(r,n,e)=>e,getPreferredReplacementString:Dt,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const Dn=Ft;var Ke;let Fn=(Ke=class extends S.PureComponent{constructor(e){super(e);u(this,"container");u(this,"oldFocus");u(this,"rAF");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=v.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:t}=e,s=t.initialKeyboardIndex??-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e){const{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:e}=this.props,t=R.getMenuItems(e,!1);t.length>0&&this.setState(s=>({menuItems:R.sortActions(s.menuItems.concat(t))}))}handleKeyDown(e){const{menuItems:t}=this.state,s=this.getKeyboardIndex();let i=s;if(e.key==="Enter"||e.key===" "){s!=null&&s>=0&&s<t.length&&this.handleMenuItemClick(t[s],e);return}e.key==="Escape"?i=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?i=R.getNextMenuItem(i??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(i=R.getNextMenuItem(i??0,1,t)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(),this.closeMenu(!0))}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,s=t.indexOf(e);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{"data-testid":t}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:a}=this.state;for(let l=0;l<i.length;l+=1){const c=i[l];l>0&&c.group!==i[l-1].group&&e.push(d.jsx("hr",{},`${l}.separator`));const h=d.jsx(vt,{isKeyboardSelected:s===l,isMouseSelected:a===l,menuItem:c,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},l);e.push(h)}const{menuStyle:o}=this.props;return d.jsx("div",{className:"context-menu-container",style:{...o},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}},u(Ke,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0}),Ke);const kn=Fn;class kt extends S.PureComponent{constructor(e){super(e);u(this,"container");u(this,"parent");u(this,"popper");u(this,"isOpen");this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=v.createRef(),this.parent=null,this.popper=v.createRef(),this.isOpen=!1}componentDidMount(){var t;const{isShown:e}=this.props;e===null?(t=this.container.current)!=null&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):e&&this.openMenu()}componentDidUpdate(e){const{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)==null||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:e}=this.props;e()}render(){const{actions:e,onMenuOpened:t,popperClassName:s,"data-testid":i}=this.props,{menuStyle:a}=this.props;let{options:o,popperOptions:l}=this.props;return l={placement:"bottom",...l},o={separateKeyboardMouse:!0,...o},d.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:d.jsx(Xe,{ref:this.popper,options:l,className:D("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:d.jsx(kn,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:o,menuStyle:a})})})}}u(kt,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const vs=kt;function me(r,n,e,t,s){const i=t-e+1;return`${((parseInt(n,10)-r-e)%i+i)%i+e}`.padStart(s,"0")}function An(r,n,e){const{selectionStart:t}=r;return t===0?me(n,e,1900,2099,4):t===5?me(n,e,1,12,2):t===8?me(n,e,1,31,2):t===11?me(n,e,0,23,2):t===17||t===14?me(n,e,0,59,2):t===20||t===24||t===28?me(n,e,0,999,3):e}function Qe(r){const n=r.substring(0,23),e=r.substring(23,26),t=r.substring(26);return[n,e,t].filter(s=>s!=="").join("​")}const On=U.module("DateTimeInput"),Rn="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Ln="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}​[0-9]{3}​[0-9]{3}",Pn=`${Rn} ${Ln}`,ke="2022-01-01",At=`${ke} 00:00:00.000000000`,$n="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function ht(r){return r!=null&&r.length>=ke.length?`${r.substring(0,ke.length)}${r.substring(ke.length).replace(/\u2007/g,"0")}${At.substring(r.length)}`:r}function pt(r){return r.replace(/\u200B/g,"")}const jn=[Qe(At)],tt=v.forwardRef((r,n)=>{const{className:e="",onChange:t=()=>{},defaultValue:s="",onFocus:i=()=>{},onBlur:a=()=>{},onSubmit:o,"data-testid":l}=r,[c,h]=S.useState(s.length>0?Qe(s):""),[p,g]=S.useState(),C=S.useCallback(F=>{On.debug("handleChange",F),h(F),t(ht(pt(F)))},[t]),x=S.useCallback(()=>{const F=pt(c),A=ht(F);A!==F&&h(Qe(A)),a()},[c,a]);return d.jsx("div",{className:"d-flex flex-row align-items-center",children:d.jsx(Dn,{ref:n,className:D(e),example:jn,getNextSegmentValue:An,onChange:C,onSelect:g,onSubmit:o,pattern:Pn,placeholder:$n,selection:p,value:c,onFocus:i,onBlur:x,"data-testid":l})})});tt.displayName="DateTimeInput";tt.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const ws=tt;const Un=U.module("ItemListItem"),it=class extends S.Component{constructor(e){super(e);u(this,"itemRef");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=v.createRef()}static handleKeyDown(){return Un.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:s}=this.props;s(t,e)}handleFocus(e){const{itemIndex:t,onFocus:s}=this.props;s(t,e)}handleClick(e){const{itemIndex:t,onClick:s}=this.props;s(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:s}=this.props;s(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:s}=this.props;s(t,e)}handleDrag(e){const{itemIndex:t,onDrag:s}=this.props;s(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:s}=this.props;s(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:s}=this.props;s(t,e)}handleDrop(e){const{itemIndex:t,onDrop:s}=this.props;s(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:s}=this.props;s(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:s}=this.props;s(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:s}=this.props;s(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:s}=this.props;s(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:s,style:i,children:a,"data-testid":o}=this.props;return d.jsx("div",{className:D("item-list-item",{active:s},{"is-focused":t},{"is-draggable":e}),onKeyDown:it.handleKeyDown,onContextMenuCapture: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:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:a})}};let Ae=it;u(Ae,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const Vn=Ae;const mt=U.module("ItemList"),ft=5,ue=class extends S.PureComponent{constructor(e){super(e);u(this,"list");u(this,"listContainer");u(this,"getItemSelected",Z((e,t)=>ne.isSelected(t,e),{max:ue.CACHE_SIZE}));u(this,"getCachedItem",Z((e,t,s,i,a,o,l,c)=>{const h=o({item:s,itemIndex:e,isFocused:i,isSelected:a,style:l});return d.jsx(Vn,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:c,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:i,isSelected:a,itemIndex:e,style:l,children:h},t)},{max:ue.CACHE_SIZE}));u(this,"getOuterElement",Z(e=>{const t=v.forwardRef((s,i)=>d.jsx("div",{ref:i,tabIndex:-1,onKeyDown:e,role:"presentation",...s}));return t.displayName="ItemListOuterElement",t}));u(this,"getInnerElement",Z(()=>{const e=v.forwardRef((t,s)=>d.jsx("div",{className:"item-list-inner-element",ref:s,...t}));return e.displayName="ItemListInnerElement",e}));u(this,"getItemData",Z((e,t,s)=>({items:e,selectedRanges:t,renderItem:s})));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=v.createRef(),this.listContainer=v.createRef();const{isStickyBottom:t,selectedRanges:s}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:s,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}static renderItem({item:e}){return d.jsx("div",{className:"item-list-item-content",children:e!=null&&(e.displayValue??e.value??`${e}`)})}componentDidUpdate(e,t){const{selectedRanges:s,itemCount:i}=this.props,{focusIndex:a,isStuckToBottom:o,scrollOffset:l,height:c,selectedRanges:h}=this.state;if(o&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(l!==t.scrollOffset||c!==t.height)&&this.sendViewportUpdate(),s!==e.selectedRanges&&s!==h)this.setSelectedRanges(s);else if(h!==t.selectedRanges){const{onSelectionChange:p}=this.props;p(h)}if(a!==t.focusIndex){const{onFocusChange:p}=this.props;p(a)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}restoreScrollPosition(){var t;const{scrollOffset:e}=this.state;e!=null&&((t=this.listContainer.current)==null||t.scrollTo(0,e))}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:s}=this.state,i=this.listContainer.current.querySelectorAll(t),a=e-s;return i[a]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const s=this.getElement(e);s instanceof HTMLElement&&s.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:s}=this.state,a=ne.isSelected(s,e)||R.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:s,onSelect:i}=this.props;s&&this.setState(({selectedRanges:a})=>({selectedRanges:ne.selectRange(a,[e,e])}),()=>{i(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:s}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&s.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){mt.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){mt.debug2("item focus",e,t.target),this.setState(s=>{const{focusIndex:i}=s;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:s,isMultiSelect:i,disableSelect:a}=this.props,{mouseDownIndex:o,selectedRanges:l,mouseX:c,mouseY:h}=this.state;if(o==null||a)return;const p=Math.abs(t.clientX-(c??0)),g=Math.abs(t.clientY-(h??0));p>ft&&g>ft&&this.setState({isDragging:!0}),(s||o===e)&&(this.focusItem(e),i?(!s&&!this.getItemSelected(e,l)&&!R.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,R.isModifierKeyDown(t),!1))}handleItemMouseUp(e,t){const{isDeselectOnClick:s,isDoubleClickSelect:i,onSelect:a}=this.props,{mouseDownIndex:o,isDragging:l}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!l){const c=t.shiftKey,h=R.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,c,h,s),!i&&!c&&!h&&a(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 l;const{isMultiSelect:t,itemCount:s,onSelect:i}=this.props,{focusIndex:a}=this.state;let o=a;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&i(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=s-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,s-1):o=0;else return;if(a!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:c}=this.state;if(e.shiftKey&&c.length>0){const h=c[c.length-1];this.selectRange([Math.min(o,h[0]),Math.max(o,h[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(l=this.listContainer.current)==null||l.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(s=>{if(e)return{scrollOffset:t};const{isStickyBottom:i}=this.props,{height:a}=s;return{isStuckToBottom:i&&this.isListAtBottom({scrollOffset:t,height:a}),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,s,i=!0){const{isMultiSelect:a}=this.props,{selectedRanges:o}=this.state;if(a&&t&&o.length>0){const l=o[o.length-1];this.selectRange([Math.min(l[0],e),Math.max(e,l[1])])}else a&&o.length===1&&o[0][0]===e&&o[0][1]===e?i&&this.deselectItem(e):a&&s?this.getItemSelected(e,o)?i&&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){ne.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:ne.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){ne.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:ne.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:s,rowHeight:i}=this.props,a=Math.floor(e/i),o=a+Math.ceil(t/i);s(a,o)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:s,rowHeight:i}=this.props;return e+t>=s*i}renderInnerElement({index:e,style:t}){const{items:s,offset:i,renderItem:a,disableSelect:o}=this.props,{focusIndex:l,selectedRanges:c}=this.state;if(e<i||e>=i+s.length)return null;const h=s[e-i];return this.getCachedItem(e,e,h,e===l&&!o,this.getItemSelected(e,c),a,t,o)}render(){const{items:e,itemCount:t,overscanCount:s,renderItem:i,rowHeight:a,"data-testid":o}=this.props,{selectedRanges:l,isStuckToBottom:c}=this.state;return d.jsx(Wt,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:h,height:p})=>d.jsx(qt,{className:"item-list-scroll-pane",height:p,width:h,initialScrollOffset:c?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,l,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:s,"data-testid":o,children:this.renderInnerElement})})}};let se=ue;u(se,"CACHE_SIZE",1e3),u(se,"DEFAULT_ROW_HEIGHT",20),u(se,"DEFAULT_OVERSCAN",10),u(se,"defaultProps",{offset:0,items:[],rowHeight:ue.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:ue.DEFAULT_OVERSCAN,renderItem:ue.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});const ie=class extends S.PureComponent{constructor(e){super(e);u(this,"itemList");u(this,"getCachedDraggableItem",Z((e,t,s,i,a,o,l,c)=>d.jsx(Gt,{draggableId:ie.getDraggableId(e,i),index:i,isDragDisabled:l,children:h=>d.jsx("div",{role:"menuitem",className:"draggable-item-list-item",ref:h.innerRef,tabIndex:-1,...h.draggableProps,...h.dragHandleProps,children:t({item:s,itemIndex:i,isFocused:a,isSelected:o,style:c,isClone:!1})})},i),{max:se.CACHE_SIZE}));u(this,"getCachedRenderDraggableItem",Z((e,t,s)=>({item:i,itemIndex:a,isFocused:o,isSelected:l,style:c})=>this.getCachedDraggableItem(e,s,i,a,o,l,t,c),{max:1}));u(this,"getCachedRenderClone",Z((e,t,s,i)=>(a,o,l)=>{const{selectedCount:c}=this.state,{draggableProps:h,dragHandleProps:p,innerRef:g}=a,{index:C}=l.source,x=t[C-s];return d.jsx("div",{className:D("draggable-item-list-dragging-item-container",e),...h,...p,ref:g,children:d.jsx("div",{className:D("draggable-item-list-dragging-item",{"two-dragged":c===2},{"multiple-dragged":c>2}),children:i({item:x,itemIndex:C,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:c})})})},{max:1}));this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=v.createRef(),this.state={selectedCount:0}}static renderHandle(){return d.jsxs("div",{children:[d.jsx(Tt,{children:"Drag to re-order"}),d.jsx(oe,{icon:en})]})}static renderBadge({text:e}){return e!=null&&e.length>0?d.jsx("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:s=""}){return d.jsxs("div",{className:D("item-list-item-content","draggable-item-list-item-content",s),children:[d.jsx("span",{className:"title",children:e}),ie.renderBadge({text:t}),ie.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:s}){const i=e!=null?e.displayValue??e.value??`${e}`:"",a=t!==void 0&&t?`${s}`:"",o=t!==void 0&&t?"item-list-item-clone":"";return ie.renderTextItem({text:i,badgeText:a,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){const t=e.split("/").pop();return parseInt(t!==void 0?t:"",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:ne.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:s,droppableId:i,isDoubleClickSelect:a,isDragDisabled:o,isDropDisabled:l,isMultiSelect:c,isStickyBottom:h,itemCount:p,items:g,offset:C,onFocusChange:x,onSelect:F,onViewportChange:A,renderItem:w,rowHeight:O,selectedRanges:N,style:H,"data-testid":q}=this.props;return d.jsx(zt,{isDropDisabled:l,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(s,g,C,w),"data-testid":q,children:(X,_)=>d.jsx("div",{role:"menu",className:D("draggable-item-list",e,{"is-drop-disabled":l,"is-drag-disabled":o,"is-dragging-from-this":_.draggingFromThisWith,"is-dragging-over":_.isDraggingOver,"is-dropping":_.draggingOverWith}),style:H,ref:X.innerRef,...X.droppableProps,children:d.jsx(se,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:c,isStickyBottom:h,itemCount:p,items:g,onFocusChange:x,onSelect:F,onSelectionChange:this.handleSelectionChange,onViewportChange:A,offset:C,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,w),rowHeight:O,selectedRanges:N})})})}};let ye=ie;u(ye,"DEFAULT_ROW_HEIGHT",30),u(ye,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:ie.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:ie.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const Es=ye;class Re{static reorder(n,e,t,s){const i=n===t?Re.adjustDestinationIndex(s,e):s,a=Re.removeItems(n,e);return t.splice(i,0,...a),a}static removeItems(n,e){const t=[],s=e.map((i,a)=>({range:i,index:a})).sort((i,a)=>a.range[0]-i.range[0]);for(let i=0;i<s.length;i+=1){const{range:a,index:o}=s[i],[l,c]=a;t[o]=n.splice(l,c-l+1)}return Qt(t)}static adjustDestinationIndex(n,e){let t=n;for(let s=0;s<e.length;s+=1){const[i,a]=e[s];if(i>n)break;t-=Math.min(a,n-1)-i+1}return t}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const xs=Re;function Bn({on:r,id:n,className:e,isInvalid:t,disabled:s=!1,onClick:i,"data-testid":a}){return d.jsx("button",{type:"button",className:D("btn","btn-switch",e,{active:r},{"is-invalid":t}),id:n,onClick:i,disabled:s,"data-testid":a,children:d.jsx("div",{className:"handle"})})}function gt(r){return r.isOn!==void 0}function Kn({item:r,onSelect:n=()=>{},"data-testid":e}){const{icon:t,subtitle:s,title:i}=r,a=S.useMemo(()=>gt(r)?()=>{r.onChange(!r.isOn)}:n,[r,n]);return d.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${i}`,onClick:a,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&a()},tabIndex:0,role:"menuitem",children:[t!==void 0&&d.jsx("div",{className:"icon",children:d.jsx(oe,{icon:t})}),d.jsx("div",{className:"title",children:i}),s!==void 0&&d.jsx("div",{className:"shortcut",children:s}),d.jsx("div",{className:"accessory","data-testid":e,children:gt(r)?d.jsx(Bn,{on:r.isOn,onClick:o=>{o.stopPropagation(),a()}}):d.jsx(oe,{icon:yt})})]})}function Ns({items:r,onSelect:n=()=>{},"data-testid":e}){return d.jsx("div",{className:"navigation-menu-view","data-testid":e,children:d.jsx("ul",{className:"navigation-menu-list",children:r.map((t,s)=>d.jsx("li",{children:d.jsx(Kn,{item:t,onSelect:()=>{n(s)}})},t.title))})})}function Ds({children:r,onBack:n,onClose:e,title:t,"data-testid":s}){return d.jsxs("div",{className:"navigation-page","data-testid":s,children:[d.jsxs("div",{className:"navigation-title-bar",children:[d.jsx("div",{className:"navigation-left-buttons",children:n!==void 0&&d.jsx(Ge,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:n,icon:tn,children:"Back"})}),d.jsx("div",{className:"navigation-title",children:t}),d.jsx("div",{className:"navigation-right-buttons",children:e!==void 0&&d.jsx(Ge,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:e,icon:nn,tooltip:"Close"})})]}),d.jsx("div",{className:"navigation-content",children:r})]})}function Fs({children:r,"data-testid":n}){const e=S.useMemo(()=>v.Children.toArray(r),[r]),t=Tn(e),[s,i]=S.useState(e[e.length-1]),[a,o]=S.useState(null),[l,c]=S.useState(null);S.useEffect(function(){if(t===void 0||e===t)return;const C=e[e.length-1];e.length===t.length||t.length===0||a!==null||l!==null?a!==null&&C!==a?o(C):C!==l&&C!==s&&i(C):e.length>t.length?o(C):e.length<t.length&&(i(C),c(t[t.length-1]))},[e,t,a,l,s]);const h=S.useCallback(()=>{i(a),o(null)},[a]),p=S.useCallback(()=>{c(null)},[]);return d.jsxs("div",{className:"navigation-stack",children:[d.jsx("div",{className:"main-view","data-testid":n,children:s}),d.jsx(He,{in:l!=null,timeout:We.transitionMidMs,classNames:"slide-right",onEntered:p,children:d.jsx(d.Fragment,{children:l!=null&&d.jsx("div",{className:"popping-view",children:l})})}),d.jsx(He,{in:a!=null,timeout:We.transitionMidMs,classNames:"slide-left",onEntered:h,children:d.jsx(d.Fragment,{children:a!=null&&d.jsx("div",{className:"pushing-view",children:a})})})]})}function ks({children:r,disabled:n,value:e,"data-testid":t}){return d.jsx("option",{value:e,disabled:n,"data-testid":t,children:r})}function As(r){const{children:n,disabled:e=!1,name:t,onChange:s,value:i="","data-testid":a}=r,[o]=S.useState(t??Ze());return d.jsx(d.Fragment,{children:v.Children.map(n,l=>l?v.cloneElement(l,{name:o,onChange:l.props.onChange??s,checked:i===l.props.value,disabled:l.props.disabled??e,"data-testid":a}):null)})}const nt=v.forwardRef((r,n)=>{const{checked:e,children:t,className:s="",disabled:i=!1,inputClassName:a="",isInvalid:o=!1,labelClassName:l="",name:c,onChange:h,value:p,"data-testid":g}=r,[C]=S.useState(Ze());return d.jsxs("div",{className:D("custom-control custom-radio",s),children:[d.jsx("input",{type:"radio",id:C,"data-testid":g,name:c,ref:n,className:D("custom-control-input",a,{"is-invalid":o}),checked:e,disabled:i,value:p,onChange:h}),d.jsx("label",{className:D("custom-control-label",l),htmlFor:C,children:t})]})});nt.displayName="RadioItem";nt.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Os=nt;function Rs({children:r,onBlur:n,onChange:e,className:t,defaultValue:s,name:i,value:a,disabled:o,"data-testid":l}){const c=S.useCallback(h=>{e(h.target.value)},[e]);return d.jsx("select",{className:D("custom-select",t),onBlur:n,onChange:c,defaultValue:s,value:a,name:i,disabled:o,"data-testid":l,children:r})}class Ot extends S.PureComponent{constructor(e){super(e);u(this,"list");u(this,"topRow");u(this,"bottomRow");u(this,"getCachedItem",Z((e,t,s,i,a,o,l)=>{const c={height:a},h=i??s;return d.jsx("li",{className:"value-list-item",style:c,tabIndex:-1,children:d.jsx(En,{checked:o,disabled:l,onChange:()=>this.handleSelect(e),children:h})},t)},{max:1e3}));u(this,"getCachedItems",Z((e,t,s,i)=>{const a=[];for(let o=0;o<e.length;o+=1){const l=e[o],{value:c,displayValue:h,isSelected:p}=l,g=s+o,C=g,x=this.getCachedItem(g,C,c,h,t,p,i);a.push(x)}return a},{max:1}));this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=v.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){const{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){const{items:t,offset:s,onSelect:i}=this.props,a=e-s;if(a>=0&&a<t.length){const o=t[a],{value:l}=o;i(e,l)}else i(e,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:e,rowHeight:t}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,a=Math.floor(s/t),o=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==o)&&(this.topRow=a,this.bottomRow=o,e(a,o))}getElement(e){return this.list.current==null?null:this.list.current.querySelectorAll(".value-list-item")[e]}scrollIntoView(e){const t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){const{className:e,disabled:t,isInvalid:s,items:i,itemCount:a,offset:o,rowHeight:l,"data-testid":c}=this.props,h=this.getCachedItems(i,l,o,t);return d.jsx("div",{className:D("select-value-list-scroll-pane h-100 w-100",{"is-invalid":s},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":c,children:d.jsx("div",{className:"select-value-list",style:{height:a*l},children:d.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*l,top:o*l,left:0},children:h})})})}}u(Ot,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const Ls=Ot,bt=U.module("Shortcut");var z=(r=>(r.CTRL="MODIFIER_CTRL",r.CMD="MODIFIER_CMD",r.ALT="MODIFIER_ALT",r.OPTION="MODIFIER_OPTION",r.SHIFT="MODIFIER_SHIFT",r))(z||{}),B=(r=>(r.A="A",r.B="B",r.C="C",r.D="D",r.E="E",r.F="F",r.G="G",r.H="H",r.I="I",r.J="J",r.K="K",r.L="L",r.M="M",r.N="N",r.O="O",r.P="P",r.Q="Q",r.R="R",r.S="S",r.T="T",r.U="U",r.V="V",r.W="W",r.X="X",r.Y="Y",r.Z="Z",r.ZERO="0",r.ONE="1",r.TWO="2",r.THREE="3",r.FOUR="4",r.FIVE="5",r.SIX="6",r.SEVEN="7",r.EIGHT="8",r.NINE="9",r.BACKSPACE="Backspace",r.ESCAPE="Escape",r.ENTER="Enter",r.DELETE="Delete",r.SLASH="/",r.QUESTION_MARK="?",r.BACKSLASH="\\",r.PIPE="|",r.MINUS="-",r.UNDERSCORE="_",r.EQUALS="=",r.PLUS="+",r.BACKTICK="`",r.TILDE="~",r.COMMA=",",r.LEFT_CHEVRON="<",r.PERIOD=".",r.RIGHT_CHEVRON=">",r.SEMICOLON=";",r.COLON=":",r.SINGLE_QUOTE="'",r.DOUBLE_QUOTE='"',r.LEFT_BRACKET="[",r.RIGHT_BRACKET="]",r.LEFT_CURLY="{",r.RIGHT_CURLY="}",r.F1="F1",r.F2="F2",r.F3="F3",r.F4="F4",r.F5="F5",r.F6="F6",r.F7="F7",r.F8="F8",r.F9="F9",r.F10="F10",r.F11="F11",r.F12="F12",r))(B||{});const Hn=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),P=class extends Ct{constructor({id:e,shortcut:t,macShortcut:s,isEditable:i=!0,name:a,tooltip:o}){super();u(this,"id");u(this,"name");u(this,"tooltip");u(this,"isEditable");u(this,"defaultKeyState");u(this,"keyState");this.id=e,this.name=a,this.tooltip=o,this.isEditable=i;const c=P.isMacPlatform?s:t;this.defaultKeyState=P.createKeyState(c),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(B).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!P.isMacPlatform&&e.metaKey||!P.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Hn.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(s=>{switch(s){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:s}=e;let i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!P.isAllowedKey(t)&&P.isAllowedKey(String.fromCharCode(s))?i=String.fromCharCode(s):i=t,{keyValue:i,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+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case"Enter":t+="⏎";break;case"Escape":t+="⎋";break;case"Backspace":t+="⌫";break;case"Delete":t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var s,i;return((s=e.keyValue)==null?void 0:s.toUpperCase())===((i=t.keyValue)==null?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":P.isMacPlatform?P.getMacDisplayText(e):P.getWindowsDisplayText(e)}getDisplayText(){return P.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){P.isValidKeyState(e)?(bt.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new wt("onUpdate",{detail:this}))):bt.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return P.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(P.NULL_KEY_STATE)}isNull(){return P.doKeyStatesMatch(this.keyState,P.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return P.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(P.getKeyStateFromEvent(e))}};let Te=P;u(Te,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null}),u(Te,"isMacPlatform",R.isMacPlatform());const St=U.module("ShortcutRegistry");class Wn extends Ct{constructor(){super(...arguments);u(this,"shortcutMap",new Map);u(this,"shortcutsByCategory",new Map)}createAndAdd(e){const t=new Te(e);return this.add(t)}add(e){var i;const t=this.shortcutMap.get(e.id);if(t)return St.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${e.id}`),t;St.debug2(`Adding shortcut to registry: ${e.id}`),e.addEventListener("onUpdate",({detail:a})=>this.dispatchEvent(new wt("onUpdate",{detail:a})));const s=e.id.split(".")[0];return this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(e):this.shortcutsByCategory.set(s,[e]),e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}const qn=Object.freeze(new Wn),fe=qn,Gn={COPY:fe.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[z.CTRL,B.C],macShortcut:[z.CMD,B.C],isEditable:!1}),PASTE:fe.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[z.CTRL,B.V],macShortcut:[z.CMD,B.V],isEditable:!1}),SAVE:fe.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[z.CTRL,B.S],macShortcut:[z.CMD,B.S],isEditable:!1}),SELECT_ALL:fe.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[z.CTRL,B.A],macShortcut:[z.CMD,B.A],isEditable:!1}),LINKER:fe.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[z.CTRL,B.L],macShortcut:[z.CMD,B.L]}),LINKER_CLOSE:fe.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[B.ESCAPE],macShortcut:[B.ESCAPE],isEditable:!1})},Ps=Gn;function Rt(){return et(sn,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function zn(r,n){const e=Rt(),t=S.useMemo(()=>new e.CoreClient(r,n),[e,r,n]);return S.useEffect(()=>()=>{t.disconnect()},[t]),t}const Lt=S.createContext(null);function $s({serverUrl:r,options:n,children:e}){const t=zn(r,n);return d.jsx(Lt.Provider,{value:t,children:e})}function Qn(){return et(Lt,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}const Zn=1e4;function js(r,n,e=Zn){return new Promise((t,s)=>{let i;const a=setTimeout(()=>{i==null||i(),s(new _e(`Variable ${n} not found`))},e);function o(l){const c=l.created.find(h=>h.title===n);c!=null&&(clearTimeout(a),i==null||i(),t(c))}i=r.subscribeToFieldUpdates(o)})}class Oe{static isValid(n){return!0}static isSameFormat(n,e){throw new Error("isSameFormat not implemented")}static makeFormat(n,e,t){return{label:n,formatString:e,type:t}}format(n,e){return""}}u(Oe,"TYPE_GLOBAL","type-global"),u(Oe,"TYPE_CONTEXT_PRESET","type-context-preset"),u(Oe,"TYPE_CONTEXT_CUSTOM","type-context-custom");const j=Oe;class Xn extends j{format(n){switch(n){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const Jn=Xn;class _n extends j{format(n){return String.fromCharCode(n)}}const Yn=_n,{dh:es}=globalThis,y=es,Mt=U.module("DateTimeColumnFormatter"),ae=class extends j{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:s=!1,defaultDateTimeFormatString:i=ae.DEFAULT_DATETIME_FORMAT_STRING}={}){super();u(this,"dhTimeZone");u(this,"defaultDateTimeFormatString");u(this,"showTimeZone");u(this,"showTSeparator");u(this,"formatStringMap");const a=e||ae.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=y.i18n.TimeZone.getTimeZone(a)}catch{Mt.error("Unsupported time zone id",a),this.dhTimeZone=y.i18n.TimeZone.getTimeZone(ae.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=i,this.showTimeZone=t,this.showTSeparator=s,this.formatStringMap=ae.makeFormatStringMap(t,s)}static isValid(e){try{return y.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,s=j.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:s}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){const s=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${s}HH:mm:ss${i}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${s}HH:mm:ss.SSS${i}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${s}HH:mm:ss.SSSSSSSSS${i}`]])}static getGlobalFormats(e,t){return[...ae.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const s=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${i}`],["MM-dd-yyyy",`MM-dd-yyyy${i}`],["HH:mm:ss",`HH:mm:ss${i}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${i}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${i}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${s}HH:mm:ss${i}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${s}HH:mm:ss.SSS${i}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${s}HH:mm:ss.SSSSSSSSS${i}`]])}static getFormats(e,t){return[...ae.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)??e}format(e,t={}){const s=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(s);try{return y.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{Mt.error("Invalid format arguments")}return""}};let Ie=ae;u(Ie,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS"),u(Ie,"DEFAULT_TIME_ZONE_ID","America/New_York");const ts=U.module("DecimalColumnFormatter"),W=class extends j{constructor({defaultFormatString:e=W.DEFAULT_FORMAT_STRING}={}){super();u(this,"defaultFormatString");this.defaultFormatString=e}static isValid(e){try{return y.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,s=j.TYPE_CONTEXT_PRESET,i){return{label:e,type:s,formatString:t,multiplier:i}}static makePresetFormat(e,t="",s){return W.makeFormat(e,t,j.TYPE_CONTEXT_PRESET,s)}static makeCustomFormat(e="",t){return W.makeFormat("Custom Format",e,j.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 s=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return y.i18n.NumberFormat.format(s,i)}catch{ts.error("Invalid format arguments")}return""}};let Q=W;u(Q,"DEFAULT_FORMAT_STRING","###,##0.0000"),u(Q,"FORMAT_PERCENT",W.makePresetFormat("Percent","##0.00%")),u(Q,"FORMAT_BASIS_POINTS",W.makePresetFormat("Basis Points","###,##0 bp",1e4)),u(Q,"FORMAT_MILLIONS",W.makePresetFormat("Millions","###,##0.000 mm",1e-6)),u(Q,"FORMAT_SCIENTIFIC_NOTATION",W.makePresetFormat("Scientific Notation","0.0000E0")),u(Q,"FORMAT_ROUND",W.makePresetFormat("Round","###,##0")),u(Q,"FORMAT_ROUND_TWO_DECIMALS",W.makePresetFormat("0.00","###,##0.00")),u(Q,"FORMAT_ROUND_FOUR_DECIMALS",W.makePresetFormat("0.0000","###,##0.0000"));class ns extends j{format(n){return`${n}`}}const ss=ns,is=U.module("IntegerColumnFormatter"),de=class extends j{constructor({defaultFormatString:e=de.DEFAULT_FORMAT_STRING}={}){super();u(this,"defaultFormatString");this.defaultFormatString=e}static isValid(e){try{return y.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,s=j.TYPE_CONTEXT_PRESET,i){return{label:e,type:s,formatString:t,multiplier:i}}static makePresetFormat(e,t="",s){return de.makeFormat(e,t,j.TYPE_CONTEXT_PRESET,s)}static makeCustomFormat(e="",t){return de.makeFormat("Custom Format",e,j.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 s=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return y.i18n.NumberFormat.format(s,i)}catch{is.error("Invalid format arguments")}return""}};let ge=de;u(ge,"DEFAULT_FORMAT_STRING","###,##0"),u(ge,"FORMAT_MILLIONS",de.makePresetFormat("Millions","###,##0.000 mm",1e-6)),u(ge,"FORMAT_SCIENTIFIC_NOTATION",de.makePresetFormat("Scientific Notation","0.0000E0"));class as extends j{format(n){return n}}const V=class{static makeDateWrapper(n,e,t=0,s=1,i=0,a=0,o=0,l=0){if(!n)throw new Error("No timezone provided");const c=`${e}`.padStart(4,"0"),h=`${t+1}`.padStart(2,"0"),p=`${s}`.padStart(2,"0"),g=`${i}`.padStart(2,"0"),C=`${a}`.padStart(2,"0"),x=`${o}`.padStart(2,"0"),F=`${l}`.padStart(9,"0"),A=`${c}-${h}-${p} ${g}:${C}:${x}.${F}`;return y.i18n.DateTimeFormat.parse(V.FULL_DATE_FORMAT,A,y.i18n.TimeZone.getTimeZone(n))}static getNextNanos(n){const e=parseInt(n,10),t="0".repeat(9-n.length),s=`${e+1}${t}`;return parseInt(s,10)}static getNextDate(n,e,t){let{year:s,month:i,date:a,hours:o,minutes:l,seconds:c,nanos:h}=e;if(n.nanos!=null){if(n.nanos.length===9)return null;h=V.getNextNanos(n.nanos),h>999999999&&(c+=1,h=0)}else n.seconds!=null?c+=1:n.minutes!=null?l+=1:n.hours!=null?o+=1:n.date!=null?a+=1:n.month!=null?i+=1:s+=1;const p=new Date(s,i,a,o,l,c);return V.makeDateWrapper(t,p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds(),h)}static parseMonth(n){const e=parseInt(n,10);if(!Number.isNaN(e))return e>=1&&e<=12?e-1:NaN;const t=n.trim().toLowerCase();if(t.length>=3){for(let s=0;s<V.months.length;s+=1)if(V.months[s].startsWith(t))return s}return NaN}static parseDateValues(n,e,t,s,i,a,o){const l=parseInt(n,10),c=e!=null?this.parseMonth(e):0,h=t!=null?parseInt(t,10):1,p=s!=null?parseInt(s,10):0,g=i!=null?parseInt(i,10):0,C=a!=null?parseInt(a,10):0,x=o!=null?parseInt(o.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(c)||Number.isNaN(h)||Number.isNaN(p)||Number.isNaN(g)||Number.isNaN(C)||Number.isNaN(x)?null:{year:l,month:c,date:h,hours:p,minutes:g,seconds:C,nanos:x}}static parseDateTimeString(n){const t=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(n);if(t==null)throw new Error(`Unexpected date string: ${n}`);const[,s,,i,,a,,o,,l,,c,,h,p]=t;if(p!=null&&p.length>0)throw new Error(`Unexpected characters after date string '${n}': ${p}`);return{year:s,month:i,date:a,hours:o,minutes:l,seconds:c,nanos:h}}static parseDateRange(n,e){const t=n.trim().toLowerCase();if(t.length===0)throw new Error("Cannot parse date range from empty string");if(t==="null")return[null,null];if(t==="today"){const l=new Date(Date.now()),c=V.makeDateWrapper(e,l.getFullYear(),l.getMonth(),l.getDate()),h=V.makeDateWrapper(e,l.getFullYear(),l.getMonth(),l.getDate()+1);return[c,h]}if(t==="yesterday"){const l=new Date(Date.now()),c=V.makeDateWrapper(e,l.getFullYear(),l.getMonth(),l.getDate()-1),h=V.makeDateWrapper(e,l.getFullYear(),l.getMonth(),l.getDate());return[c,h]}if(t==="now"){const l=new Date(Date.now());return[y.DateWrapper.ofJsDate(l),null]}const s=V.parseDateTimeString(t);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${t}`);const i=V.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 a=V.makeDateWrapper(e,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),o=V.getNextDate(s,i,e);return[a,o]}static getJsDate(n){return typeof n=="number"?new Date(n):n.asDate()}};let be=V;u(be,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS"),u(be,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);class ve{}u(ve,"not","not"),u(ve,"and","and"),u(ve,"or","or");function Us(r){if(!(r==="not"||r==="and"||r==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class f{}u(f,"eq","eq"),u(f,"eqIgnoreCase","eqIgnoreCase"),u(f,"notEq","notEq"),u(f,"notEqIgnoreCase","notEqIgnoreCase"),u(f,"greaterThan","greaterThan"),u(f,"greaterThanOrEqualTo","greaterThanOrEqualTo"),u(f,"lessThan","lessThan"),u(f,"lessThanOrEqualTo","lessThanOrEqualTo"),u(f,"in","in"),u(f,"inIgnoreCase","inIgnoreCase"),u(f,"notIn","notIn"),u(f,"notInIgnoreCase","notInIgnoreCase"),u(f,"isTrue","isTrue"),u(f,"isFalse","isFalse"),u(f,"isNull","isNull"),u(f,"invoke","invoke"),u(f,"contains","contains"),u(f,"notContains","notContains"),u(f,"startsWith","startsWith"),u(f,"endsWith","endsWith"),u(f,"containsAny","containsAny");const Y=U.module("TableUtils"),m=class{static getSortIndex(n,e){var t;for(let s=0;s<n.length;s+=1)if(((t=n[s].column)==null?void 0:t.name)===e)return s;return null}static getSortForColumn(n,e){const t=m.getSortIndex(n,e);return t!=null?n[t]:null}static getFilterText(n){return n?n.toString():null}static getFilterTypes(n){return m.isBooleanType(n)?[f.isTrue,f.isFalse,f.isNull]:m.isCharType(n)||m.isNumberType(n)||m.isDateType(n)?[f.eq,f.notEq,f.greaterThan,f.greaterThanOrEqualTo,f.lessThan,f.lessThanOrEqualTo]:m.isTextType(n)?[f.eq,f.eqIgnoreCase,f.notEq,f.notEqIgnoreCase,f.contains,f.notContains,f.startsWith,f.endsWith]:[]}static getNextSort(n,e,t){if(t<0||t>=n.length)return null;const s=m.getSortForColumn(e,n[t].name);return s===null?n[t].sort().asc():s.direction===m.sortDirection.ascending?s.desc():null}static makeColumnSort(n,e,t,s){if(e<0||e>=n.length||t===m.sortDirection.none)return null;let i=n[e].sort();switch(t){case m.sortDirection.ascending:i=i.asc();break;case m.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(n,e,t,s=!1){if(t<0||t>=e.length)return[];const i=m.getNextSort(e,n,t);return m.setSortForColumn(n,e[t].name,i,s)}static sortColumn(n,e,t,s,i,a){if(t<0||t>=e.length)return[];const o=m.makeColumnSort(e,t,s,i);return m.setSortForColumn(n,e[t].name,o,a)}static setSortForColumn(n,e,t,s=!1){const i=m.getSortIndex(n,e);let a=[];return s&&(a=a.concat(n.filter(({direction:o})=>o!==m.sortDirection.reverse)),i!==null&&a.splice(i,1)),t!==null&&a.push(t),a}static getNormalizedType(n){switch(n){case"boolean":case"java.lang.Boolean":case m.dataType.BOOLEAN:return m.dataType.BOOLEAN;case"char":case"java.lang.Character":case m.dataType.CHAR:return m.dataType.CHAR;case"java.lang.String":case m.dataType.STRING:return m.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case m.dataType.DATETIME:return m.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case m.dataType.DECIMAL:return m.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 m.dataType.INT:return m.dataType.INT;default:return m.dataType.UNKNOWN}}static isLongType(n){switch(n){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(n){switch(n){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(n){return m.isIntegerType(n)||m.isDecimalType(n)}static isIntegerType(n){switch(n){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(n){switch(n){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(n){switch(n){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(n){switch(n){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(n){switch(n){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(n){switch(n){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(n){switch(n){case"java.lang.String":return!0;default:return!1}}static isTextType(n){return this.isStringType(n)||this.isCharType(n)}static getBaseType(n){return n.split("[]")[0]}static isCompatibleType(n,e){return m.getNormalizedType(n)===m.getNormalizedType(e)}static makeQuickFilter(n,e,t){const s=e.split("||");let i=null;for(let a=0;a<s.length;a+=1){const l=s[a].split("&&");let c=null;for(let h=0;h<l.length;h+=1){const p=l[h].trim();if(p.length>0){const g=m.makeQuickFilterFromComponent(n,p,t);if(g)c?c=c.and(g):c=g;else throw new Error(`Unable to parse quick filter from text ${e}`)}}i&&c?i=i.or(c):i=c}return i}static makeQuickFilterFromComponent(n,e,t){const{type:s}=n;return m.isNumberType(s)?this.makeQuickNumberFilter(n,e):m.isBooleanType(s)?this.makeQuickBooleanFilter(n,e):t!=null&&m.isDateType(s)?this.makeQuickDateFilter(n,e,t):m.isCharType(s)?this.makeQuickCharFilter(n,e):this.makeQuickTextFilter(n,e)}static makeQuickNumberFilter(n,e){const t=n.filter();let s=null;const a=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(e);let o=null,l=null,c=null,h=null,p=null;if(a!==null&&a.length>3&&([,o,l,c,h,p]=a),p!=null&&p.trim().length>0)return null;if(o==null&&(o="="),h!=null){if(!(o==="="||o==="!"||o==="!="))return null;switch(h=h.trim().toLowerCase(),h){case"null":s=t.isNull();break;case"nan":s=y.FilterCondition.invoke("isNaN",t);break;case"infinity":case"inf":case"∞":l!=null?s=y.FilterCondition.invoke("isInf",t).and(t.lessThan(y.FilterValue.ofNumber(0))):s=y.FilterCondition.invoke("isInf",t).and(t.greaterThan(y.FilterValue.ofNumber(0)));break}return s!==null&&(o==="!"||o==="!=")&&(s=s.not()),s}if(c==null)return null;if(c=m.removeCommas(c),m.isLongType(n.type))try{c=y.FilterValue.ofNumber(y.LongWrapper.ofString(`${l!=null?"-":""}${c}`))}catch(g){return Y.warn("Unable to create long filter",g),null}else{if(c=parseFloat(c),c==null||Number.isNaN(c))return null;c=y.FilterValue.ofNumber(l!=null?0-c:c)}return s=n.filter(),m.makeRangeFilterWithOperation(s,o,c)}static makeQuickTextFilter(n,e){const t=`${e}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(t);let a=null,o=null;if(i!==null&&i.length>2&&([,a,o]=i,o!=null&&(o=o.trim())),o==null||o.length===0)return null;a==null&&(a="=");const l=n.filter();if(o.toLowerCase()==="null")switch(a){case"=":return l.isNull();case"!=":case"!":return l.isNull().not()}let c=null,h=null;switch(o.startsWith("*")?(c="*",o=o.substring(1)):o.endsWith("*")&&!o.endsWith("\\*")&&(h="*",o=o.substring(0,o.length-1)),o=o.replace("\\",""),a){case"~":return l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${o}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${o}\\E.*`)).not());case"!=":return c==="*"?l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${o}\\E$`)).not()):h==="*"?l.isNull().or(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${o}\\E.*`)).not()):l.notEqIgnoreCase(y.FilterValue.ofString(o.toLowerCase()));case"=":return c==="*"?l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${o}\\E$`))):h==="*"?l.isNull().not().and(l.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${o}\\E.*`))):l.eqIgnoreCase(y.FilterValue.ofString(o.toLowerCase()))}return null}static makeQuickBooleanFilter(n,e){const s=/^(!=|=|!)?(.*)/.exec(`${e}`.trim());if(s===null)return null;const[,i,a]=s,o=i==="!"||i==="!=",l=a.trim().toLowerCase();let c=n.filter();try{const h=m.makeBooleanValue(l);return h!=null&&h?c=c.isTrue():h===null?c=c.isNull():c=c.isFalse(),o?c.not():c}catch{return null}}static makeQuickDateFilter(n,e,t){const s=e.trim(),a=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(a==null||a.length<=2)throw new Error(`Unable to parse date filter: ${e}`);let o=null,l=null;[,o,l]=a;let c=f.eq;switch(o){case"<":c=f.lessThan;break;case"<=":case"=<":c=f.lessThanOrEqualTo;break;case">":c=f.greaterThan;break;case">=":case"=>":c=f.greaterThanOrEqualTo;break;case"!=":case"!":c=f.notEq;break;case"=":case"==":default:c=f.eq;break}return m.makeQuickDateFilterWithOperation(n,l,c,t)}static makeQuickDateFilterWithOperation(n,e,t,s){const[i,a]=be.parseDateRange(e,s),o=i!=null?y.FilterValue.ofNumber(i):null,l=a!=null?y.FilterValue.ofNumber(a):null,c=n.filter();if(o==null)return t===f.notEq?c.isNull().not():c.isNull();switch(t){case f.eq:{if(l!=null){const h=c.greaterThanOrEqualTo(o),p=c.lessThan(l);return h.and(p)}return c.eq(o)}case f.lessThan:return c.lessThan(o);case f.lessThanOrEqualTo:return l!=null?c.lessThan(l):c.lessThanOrEqualTo(o);case f.greaterThan:return l!=null?c.greaterThanOrEqualTo(l):c.greaterThan(o);case f.greaterThanOrEqualTo:return c.greaterThanOrEqualTo(o);case f.notEq:{if(l!=null){const h=c.lessThan(o),p=c.greaterThanOrEqualTo(l);return h.or(p)}return c.notEq(o)}default:throw new Error(`Invalid operator: ${t}`)}}static quoteValue(n){return n.length>=2&&(n.charAt(0)==='"'&&n.charAt(n.length-1)==='"'||n.charAt(0)==="'"&&n.charAt(n.length-1)==="'")?n:`"${n}"`}static isRangeOperation(n){switch(n){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(n,e){const t=`${e}`.trim(),i=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(t);let a=null,o=null,l=null;if(i!==null&&i.length>3&&([,a,o,l]=i),l!=null&&l.trim().length>0||o==null||o.length===0)return null;a==null&&(a="=");const c=n.filter();if(o.toLowerCase()==="null")switch(a){case"=":return c.isNull();case"!=":case"!":return c.isNull().not();default:return null}const h=y.FilterValue.ofString(m.isRangeOperation(a)?m.quoteValue(o):o);return m.makeRangeFilterWithOperation(c,a,h)}static makeRangeFilterWithOperation(n,e,t){switch(e){case"=":return n.eq(t);case"<":return n.lessThan(t);case"<=":case"=<":return n.lessThanOrEqualTo(t);case">":return n.greaterThan(t);case">=":case"=>":return n.greaterThanOrEqualTo(t);case"!=":case"!":return n.notEq(t);default:return null}}static makeCancelableTablePromise(n){return ze.makeCancelable(n,e=>{e.close()})}static makeCancelableTableEventPromise(n,e,t=0,s=null){let i,a,o=!0;const l=new Promise((c,h)=>{a=setTimeout(()=>{i(),o=!1,h(new _e(`Event "${e}" timed out.`))},t),i=n.addEventListener(e,p=>{if(s!=null&&!s(p)){Y.debug2("Event triggered, but matcher returned false.");return}Y.debug2("Event triggered, resolving."),i(),clearTimeout(a),o=!1,c(p)})});return l.cancel=()=>{if(o){Y.debug2("Pending promise cleanup."),i(),clearTimeout(a),o=!1;return}Y.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(n,e,t){const{filterItems:s,filterOperators:i,invertSelection:a,selectedValues:o}=e;let l=null;for(let h=0;h<s.length;h+=1){const p=s[h],{selectedType:g,value:C}=p;if(g!=null&&g.length>0&&C!=null&&C.length>0)try{const x=m.makeAdvancedValueFilter(n,g,C,t);if(x!=null){if(h===0)l=x;else if(l!==null&&h-1<i.length){const F=i[h-1];if(F===ve.and)l=l.and(x);else if(F===ve.or)l=l.or(x);else{Y.error("Unexpected filter operator",F,x),l=null;break}}}else Y.debug2("Empty filter ignored for",g,C)}catch(x){Y.error("Unable to create filter",x),l=null;break}}const c=m.makeSelectValueFilter(n,o,a);return c!=null&&(l!=null?l=l.and(c):l=c),l}static removeCommas(n){return n.replace(/[\s|,]/g,"")}static makeFilterValue(n,e){const t=m.getBaseType(n);return m.isTextType(t)?y.FilterValue.ofString(e):m.isLongType(t)?y.FilterValue.ofNumber(y.LongWrapper.ofString(m.removeCommas(e))):y.FilterValue.ofNumber(m.removeCommas(e))}static makeFilterRawValue(n,e){return m.isTextType(n)?y.FilterValue.ofString(e):m.isBooleanType(n)?y.FilterValue.ofBoolean(e):y.FilterValue.ofNumber(e)}static makeValue(n,e,t){if(e==="null")return null;if(m.isTextType(n))return e;if(m.isLongType(n))return y.LongWrapper.ofString(m.removeCommas(e));if(m.isBooleanType(n))return m.makeBooleanValue(e,!0);if(m.isDateType(n)){const[s]=be.parseDateRange(e,t);return s}return m.isNumberType(n)?m.makeNumberValue(e):(Y.error("Unexpected column type",n),null)}static makeBooleanValue(n,e=!1){if(n===""&&e)return null;switch(n==null?void 0:n.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 '${n}'`)}}static makeNumberValue(n){if(n==="null"||n==="")return null;const e=n.toLowerCase().trim();if(e==="∞"||e==="infinity"||e==="inf")return Number.POSITIVE_INFINITY;if(e==="-∞"||e==="-infinity"||e==="-inf")return Number.NEGATIVE_INFINITY;const t=m.removeCommas(e);if(m.NUMBER_REGEX.test(t))return parseFloat(t);throw new Error(`Invalid number '${n}'`)}static getFilterOperatorString(n){switch(n){case f.eq:return"=";case f.notEq:return"!=";case f.greaterThan:return">";case f.greaterThanOrEqualTo:return">=";case f.lessThan:return"<";case f.lessThanOrEqualTo:return"<=";case f.contains:return"~";case f.notContains:return"!~";default:throw new Error(`Unexpected filter type ${n}`)}}static makeAdvancedValueFilter(n,e,t,s){if(m.isDateType(n.type))return m.makeQuickDateFilterWithOperation(n,t,e,s);if(m.isNumberType(n.type)||m.isCharType(n.type))return m.makeQuickFilter(n,`${m.getFilterOperatorString(e)}${t}`);const i=m.makeFilterValue(n.type,t),a=n.filter();switch(e){case f.eq:return a.eq(i);case f.eqIgnoreCase:return a.eqIgnoreCase(i);case f.notEq:return a.notEq(i);case f.notEqIgnoreCase:return a.notEqIgnoreCase(i);case f.greaterThan:return a.greaterThan(i);case f.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(i);case f.lessThan:return a.lessThan(i);case f.lessThanOrEqualTo:return a.lessThanOrEqualTo(i);case f.isTrue:return a.isTrue();case f.isFalse:return a.isFalse();case f.isNull:return a.isNull();case f.contains:return a.isNull().not().and(a.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${t}\\E.*`)));case f.notContains:return a.isNull().or(a.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${t}\\E.*`)).not());case f.startsWith:return a.isNull().not().and(a.invoke("matches",y.FilterValue.ofString(`(?s)(?i)^\\Q${t}\\E.*`)));case f.endsWith:return a.isNull().not().and(a.invoke("matches",y.FilterValue.ofString(`(?s)(?i).*\\Q${t}\\E$`)));case f.in:case f.inIgnoreCase:case f.notIn:case f.notInIgnoreCase:case f.invoke:default:throw new Error(`Unexpected filter operation: ${e}`)}}static makeSelectValueFilter(n,e,t){if(e.length===0){if(t)return null;let a=null;m.isTextType(n.type)?a=y.FilterValue.ofString("a"):m.isBooleanType(n.type)?a=y.FilterValue.ofBoolean(!0):m.isDateType(n.type)?a=y.FilterValue.ofNumber(y.DateWrapper.ofJsDate(new Date)):a=y.FilterValue.ofNumber(0);const o=n.filter().eq(a),l=n.filter().notEq(a);return o.and(l)}const s=[];let i=!1;for(let a=0;a<e.length;a+=1){const o=e[a];o==null?i=!0:m.isTextType(n.type)?s.push(y.FilterValue.ofString(typeof o=="number"?String.fromCharCode(o):o)):m.isBooleanType(n.type)?s.push(y.FilterValue.ofBoolean(Boolean(o))):s.push(y.FilterValue.ofNumber(o))}return i?s.length>0?t?n.filter().isNull().not().and(n.filter().notIn(s)):n.filter().isNull().or(n.filter().in(s)):t?n.filter().isNull().not():n.filter().isNull():t?n.filter().notIn(s):n.filter().in(s)}static isTreeTable(n){return n!=null&&n.expand!==void 0&&n.collapse!==void 0}static sortColumns(n,e=!0){return[...n].sort((t,s)=>{const i=t.name.toUpperCase(),a=s.name.toUpperCase();return Mn.sort(i,a,e)})}};let $=m;u($,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"}),u($,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null}),u($,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"})),u($,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);class Pt{constructor(n=[],e,t,s,i=!1){u(this,"defaultColumnFormatter");u(this,"typeFormatterMap");u(this,"columnFormatMap");u(this,"truncateNumbersWithPound");this.defaultColumnFormatter=new ss,this.typeFormatterMap=new Map([[$.dataType.BOOLEAN,new Jn],[$.dataType.CHAR,new Yn],[$.dataType.DATETIME,new Ie(e)],[$.dataType.DECIMAL,new Q(t)],[$.dataType.INT,new ge(s)],[$.dataType.STRING,new as]]),this.columnFormatMap=Pt.makeColumnFormatMap(n),this.truncateNumbersWithPound=i}static makeColumnFormatMap(n){return n==null?new Map:n.reduce((e,t)=>{const s=$.getNormalizedType(t.columnType);if(s===null)return e;e.has(s)||e.set(s,new Map);const i=e.get(s);return i==null||i.set(t.columnName,t.format),e},new Map)}static makeColumnFormattingRule(n,e,t){return{columnType:n,columnName:e,format:t}}getColumnFormatMapForType(n,e=!1){const t=$.getNormalizedType(n);if(t!==null)return e&&!this.columnFormatMap.has(t)&&this.columnFormatMap.set(t,new Map),this.columnFormatMap.get(t)}getColumnFormat(n,e){const t=this.getColumnFormatMapForType(n);return(t==null?void 0:t.get(e))??null}getColumnTypeFormatter(n){const e=$.getNormalizedType(n);let t=this.defaultColumnFormatter;return e&&(t=this.typeFormatterMap.get(e)??t),t}getFormattedString(n,e,t="",s){if(n==null)return"";const i=this.getColumnTypeFormatter(e),a=s||this.getColumnFormat(e,t);return i.format(n,a??void 0)}get timeZone(){var e;const n=this.typeFormatterMap.get($.dataType.DATETIME);return(e=n==null?void 0:n.dhTimeZone)==null?void 0:e.id}}function os(r){if(r&&r.formatter){const{formatter:n}=r;return n}}function rs(r){return{timeZone:r==null?void 0:r.timeZone,defaultDateTimeFormatString:r==null?void 0:r.defaultDateTimeFormat,showTimeZone:r==null?void 0:r.showTimeZone,showTSeparator:r==null?void 0:r.showTSeparator}}function ls(r,n,e){const t=r.getColumnFormat(e,n);return t!=null&&(t.type===j.TYPE_CONTEXT_PRESET||t.type===j.TYPE_CONTEXT_CUSTOM)}const Vs={getColumnFormats:os,getDateTimeFormatterOptions:rs,isCustomColumnFormatDefined:ls},cs=U.module("@deephaven/jsapi-components.ConnectionBootstrap"),$t=S.createContext(null);function Bs({children:r}){const n=Rt(),e=Qn(),[t,s]=S.useState(),[i,a]=S.useState();return S.useEffect(function(){let l=!1;async function c(){try{const h=await e.getAsIdeConnection();if(l)return;a(h)}catch(h){if(l)return;s(h)}}return c(),()=>{l=!0}},[n,e]),S.useEffect(function(){if(i==null)return;function l(h){const{detail:p}=h;cs.info("Shutdown",`${JSON.stringify(p)}`),s(`Server shutdown: ${p??"Unknown reason"}`)}return i.addEventListener(n.IdeConnection.EVENT_SHUTDOWN,l)},[n,i]),i==null||t!=null?d.jsx(an,{"data-testid":"connection-bootstrap-loading",isLoading:i==null,errorMessage:t!=null?`${t}`:void 0}):d.jsx($t.Provider,{value:i,children:r})}function Ks(){return et($t,"No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?")}export{wn as $,Xe as A,Ge as B,lt as C,be as D,ms as E,Vs as F,Ps as G,vs as H,ge as I,Ns as J,B as K,ys as L,z as M,ws as N,ve as O,ze as P,Pt as Q,As as R,fe as S,f as T,Fs as U,Ds as V,wt as W,Ks as X,Cs as Y,js as Z,et as _,bs as a,Et as a0,Dn as a1,Dt as a2,An as a3,ne as a4,vt as a5,Vn as a6,Kn as a7,Te as a8,Bn as a9,Nn as aa,dt as ab,$s as ac,Lt as ad,Rt as ae,Qn as af,_e as ag,Jn as ah,Yn as ai,ss as aj,Zn as ak,as as al,os as am,rs as an,ls as ao,gs as ap,Bs as aq,$t as ar,$ as b,fs as c,gn as d,R as e,Tt as f,Ss as g,j as h,Ie as i,Q as j,ps as k,Ts as l,Ls as m,Us as n,xs as o,Es as p,Rs as q,ks as r,y as s,Os as t,Tn as u,En as v,se as w,xn as x,Ms as y,Mn as z};
3
- //# sourceMappingURL=useConnection-dc17671e.js.map
3
+ //# sourceMappingURL=useConnection-a2bb8445.js.map