@deephaven/embed-grid 0.49.2-beta.0 → 0.49.2-theme-plugins.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/App-ba93557e.js +15 -0
- package/build/assets/App-ba93557e.js.map +1 -0
- package/build/assets/App-e9f9b9ab.css +1 -0
- package/build/assets/index-1bf3f03b.js +4 -0
- package/build/assets/index-1bf3f03b.js.map +1 -0
- package/build/assets/index-8f0c28fd.js +8 -0
- package/build/assets/index-8f0c28fd.js.map +1 -0
- package/build/assets/{index-d295a2b4.css → index-db26989e.css} +1 -1
- package/build/assets/useUser-76f29a50.js +3 -0
- package/build/assets/useUser-76f29a50.js.map +1 -0
- package/build/index.html +2 -2
- package/package.json +13 -13
- package/build/assets/App-b820d4b9.js +0 -15
- package/build/assets/App-b820d4b9.js.map +0 -1
- package/build/assets/App-bc379782.css +0 -1
- package/build/assets/index-8d34833f.js +0 -2
- package/build/assets/index-8d34833f.js.map +0 -1
- package/build/assets/index-e929c673.js +0 -8
- package/build/assets/index-e929c673.js.map +0 -1
- package/build/assets/useUser-ff64c9ad.js +0 -3
- package/build/assets/useUser-ff64c9ad.js.map +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as g,a as E,a8 as Tn,j as c,C as Ze,c as P,R as En,P as C,F as me,s as rt,m as J,a9 as In,aa as On,i as Pn,k as Nn,ab as xn,E as Xt,b as yt}from"./vendor-87a7d5fa.js";import{L as V,T as Xe,ai as Jt,a as Dn,a8 as Fn,i as An,aj as Rn,ak as jn,B as Ln,al as kn,U as $n,ah as Kn,ab as Vn}from"./index-8d34833f.js";var Mi=Object.freeze([]),wi=new Map,Ti=()=>{};function ze(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(n=>n!=null)}function Bn(r,e,t){return e=Hn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hn(r){var e=_n(r,"string");return typeof e=="symbol"?e:String(e)}function _n(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Wn extends Error{constructor(){super(...arguments),Bn(this,"isCanceled",!0)}}const bt=Wn;function Un(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=qn(r,e);t.forEach(n=>{r[n]=r[n].bind(r)})}function qn(r,e){for(var t=new Set,n=r,a=0;n!=null&&n!==Object.prototype&&(a<=1||e);){for(var i of Object.getOwnPropertyNames(n))i!=="constructor"&&typeof n[i]=="function"&&t.add(i);n=Object.getPrototypeOf(n),a+=1}return[...t.keys()]}function St(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Gn(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){St(i,n,a,s,o,"next",l)}function o(l){St(i,n,a,s,o,"throw",l)}s(void 0)})}}function zn(r){return Je.apply(this,arguments)}function Je(){return Je=Gn(function*(r){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(r)}catch{return Ct(r)}Ct(r)}),Je.apply(this,arguments)}function Ct(r){var e=document.activeElement,t=document.createElement("textarea");t.value=r,document.body.appendChild(t),t.focus(),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!n)throw new Error("Unable to execute copy command")}function Qn(r,e){return r?r.closest(".".concat(e)):null}function Zn(r){return r instanceof HTMLElement?r:null}const Ei={getClosestByClassName:Qn,identityExtractHTMLElement:Zn};class Yt extends CustomEvent{constructor(e,t){super(e,t)}}function Xn(r,e,t){return e=Jn(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jn(r){var e=Yn(r,"string");return typeof e=="symbol"?e:String(e)}function Yn(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class er extends Error{constructor(){super(...arguments),Xn(this,"isTimeout",!0)}}const at=er;class Ye{static makeCancelable(e,t){var n=!1,a,i,s=new Promise((o,l)=>{i=l,Promise.resolve(e).then(u=>{n?t&&t(u):(a=u,o(u))}).catch(u=>l(u))});return s.cancel=()=>{n=!0,i(new bt),a!=null&&t&&t(a)},s}static isCanceled(e){return e instanceof bt}static isTimedOut(e){return e instanceof at}static withTimeout(e,t){return new Promise((n,a)=>{setTimeout(()=>{try{n(t())}catch(i){a(i)}},e)})}}function Ii(r){if(r==null)throw new Error("Value is null or undefined")}function Oi(r,e){var t,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,a=(t=r.get(e))!==null&&t!==void 0?t:n;if(a!==void 0)return a;throw new Error("Missing value for key ".concat(e))}class it{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!it.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var n=0;n<e.length;n+=1){var a=e[n],i=a[0],s=a[1];if(i<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[n,a]=t,i=[...e],s=i.length-1;s>=0;s-=1){var o=i[s],l=o[0],u=o[1];if(l<=n&&a<=u)return i;n<=u&&l<=a&&(n=Math.min(n,l),a=Math.max(a,u),i.splice(s,1))}return i.push([n,a]),i}static deselectRange(e,t){for(var[n,a]=t,i=[...e],s=i.length-1;s>=0;s-=1){var o=i[s],l=o[0],u=o[1];if(!(a<l||u<n))if(l<n&&a<u){i[s]=[l,n-1],i.splice(s+1,0,[a+1,u]);break}else n<=l&&u<=a?i.splice(s,1):l<n?i[s]=[l,n-1]:i[s]=[a+1,u]}return i}static count(e){return e.reduce((t,n)=>t+(n[1]-n[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((n,a)=>{for(var i=[...n],s=a[0];s<=a[1];s+=1)i.push(e[s]);return i},[])}}const le=it;function*Pi(r,e){for(var t=r;t<=e;++t)yield t}class tr{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var n=e.slice(0,e.length-1).join(", "),a=e[e.length-1];return"".concat(n,", ").concat(t," ").concat(a)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?n?-1:1:e>t?n?1:-1:0}}const nr=tr;function en(r,e,t){return e=rr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rr(r){var e=ar(r,"string");return typeof e=="symbol"?e:String(e)}function ar(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Fe{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),n=Math.floor(e%3600/60),a=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(n>0||t>0?"".concat(n,"m "):"")+"".concat(e>=60?"".concat(a,"s").padStart(3,"0"):"".concat(a,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),a=String(Math.floor(n/60)).padStart(2,"0"),i=n%60,s=String(Math.ceil(i)).padStart(2,"0");return"".concat(t,":").concat(a,":").concat(s)}static isTimeString(e){return new RegExp(Fe.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}en(Fe,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");en(Fe,"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 Ni=Fe;function Ke(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=g.useContext(r);if(t==null)throw new Error(e);return t}function ir(r){var e=g.useRef();return g.useEffect(function(){e.current=r}),e.current}function tn(r){var e=g.useRef(null);return g.useEffect(function(){r&&(typeof r=="function"?r(e.current):r.current=e.current)}),e}var sr=3500,or=V.module("useCopyToClipboard");function lr(){var[r,e]=g.useState(!1),t=g.useRef(null),n=g.useCallback(a=>{zn(a).then(()=>{e(!0)}).catch(i=>or.error("Unable to copy ".concat(a),`
|
|
2
|
-
`,i))},[]);return g.useEffect(()=>(t.current&&clearTimeout(t.current),r&&(t.current=setTimeout(()=>{e(!1)},sr)),()=>{t.current&&clearTimeout(t.current)}),[r]),[r,n]}function Mt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function ur(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mt(Object(t),!0).forEach(function(n){Oe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Mt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Oe(r,e,t){return e=dr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dr(r){var e=cr(r,"string");return typeof e=="symbol"?e:String(e)}function cr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class st extends g.Component{constructor(e){super(e),Oe(this,"element",void 0),Oe(this,"container",void 0),Oe(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=E.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{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(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:n}=this.props;if(!e&&this.container.current!==null){var{options:a}=this.props;a=ur({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},a),document.body.appendChild(this.element);var i=this.getVisibleElement(this.container.current);i==null&&(i=this.container.current),e=new Tn(n||i,this.element,a),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var s=this.element.firstElementChild;s instanceof HTMLElement&&s.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{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(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:n,interactive:a,closeOnBlur:i}=this.props,{show:s}=this.state;return c.jsx(Ze,{in:s,timeout:n,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:c.jsx("div",{onClick:o=>{o.stopPropagation()},onKeyDown:o=>{o.key==="Escape"&&this.hide()},className:P("popper",{interactive:a},e),onBlur:i?this.handleBlur:void 0,tabIndex:i?-1:void 0,role:"presentation",children:c.jsxs("div",{className:"popper-content",children:[t,c.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return c.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&En.createPortal(this.renderContent(),this.element)})}}Oe(st,"propTypes",{children:C.node.isRequired,options:C.shape({}),className:C.string,timeout:C.number,onEntered:C.func,onExited:C.func,isShown:C.bool,closeOnBlur:C.bool,interactive:C.bool,referenceObject:C.shape({}),"data-testid":C.string});Oe(st,"defaultProps",{options:{},className:"",timeout:Xe.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const ot=st;function wt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function hr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(t),!0).forEach(function(n){Y(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):wt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Y(r,e,t){return e=fr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fr(r){var e=mr(r,"string");return typeof e=="symbol"?e:String(e)}function mr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var pr=V.module("Tooltip");class R extends g.Component{static handleHidden(){R.shownTooltipCount-=1,R.shownTooltipCount===0&&(R.lastHiddenTime=Date.now())}static handleShown(){R.shownTooltipCount+=1}constructor(e){super(e),Y(this,"container",void 0),Y(this,"popper",void 0),Y(this,"parent",void 0),Y(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=E.createRef(),this.popper=E.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:n}=t,{isShown:a}=this.state;a!==n&&(a?R.handleShown():R.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&R.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){pr.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{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(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,n=e.clientY,{isShown:a}=this.state;if(!(!this.popper.current||!this.parent)){var i=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&n>=s.top&&n<=s.top+s.height?this.handleMouseMove():a&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,n=e;(R.shownTooltipCount>0||Date.now()-R.lastHiddenTime<R.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:n,popperClassName:a,"data-testid":i,onEntered:s}=this.props,{isShown:o}=this.state,{options:l}=this.props;return l=hr({placement:"bottom"},l),c.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":i,children:c.jsx(ot,{className:P(a),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:n,children:c.jsxs("div",{className:"tooltip-content",children:[" ",o&&t]})})})}}Y(R,"defaultTimeout",500);Y(R,"defaultReshowTimeout",100);Y(R,"triggerReshowThreshold",300);Y(R,"shownTooltipCount",0);Y(R,"lastHiddenTime",Date.now());Y(R,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:R.defaultReshowTimeout,timeout:R.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const nn=R;var vr=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Tt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Et(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(t),!0).forEach(function(n){gr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Tt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function gr(r,e,t){return e=yr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yr(r){var e=br(r,"string");return typeof e=="symbol"?e:String(e)}function br(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Sr(r,e){if(r==null)return{};var t=Cr(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Cr(r,e){if(r==null)return{};var t={},n=Object.keys(r),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}var Mr=["primary","secondary","tertiary","success","danger","inline","ghost"],wr=["group-end"];function Tr(r,e){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 P("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Er(r){switch(r){case"group-end":return P("pl-2","pr-3")}}var Ve=E.forwardRef((r,e)=>{var{kind:t,variant:n,type:a,tooltip:i,icon:s,disabled:o=!1,active:l,onClick:u,onContextMenu:d,onMouseDown:h,onMouseUp:m,onMouseEnter:y,onMouseLeave:b,onKeyDown:w,className:T,style:N,children:H,tabIndex:k,"data-testid":_,"aria-label":W}=r,A=Sr(r,vr),U=!!(s&&H==null),q=Tr(t,U),ye;n&&(ye=Er(n));var be;s&&(be=E.isValidElement(s)?s:c.jsx(me,{icon:s}));var pe;i!==void 0&&(pe=typeof i=="string"?c.jsx(nn,{children:i}):i);var Se=W;W===void 0&&U&&i!=null&&typeof i=="string"&&(Se=i);var M=c.jsxs("button",Et(Et({"data-testid":_,ref:e,type:a,className:P("btn",q,ye,{active:l},T),onClick:u,onContextMenu:d,onMouseUp:m,onMouseDown:h,onMouseEnter:y,onMouseLeave:b,onKeyDown:w,style:N,disabled:o,tabIndex:k,"aria-label":Se},A),{},{children:[s&&be,H,i!=null&&!o&&pe]}));return o?c.jsxs("span",{className:"btn-disabled-wrapper",children:[M,i!==void 0&&pe]}):M});Ve.displayName="Button";Ve.propTypes={kind:C.oneOf(Mr).isRequired,variant:C.oneOf(wr),type:C.oneOf(["submit","reset","button"]),tooltip(r){var{tooltip:e,icon:t,children:n}=r;return e===void 0&&t!=null&&n==null?new Error("Tooltip is required for icon only buttons"):null},icon(r){var{children:e,icon:t}=r;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!E.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:C.bool,active:C.bool,onClick(r){var{onClick:e,type:t}=r;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:C.func,onMouseUp:C.func,onMouseDown:C.func,onMouseEnter:C.func,onMouseLeave:C.func,onKeyDown:C.func,tabIndex:C.number,children:C.node,className:C.string,style:C.object,"data-testid":C.string};Ve.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 et=Ve;function Ir(r,e,t){return e=Or(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Or(r){var e=Pr(r,"string");return typeof e=="symbol"?e:String(e)}function Pr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Qe(r){return r.then!==void 0}class fe{static disableAllActions(){fe.actionsDisabled=!0}static enableAllActions(){fe.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var n,a;return((n=e.group)!==null&&n!==void 0?n:0)>((a=t.group)!==null&&a!==void 0?a:0)?1:-1}if(e.order!==t.order){var i,s;return((i=e.order)!==null&&i!==void 0?i:0)>((s=t.order)!==null&&s!==void 0?s:0)?1:-1}if(e.title!==t.title){var o,l;return((o=e.title)!==null&&o!==void 0?o:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort(fe.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return fe.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=fe.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=[],a=e;Array.isArray(a)||(a=[a]);for(var i=0;i<a.length;i+=1){var s=a[i],o=void 0;typeof s=="function"?o=s():o=s,o!=null&&(o instanceof Promise?t&&n.push(o):Array.isArray(o)?n=n.concat(o):n.push(o))}return n=n.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),n}static getNextMenuItem(e,t,n){var a=e;a<0&&t<0&&(a=n.length);for(var i=1;i<n.length+1;i+=1){var s=(a+t*i+n.length)%n.length,o=n[s];if(!(o instanceof Promise)&&o.disabled!==!0)return s}return e}}Ir(fe,"actionsDisabled",!1);const j=fe;var It=V.module("GlobalContextAction");class Nr extends g.Component{constructor(e){super(e),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(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:n}=this.props;n.title==null&&!n.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(n),It.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!j.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var n;It.debug("Global hotkey matched!",e),(n=t.action)===null||n===void 0||n.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const xr=Nr;class Dr extends g.Component{render(){for(var{actions:e,"data-testid":t}=this.props,n=[],a=0;a<e.length;a+=1){var i=e[a],{shortcut:s}=i;if(i.title!=null||i.menuElement||s){var o=c.jsx(xr,{action:i,"data-testid":t},"".concat(i.title,".").concat(s==null?void 0:s.id));n.push(o)}}return n}}const Fr=Dr;function rn(r,e,t){return e=Ar(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ar(r){var e=Rr(r,"string");return typeof e=="symbol"?e:String(e)}function Rr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Re=V.module("ContextActions");class an extends g.Component{static triggerMenu(e,t,n,a){if(a.length!==0){var i=new MouseEvent("contextmenu",{clientX:t,clientY:n,bubbles:!0,cancelable:!0});i.contextActions=a,e.dispatchEvent(i)}}constructor(e){super(e),rn(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=E.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(a=>!Qe(a)&&typeof a!="function"&&a.isGlobal),n=e.actions.filter(a=>!Qe(a)&&typeof a!="function"&&(a.isGlobal===void 0||!a.isGlobal)&&a.shortcut!=null);return{globalActions:t,keyboardActions:n}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&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!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var n=e.target,a=function(){var{classList:u}=n,d=t.find(h=>u.contains(h));if(d!==void 0)return Re.debug2('Contextmenu event ignored based on the target className "'.concat(d,'"')),{v:void 0};n=n.parentElement};n!=null;){var i=a();if(typeof i=="object")return i.v}if(j.isContextActionEvent(e)||(e.contextActions=[]),!!j.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var o=s;Array.isArray(o)&&(o=o.filter(l=>Qe(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(o)}Re.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,n=0;n<t.length;n+=1){var a=t[n];if(!j.actionsDisabled&&a.shortcut!=null&&a.shortcut.matchesEvent(e)){var i;Re.debug("Context hotkey matched!",e),(i=a.action)===null||i===void 0||i.call(a,e),e.stopPropagation(),e.preventDefault(),Re.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return c.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:c.jsx(Fr,{actions:t})})}}rn(an,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const xi=an;var lt=E.forwardRef((r,e)=>{var t;function n(A){var{menuItem:U,onMenuItemClick:q}=r;q(U,A)}function a(A){var{menuItem:U,onMenuItemMouseMove:q}=r;q(U,A)}function i(A){var{menuItem:U,onMenuItemContextMenu:q}=r;q(U,A)}function s(A,U,q){if(typeof A.type=="string")return A;var{closeMenu:ye,menuItem:be,isKeyboardSelected:pe,isMouseSelected:Se,"data-testid":M}=r,S={menuItem:be,closeMenu:ye,isKeyboardSelected:pe,isMouseSelected:Se,iconElement:U,displayShortcut:q,"data-testid":M};return E.cloneElement(A,{forwardedProps:S})}var{children:o,menuItem:l,isKeyboardSelected:u=!1,isMouseSelected:d=!1,"data-testid":h}=r,m=(t=l.shortcut)===null||t===void 0?void 0:t.getDisplayText(),y=null;if(l.icon){var b=l.icon;if(E.isValidElement(b))y=b;else{var w;l.iconColor!=null&&(l.disabled===void 0||!l.disabled)&&(w={color:l.iconColor}),y=c.jsx(me,{icon:b,style:w})}}var T=null,N=!!o;l.actions&&(T=c.jsx(me,{icon:Jt}));var H=null;if(l.menuElement)H=c.jsx("div",{className:"custom-menu-item",onMouseMove:a,children:s(l.menuElement,y,m)});else{var k,_=l.disabled,W=l.iconOutline;H=c.jsx("button",{type:"button",className:P("btn-context-menu",{disabled:_},{active:(N||d)&&(_===void 0||!_)},{"keyboard-active":u&&(_===void 0||!_)}),onClick:n,onMouseMove:a,onContextMenu:i,title:(k=l.description)!==null&&k!==void 0?k:"",children:c.jsxs("div",{className:"btn-context-menu-wrapper",children:[c.jsx("span",{className:P("icon",{outline:W}),children:y}),c.jsx("span",{className:"title",children:l.title}),m!==void 0&&c.jsx("span",{className:"shortcut",children:m}),T&&c.jsx("span",{className:P("submenu-indicator",{disabled:_}),children:T})]})})}return c.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":h,children:[o,H]})});lt.displayName="ContextMenuItem";lt.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const sn=lt;function Ot(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function jr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ot(Object(t),!0).forEach(function(n){de(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ot(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function de(r,e,t){return e=Lr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lr(r){var e=kr(r,"string");return typeof e=="symbol"?e:String(e)}function kr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Pt=V.module("ContextMenu");class Ne extends g.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),de(this,"container",void 0),de(this,"oldFocus",void 0),de(this,"activeSubMenuRef",void 0),de(this,"subMenuTimer",void 0),de(this,"rAF",void 0),de(this,"initialPosition",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=E.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=E.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:n}=this.props,{activeSubMenu:a}=this.state;if(a!==t.activeSubMenu)if(a==null){var i;(i=this.container.current)===null||i===void 0||i.focus()}else this.setActiveSubMenuPosition();if(e.actions!==n&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var s;(s=this.container.current)===null||s===void 0||s.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:n}=this.props,a=j.getMenuItems(n),i=[],s=a.length-1;s>=0;s-=1){var o=a[s];o instanceof Promise?this.initMenuPromise(o):i.push(o)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:j.sortActions(i)})}initMenuPromise(e){var t=Ye.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(a=>{var i=a.pendingItems.indexOf(t);if(i>=0){var s=a.pendingItems.slice();return s.splice(i,1),{menuItems:j.sortActions(a.menuItems.concat(n)),pendingItems:s}}return null})},n=>{Ye.isCanceled(n)||(this.setState(a=>{var i=a.pendingItems.indexOf(t);if(i>=0){var s=a.pendingItems.slice();return s.splice(i,1),{pendingItems:s}}return null}),Pt.error(n))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,n,a,{options:i,updatePosition:s,subMenuParentWidth:o,subMenuParentHeight:l,top:u,left:d}=this.props;if(!(!this.container.current||i.doNotVerifyPosition!=null&&i.doNotVerifyPosition)){var{top:h,left:m}=this.initialPosition,{width:y,height:b}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},w=((n=(a=this.container.current)===null||a===void 0?void 0:a.scrollHeight)!==null&&n!==void 0?n:0)>window.innerHeight;b===0||y===0||(h+b>window.innerHeight&&(h-b-l>0?h-=b-l:h=window.innerHeight-b),m+y>window.innerWidth&&(m=m-y-o),(d!==m||u!==h)&&(this.setState({hasOverflow:w}),s(h,m)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Pt.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,n=!1;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),a=n,i=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?i=!0:a=0:this.isEscapeKey(e.key)?a=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?a=j.getNextMenuItem(a,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(a=j.getNextMenuItem(a,1,t)),i){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==a&&(a!==null?this.setKeyboardIndex(a):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:n}=this.state,a=t[e].actions?e:null;n!==a&&this.setState({activeSubMenu:a,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();var{menuItems:n}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:n}=this.props,{activeSubMenu:a,hasOverflow:i,keyboardIndex:s,menuItems:o,mouseIndex:l,pendingItems:u,subMenuTop:d,subMenuLeft:h,subMenuParentWidth:m,subMenuParentHeight:y}=this.state,b=0;b<o.length;b+=1){var w=o[b];b>0&&w.group!==o[b-1].group&&e.push(c.jsx("hr",{},"".concat(b,".separator")));var T=c.jsx(sn,{ref:a===b?this.activeSubMenuRef:null,isKeyboardSelected:s===b,isMouseSelected:l===b,menuItem:w,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},b);e.push(T)}var N=null;u.length>0&&(N=c.jsx("div",{className:"loading",children:c.jsx(Dn,{})}));var{menuStyle:H,"data-testid":k}=this.props,_=a!==null&&d!==null&&h!==null;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:P({"has-overflow":i},"context-menu-container"),style:jr({top:t,left:n},H),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Ne.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":k,children:[e,N]}),_&&a!==null&&d!==null&&h!==null&&c.jsx(Ne,{actions:o[a].actions||[],closeMenu:this.handleCloseSubMenu,top:d,left:h,updatePosition:(W,A)=>{this.setState({subMenuTop:W,subMenuLeft:A})},subMenuParentWidth:m,subMenuParentHeight:y},"sub-".concat(a))]})}}de(Ne,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const $r=Ne;function Nt(r,e,t){return e=Kr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Kr(r){var e=Vr(r,"string");return typeof e=="symbol"?e:String(e)}function Vr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Br extends g.Component{constructor(e){super(e),Nt(this,"container",void 0),Nt(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=E.createRef(),this.openMenu=E.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),n=e.clientY-t.top,a=e.clientX-t.left,{actions:i}=this.state;if(i!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var o=document.elementFromPoint(a,n),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});o==null||o.dispatchEvent(l)});return}if(j.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var s=j.getMenuItems(e.contextActions);s.length!==0&&(e.preventDefault(),this.setState({actions:s,top:n,left:a}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:n,top:a,left:i}=this.state;return n&&(e=c.jsx($r,{ref:this.openMenu,actions:n,onMenuClosed:this.handleMenuClose,top:a,left:i,updatePosition:(s,o)=>{this.setState({top:s,left:o})},"data-testid":t})),c.jsx("div",{className:P("context-menu-root",{active:n}),ref:this.container,children:e})}}const Di=Br;var Be=E.forwardRef((r,e)=>{var{checked:t=!1,children:n,className:a,disabled:i,inputClassName:s,isInvalid:o,labelClassName:l,name:u,onChange:d,"data-testid":h}=r,[m]=g.useState(rt()),y=tn(e);g.useEffect(function(){y.current&&(y.current.indeterminate=t===null)},[y,t]);var b=g.useCallback(w=>{y.current&&(y.current.indeterminate=t===null),d&&d(w)},[y,t,d]);return c.jsxs("div",{className:P("custom-control custom-checkbox",a),children:[c.jsx("input",{type:"checkbox",ref:y,checked:t??!1,className:P("custom-control-input",s,{"is-invalid":o}),disabled:i,id:m,name:u,onChange:b,"data-testid":h}),c.jsx("label",{className:P("custom-control-label",l),htmlFor:m,children:n})]})});Be.displayName="Checkbox";Be.propTypes={checked:(r,e)=>{var{[e]:t}=r;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:C.node.isRequired,className:C.string,disabled:C.bool,inputClassName:C.string,isInvalid:C.bool,labelClassName:C.string,name:C.string,onChange:C.func,"data-testid":C.string};Be.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Hr=Be;function on(r,e,t){return e=_r(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _r(r){var e=Wr(r,"string");return typeof e=="symbol"?e:String(e)}function Wr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ln extends g.PureComponent{constructor(e){super(e),on(this,"inputField",void 0),this.inputField=E.createRef()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}render(){var{value:e,placeholder:t,onBlur:n,onChange:a,className:i,disabled:s,matchCount:o,id:l,onKeyDown:u,"data-testid":d}=this.props;return c.jsxs("div",{className:P("search-group",i),children:[c.jsx("input",{type:"search",value:e,onBlur:n,onChange:a,onKeyDown:u,className:"form-control",disabled:s,placeholder:t,ref:this.inputField,id:l,"data-testid":d}),o!=null&&c.jsx("span",{className:"search-match",children:o}),c.jsx("span",{className:"search-icon",children:c.jsx(me,{icon:Fn})})]})}}on(ln,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0});const Ur=ln;function xt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function qr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xt(Object(t),!0).forEach(function(n){z(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):xt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function z(r,e,t){return e=Gr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gr(r){var e=zr(r,"string");return typeof e=="symbol"?e:String(e)}function zr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var tt;(function(r){r.UP="UP",r.DOWN="DOWN"})(tt||(tt={}));class te extends g.Component{constructor(e){super(e),z(this,"popper",void 0),z(this,"cbContainer",void 0),z(this,"toggleButton",void 0),z(this,"menuContainer",void 0),z(this,"input",void 0),z(this,"searchInput",void 0),z(this,"getCachedFilteredOptions",J((t,n)=>t.filter(a=>a.title.toLowerCase().indexOf(n.toLowerCase())>=0||a.value.toLowerCase().indexOf(n.toLowerCase())>=0))),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=E.createRef(),this.cbContainer=E.createRef(),this.toggleButton=E.createRef(),this.menuContainer=E.createRef(),this.input=E.createRef(),this.searchInput=E.createRef()}componentDidUpdate(){var{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===void 0||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){var{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,n,{filter:a,filteredOptions:i,keyboardOptionIndex:s}=this.state,{options:o}=this.props,l=a?i:o;switch(e.key){case"Enter":((t=l[s])===null||t===void 0?void 0:t.value)!=null&&this.updateInputValue(l[s].value),this.closeMenu(),(n=this.input.current)===null||n===void 0||n.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":a!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===l.length-1&&this.closeMenu();break}}handleMenuNavigation(e){var{filter:t,filteredOptions:n,keyboardOptionIndex:a}=this.state,{options:i}=this.props,s=t?n:i,o=s.length,l=0;switch(e){case te.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case te.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(a+l+o)%o})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,n=Number(e.currentTarget.value),{filter:a,filteredOptions:i}=this.state,{options:s}=this.props,o=a?i:s;this.updateInputValue(o[n].value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var t,{options:n}=this.props,a=e.target.value,i=this.getCachedFilteredOptions(n,a);this.setState({filter:a,filteredOptions:i,keyboardOptionIndex:0}),(t=this.popper.current)===null||t===void 0||t.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){var{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===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;if(e){var t;this.setState({menuIsOpen:!1}),(t=this.popper.current)===null||t===void 0||t.hide()}this.setState({filter:""})}toggleMenu(e){var{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===void 0||e.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),t){var n;(n=this.input.current)===null||n===void 0||n.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:n}=this.state,{options:a}=this.props,i=t?n:a,s=i.findIndex(o=>o.value===e);this.setState({keyboardOptionIndex:s})}scrollOptionIntoView(){var e,t=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cb-option-btn.keyboard-active");t instanceof HTMLElement&&t.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){var{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return c.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:a=>{a.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[c.jsx("div",{className:"cb-search-input-container",children:c.jsx(Ur,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),c.jsx("div",{className:"cb-options-container",children:c.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:a}=this.state,i=n?a:e;return i.map((s,o)=>{var l="option-".concat(o,"-").concat(s.value);return c.jsx("button",{type:"button",value:o,className:P("cb-option-btn",{"keyboard-active":t===o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:s.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:n,className:a,defaultValue:i,spellCheck:s,"data-testid":o}=this.props,{value:l}=this.state,{popperOptions:u}=this.props;return u=qr({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},u),c.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[c.jsx("input",{value:l||i,className:P("form-control",a,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o!==void 0?"".concat(o,"-input"):void 0}),c.jsx("div",{className:"input-group-append cb-dropdown",children:c.jsxs("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":o!==void 0?"".concat(o,"-btn"):void 0,children:[c.jsx(me,{icon:An}),c.jsx(ot,{ref:this.popper,options:u,className:P("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}z(te,"MENU_NAVIGATION_DIRECTION",tt);z(te,"DROP_DOWN_MENU_HEIGHT",200);z(te,"propTypes",{options:C.arrayOf(C.shape({title:C.string.isRequired,value:C.string.isRequired})).isRequired,popperOptions:C.shape({title:C.string.isRequired,value:C.string.isRequired}),onChange:C.func,inputPlaceholder:C.string,searchPlaceholder:C.string,disabled:C.bool,className:C.string,defaultValue:C.string,spellCheck:C.bool,onEnter:C.func,"data-testid":C.string});z(te,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const Fi=te;function Ai(r){var{copy:e,kind:t="ghost",tooltip:n="Copy",className:a,"data-testid":i,children:s}=r,[o,l]=lr();return c.jsx(et,{kind:t,className:a,"data-testid":i,icon:o?Rn:jn,tooltip:o?"Copied":n,onClick:()=>{l(typeof e=="function"?e():e)},children:s})}function un(r,e,t){return r.substring(0,e)+t+r.substring(e+1)}function Qr(r,e,t){return r.length<t?"".concat(r).concat(e.substring(r.length,t)):r}function Dt(r,e){for(var{length:t}=r,n=r.length-1;n>=0&&e[n]===r[n];n-=1)t=n;return r.substring(0,t)}function Ft(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Zr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ft(Object(t),!0).forEach(function(n){Xr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ft(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Xr(r,e,t){return e=Jr(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jr(r){var e=Yr(r,"string");return typeof e=="symbol"?e:String(e)}function Yr(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var X=V.module("MaskedInput"),Me={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},je=" ",dn=E.forwardRef((r,e)=>{var{className:t,example:n,getNextSegmentValue:a=(M,S,v)=>v,getPreferredReplacementString:i=un,onChange:s=()=>!1,onSelect:o=()=>!1,onSubmit:l,pattern:u,placeholder:d,selection:h,value:m,onFocus:y=()=>!1,onBlur:b=()=>!1,"data-testid":w}=r,T=tn(e),N=g.useMemo(()=>Array.isArray(n)?n:[n],[n]),H=g.useMemo(()=>N[0].replace(/[a-zA-Z0-9]/g,je),[N]);g.useEffect(function(){if(h!=null){var S;X.debug("setting selection...",h);var{selectionStart:v,selectionEnd:I,selectionDirection:D}=h;(S=T.current)===null||S===void 0||S.setSelectionRange(v,I,D),X.debug("selection set!")}},[h,T]);var k=g.useCallback(M=>{for(var S=M,v=M,I=N.length>0?N[0]:m,D=S-1;D>=0&&/[a-zA-Z0-9]/g.test(I.charAt(D));D-=1)S=D;for(var G=v;G<I.length&&/[a-zA-Z0-9]/g.test(I.charAt(G));G+=1)v=G+1;var Ae=S===v?Me.NONE:Me.BACKWARD;return{selectionStart:S,selectionEnd:v,selectionDirection:Ae}},[N,m]);function _(M,S){for(var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.length,I="",D=0;D<v;D+=1)M.charAt(D)!==je?I=I.concat(M[D]):I=I.concat(S[D]);return I=I.concat(S.substring(v)),I}function W(M){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.length,v=new RegExp("^".concat(u,"$"));if(v.test(M))return!0;for(var I=0;I<N.length;I+=1){var D=_(M,N[I],S);if(v.test(D))return!0}return!1}function A(M){var S=k(M),v=S.selectionEnd+1;return v>=m.length?S:k(v)}function U(M){var S=k(M),v=S.selectionStart-1;return v<=0?S:k(v)}function q(M,S){var v=k(M),I=m.substring(v.selectionStart,v.selectionEnd),D=a(v,S,I,m),G=m.substring(0,v.selectionStart)+D+m.substring(v.selectionEnd);W(G,v.selectionEnd)&&(s(G),o(v))}var ye=g.useCallback(M=>{var{selectionStart:S=0,selectionEnd:v=0,selectionDirection:I="none"}=M.target;if(S===null||v===null||I===null){X.error("Selection attempted on non-text input element",M.target);return}if(X.debug2("handleSelect",S,v,I),!(h!=null&&S===h.selectionStart&&v===h.selectionEnd)){if(h!=null&&S===m.length&&v===m.length&&M.nativeEvent.type!=="mouseup"){o(Zr({},h));return}if(S===v){var D=k(S);X.debug("Selection segment from ",S,v,"=>",D),o(D)}else o({selectionStart:S,selectionEnd:v,selectionDirection:I})}},[k,o,h,m]),be=g.useCallback(M=>{var S;if(T.current){X.debug("handleSelectCapture",M);var v=(S=T.current.selectionStart)!==null&&S!==void 0?S:0;v===m.length&&h!=null&&v!==h.selectionStart&&(M.preventDefault(),M.stopPropagation())}},[T,h,m]);function pe(M){if(M.preventDefault(),M.stopPropagation(),!!T.current){var{key:S}=M,{selectionStart:v=0,selectionEnd:I=0}=T.current;if(v===null||I===null){X.error("Selection arrow nvaigation attempted on non-text input element",M.target);return}S==="ArrowLeft"?o(U(v)):S==="ArrowRight"?o(A(I)):S==="ArrowUp"?q(v,-1):S==="ArrowDown"&&q(v,1)}}function Se(M){if(T.current){X.debug("handleKeyDown",M);var{key:S}=M,{selectionStart:v=0,selectionEnd:I=0}=T.current;if(v===null||I===null){X.error("Selection key event on non-text input element",M.target);return}if(S==="Enter"){l==null||l(M);return}if(S.startsWith("Arrow")){pe(M);return}if(S==="Delete"||S==="Backspace"){if(M.preventDefault(),M.stopPropagation(),I>=Dt(m,H).length){var D=m.substring(0,v===I?v-1:v),G=Dt(D,H);G!==m&&(s(G),o({selectionStart:G.length,selectionEnd:G.length,selectionDirection:Me.NONE}));return}if(v!==I){var Ae=m.substring(0,v)+m.substring(v,I).replace(/[a-zA-Z0-9]/g,je)+m.substring(I);X.debug("Range ",v,I,"deleted, setting value",Ae),s(Ae),o({selectionStart:v,selectionEnd:v,selectionDirection:Me.NONE})}else if(v>0)for(var Ce=v-1;Ce>=0;Ce-=1){var ft=m.substring(0,Ce)+m.substring(Ce,v).replace(/[a-zA-Z0-9]/g,je)+m.substring(v);if(ft!==m){s(ft),o({selectionStart:Ce,selectionEnd:Ce,selectionDirection:Me.NONE});return}}return}if(!(M.altKey||M.metaKey||M.ctrlKey||S.length>1)){M.preventDefault(),M.stopPropagation();for(var mt=Array.from(new Set([S,S.toUpperCase(),S.toLowerCase()])),We=0;We<mt.length;We+=1)for(var pt=mt[We],Mn=/[a-zA-Z0-9]/g.test(pt)?N[0].length-1:v,se=v;se<=Mn;se+=1){var wn=Qr(m,N[0],se+1),Ue=i(wn,se,pt,v,I);if(W(Ue,se+1)){var vt=k(se),qe=se+1,Ge={selectionStart:qe,selectionEnd:qe,selectionDirection:Me.NONE};if(qe>=vt.selectionEnd){var gt=A(se);gt.selectionStart!==vt.selectionStart&&(Ge=gt)}X.debug("handleKeyDown",S,"=>",Ue,Ge),s(Ue),o(Ge);return}}}}}return c.jsx("input",{ref:T,className:P("form-control masked-input",t),type:"text",pattern:u,placeholder:d,value:m,onChange:()=>{},onKeyDown:Se,onSelect:ye,onSelectCapture:be,onFocus:y,onBlur:b,"data-testid":w})});dn.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(r,e,t)=>t,getPreferredReplacementString:un,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const ea=dn;function At(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function ta(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?At(Object(t),!0).forEach(function(n){Pe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):At(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Pe(r,e,t){return e=na(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function na(r){var e=ra(r,"string");return typeof e=="symbol"?e:String(e)}function ra(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}let cn=class extends g.PureComponent{constructor(e){var t;super(e),Pe(this,"container",void 0),Pe(this,"oldFocus",void 0),Pe(this,"rAF",void 0),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=E.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:n}=e,a=(t=n.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:a,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=j.getMenuItems(e,!1);t.length>0&&this.setState(n=>({menuItems:j.sortActions(n.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),a=n;if(e.key==="Enter"||e.key===" "){n!=null&&n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="Escape")a=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var i;a=j.getNextMenuItem((i=a)!==null&&i!==void 0?i:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;a=j.getNextMenuItem((s=a)!==null&&s!==void 0?s:0,1,t)}n!==a&&(a!==null?this.setKeyboardIndex(a):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}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){var{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:n,menuItems:a,mouseIndex:i}=this.state,s=0;s<a.length;s+=1){var o=a[s];s>0&&o.group!==a[s-1].group&&e.push(c.jsx("hr",{},"".concat(s,".separator")));var l=c.jsx(sn,{isKeyboardSelected:n===s,isMouseSelected:i===s,menuItem:o,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:u}=this.props;return c.jsx("div",{className:"context-menu-container",style:ta({},u),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};Pe(cn,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const aa=cn;function Rt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function jt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rt(Object(t),!0).forEach(function(n){Ie(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Rt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ie(r,e,t){return e=ia(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ia(r){var e=sa(r,"string");return typeof e=="symbol"?e:String(e)}function sa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class hn extends g.PureComponent{constructor(e){super(e),Ie(this,"container",void 0),Ie(this,"parent",void 0),Ie(this,"popper",void 0),Ie(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=E.createRef(),this.parent=null,this.popper=E.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{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===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:n,"data-testid":a}=this.props,{menuStyle:i}=this.props,{options:s,popperOptions:o}=this.props;return o=jt({placement:"bottom"},o),s=jt({separateKeyboardMouse:!0},s),c.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":a,children:c.jsx(ot,{ref:this.popper,options:o,className:P("menu-popper",n),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:c.jsx(aa,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:i})})})}}Ie(hn,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const ji=hn;function we(r,e,t,n,a){var i=n-t+1,s=((parseInt(e,10)-r-t)%i+i)%i+t;return"".concat(s).padStart(a,"0")}function oa(r,e,t){var{selectionStart:n}=r;return n===0?we(e,t,1900,2099,4):n===5?we(e,t,1,12,2):n===8?we(e,t,1,31,2):n===11?we(e,t,0,23,2):n===17||n===14?we(e,t,0,59,2):n===20||n===24||n===28?we(e,t,0,999,3):t}function nt(r){var e=r.substring(0,23),t=r.substring(23,26),n=r.substring(26);return[e,t,n].filter(a=>a!=="").join("")}var la=V.module("DateTimeInput"),ua="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",da="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",ca="".concat(ua," ").concat(da),ke="2022-01-01",fn="".concat(ke," 00:00:00.000000000"),ha="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function Lt(r){return r!=null&&r.length>=ke.length?"".concat(r.substring(0,ke.length)).concat(r.substring(ke.length).replace(/\u2007/g,"0")).concat(fn.substring(r.length)):r}function kt(r){return r.replace(/\u200B/g,"")}var fa=[nt(fn)],ut=E.forwardRef((r,e)=>{var{className:t="",onChange:n=()=>{},defaultValue:a="",onFocus:i=()=>{},onBlur:s=()=>{},onSubmit:o,"data-testid":l}=r,[u,d]=g.useState(a.length>0?nt(a):""),[h,m]=g.useState(),y=g.useCallback(w=>{la.debug("handleChange",w),d(w),n(Lt(kt(w)))},[n]),b=g.useCallback(()=>{var w=kt(u),T=Lt(w);T!==w&&d(nt(T)),s()},[u,s]);return c.jsx("div",{className:"d-flex flex-row align-items-center",children:c.jsx(ea,{ref:e,className:P(t),example:fa,getNextSegmentValue:oa,onChange:y,onSelect:m,onSubmit:o,pattern:ca,placeholder:ha,selection:h,value:u,onFocus:i,onBlur:b,"data-testid":l})})});ut.displayName="DateTimeInput";ut.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const Li=ut;function mn(r,e,t){return e=ma(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ma(r){var e=pa(r,"string");return typeof e=="symbol"?e:String(e)}function pa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var va=V.module("ItemListItem");class He extends g.Component{static handleKeyDown(){return va.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),mn(this,"itemRef",void 0),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=E.createRef()}handleBlur(e){var{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){var{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){var{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){var{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){var{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:n,style:a,children:i,"data-testid":s}=this.props;return c.jsx("div",{className:P("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:He.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:a,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:i})}}mn(He,"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 ga=He;function $t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Kt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$t(Object(t),!0).forEach(function(n){Q(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$t(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Q(r,e,t){return e=ya(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ya(r){var e=ba(r,"string");return typeof e=="symbol"?e:String(e)}function ba(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Vt=V.module("ItemList"),Bt=5;class Z extends g.PureComponent{static renderItem(e){var t,n,{item:a}=e;return c.jsx("div",{className:"item-list-item-content",children:a!=null&&((t=(n=a.displayValue)!==null&&n!==void 0?n:a.value)!==null&&t!==void 0?t:"".concat(a))})}constructor(e){super(e),Q(this,"list",void 0),Q(this,"listContainer",void 0),Q(this,"getItemSelected",J((a,i)=>le.isSelected(i,a),{max:Z.CACHE_SIZE})),Q(this,"getCachedItem",J((a,i,s,o,l,u,d,h)=>{var m=u({item:s,itemIndex:a,isFocused:o,isSelected:l,style:d});return c.jsx(ga,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:h,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:o,isSelected:l,itemIndex:a,style:d,children:m},i)},{max:Z.CACHE_SIZE})),Q(this,"getOuterElement",J(a=>{var i=E.forwardRef((s,o)=>c.jsx("div",Kt({ref:o,tabIndex:-1,onKeyDown:a,role:"presentation"},s)));return i.displayName="ItemListOuterElement",i})),Q(this,"getInnerElement",J(()=>{var a=E.forwardRef((i,s)=>c.jsx("div",Kt({className:"item-list-inner-element",ref:s},i)));return a.displayName="ItemListInnerElement",a})),Q(this,"getItemData",J((a,i,s)=>({items:a,selectedRanges:i,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=E.createRef(),this.listContainer=E.createRef();var{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:n,itemCount:a}=this.props,{focusIndex:i,isStuckToBottom:s,scrollOffset:o,height:l,selectedRanges:u}=this.state;if(s&&!this.isListAtBottom()&&a>0&&this.scrollToBottom(),(o!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==u)this.setSelectedRanges(n);else if(u!==t.selectedRanges){var{onSelectionChange:d}=this.props;d(u)}if(i!==t.focusIndex){var{onFocusChange:h}=this.props;h(i)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,a=this.listContainer.current.querySelectorAll(t),i=e-n;return a[i]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var n=this.getElement(e);n instanceof HTMLElement&&n.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:n}=this.state,a=le.isSelected(n,e),i=a||j.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:n,onSelect:a}=this.props;n&&this.setState(i=>{var{selectedRanges:s}=i;return{selectedRanges:le.selectRange(s,[e,e])}},()=>{a(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Vt.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){Vt.debug2("item focus",e,t.target),this.setState(n=>{var{focusIndex:a}=n;return a!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:n,isMultiSelect:a,disableSelect:i}=this.props,{mouseDownIndex:s,selectedRanges:o,mouseX:l,mouseY:u}=this.state;if(!(s==null||i)){var d=Math.abs(t.clientX-(l??0)),h=Math.abs(t.clientY-(u??0));d>Bt&&h>Bt&&this.setState({isDragging:!0}),(n||s===e)&&(this.focusItem(e),a?(!n&&!this.getItemSelected(e,o)&&!j.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,j.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:n,isDoubleClickSelect:a,onSelect:i}=this.props,{mouseDownIndex:s,isDragging:o}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(s===e&&!o){var l=t.shiftKey,u=j.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,u,n),!a&&!l&&!u&&i(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:n,onSelect:a}=this.props,{focusIndex:i}=this.state,s=i;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&a(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=n-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,n-1):s=0;else return;if(i!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var{selectedRanges:o}=this.state;if(e.shiftKey&&o.length>0){var l=o[o.length-1];this.selectRange([Math.min(s,l[0]),Math.max(s,l[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var u;(u=this.listContainer.current)===null||u===void 0||u.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:n}=e;this.setState(a=>{if(t)return{scrollOffset:n};var{isStickyBottom:i}=this.props,{height:s}=a,o=i&&this.isListAtBottom({scrollOffset:n,height:s});return{isStuckToBottom:o,scrollOffset:n}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:i}=this.props,{selectedRanges:s}=this.state;if(i&&t&&s.length>0){var o=s[s.length-1];this.selectRange([Math.min(o[0],e),Math.max(e,o[1])])}else i&&s.length===1&&s[0][0]===e&&s[0][1]===e?a&&this.deselectItem(e):i&&n?this.getItemSelected(e,s)?a&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){le.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:le.deselectRange(n,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){le.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:le.selectRange(n,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:n,rowHeight:a}=this.props,i=Math.floor(e/a),s=i+Math.ceil(t/a);n(i,s)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:n,rowHeight:a}=this.props;return e+t>=n*a}renderInnerElement(e){var{index:t,style:n}=e,{items:a,offset:i,renderItem:s,disableSelect:o}=this.props,{focusIndex:l,selectedRanges:u}=this.state;if(t<i||t>=i+a.length)return null;var d=a[t-i];return this.getCachedItem(t,t,d,t===l&&!o,this.getItemSelected(t,u),s,n,o)}render(){var{items:e,itemCount:t,overscanCount:n,renderItem:a,rowHeight:i,"data-testid":s}=this.props,{selectedRanges:o,isStuckToBottom:l}=this.state;return c.jsx(In,{className:"item-list-auto-sizer",onResize:this.handleResize,children:u=>{var{width:d,height:h}=u;return c.jsx(On,{className:"item-list-scroll-pane",height:h,width:d,initialScrollOffset:l?t*i:0,itemCount:t,itemSize:i,itemData:this.getItemData(e,o,a),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":s,children:this.renderInnerElement})}})}}Q(Z,"CACHE_SIZE",1e3);Q(Z,"DEFAULT_ROW_HEIGHT",20);Q(Z,"DEFAULT_OVERSCAN",10);Q(Z,"defaultProps",{offset:0,items:[],rowHeight:Z.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Z.DEFAULT_OVERSCAN,renderItem:Z.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function Ht(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function oe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ht(Object(t),!0).forEach(function(n){ve(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ht(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ve(r,e,t){return e=Sa(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Sa(r){var e=Ca(r,"string");return typeof e=="symbol"?e:String(e)}function Ca(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ne extends g.PureComponent{static renderHandle(){return c.jsxs("div",{children:[c.jsx(nn,{children:"Drag to re-order"}),c.jsx(me,{icon:Ln})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?c.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:n="",className:a=""}=e;return c.jsxs("div",{className:P("item-list-item-content","draggable-item-list-item-content",a),children:[c.jsx("span",{className:"title",children:t}),ne.renderBadge({text:n}),ne.renderHandle()]})}static renderItem(e){var t,n,{item:a,isClone:i,selectedCount:s}=e,o=a!=null?(t=(n=a.displayValue)!==null&&n!==void 0?n:a.value)!==null&&t!==void 0?t:"".concat(a):"",l=i!==void 0&&i?"".concat(s):"",u=i!==void 0&&i?"item-list-item-clone":"";return ne.renderTextItem({text:o,badgeText:l,className:u})}static getDraggableId(e,t){return"".concat(e,"/").concat(t)}static getDraggableIndex(e){var t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}constructor(e){super(e),ve(this,"itemList",void 0),ve(this,"getCachedDraggableItem",J((t,n,a,i,s,o,l,u)=>c.jsx(Pn,{draggableId:ne.getDraggableId(t,i),index:i,isDragDisabled:l,children:d=>c.jsx("div",oe(oe(oe({role:"menuitem",className:"draggable-item-list-item",ref:d.innerRef,tabIndex:-1},d.draggableProps),d.dragHandleProps),{},{children:n({item:a,itemIndex:i,isFocused:s,isSelected:o,style:u,isClone:!1})}))},i),{max:Z.CACHE_SIZE})),ve(this,"getCachedRenderDraggableItem",J((t,n,a)=>i=>{var{item:s,itemIndex:o,isFocused:l,isSelected:u,style:d}=i;return this.getCachedDraggableItem(t,a,s,o,l,u,n,d)},{max:1})),ve(this,"getCachedRenderClone",J((t,n,a,i)=>(s,o,l)=>{var{selectedCount:u}=this.state,{draggableProps:d,dragHandleProps:h,innerRef:m}=s,{index:y}=l.source,b=n[y-a];return c.jsx("div",oe(oe(oe({className:P("draggable-item-list-dragging-item-container",t)},d),h),{},{ref:m,children:c.jsx("div",{className:P("draggable-item-list-dragging-item",{"two-dragged":u===2},{"multiple-dragged":u>2}),children:i({item:b,itemIndex:y,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:u})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=E.createRef(),this.state={selectedCount:0}}selectItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:le.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:a,isDoubleClickSelect:i,isDragDisabled:s,isDropDisabled:o,isMultiSelect:l,isStickyBottom:u,itemCount:d,items:h,offset:m,onFocusChange:y,onSelect:b,onViewportChange:w,renderItem:T,rowHeight:N,selectedRanges:H,style:k,"data-testid":_}=this.props;return c.jsx(Nn,{isDropDisabled:o,droppableId:a,mode:"virtual",renderClone:this.getCachedRenderClone(n,h,m,T),"data-testid":_,children:(W,A)=>c.jsx("div",oe(oe({role:"menu",className:P("draggable-item-list",e,{"is-drop-disabled":o,"is-drag-disabled":s,"is-dragging-from-this":A.draggingFromThisWith,"is-dragging-over":A.isDraggingOver,"is-dropping":A.draggingOverWith}),style:k,ref:W.innerRef},W.droppableProps),{},{children:c.jsx(Z,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:l,isStickyBottom:u,itemCount:d,items:h,onFocusChange:y,onSelect:b,onSelectionChange:this.handleSelectionChange,onViewportChange:w,offset:m,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,s,T),rowHeight:N,selectedRanges:H})}))})}}ve(ne,"DEFAULT_ROW_HEIGHT",30);ve(ne,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:ne.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:ne.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const ki=ne;class $e{static reorder(e,t,n,a){var i=e===n?$e.adjustDestinationIndex(a,t):a,s=$e.removeItems(e,t);return n.splice(i,0,...s),s}static removeItems(e,t){for(var n=[],a=t.map((d,h)=>({range:d,index:h})).sort((d,h)=>h.range[0]-d.range[0]),i=0;i<a.length;i+=1){var{range:s,index:o}=a[i],[l,u]=s;n[o]=e.splice(l,u-l+1)}return xn(n)}static adjustDestinationIndex(e,t){for(var n=e,a=0;a<t.length;a+=1){var[i,s]=t[a];if(i>e)break;n-=Math.min(s,e-1)-i+1}return n}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const $i=$e;function Ma(r){var{on:e,id:t,className:n,isInvalid:a,disabled:i=!1,onClick:s,"data-testid":o}=r;return c.jsx("button",{type:"button",className:P("btn","btn-switch",n,{active:e},{"is-invalid":a}),id:t,onClick:s,disabled:i,"data-testid":o,children:c.jsx("div",{className:"handle"})})}function _t(r){return r.isOn!==void 0}function wa(r){var{item:e,onSelect:t=()=>{},"data-testid":n}=r,{icon:a,subtitle:i,title:s}=e,o=g.useMemo(()=>_t(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return c.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":"menu-item-".concat(s),onClick:o,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&o()},tabIndex:0,role:"menuitem",children:[a!==void 0&&c.jsx("div",{className:"icon",children:c.jsx(me,{icon:a})}),c.jsx("div",{className:"title",children:s}),i!==void 0&&c.jsx("div",{className:"shortcut",children:i}),c.jsx("div",{className:"accessory","data-testid":n,children:_t(e)?c.jsx(Ma,{on:e.isOn,onClick:l=>{l.stopPropagation(),o()}}):c.jsx(me,{icon:Jt})})]})}function Ki(r){var{items:e,onSelect:t=()=>{},"data-testid":n}=r;return c.jsx("div",{className:"navigation-menu-view","data-testid":n,children:c.jsx("ul",{className:"navigation-menu-list",children:e.map((a,i)=>c.jsx("li",{children:c.jsx(wa,{item:a,onSelect:()=>{t(i)}})},a.title))})})}function Vi(r){var{children:e,onBack:t,onClose:n,title:a,"data-testid":i}=r;return c.jsxs("div",{className:"navigation-page","data-testid":i,children:[c.jsxs("div",{className:"navigation-title-bar",children:[c.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&c.jsx(et,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:t,icon:kn,children:"Back"})}),c.jsx("div",{className:"navigation-title",children:a}),c.jsx("div",{className:"navigation-right-buttons",children:n!==void 0&&c.jsx(et,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:n,icon:$n,tooltip:"Close"})})]}),c.jsx("div",{className:"navigation-content",children:e})]})}function Bi(r){var{children:e,"data-testid":t}=r,n=g.useMemo(()=>E.Children.toArray(e),[e]),a=ir(n),[i,s]=g.useState(n[n.length-1]),[o,l]=g.useState(null),[u,d]=g.useState(null);g.useEffect(function(){if(!(a===void 0||n===a)){var b=n[n.length-1];n.length===a.length||a.length===0||o!==null||u!==null?o!==null&&b!==o?l(b):b!==u&&b!==i&&s(b):n.length>a.length?l(b):n.length<a.length&&(s(b),d(a[a.length-1]))}},[n,a,o,u,i]);var h=g.useCallback(()=>{s(o),l(null)},[o]),m=g.useCallback(()=>{d(null)},[]);return c.jsxs("div",{className:"navigation-stack",children:[c.jsx("div",{className:"main-view","data-testid":t,children:i}),c.jsx(Ze,{in:u!=null,timeout:Xe.transitionMidMs,classNames:"slide-right",onEntered:m,children:c.jsx(c.Fragment,{children:u!=null&&c.jsx("div",{className:"popping-view",children:u})})}),c.jsx(Ze,{in:o!=null,timeout:Xe.transitionMidMs,classNames:"slide-left",onEntered:h,children:c.jsx(c.Fragment,{children:o!=null&&c.jsx("div",{className:"pushing-view",children:o})})})]})}function Hi(r){var{children:e,disabled:t,value:n,"data-testid":a}=r;return c.jsx("option",{value:n,disabled:t,"data-testid":a,children:e})}function _i(r){var{children:e,disabled:t=!1,name:n,onChange:a,value:i="","data-testid":s}=r,[o]=g.useState(n??rt());return c.jsx(c.Fragment,{children:E.Children.map(e,l=>{var u,d;return l?E.cloneElement(l,{name:o,onChange:(u=l.props.onChange)!==null&&u!==void 0?u:a,checked:i===l.props.value,disabled:(d=l.props.disabled)!==null&&d!==void 0?d:t,"data-testid":s}):null})})}var dt=E.forwardRef((r,e)=>{var{checked:t,children:n,className:a="",disabled:i=!1,inputClassName:s="",isInvalid:o=!1,labelClassName:l="",name:u,onChange:d,value:h,"data-testid":m}=r,[y]=g.useState(rt());return c.jsxs("div",{className:P("custom-control custom-radio",a),children:[c.jsx("input",{type:"radio",id:y,"data-testid":m,name:u,ref:e,className:P("custom-control-input",s,{"is-invalid":o}),checked:t,disabled:i,value:h,onChange:d}),c.jsx("label",{className:P("custom-control-label",l),htmlFor:y,children:n})]})});dt.displayName="RadioItem";dt.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Wi=dt;function Ui(r){var{children:e,onBlur:t,onChange:n,className:a,defaultValue:i,name:s,value:o,disabled:l,"data-testid":u}=r,d=g.useCallback(h=>{n(h.target.value)},[n]);return c.jsx("select",{className:P("custom-select",a),onBlur:t,onChange:d,defaultValue:i,value:o,name:s,disabled:l,"data-testid":u,children:e})}function Ee(r,e,t){return e=Ta(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ta(r){var e=Ea(r,"string");return typeof e=="symbol"?e:String(e)}function Ea(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class pn extends g.PureComponent{constructor(e){super(e),Ee(this,"list",void 0),Ee(this,"topRow",void 0),Ee(this,"bottomRow",void 0),Ee(this,"getCachedItem",J((t,n,a,i,s,o,l)=>{var u={height:s},d=i??a;return c.jsx("li",{className:"value-list-item",style:u,tabIndex:-1,children:c.jsx(Hr,{checked:o,disabled:l,onChange:()=>this.handleSelect(t),children:d})},n)},{max:1e3})),Ee(this,"getCachedItems",J((t,n,a,i)=>{for(var s=[],o=0;o<t.length;o+=1){var l=t[o],{value:u,displayValue:d,isSelected:h}=l,m=a+o,y=m,b=this.getCachedItem(m,y,u,d,n,h,i);s.push(b)}return s},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=E.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)){var{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){var{items:t,offset:n,onSelect:a}=this.props,i=e-n;if(i>=0&&i<t.length){var s=t[i],{value:o}=s;a(e,o)}else a(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,n=this.list.current.scrollTop,a=n+this.list.current.clientHeight,i=Math.floor(n/t),s=Math.ceil(a/t);(this.topRow!==i||this.bottomRow!==s)&&(this.topRow=i,this.bottomRow=s,e(i,s))}}getElement(e){if(this.list.current==null)return null;var t=this.list.current.querySelectorAll(".value-list-item");return t[e]}scrollIntoView(e){var t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){var{className:e,disabled:t,isInvalid:n,items:a,itemCount:i,offset:s,rowHeight:o,"data-testid":l}=this.props,u=this.getCachedItems(a,o,s,t);return c.jsx("div",{className:P("select-value-list-scroll-pane h-100 w-100",{"is-invalid":n},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:c.jsx("div",{className:"select-value-list",style:{height:i*o},children:c.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:a.length*o,top:s*o,left:0},children:u})})})}}Ee(pn,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const qi=pn;function ce(r,e,t){return e=Ia(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ia(r){var e=Oa(r,"string");return typeof e=="symbol"?e:String(e)}function Oa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Wt=V.module("Shortcut"),K;(function(r){r.CTRL="MODIFIER_CTRL",r.CMD="MODIFIER_CMD",r.ALT="MODIFIER_ALT",r.OPTION="MODIFIER_OPTION",r.SHIFT="MODIFIER_SHIFT"})(K||(K={}));var O;(function(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"})(O||(O={}));var Pa=new Set([O.ENTER,O.DELETE,O.F1,O.F2,O.F3,O.F4,O.F5,O.F6,O.F7,O.F8,O.F9,O.F10,O.F11,O.F12]);class F extends Xt{static isAllowedKey(e){return Object.values(O).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!F.isMacPlatform&&e.metaKey||!F.isAllowedKey(t))return!1;var n=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!n||Pa.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case K.CTRL:t.ctrlKey=!0;break;case K.ALT:case K.OPTION:t.altKey=!0;break;case K.CMD:t.metaKey=!0;break;case K.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:n}=e,a="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?a="":!F.isAllowedKey(t)&&F.isAllowedKey(String.fromCharCode(n))?a=String.fromCharCode(n):a=t,{keyValue:a,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===O.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case O.ENTER:t+="⏎";break;case O.ESCAPE:t+="⎋";break;case O.BACKSPACE:t+="⌫";break;case O.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,a;return((n=e.keyValue)===null||n===void 0?void 0:n.toUpperCase())===((a=t.keyValue)===null||a===void 0?void 0:a.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":F.isMacPlatform?F.getMacDisplayText(e):F.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:n,macShortcut:a,isEditable:i=!0,name:s,tooltip:o}=e;super(),ce(this,"id",void 0),ce(this,"name",void 0),ce(this,"tooltip",void 0),ce(this,"isEditable",void 0),ce(this,"defaultKeyState",void 0),ce(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=o,this.isEditable=i;var l=F.isMacPlatform,u=l?a:n;this.defaultKeyState=F.createKeyState(u),this.keyState=this.defaultKeyState}getDisplayText(){return F.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){F.isValidKeyState(e)?(Wt.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Yt("onUpdate",{detail:this}))):Wt.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return F.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(F.NULL_KEY_STATE)}isNull(){return F.doKeyStatesMatch(this.keyState,F.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return F.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(F.getKeyStateFromEvent(e))}}ce(F,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});ce(F,"isMacPlatform",j.isMacPlatform());function Ut(r,e,t){return e=Na(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Na(r){var e=xa(r,"string");return typeof e=="symbol"?e:String(e)}function xa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var qt=V.module("ShortcutRegistry");class Da extends Xt{constructor(){super(...arguments),Ut(this,"shortcutMap",new Map),Ut(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new F(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return qt.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;qt.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",i=>{var{detail:s}=i;return this.dispatchEvent(new Yt("onUpdate",{detail:s}))});var n=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(n)){var a;(a=this.shortcutsByCategory.get(n))===null||a===void 0||a.push(e)}else this.shortcutsByCategory.set(n,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var Fa=Object.freeze(new Da);const Te=Fa;var Aa={COPY:Te.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[K.CTRL,O.C],macShortcut:[K.CMD,O.C],isEditable:!1}),PASTE:Te.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[K.CTRL,O.V],macShortcut:[K.CMD,O.V],isEditable:!1}),SAVE:Te.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[K.CTRL,O.S],macShortcut:[K.CMD,O.S],isEditable:!1}),SELECT_ALL:Te.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[K.CTRL,O.A],macShortcut:[K.CMD,O.A],isEditable:!1}),LINKER:Te.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[K.CTRL,O.L],macShortcut:[K.CMD,O.L]}),LINKER_CLOSE:Te.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[O.ESCAPE],macShortcut:[O.ESCAPE],isEditable:!1})};const Gi=Aa;function vn(){return Ke(Kn,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Ra(r,e){var t=vn(),n=g.useMemo(()=>new t.CoreClient(r,e),[t,r,e]);return g.useEffect(()=>()=>{n.disconnect()},[n]),n}var gn=g.createContext(null);function zi(r){var{serverUrl:e,options:t,children:n}=r,a=Ra(e,t);return c.jsx(gn.Provider,{value:a,children:n})}function ja(){return Ke(gn,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}var La=1e4;function Qi(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:La;return new Promise((n,a)=>{var i,s=setTimeout(()=>{var l;(l=i)===null||l===void 0||l(),a(new at("Variable ".concat(e," not found")))},t);function o(l){var u=l.created.find(h=>h.title===e);if(u!=null){var d;clearTimeout(s),(d=i)===null||d===void 0||d(),n(u)}}i=r.subscribeToFieldUpdates(o)})}function ct(r,e,t){return e=ka(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ka(r){var e=$a(r,"string");return typeof e=="symbol"?e:String(e)}function $a(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class _e{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,n){return{label:e,formatString:t,type:n}}format(e,t){return""}}ct(_e,"TYPE_GLOBAL","type-global");ct(_e,"TYPE_CONTEXT_PRESET","type-context-preset");ct(_e,"TYPE_CONTEXT_CUSTOM","type-context-custom");const B=_e;class Ka extends B{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const Va=Ka;class Ba extends B{format(e){return String.fromCharCode(e)}}const Ha=Ba;function he(r,e,t){return e=_a(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _a(r){var e=Wa(r,"string");return typeof e=="symbol"?e:String(e)}function Wa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Gt=V.module("DateTimeColumnFormatter");class ee extends B{static isValid(e,t){try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var n=t?"'T'":" ",a=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(a)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(a)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(a)]])}static getGlobalFormats(e,t){var n=ee.makeGlobalFormatStringMap(e,t);return[...n.keys()]}static makeFormatStringMap(e,t){var n=t!==void 0&&t?"'T'":" ",a=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(a)],["MM-dd-yyyy","MM-dd-yyyy".concat(a)],["HH:mm:ss","HH:mm:ss".concat(a)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(a)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(a)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(a)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(a)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(a)]])}static getFormats(e,t){var n=ee.makeFormatStringMap(e,t);return[...n.keys()]}constructor(e){var{timeZone:t="",showTimeZone:n=!0,showTSeparator:a=!1,defaultDateTimeFormatString:i=ee.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),he(this,"dh",void 0),he(this,"dhTimeZone",void 0),he(this,"defaultDateTimeFormatString",void 0),he(this,"showTimeZone",void 0),he(this,"showTSeparator",void 0),he(this,"formatStringMap",void 0);var s=t||ee.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(s)}catch{Gt.error("Unsupported time zone id",s),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ee.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=i,this.showTimeZone=n,this.showTSeparator=a,this.formatStringMap=ee.makeFormatStringMap(n,a)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,a=this.getEffectiveFormatString(n);try{return this.dh.i18n.DateTimeFormat.format(a,e,this.dhTimeZone)}catch{Gt.error("Invalid format arguments")}return""}}he(ee,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");he(ee,"DEFAULT_TIME_ZONE_ID","America/New_York");function ae(r,e,t){return e=Ua(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ua(r){var e=qa(r,"string");return typeof e=="symbol"?e:String(e)}function qa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ga=V.module("DecimalColumnFormatter");class L extends B{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.TYPE_CONTEXT_PRESET,a=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:a}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return L.makeFormat(e,t,B.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return L.makeFormat("Custom Format",e,B.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}constructor(e){var{defaultFormatString:t=L.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),ae(this,"defaultFormatString",void 0),ae(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,a=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(n,a)}catch{Ga.error("Invalid format arguments")}return""}}ae(L,"DEFAULT_FORMAT_STRING","###,##0.0000");ae(L,"FORMAT_PERCENT",L.makePresetFormat("Percent","##0.00%"));ae(L,"FORMAT_BASIS_POINTS",L.makePresetFormat("Basis Points","###,##0 bp",1e4));ae(L,"FORMAT_MILLIONS",L.makePresetFormat("Millions","###,##0.000 mm",1e-6));ae(L,"FORMAT_SCIENTIFIC_NOTATION",L.makePresetFormat("Scientific Notation","0.0000E0"));ae(L,"FORMAT_ROUND",L.makePresetFormat("Round","###,##0"));ae(L,"FORMAT_ROUND_TWO_DECIMALS",L.makePresetFormat("0.00","###,##0.00"));ae(L,"FORMAT_ROUND_FOUR_DECIMALS",L.makePresetFormat("0.0000","###,##0.0000"));class za extends B{format(e){return"".concat(e)}}const Qa=za;function xe(r,e,t){return e=Za(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Za(r){var e=Xa(r,"string");return typeof e=="symbol"?e:String(e)}function Xa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ja=V.module("IntegerColumnFormatter");class re extends B{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.TYPE_CONTEXT_PRESET,a=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:a}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return re.makeFormat(e,t,B.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return re.makeFormat("Custom Format",e,B.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}constructor(e){var{defaultFormatString:t=re.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),xe(this,"dh",void 0),xe(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,a=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(n,a)}catch{Ja.error("Invalid format arguments")}return""}}xe(re,"DEFAULT_FORMAT_STRING","###,##0");xe(re,"FORMAT_MILLIONS",re.makePresetFormat("Millions","###,##0.000 mm",1e-6));xe(re,"FORMAT_SCIENTIFIC_NOTATION",re.makePresetFormat("Scientific Notation","0.0000E0"));class Ya extends B{format(e){return e}}function yn(r,e,t){return e=ei(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ei(r){var e=ti(r,"string");return typeof e=="symbol"?e:String(e)}function ti(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ${static makeDateWrapper(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var d="".concat(n).padStart(4,"0"),h="".concat(a+1).padStart(2,"0"),m="".concat(i).padStart(2,"0"),y="".concat(s).padStart(2,"0"),b="".concat(o).padStart(2,"0"),w="".concat(l).padStart(2,"0"),T="".concat(u).padStart(9,"0"),N="".concat(d,"-").concat(h,"-").concat(m," ").concat(y,":").concat(b,":").concat(w,".").concat(T);return e.i18n.DateTimeFormat.parse($.FULL_DATE_FORMAT,N,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),n="0".repeat(9-e.length),a="".concat(t+1).concat(n);return parseInt(a,10)}static getNextDate(e,t,n,a){var{year:i,month:s,date:o,hours:l,minutes:u,seconds:d,nanos:h}=n;if(t.nanos!=null){if(t.nanos.length===9)return null;h=$.getNextNanos(t.nanos),h>999999999&&(d+=1,h=0)}else t.seconds!=null?d+=1:t.minutes!=null?u+=1:t.hours!=null?l+=1:t.date!=null?o+=1:t.month!=null?s+=1:i+=1;var m=new Date(i,s,o,l,u,d);return $.makeDateWrapper(e,a,m.getFullYear(),m.getMonth(),m.getDate(),m.getHours(),m.getMinutes(),m.getSeconds(),h)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var n=e.trim().toLowerCase();if(n.length>=3){for(var a=0;a<$.months.length;a+=1)if($.months[a].startsWith(n))return a}return NaN}static parseDateValues(e,t,n,a,i,s,o){var l=parseInt(e,10),u=t!=null?this.parseMonth(t):0,d=n!=null?parseInt(n,10):1,h=a!=null?parseInt(a,10):0,m=i!=null?parseInt(i,10):0,y=s!=null?parseInt(s,10):0,b=o!=null?parseInt(o.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(u)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(y)||Number.isNaN(b)?null:{year:l,month:u,date:d,hours:h,minutes:m,seconds:y,nanos:b}}static parseDateTimeString(e){var t=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/,n=t.exec(e);if(n==null)throw new Error("Unexpected date string: ".concat(e));var[,a,,i,,s,,o,,l,,u,,d,h]=n;if(h!=null&&h.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(h));return{year:a,month:i,date:s,hours:o,minutes:l,seconds:u,nanos:d}}static parseDateRange(e,t,n){var a=t.trim().toLowerCase();if(a.length===0)throw new Error("Cannot parse date range from empty string");if(a==="null")return[null,null];if(a==="today"){var i=new Date(Date.now()),s=$.makeDateWrapper(e,n,i.getFullYear(),i.getMonth(),i.getDate()),o=new Date(i.getFullYear(),i.getMonth(),i.getDate()+1),l=$.makeDateWrapper(e,n,o.getFullYear(),o.getMonth(),o.getDate());return[s,l]}if(a==="yesterday"){var u=new Date(Date.now()),d=new Date(u.getFullYear(),u.getMonth(),u.getDate()-1),h=$.makeDateWrapper(e,n,d.getFullYear(),d.getMonth(),d.getDate()),m=$.makeDateWrapper(e,n,u.getFullYear(),u.getMonth(),u.getDate());return[h,m]}if(a==="now"){var y=new Date(Date.now()),b=e.DateWrapper.ofJsDate(y);return[b,null]}var w=$.parseDateTimeString(a);if(w.year==null&&w.month==null&&w.date==null)throw new Error("Unable to extract year, month, or day ".concat(a));var T=$.parseDateValues(w.year,w.month,w.date,w.hours,w.minutes,w.seconds,w.nanos);if(T==null)throw new Error("Unable to extract date values from ".concat(w));var N=$.makeDateWrapper(e,n,T.year,T.month,T.date,T.hours,T.minutes,T.seconds,T.nanos),H=$.getNextDate(e,w,T,n);return[N,H]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}}yn($,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");yn($,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);function Zi(r,e){return r===e?{operator:"notEq",value:""}:{operator:"eq",value:r}}function Xi(r,e,t){return function(a){var i=t.trim();if(i==="")return null;var s=bn(e,o=>o.filter().containsIgnoreCase(r.makeFilterValue(o.type,i)),"or");return s(a)}}function bn(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(a){var i=a==null?void 0:a.findColumns(typeof r=="string"?[r]:r);if(i==null||i.length===0)return null;var s=i.map(e);return s.reduce((o,l)=>o[t](l))}}function ni(r,e,t,n){return bn(e,a=>a.filter()[n](r.makeFilterValue(a.type,t)),"or")}function Ji(r,e,t,n,a){return function(s){var o=s==null?void 0:s.findColumn(e),l=t==="all"||n&&t.size===0;return o==null||l?null:r.makeSelectValueFilter(o,[...t.keys()],a)}}function Yi(r){return function(t){return t.filter().isNull().not().and(t.filter().notEq(r.makeFilterValue(t.type,"")))}}function es(r,e){return function(n){var a=n.filter(),i=r.makeFilterValue(n.type,""),s=a.eq(i);return e?a.isNull().or(s):s.or(a.notEq(i))}}function ht(r,e,t){return e=ri(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ri(r){var e=ai(r,"string");return typeof e=="symbol"?e:String(e)}function ai(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class De{}ht(De,"not","not");ht(De,"and","and");ht(De,"or","or");function ts(r){if(!(r==="not"||r==="and"||r==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function x(r,e,t){return e=ii(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ii(r){var e=si(r,"string");return typeof e=="symbol"?e:String(e)}function si(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class p{}x(p,"eq","eq");x(p,"eqIgnoreCase","eqIgnoreCase");x(p,"notEq","notEq");x(p,"notEqIgnoreCase","notEqIgnoreCase");x(p,"greaterThan","greaterThan");x(p,"greaterThanOrEqualTo","greaterThanOrEqualTo");x(p,"lessThan","lessThan");x(p,"lessThanOrEqualTo","lessThanOrEqualTo");x(p,"in","in");x(p,"inIgnoreCase","inIgnoreCase");x(p,"notIn","notIn");x(p,"notInIgnoreCase","notInIgnoreCase");x(p,"isTrue","isTrue");x(p,"isFalse","isFalse");x(p,"isNull","isNull");x(p,"invoke","invoke");x(p,"contains","contains");x(p,"notContains","notContains");x(p,"containsIgnoreCase","containsIgnoreCase");x(p,"startsWith","startsWith");x(p,"endsWith","endsWith");x(p,"containsAny","containsAny");var zt=V.module("ViewportDataUtils");function oi(r,e){return String(r.offsetInSnapshot+e)}function ns(r,e){var{bulkUpdate:t}=r;return function(a){var{columns:i,offset:s,rows:o}=a.detail;zt.debug("table updated",a.detail);var l=new Map;o.forEach(u=>{var d=e(u,i),h=oi(u,s);l.set(h,{key:h,item:d})}),zt.debug("update keys",l),t(l)}}function rs(r,e){return e.reduce((t,n)=>(t[n.name]=r.get(n),t),{})}function*as(r,e){for(var t=r;t<=e;++t)yield{key:String(t)}}function li(r){return r==null||ui(r)?0:r.size}function ui(r){return"isClosed"in r?r.isClosed:!1}function is(r,e,t,n){var a=r+e-1,[i,s]=[0,n-1],o=yt(r-t,i,s),l=yt(a+t,i,s);return[o,l]}function Qt(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function ue(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Qt(i,n,a,s,o,"next",l)}function o(l){Qt(i,n,a,s,o,"throw",l)}s(void 0)})}}function ge(r,e,t){return e=di(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function di(r){var e=ci(r,"string");return typeof e=="symbol"?e:String(e)}function ci(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ie=V.module("TableUtils");class f{static copyTableAndApplyFilters(e){var t=arguments;return ue(function*(){if(e==null)return null;for(var n=yield e.copy(),a=t.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=t[s];return n.applyFilter(ze(...i.map(o=>o(n)))),n})()}static getSortIndex(e,t){for(var n=0;n<e.length;n+=1){var a,i=e[n];if(((a=i.column)===null||a===void 0?void 0:a.name)===t)return n}return null}static getSortForColumn(e,t){var n=f.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return f.isBooleanType(e)?[p.isTrue,p.isFalse,p.isNull]:f.isCharType(e)||f.isNumberType(e)||f.isDateType(e)?[p.eq,p.notEq,p.greaterThan,p.greaterThanOrEqualTo,p.lessThan,p.lessThanOrEqualTo]:f.isTextType(e)?[p.eq,p.eqIgnoreCase,p.notEq,p.notEqIgnoreCase,p.contains,p.notContains,p.startsWith,p.endsWith]:[]}static getNextSort(e,t,n){if(n<0||n>=e.length)return null;var a=f.getSortForColumn(t,e[n].name);return a===null?e[n].sort().asc():a.direction===f.sortDirection.ascending?a.desc():null}static makeColumnSort(e,t,n,a){if(t<0||t>=e.length||n===f.sortDirection.none)return null;var i=e[t].sort();switch(n){case f.sortDirection.ascending:i=i.asc();break;case f.sortDirection.descending:i=i.desc();break}return a&&(i=i.abs()),i}static toggleSortForColumn(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(n<0||n>=t.length)return[];var i=f.getNextSort(t,e,n);return f.setSortForColumn(e,t[n].name,i,a)}static sortColumn(e,t,n,a,i,s){if(n<0||n>=t.length)return[];var o=f.makeColumnSort(t,n,a,i);return f.setSortForColumn(e,t[n].name,o,s)}static setSortForColumn(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=f.getSortIndex(e,t),s=[];return a&&(s=s.concat(e.filter(o=>{var{direction:l}=o;return l!==f.sortDirection.reverse})),i!==null&&s.splice(i,1)),n!==null&&s.push(n),s}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case f.dataType.BOOLEAN:return f.dataType.BOOLEAN;case"char":case"java.lang.Character":case f.dataType.CHAR:return f.dataType.CHAR;case"java.lang.String":case f.dataType.STRING:return f.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 f.dataType.DATETIME:return f.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case f.dataType.DECIMAL:return f.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 f.dataType.INT:return f.dataType.INT;default:return f.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return f.isIntegerType(e)||f.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return f.getNormalizedType(e)===f.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return Ye.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i,s,o=!0,l=new Promise((u,d)=>{s=setTimeout(()=>{i(),o=!1,d(new at('Event "'.concat(t,'" timed out.')))},n),i=e.addEventListener(t,h=>{if(a!=null&&!a(h)){ie.debug2("Event triggered, but matcher returned false.");return}ie.debug2("Event triggered, resolving."),i(),clearTimeout(s),o=!1,u(h)})});return l.cancel=()=>{if(o){ie.debug2("Pending promise cleanup."),i(),clearTimeout(s),o=!1;return}ie.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error("Invalid boolean '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var n=f.removeCommas(t);if(f.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case p.eq:return"=";case p.notEq:return"!=";case p.greaterThan:return">";case p.greaterThanOrEqualTo:return">=";case p.lessThan:return"<";case p.lessThanOrEqualTo:return"<=";case p.contains:return"~";case p.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((n,a)=>{var i=n.name.toUpperCase(),s=a.name.toUpperCase();return nr.sort(i,s,t)})}constructor(e){ge(this,"dh",void 0),this.dh=e,Un(this)}createDistinctSortedColumnTable(e,t,n){var a=arguments,i=this;return ue(function*(){if(e==null)return null;for(var s=e,o=a.length,l=new Array(o>3?o-3:0),u=3;u<o;u++)l[u-3]=a[u];l.length>0&&(s=yield e.copy(),yield s.applyFilter(ze(...l.map(y=>y(s)))));var d=s.findColumn(t),h=yield s.selectDistinct([d]);s!==e&&s.close();var m=h.findColumn(t).sort()[n]();return i.applySort(h,[m])})()}doesColumnValueExist(e,t,n,a){var i=this;return ue(function*(){if(e==null)return null;var s=ni(i,t,n,a?"eq":"eqIgnoreCase"),o=yield e.copy();yield i.applyFilter(o,ze(s(o)));var l=li(o);return o.close(),l>0})()}makeQuickFilter(e,t,n){for(var a=t.split("||"),i=null,s=0;s<a.length;s+=1){for(var o=a[s],l=o.split("&&"),u=null,d=0;d<l.length;d+=1){var h=l[d].trim();if(h.length>0){var m=this.makeQuickFilterFromComponent(e,h,n);if(m)u?u=u.and(m):u=m;else throw new Error("Unable to parse quick filter from text ".concat(t))}}i&&u?i=i.or(u):i=u}return i}makeQuickFilterFromComponent(e,t,n){var{type:a}=e;return f.isNumberType(a)?this.makeQuickNumberFilter(e,t):f.isBooleanType(a)?this.makeQuickBooleanFilter(e,t):n!=null&&f.isDateType(a)?this.makeQuickDateFilter(e,t,n):f.isCharType(a)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var n=e.filter(),{dh:a}=this,i=null,s=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,o=s.exec(t),l=null,u=null,d=null,h=null,m=null;if(o!==null&&o.length>3&&([,l,u,d,h,m]=o),m!=null&&m.trim().length>0)return null;if(l==null&&(l="="),h!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(h=h.trim().toLowerCase(),h){case"null":i=n.isNull();break;case"nan":i=a.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"∞":u!=null?i=a.FilterCondition.invoke("isInf",n).and(n.lessThan(a.FilterValue.ofNumber(0))):i=a.FilterCondition.invoke("isInf",n).and(n.greaterThan(a.FilterValue.ofNumber(0)));break}return i!==null&&(l==="!"||l==="!=")&&(i=i.not()),i}if(d==null)return null;if(d=f.removeCommas(d),f.isLongType(e.type))try{d=a.FilterValue.ofNumber(a.LongWrapper.ofString("".concat(u!=null?"-":"").concat(d)))}catch(y){return ie.warn("Unable to create long filter",y),null}else{if(d=parseFloat(d),d==null||Number.isNaN(d))return null;d=a.FilterValue.ofNumber(u!=null?0-d:d)}return i=e.filter(),f.makeRangeFilterWithOperation(i,l,d)}static escapeQuickTextFilter(e){var t,n;if(e==null)return null;var a=/^(!~|!=|~|=|!)?(.*)/,i=/^\\*null$/,s=a.exec(e),o=null,l=null;if(s!==null&&s.length>2&&([,o,l]=s),o!=null){var u;return"\\".concat(o).concat((u=l)!==null&&u!==void 0?u:"")}return l!=null&&i.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=o)!==null&&t!==void 0?t:"").concat((n=l)!==null&&n!==void 0?n:"")}static unescapeQuickTextFilter(e){var t,n,a=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,i=/^\\*null$/,s=a.exec(e),o=null,l=null;return s!==null&&s.length>2&&([,o,l]=s),o!=null&&(o=o.replace("\\","")),l!=null&&i.test(l.toLowerCase())&&(l=l.replace("\\","")),o==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),o==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=o)!==null&&t!==void 0?t:"").concat((n=l)!==null&&n!==void 0?n:"")}makeQuickTextFilter(e,t){var{dh:n}=this,a="".concat(t).trim(),i=/^(!~|!=|~|=|!)?(.*)/,s=i.exec(a),o=null,l=null;if(s!==null&&s.length>2&&([,o,l]=s,l!=null&&(l=l.trim())),l==null||l.length===0&&!(o==="="||o==="!="))return null;o==null&&(o="=");var u=e.filter();if(l.toLowerCase()==="null")switch(o){case"=":return u.isNull();case"!=":case"!":return u.isNull().not()}var d=null,h=null;switch(l.startsWith("*")?(d="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(h="*",l=l.substring(0,l.length-1)),l=f.unescapeQuickTextFilter(l),o){case"~":return u.isNull().not().and(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return u.isNull().or(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return d==="*"?u.isNull().or(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):h==="*"?u.isNull().or(u.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):u.notEqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()));case"=":return d==="*"?u.isNull().not().and(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):h==="*"?u.isNull().not().and(u.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):u.eqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var n=/^(!=|=|!)?(.*)/,a=n.exec("".concat(t).trim());if(a===null)return null;var[,i,s]=a,o=i==="!"||i==="!=",l=s.trim().toLowerCase(),u=e.filter();try{var d=f.makeBooleanValue(l);return d!=null&&d?u=u.isTrue():d===null?u=u.isNull():u=u.isFalse(),o?u.not():u}catch{return null}}makeQuickDateFilter(e,t,n){var a=t.trim(),i=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,s=i.exec(a);if(s==null||s.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var o=null,l=null;[,o,l]=s;var u=p.eq;switch(o){case"<":u=p.lessThan;break;case"<=":case"=<":u=p.lessThanOrEqualTo;break;case">":u=p.greaterThan;break;case">=":case"=>":u=p.greaterThanOrEqualTo;break;case"!=":case"!":u=p.notEq;break;case"=":case"==":default:u=p.eq;break}return this.makeQuickDateFilterWithOperation(e,l,u,n)}makeQuickDateFilterWithOperation(e,t,n,a){var{dh:i}=this,[s,o]=$.parseDateRange(i,t,a),l=s!=null?i.FilterValue.ofNumber(s):null,u=o!=null?i.FilterValue.ofNumber(o):null,d=e.filter();if(l==null)return n===p.notEq?d.isNull().not():d.isNull();switch(n){case p.eq:{if(u!=null){var h=d.greaterThanOrEqualTo(l),m=d.lessThan(u);return h.and(m)}return d.eq(l)}case p.lessThan:return d.lessThan(l);case p.lessThanOrEqualTo:return u!=null?d.lessThan(u):d.lessThanOrEqualTo(l);case p.greaterThan:return u!=null?d.greaterThanOrEqualTo(u):d.greaterThan(l);case p.greaterThanOrEqualTo:return d.greaterThanOrEqualTo(l);case p.notEq:{if(u!=null){var y=d.lessThan(l),b=d.greaterThanOrEqualTo(u);return y.or(b)}return d.notEq(l)}default:throw new Error("Invalid operator: ".concat(n))}}makeQuickCharFilter(e,t){var{dh:n}=this,a="".concat(t).trim(),i=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,s=i.exec(a),o=null,l=null,u=null;if(s!==null&&s.length>3&&([,o,l,u]=s),u!=null&&u.trim().length>0||l==null||l.length===0)return null;o==null&&(o="=");var d=e.filter();if(l.toLowerCase()==="null")switch(o){case"=":return d.isNull();case"!=":case"!":return d.isNull().not();default:return null}var h=n.FilterValue.ofString(f.isRangeOperation(o)?f.quoteValue(l):l);return f.makeRangeFilterWithOperation(d,o,h)}makeAdvancedFilter(e,t,n){for(var{filterItems:a,filterOperators:i,invertSelection:s,selectedValues:o}=t,l=null,u=0;u<a.length;u+=1){var d=a[u],{selectedType:h,value:m}=d;if(h!=null&&h.length>0&&m!=null&&m.length>0)try{var y=this.makeAdvancedValueFilter(e,h,m,n);if(y!=null){if(u===0)l=y;else if(l!==null&&u-1<i.length){var b=i[u-1];if(b===De.and)l=l.and(y);else if(b===De.or)l=l.or(y);else{ie.error("Unexpected filter operator",b,y),l=null;break}}}else ie.debug2("Empty filter ignored for",h,m)}catch(T){ie.error("Unable to create filter",T),l=null;break}}var w=this.makeSelectValueFilter(e,o,s);return w!=null&&(l!=null?l=l.and(w):l=w),l}makeAdvancedValueFilter(e,t,n,a){var{dh:i}=this;if(f.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,n,t,a);if(f.isNumberType(e.type)||f.isCharType(e.type))return this.makeQuickFilter(e,"".concat(f.getFilterOperatorString(t)).concat(n));var s=this.makeFilterValue(e.type,n),o=e.filter();switch(t){case p.eq:return o.eq(s);case p.eqIgnoreCase:return o.eqIgnoreCase(s);case p.notEq:return o.notEq(s);case p.notEqIgnoreCase:return o.notEqIgnoreCase(s);case p.greaterThan:return o.greaterThan(s);case p.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(s);case p.lessThan:return o.lessThan(s);case p.lessThanOrEqualTo:return o.lessThanOrEqualTo(s);case p.isTrue:return o.isTrue();case p.isFalse:return o.isFalse();case p.isNull:return o.isNull();case p.contains:return o.isNull().not().and(o.invoke("matches",i.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E.*"))));case p.notContains:return o.isNull().or(o.invoke("matches",i.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E.*"))).not());case p.startsWith:return o.isNull().not().and(o.invoke("matches",i.FilterValue.ofString("(?s)(?i)^\\Q".concat(n,"\\E.*"))));case p.endsWith:return o.isNull().not().and(o.invoke("matches",i.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E$"))));case p.in:case p.inIgnoreCase:case p.notIn:case p.notInIgnoreCase:case p.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}applyNeverFilter(e,t){var n=arguments,a=this;return ue(function*(){var i=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var s=e.findColumn(t),o=[a.makeNeverFilter(s)];return yield a.applyFilter(e,o,i),e})()}applyCustomColumns(e,t){var n=arguments,a=this;return ue(function*(){var i=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:s}=a;return f.executeAndWaitForEvent(o=>o==null?void 0:o.applyCustomColumns(t),e,s.Table.EVENT_CUSTOMCOLUMNSCHANGED,i)})()}applyFilter(e,t){var n=arguments,a=this;return ue(function*(){var i=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:s}=a;return f.executeAndWaitForEvent(o=>o==null?void 0:o.applyFilter(t),e,s.Table.EVENT_FILTERCHANGED,i)})()}applySort(e,t){var n=arguments,a=this;return ue(function*(){var i=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:s}=a;return f.executeAndWaitForEvent(o=>o==null?void 0:o.applySort(t),e,s.Table.EVENT_SORTCHANGED,i)})()}makeNeverFilter(e){var{dh:t}=this,n=null;f.isTextType(e.type)?n=t.FilterValue.ofString("a"):f.isBooleanType(e.type)?n=t.FilterValue.ofBoolean(!0):f.isDateType(e.type)?n=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):n=t.FilterValue.ofNumber(0);var a=e.filter().eq(n),i=e.filter().notEq(n);return a.and(i)}makeFilterValue(e,t){var{dh:n}=this,a=f.getBaseType(e);return f.isTextType(a)?n.FilterValue.ofString(t):f.isLongType(a)?n.FilterValue.ofNumber(n.LongWrapper.ofString(f.removeCommas(t))):n.FilterValue.ofNumber(f.removeCommas(t))}makeFilterRawValue(e,t){var{dh:n}=this;return f.isTextType(e)?n.FilterValue.ofString(t):f.isBooleanType(e)?n.FilterValue.ofBoolean(t):n.FilterValue.ofNumber(t)}makeValue(e,t,n){var{dh:a}=this;if(t==="null")return null;if(f.isTextType(e))return t;if(f.isLongType(e))return a.LongWrapper.ofString(f.removeCommas(t));if(f.isBooleanType(e))return f.makeBooleanValue(t,!0);if(f.isDateType(e)){var[i]=$.parseDateRange(a,t,n);return i}return f.isNumberType(e)?f.makeNumberValue(t):(ie.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,n){var{dh:a}=this;if(t.length===0)return n?null:this.makeNeverFilter(e);for(var i=[],s=!1,o=0;o<t.length;o+=1){var l=t[o];l==null?s=!0:f.isTextType(e.type)?i.push(a.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):f.isBooleanType(e.type)?i.push(a.FilterValue.ofBoolean(!!l)):i.push(a.FilterValue.ofNumber(l))}return s?i.length>0?n?e.filter().isNull().not().and(e.filter().notIn(i)):e.filter().isNull().or(e.filter().in(i)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(i):e.filter().in(i)}}ge(f,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});ge(f,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});ge(f,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);ge(f,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));ge(f,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);ge(f,"executeAndWaitForEvent",function(){var r=ue(function*(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var i=f.makeCancelableTableEventPromise(t,n,a);return e(t),yield i,t});return function(e,t,n){return r.apply(this,arguments)}}());function Le(r,e,t){return e=hi(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hi(r){var e=fi(r,"string");return typeof e=="symbol"?e:String(e)}function fi(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Sn{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,n)=>{var a=f.getNormalizedType(n.columnType);if(a===null)return t;t.has(a)||t.set(a,new Map);var i=t.get(a);return i==null||i.set(n.columnName,n.format),t},new Map)}static makeColumnFormattingRule(e,t,n){return{columnType:e,columnName:t,format:n}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1;Le(this,"defaultColumnFormatter",void 0),Le(this,"typeFormatterMap",void 0),Le(this,"columnFormatMap",void 0),Le(this,"truncateNumbersWithPound",void 0),this.defaultColumnFormatter=new Qa,this.typeFormatterMap=new Map([[f.dataType.BOOLEAN,new Va],[f.dataType.CHAR,new Ha],[f.dataType.DATETIME,new ee(e,n)],[f.dataType.DECIMAL,new L(e,a)],[f.dataType.INT,new re(e,i)],[f.dataType.STRING,new Ya]]),this.columnFormatMap=Sn.makeColumnFormatMap(t),this.truncateNumbersWithPound=s}getColumnFormatMapForType(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=f.getNormalizedType(e);if(n!==null)return t&&!this.columnFormatMap.has(n)&&this.columnFormatMap.set(n,new Map),this.columnFormatMap.get(n)}getColumnFormat(e,t){var n,a=this.getColumnFormatMapForType(e);return(n=a==null?void 0:a.get(t))!==null&&n!==void 0?n:null}getColumnTypeFormatter(e){var t=f.getNormalizedType(e),n=this.defaultColumnFormatter;if(t){var a;n=(a=this.typeFormatterMap.get(t))!==null&&a!==void 0?a:n}return n}getFormattedString(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;if(e==null)return"";var i=this.getColumnTypeFormatter(t),s=a||this.getColumnFormat(t,n);return i.format(e,s??void 0)}get timeZone(){var e,t=this.typeFormatterMap.get(f.dataType.DATETIME);return t==null||(e=t.dhTimeZone)===null||e===void 0?void 0:e.id}}function mi(r){if(r&&r.formatter){var{formatter:e}=r;return e}}function pi(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 vi(r,e,t){var n=r.getColumnFormat(t,e);return n!=null&&(n.type===B.TYPE_CONTEXT_PRESET||n.type===B.TYPE_CONTEXT_CUSTOM)}const ss={getColumnFormats:mi,getDateTimeFormatterOptions:pi,isCustomColumnFormatDefined:vi};var os=g.createContext({}),ls=g.createContext({}),gi=g.createContext(null);function Zt(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function yi(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Zt(i,n,a,s,o,"next",l)}function o(l){Zt(i,n,a,s,o,"throw",l)}s(void 0)})}}var bi=V.module("@deephaven/jsapi-components.ConnectionBootstrap"),Cn=g.createContext(null);function us(r){var{children:e}=r,t=vn(),n=ja(),[a,i]=g.useState(),[s,o]=g.useState();return g.useEffect(function(){var u=!1;function d(){return h.apply(this,arguments)}function h(){return h=yi(function*(){try{var m=yield n.getAsIdeConnection();if(u)return;o(m)}catch(y){if(u)return;i(y)}}),h.apply(this,arguments)}return d(),()=>{u=!0}},[t,n]),g.useEffect(function(){if(s==null)return;function u(h){var{detail:m}=h;bi.info("Shutdown","".concat(JSON.stringify(m))),i("Server shutdown: ".concat(m??"Unknown reason"))}var d=s.addEventListener(t.IdeConnection.EVENT_SHUTDOWN,u);return d},[t,s]),s==null||a!=null?c.jsx(Vn,{"data-testid":"connection-bootstrap-loading",isLoading:s==null,errorMessage:a!=null?"".concat(a):void 0}):c.jsx(Cn.Provider,{value:s,children:e})}function ds(){return Ke(Cn,"No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?")}function cs(){return Ke(gi,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}export{Pi as $,ot as A,et as B,bt as C,$ as D,Mi as E,ss as F,Gi as G,ji as H,re as I,Ki as J,O as K,Fi as L,K as M,Li as N,De as O,Ye as P,Sn as Q,_i as R,Te as S,p as T,Bi as U,Vi as V,Yt as W,ds as X,cs as Y,Di as Z,Qi as _,Ii as a,Zn as a0,Ke as a1,lr as a2,tn as a3,ea as a4,un as a5,oa as a6,le as a7,sn as a8,ga as a9,mi as aA,pi as aB,li as aC,ui as aD,vi as aE,is as aF,Ti as aG,ze as aH,ls as aI,gi as aJ,os as aK,us as aL,Cn as aM,wa as aa,F as ab,Ma as ac,Qr as ad,Dt as ae,zi as af,gn as ag,vn as ah,ja as ai,at as aj,Va as ak,Ha as al,Qa as am,La as an,Ya as ao,Zi as ap,bn as aq,oi as ar,Yi as as,ns as at,Xi as au,Ji as av,es as aw,ni as ax,rs as ay,as as az,f as b,wi as c,zn as d,j as e,Ei as f,Oi as g,nn as h,B as i,ee as j,L as k,xi as l,Ai as m,qi as n,ts as o,$i as p,ki as q,Ui as r,Hi as s,Wi as t,ir as u,Hr as v,Z as w,Ur as x,Ni as y,nr as z};
|
|
3
|
-
//# sourceMappingURL=useUser-ff64c9ad.js.map
|