@deephaven/embed-chart 0.49.2-theme-plugins.34 → 0.49.2-theme-plugins.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import{C as u,$ as ps,M as ri,N as un,F as X,O as ii,P as cn,r as c,K as Be,Q as Ee,S as vs,T as ai,U as ms,V as si,W as gs,X as bs,Y as Kn,G as M,Z as ys,D as Ne,E as I,R as oi,_ as m,L as re,a0 as ws,a1 as Cs,a2 as Ss,a3 as Os,a4 as xs,a5 as Es,a6 as Ts,a7 as Ps,a8 as Is,a9 as Ms,aa as Ns,ab as Ke,ac as Ds,ad as js,ae as As,af as ks,ag as li}from"./vendor-7af3c298.js";import{L as R,e as Ls,f as Rs,i as _s,g as ui,T as fe,M as dn,h as hn,j as ci,k as $s,l as Fs,m as Us,n as Vs,o as di,p as Bs,q as Ks,r as Hs,s as Gs,t as Ws,u as hi,a as zs,w as qs,x as Zs,y as Xs,z as fi,D as pi,A as vi,B as mi,C as gi,E as Js,F as Qs,c as De,G as bi,H as Ys,I as yi,J as wi,K as eo,N as to,O as Ci}from"./index-b36c8cfe.js";import{c as Je,d as Q,i as At,e as Si,C as no,f as Oi,g as ro,b as Te,h as Ge,j as xi,B as io,k as ao,l as so,D as oo,m as lo,n as uo,a as Ei,F as Vt,I as co,S as ho,o as fo,T as Ti,p as po,q as fn,r as vo,s as Pi,t as Ii,v as pn,w as vn,x as Mi,y as Ni,z as Di,A as ji,E as mo,G as go,H as mn,J as lt,K as bo,L as Ai,P as Hn,M as yo,N as wo,O as Co,Q as So}from"./useConnection-2941c9cc.js";import{R as Ef,u as Tf}from"./useConnection-2941c9cc.js";import"./helpers-042e6b4d.js";function Gn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Oo(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Gn(a,r,i,s,o,"next",l)}function o(l){Gn(a,r,i,s,o,"throw",l)}s(void 0)})}}function xo(n){return Bt.apply(this,arguments)}function Bt(){return Bt=Oo(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return Wn(n)}Wn(n)}),Bt.apply(this,arguments)}function Wn(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}class ki extends CustomEvent{constructor(e,t){super(e,t)}}function He(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}class gn{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(!gn.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],a=i[0],s=i[1];if(a<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],s=a.length-1;s>=0;s-=1){var o=a[s],l=o[0],d=o[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(s,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],s=a.length-1;s>=0;s-=1){var o=a[s],l=o[0],d=o[1];if(!(i<l||d<r))if(l<r&&i<d){a[s]=[l,r-1],a.splice(s+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(s,1):l<r?a[s]=[l,r-1]:a[s]=[i+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var a=[...r],s=i[0];s<=i[1];s+=1)a.push(e[s]);return a},[])}}const ue=gn;function*Eo(n,e){for(var t=n;t<=e;++t)yield t}function Li(n,e,t){return e=To(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function To(n){var e=Po(n,"string");return typeof e=="symbol"?e:String(e)}function Po(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qe{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),a=r%60,s=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(s)}static isTimeString(e){return new RegExp(Qe.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])}}Li(Qe,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Li(Qe,"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 qe=Qe;var Ri=24,Io=32,Mo=33,No=150,_i=200,$i=500,Fi=250,Do={spellCheck:!1},jo=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange"];function zn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zn(Object(t),!0).forEach(function(r){Ao(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ao(n,e,t){return e=ko(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ko(n){var e=Lo(n,"string");return typeof e=="symbol"?e:String(e)}function Lo(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ro(n,e){if(n==null)return{};var t=_o(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function _o(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Ui(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:s}=n,o=Ro(n,jo);return u.jsxs(ps,{type:"popover",onOpenChange:s,children:[u.jsxs(ri,qn(qn({},o),{},{"aria-label":e??i,isQuiet:r,children:[u.jsx(un,{children:u.jsx(X,{icon:t})}),i==null?null:u.jsx(ii,{children:i})]})),a]})}function $o(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function Vi(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function Bi(n,e){return n.isInverted===e.isInverted&&Vi(n.selection,e.selection)}function Ki(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function Hi(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...Eo(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function Fo(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function Gi(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function Uo(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return Wi(e)}function Vo(n){var e=n==null?void 0:n.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),r=t==null?void 0:t.getAttribute("aria-controls"),i=r==null?null:document.getElementById(r);return i}function Wi(n){return n instanceof HTMLElement?n:null}function we(n,e,t){return e=Bo(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bo(n){var e=Ko(n,"string");return typeof e=="symbol"?e:String(e)}function Ko(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var G;(function(n){n.DEBUG="D",n.LOG="L",n.WARN="W",n.ERROR="E",n.UNCAUGHT_ERROR="U"})(G||(G={}));function je(n,e){return new CustomEvent(n,{detail:e})}class Ho{constructor(){we(this,"isEnabled",!1),we(this,"debug",void 0),we(this,"log",void 0),we(this,"warn",void 0),we(this,"error",void 0),we(this,"eventTarget",void 0),we(this,"handleUncaughtError",e=>{var t=[];e.error!=null&&t.push(e.error),e.message&&t.push(e.message),this.eventTarget.dispatchEvent(je(G.UNCAUGHT_ERROR,t))}),we(this,"handleUncaughtRejection",e=>{var t=[];e.promise!=null&&t.push(e.promise.toString()),e.reason&&t.push(e.reason),this.eventTarget.dispatchEvent(je(G.UNCAUGHT_ERROR,t))}),this.debug=console.debug,this.log=console.log,this.warn=console.warn,this.error=console.error,this.eventTarget=new cn}enable(){var e=this;this.isEnabled||(console.debug=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.DEBUG,r)),e.debug.apply(console,r)},console.log=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.LOG,r)),e.log.apply(console,r)},console.warn=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.WARN,r)),e.warn.apply(console,r)},console.error=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.ERROR,r)),e.error.apply(console,r)},window.addEventListener("error",this.handleUncaughtError),window.addEventListener("unhandledrejection",this.handleUncaughtRejection),R.setLogLevel(R.level),this.isEnabled=!0)}disable(){this.isEnabled&&(console.debug=this.debug,console.log=this.log,console.warn=this.warn,console.error=this.error,window.removeEventListener("error",this.handleUncaughtError),window.removeEventListener("unhandledrejection",this.handleUncaughtRejection),R.setLogLevel(R.level),this.isEnabled=!1)}addEventListener(e,t){this.eventTarget.addEventListener(e,t)}removeEventListener(e,t){this.eventTarget.removeEventListener(e,t)}}const Go=Ho;function ze(n,e,t){return e=Wo(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wo(n){var e=zo(n,"string");return typeof e=="symbol"?e:String(e)}function zo(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ut{static formatMessages(e){var t=e.map(r=>{if(typeof r=="string")return r;var i="";try{i=JSON.stringify(r)}catch{i=r.toString()}return i==="{}"?r.toString():i});return t.join(" ")}static formatStack(e,t){if(e==="")return"";var r=e.split(`
1
+ import{C as u,$ as fs,M as ni,N as un,F as X,O as ri,P as cn,r as c,K as Ve,Q as Ee,S as ps,T as ii,U as vs,V as ai,W as ms,X as gs,Y as Kn,G as M,Z as bs,D as Ne,E as I,R as si,_ as m,L as re,a0 as ys,a1 as ws,a2 as Cs,a3 as Ss,a4 as Os,a5 as xs,a6 as Es,a7 as Ts,a8 as Ps,a9 as Is,aa as Ms,ab as Ke,ac as Ns,ad as Ds,ae as js,af as As,ag as oi}from"./vendor-7af3c298.js";import{L as R,e as ks,f as Ls,i as Rs,g as li,T as fe,M as dn,h as hn,j as ui,k as _s,l as $s,m as Fs,n as Us,o as ci,p as Bs,q as Vs,r as Ks,s as Hs,t as Gs,u as di,a as Ws,w as zs,x as qs,y as Zs,z as hi,A as fi,D as pi,B as vi,C as mi,E as gi,F as Xs,G as Js,c as De,H as bi,I as Qs,J as yi,K as Ys,N as eo,O as wi}from"./index-fc10c6be.js";import{c as Je,d as Q,i as At,e as Ci,C as to,f as Si,g as no,b as Te,h as Ge,j as Oi,B as ro,k as io,l as ao,D as so,m as oo,n as lo,a as xi,F as Bt,I as uo,S as co,o as ho,T as Ei,p as fo,q as fn,r as po,s as Ti,t as Pi,v as pn,w as vn,x as Ii,y as Mi,z as Ni,A as Di,E as vo,G as mo,H as mn,J as lt,K as go,L as ji,P as Hn,M as bo,N as yo,O as wo,Q as Co}from"./useConnection-6454ecbd.js";import{R as Ef,u as Tf}from"./useConnection-6454ecbd.js";import"./helpers-042e6b4d.js";function Gn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function So(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Gn(a,r,i,s,o,"next",l)}function o(l){Gn(a,r,i,s,o,"throw",l)}s(void 0)})}}function Oo(n){return Vt.apply(this,arguments)}function Vt(){return Vt=So(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return Wn(n)}Wn(n)}),Vt.apply(this,arguments)}function Wn(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}class Ai extends CustomEvent{constructor(e,t){super(e,t)}}function He(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}class gn{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(!gn.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],a=i[0],s=i[1];if(a<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],s=a.length-1;s>=0;s-=1){var o=a[s],l=o[0],d=o[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(s,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],s=a.length-1;s>=0;s-=1){var o=a[s],l=o[0],d=o[1];if(!(i<l||d<r))if(l<r&&i<d){a[s]=[l,r-1],a.splice(s+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(s,1):l<r?a[s]=[l,r-1]:a[s]=[i+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var a=[...r],s=i[0];s<=i[1];s+=1)a.push(e[s]);return a},[])}}const ue=gn;function*xo(n,e){for(var t=n;t<=e;++t)yield t}function ki(n,e,t){return e=Eo(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Eo(n){var e=To(n,"string");return typeof e=="symbol"?e:String(e)}function To(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qe{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),a=r%60,s=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(s)}static isTimeString(e){return new RegExp(Qe.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])}}ki(Qe,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");ki(Qe,"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 qe=Qe;var Li=24,Po=32,Io=33,Mo=150,Ri=200,_i=500,$i=250,No={spellCheck:!1},Do=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange"];function zn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zn(Object(t),!0).forEach(function(r){jo(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function jo(n,e,t){return e=Ao(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ao(n){var e=ko(n,"string");return typeof e=="symbol"?e:String(e)}function ko(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Lo(n,e){if(n==null)return{};var t=Ro(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Ro(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Fi(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:s}=n,o=Lo(n,Do);return u.jsxs(fs,{type:"popover",onOpenChange:s,children:[u.jsxs(ni,qn(qn({},o),{},{"aria-label":e??i,isQuiet:r,children:[u.jsx(un,{children:u.jsx(X,{icon:t})}),i==null?null:u.jsx(ri,{children:i})]})),a]})}function _o(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function Ui(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function Bi(n,e){return n.isInverted===e.isInverted&&Ui(n.selection,e.selection)}function Vi(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function Ki(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...xo(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function $o(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function Hi(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function Fo(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return Gi(e)}function Uo(n){var e=n==null?void 0:n.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),r=t==null?void 0:t.getAttribute("aria-controls"),i=r==null?null:document.getElementById(r);return i}function Gi(n){return n instanceof HTMLElement?n:null}function we(n,e,t){return e=Bo(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bo(n){var e=Vo(n,"string");return typeof e=="symbol"?e:String(e)}function Vo(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var G;(function(n){n.DEBUG="D",n.LOG="L",n.WARN="W",n.ERROR="E",n.UNCAUGHT_ERROR="U"})(G||(G={}));function je(n,e){return new CustomEvent(n,{detail:e})}class Ko{constructor(){we(this,"isEnabled",!1),we(this,"debug",void 0),we(this,"log",void 0),we(this,"warn",void 0),we(this,"error",void 0),we(this,"eventTarget",void 0),we(this,"handleUncaughtError",e=>{var t=[];e.error!=null&&t.push(e.error),e.message&&t.push(e.message),this.eventTarget.dispatchEvent(je(G.UNCAUGHT_ERROR,t))}),we(this,"handleUncaughtRejection",e=>{var t=[];e.promise!=null&&t.push(e.promise.toString()),e.reason&&t.push(e.reason),this.eventTarget.dispatchEvent(je(G.UNCAUGHT_ERROR,t))}),this.debug=console.debug,this.log=console.log,this.warn=console.warn,this.error=console.error,this.eventTarget=new cn}enable(){var e=this;this.isEnabled||(console.debug=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.DEBUG,r)),e.debug.apply(console,r)},console.log=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.LOG,r)),e.log.apply(console,r)},console.warn=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.WARN,r)),e.warn.apply(console,r)},console.error=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.eventTarget.dispatchEvent(je(G.ERROR,r)),e.error.apply(console,r)},window.addEventListener("error",this.handleUncaughtError),window.addEventListener("unhandledrejection",this.handleUncaughtRejection),R.setLogLevel(R.level),this.isEnabled=!0)}disable(){this.isEnabled&&(console.debug=this.debug,console.log=this.log,console.warn=this.warn,console.error=this.error,window.removeEventListener("error",this.handleUncaughtError),window.removeEventListener("unhandledrejection",this.handleUncaughtRejection),R.setLogLevel(R.level),this.isEnabled=!1)}addEventListener(e,t){this.eventTarget.addEventListener(e,t)}removeEventListener(e,t){this.eventTarget.removeEventListener(e,t)}}const Ho=Ko;function ze(n,e,t){return e=Go(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Go(n){var e=Wo(n,"string");return typeof e=="symbol"?e:String(e)}function Wo(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ut{static formatMessages(e){var t=e.map(r=>{if(typeof r=="string")return r;var i="";try{i=JSON.stringify(r)}catch{i=r.toString()}return i==="{}"?r.toString():i});return t.join(" ")}static formatStack(e,t){if(e==="")return"";var r=e.split(`
2
2
  `).map(i=>i.trim());switch(t){case G.ERROR:r=r.splice(e[0]==="Error"?4:3);break;case G.UNCAUGHT_ERROR:r=r.splice(e[0]==="Error"?3:2);break}return r!=null?" ".concat(r.join(`
3
3
  `)):""}constructor(e){ze(this,"history",void 0),ze(this,"offset",void 0),ze(this,"limit",void 0),ze(this,"isEnabled",void 0),ze(this,"proxy",void 0),this.history=[],this.offset=0,this.limit=1e4,this.isEnabled=!1,this.proxy=e,this.addHistory=this.addHistory.bind(this)}enable(){this.isEnabled||(this.proxy.addEventListener(G.DEBUG,this.addHistory),this.proxy.addEventListener(G.LOG,this.addHistory),this.proxy.addEventListener(G.WARN,this.addHistory),this.proxy.addEventListener(G.ERROR,this.addHistory),this.proxy.addEventListener(G.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!0)}disable(){this.isEnabled&&(this.proxy.removeEventListener(G.DEBUG,this.addHistory),this.proxy.removeEventListener(G.LOG,this.addHistory),this.proxy.removeEventListener(G.WARN,this.addHistory),this.proxy.removeEventListener(G.ERROR,this.addHistory),this.proxy.removeEventListener(G.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!1)}addHistory(e){var{type:t,detail:r}=e,i={type:t,messages:r,time:new Date};switch(t){case G.ERROR:case G.UNCAUGHT_ERROR:i.stack=Error().stack;break}this.history[this.offset%this.limit]=i,this.offset+=1}getHistory(){if(this.offset>this.limit){var e=this.offset%this.limit;this.history=this.history.slice(e).concat(this.history.slice(0,e)),this.offset=this.limit}return this.history}getFormattedHistory(){var e=this.getHistory().map(t=>"".concat(t.time.toISOString()," ").concat(t.type," ")+"".concat(ut.formatMessages(t.messages))+(t.stack!=null?`
4
4
  `.concat(ut.formatStack(t.stack,t.type)):""));return e.join(`
5
- `)}}const qo=ut,Zo=Object.freeze(Object.defineProperty({__proto__:null,Log:R,LogHistory:qo,LogProxy:Go,Logger:Ls,LoggerLevel:Rs,default:R},Symbol.toStringTag,{value:"Module"}));function zi(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Zn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Xo(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Zn(a,r,i,s,o,"next",l)}function o(l){Zn(a,r,i,s,o,"throw",l)}s(void 0)})}}var kt=R.module("useAsyncInterval");function Jo(n,e){var t=zi(),r=c.useRef(0),i=c.useRef(0),a=c.useRef(null),s=c.useCallback(Xo(function*(){var o=Date.now();i.current+=1;var l=a.current==null?e:o-a.current;if(kt.debug("tick #".concat(i.current,"."),l,"ms elapsed since last tick."),a.current=o,yield n(),!!t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);kt.debug("Next tick target:",e,", overage",d,", adjusted:",h),r.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(kt.debug("Setting target interval:",e),a.current=null,s(),()=>{window.clearTimeout(r.current)}),[e,s])}function Qo(n,e){return c.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function ct(n,e){var t=c.useMemo(()=>Be(n,e),[n,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function Yo(n){var[e,t]=c.useState(n);return c.useEffect(()=>{t(n)},[n]),[e,t]}function el(n,e,t,r){var i=c.useRef(0);c.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function qi(n,e){var t=c.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function Zi(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function bn(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var tl=3500,nl=R.module("useCopyToClipboard");function Xi(){var[n,e]=c.useState(!1),t=c.useRef(null),r=c.useCallback(i=>{xo(i).then(()=>{e(!0)}).catch(a=>nl.error("Unable to copy ".concat(i),`
6
- `,a))},[]);return c.useEffect(()=>(t.current&&clearTimeout(t.current),n&&(t.current=setTimeout(()=>{e(!1)},tl)),()=>{t.current&&clearTimeout(t.current)}),[n]),[n,r]}function rl(n){n.preventDefault()}function Ji(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(Ee()),[]),t=c.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=c.useMemo(()=>({id:e,onSubmit:n?void 0:rl}),[e,n]),i=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function Qi(n,e){return c.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function Yi(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return c.useMemo(()=>{var{selection:a,isInverted:s}=Hi(r,i.length);return{selection:Ki(a,t,e),isInverted:s}},[r,i.length,t,e])}function il(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_s,t=c.useRef();return c.useEffect(()=>()=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t)},[]),c.useCallback(r=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(r);a&&(a.addEventListener("scroll",n),t.current=()=>{a.removeEventListener("scroll",n),t.current=void 0})},[e,n])}function Xn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function al(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Xn(a,r,i,s,o,"next",l)}function o(l){Xn(a,r,i,s,o,"throw",l)}s(void 0)})}}function sl(n,e,t){var r=c.useRef(null),[i,a]=c.useState(null),s=c.useCallback(al(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);c.useEffect(()=>(i==null||i.addEventListener("scroll",e),s(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,s]);var o=c.useCallback(l=>{l&&setTimeout(()=>{a(n(r.current))},0)},[n]);return{ref:r,onOpenChange:o}}function Jn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function ol(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Jn(a,r,i,s,o,"next",l)}function o(l){Jn(a,r,i,s,o,"throw",l)}s(void 0)})}}function Xe(n,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=c.useState(null),[a,s]=c.useState(null),[o,l]=c.useState(!1),d=c.useCallback(ol(function*(){l(!0);try{var h=yield n(...e);i(h),s(null)}catch(f){i(null),s(f)}finally{l(!1)}}),[n,...e]);return c.useEffect(()=>{t&&d()},[t,d]),{data:r,error:a,isError:a!=null,isLoading:o,reload:d}}function Qn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qn(Object(t),!0).forEach(function(r){ll(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ll(n,e,t){return e=ul(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ul(n){var e=cl(n,"string");return typeof e=="symbol"?e:String(e)}function cl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function dl(n,e,t,r){var i=arguments.length===4;return c.useCallback(a=>{var s=i?a??r:a;t(Yn(Yn({},n),{},{[e]:s}))},[t,n,e,i,r])}function ea(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=c.useRef(),i=c.useRef(0);return c.useCallback(a=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{var s=Math.floor(a.target.scrollTop/n);i.current!==s&&(i.current=s,e(s))},t)},[t,n,e])}function vt(n,e){var[t,r]=c.useState(n);return c.useEffect(()=>{var i=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(i)}},[n,e]),t}function ta(n,e){return c.useCallback(t=>{if(t!=null){var r=e==null?[t]:t.querySelectorAll(e);r.forEach(i=>{Object.entries(n).forEach(a=>{var[s,o]=a;i.setAttribute(s,o)})})}},[n,e])}function hl(n){var e=ta(Do,n);return Qi(e,Gi)}function na(){var{getKey:n=ra}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[r,i]=c.useState(()=>new Set),a=c.useCallback(g=>b=>n(b)===g,[n]),s=c.useCallback(g=>{var b;return(b=e.find(a(g)))!==null&&b!==void 0?b:null},[e,a]),o=c.useCallback(g=>{var b=s(g);if(b==null)throw new Error("No item found matching key: ".concat(g));return b},[s]),l=c.useCallback(g=>{t(b=>[...b,...g])},[]),d=c.useCallback((g,b)=>{t(w=>[...w.slice(0,g),...b,...w.slice(g)])},[]),h=c.useCallback(g=>{var b=new Set(g);t(w=>w.filter(x=>!b.has(n(x))))},[n]),f=c.useCallback((g,b)=>{var w=e.findIndex(a(g));w!==-1&&t(x=>[...x.slice(0,w),b,...x.slice(w+1)])},[e,a]),p=c.useCallback(g=>{if(g.size!==0){var b=[],w=new Map;for(var x of g.keys()){var P=e.findIndex(a(x));b.push(P),w.set(P,x)}b.sort((k,O)=>k-O);var C=[];e.forEach((k,O)=>{if(b[0]===O){var A=w.get(b.shift()),N=g.get(A);C.push(N)}else C.push(k)}),t(C)}},[e,a]),v=c.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:p,findItem:s,getItem:o,insert:d,remove:h,setItems:t,setSelectedKeys:i,update:f}),[l,p,s,o,d,e,h,t,r,f]);return v}function ra(n){var e=n!=null&&typeof n=="object"&&"key"in n;if(!e)throw new Error("Item does not have a `key` prop.");return n.key}const fl=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:Fo,defaultGetKey:ra,extractSpectrumHTMLElement:Gi,extractSpectrumLastChildHTMLElement:Uo,findSpectrumComboBoxScrollArea:Vo,getSelectedItemCountOrAll:$o,identityExtractHTMLElement:Wi,isSelectionEqual:Vi,isSelectionMaybeInvertedEqual:Bi,mapSelection:Ki,optimizeSelection:Hi,useAsyncInterval:Jo,useCallbackWithAction:Qo,useContextOrThrow:Je,useCopyToClipboard:Xi,useDebouncedCallback:ct,useDebouncedValue:vt,useDependentState:Yo,useEffectNTimesWhen:el,useFormWithDetachedSubmitButton:Ji,useForwardedRef:bn,useIsEqualMemo:qi,useIsMountedRef:zi,useMappedRef:Qi,useMappedSelection:Yi,useOnScrollOffsetChangeCallback:ea,useOnScrollRef:il,usePopoverOnScrollRef:sl,usePrevious:Zi,usePromiseFactory:Xe,usePropChangeCallback:dl,useSetAttributesCallback:ta,useSpectrumDisableSpellcheckRef:hl,useWindowedListData:na},Symbol.toStringTag,{value:"Module"})),pl="_spectrumActionBar_tmmkp_5",vl="_spectrumDialogComponentHeading_tmmkp_9",ml="_spectrumEllipsis_tmmkp_14",yn={spectrumActionBar:pl,spectrumDialogComponentHeading:vl,spectrumEllipsis:ml};function er(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function tt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?er(Object(t),!0).forEach(function(r){gl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):er(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gl(n,e,t){return e=bl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bl(n){var e=yl(n,"string");return typeof e=="symbol"?e:String(e)}function yl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ia(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:s,submitButtonProps:o}=Ji();return u.jsxs(vs,{children:[u.jsx(ai,{level:3,UNSAFE_className:yn.spectrumDialogComponentHeading,children:e}),u.jsx(ms,{}),u.jsx(si,{children:u.jsx(gs,tt(tt({},s),{},{children:r}))}),u.jsxs(bs,{children:[u.jsx(Kn,{variant:"secondary",onPress:i,children:"Cancel"}),u.jsx(Kn,tt(tt({},o),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function wl(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,onConfirm:s}=n,o=c.useCallback(l=>u.jsx(ia,{heading:t,confirmationButtonLabel:r,onCancel:l,onConfirm:()=>{l(),s()},children:a}),[a,r,t,s]);return u.jsx(Ui,{ariaLabel:e,icon:ui,isHidden:i,isQuiet:!0,height:Ri,children:o})}var Cl=["icon","label"];function tr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tr(Object(t),!0).forEach(function(r){Sl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):tr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Sl(n,e,t){return e=Ol(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ol(n){var e=xl(n,"string");return typeof e=="symbol"?e:String(e)}function xl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function El(n,e){if(n==null)return{};var t=Tl(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Tl(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function aa(n){var{icon:e,label:t}=n,r=El(n,Cl);return u.jsx(ri,nr(nr({},r),{},{"aria-label":t,isQuiet:!0,height:Ri,children:u.jsx(un,{children:u.jsx(X,{icon:e})})}))}aa.displayName="IconActionButton";function rr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Pl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rr(Object(t),!0).forEach(function(r){Fe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fe(n,e,t){return e=Il(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Il(n){var e=Ml(n,"string");return typeof e=="symbol"?e:String(e)}function Ml(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wn extends c.Component{constructor(e){super(e),Fe(this,"element",void 0),Fe(this,"container",void 0),Fe(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=M.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:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Pl({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new ys(r||a,this.element,i),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:r,interactive:i,closeOnBlur:a}=this.props,{show:s}=this.state;return u.jsx(Ne,{in:s,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:o=>{o.stopPropagation()},onKeyDown:o=>{o.key==="Escape"&&this.hide()},className:I("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&oi.createPortal(this.renderContent(),this.element)})}}Fe(wn,"propTypes",{children:m.node.isRequired,options:m.shape({}),className:m.string,timeout:m.number,onEntered:m.func,onExited:m.func,isShown:m.bool,closeOnBlur:m.bool,interactive:m.bool,referenceObject:m.shape({}),"data-testid":m.string});Fe(wn,"defaultProps",{options:{},className:"",timeout:fe.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const We=wn;function ir(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Nl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ir(Object(t),!0).forEach(function(r){le(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ir(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function le(n,e,t){return e=Dl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dl(n){var e=jl(n,"string");return typeof e=="symbol"?e:String(e)}function jl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Al=R.module("Tooltip");class z extends c.Component{static handleHidden(){z.shownTooltipCount-=1,z.shownTooltipCount===0&&(z.lastHiddenTime=Date.now())}static handleShown(){z.shownTooltipCount+=1}constructor(e){super(e),le(this,"container",void 0),le(this,"popper",void 0),le(this,"parent",void 0),le(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=M.createRef(),this.popper=M.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:r}=t,{isShown:i}=this.state;i!==r&&(i?z.handleShown():z.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&z.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Al.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,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var a=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&r>=s.top&&r<=s.top+s.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(z.shownTooltipCount>0||Date.now()-z.lastHiddenTime<z.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}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:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":a,onEntered:s}=this.props,{isShown:o}=this.state,{options:l}=this.props;return l=Nl({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:u.jsx(We,{className:I(i),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",o&&t]})})})}}le(z,"defaultTimeout",500);le(z,"defaultReshowTimeout",100);le(z,"triggerReshowThreshold",300);le(z,"shownTooltipCount",0);le(z,"lastHiddenTime",Date.now());le(z,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:z.defaultReshowTimeout,timeout:z.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const mt=z;function ar(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function kl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ar(Object(t),!0).forEach(function(r){me(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ar(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function me(n,e,t){return e=Ll(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ll(n){var e=Rl(n,"string");return typeof e=="symbol"?e:String(e)}function Rl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _l=100,Kt;(function(n){n.UP="UP",n.DOWN="DOWN"})(Kt||(Kt={}));class oe extends c.Component{constructor(e){super(e),me(this,"popper",void 0),me(this,"cbContainer",void 0),me(this,"menuContainer",void 0),me(this,"input",void 0),me(this,"getCachedFilteredOptions",re((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=kl({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Be(this.updateInputValue,_l),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=M.createRef(),this.cbContainer=M.createRef(),this.menuContainer=M.createRef(),this.input=M.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,r=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return r.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:r[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:r,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(r,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:r}=this.props;r(e,t)}processFilterChange(e){var t,{options:r}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(r,e):r,s=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),s&&i){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:r,keyboardOptionIndex:i}=this.state,a=r[i];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:r}=this.state,i=r;e===oe.MENU_NAVIGATION_DIRECTION.UP?r>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):r===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===oe.MENU_NAVIGATION_DIRECTION.DOWN&&r<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;r?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}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)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:I("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:r}=this.state;return t&&r.length===0?u.jsx("div",{className:"no-match",children:e}):r.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:r}=this.state,i="option-".concat(t,"-").concat(e.value);return u.jsx("button",{type:"button",className:I("aci-option-btn",{"keyboard-active":r===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultTitle:a,spellCheck:s,"data-testid":o}=this.props,{title:l,menuIsOpen:d,popperOptions:h,invalid:f}=this.state;return u.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:I("form-control",i,"aci-input",{"is-invalid":f&&!d}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:r,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o}),u.jsx(We,{ref:this.popper,options:h,className:I("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}me(oe,"propTypes",{options:m.arrayOf(m.shape({title:m.string.isRequired,value:m.string.isRequired})).isRequired,popperOptions:m.shape({}),onChange:m.func,inputPlaceholder:m.string,disabled:m.bool,className:m.string,defaultTitle:m.string,spellCheck:m.bool,onEnter:m.func,noMatchText:m.string,"data-testid":m.string});me(oe,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});me(oe,"MENU_NAVIGATION_DIRECTION",Kt);const $l=oe;function Cn(n){var{className:e="",value:t,onChange:r,spellCheck:i=!1,placeholder:a="",disabled:s=!1,delimiter:o="",id:l="","data-testid":d}=n,[h,f]=c.useState(t),[p,v]=c.useState(!1),g=c.useRef(null);c.useEffect(function(){f(t)},[t]);function b(N){return N.trim().split(o).filter(L=>L).join(`
5
+ `)}}const zo=ut,qo=Object.freeze(Object.defineProperty({__proto__:null,Log:R,LogHistory:zo,LogProxy:Ho,Logger:ks,LoggerLevel:Ls,default:R},Symbol.toStringTag,{value:"Module"}));function Wi(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Zn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Zo(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Zn(a,r,i,s,o,"next",l)}function o(l){Zn(a,r,i,s,o,"throw",l)}s(void 0)})}}var kt=R.module("useAsyncInterval");function Xo(n,e){var t=Wi(),r=c.useRef(0),i=c.useRef(0),a=c.useRef(null),s=c.useCallback(Zo(function*(){var o=Date.now();i.current+=1;var l=a.current==null?e:o-a.current;if(kt.debug("tick #".concat(i.current,"."),l,"ms elapsed since last tick."),a.current=o,yield n(),!!t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);kt.debug("Next tick target:",e,", overage",d,", adjusted:",h),r.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(kt.debug("Setting target interval:",e),a.current=null,s(),()=>{window.clearTimeout(r.current)}),[e,s])}function Jo(n,e){return c.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function ct(n,e){var t=c.useMemo(()=>Ve(n,e),[n,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function Qo(n){var[e,t]=c.useState(n);return c.useEffect(()=>{t(n)},[n]),[e,t]}function Yo(n,e,t,r){var i=c.useRef(0);c.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function zi(n,e){var t=c.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function qi(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function bn(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var el=3500,tl=R.module("useCopyToClipboard");function Zi(){var[n,e]=c.useState(!1),t=c.useRef(null),r=c.useCallback(i=>{Oo(i).then(()=>{e(!0)}).catch(a=>tl.error("Unable to copy ".concat(i),`
6
+ `,a))},[]);return c.useEffect(()=>(t.current&&clearTimeout(t.current),n&&(t.current=setTimeout(()=>{e(!1)},el)),()=>{t.current&&clearTimeout(t.current)}),[n]),[n,r]}function nl(n){n.preventDefault()}function Xi(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(Ee()),[]),t=c.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=c.useMemo(()=>({id:e,onSubmit:n?void 0:nl}),[e,n]),i=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function Ji(n,e){return c.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function Qi(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return c.useMemo(()=>{var{selection:a,isInverted:s}=Ki(r,i.length);return{selection:Vi(a,t,e),isInverted:s}},[r,i.length,t,e])}function rl(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rs,t=c.useRef();return c.useEffect(()=>()=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t)},[]),c.useCallback(r=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(r);a&&(a.addEventListener("scroll",n),t.current=()=>{a.removeEventListener("scroll",n),t.current=void 0})},[e,n])}function Xn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function il(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Xn(a,r,i,s,o,"next",l)}function o(l){Xn(a,r,i,s,o,"throw",l)}s(void 0)})}}function al(n,e,t){var r=c.useRef(null),[i,a]=c.useState(null),s=c.useCallback(il(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);c.useEffect(()=>(i==null||i.addEventListener("scroll",e),s(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,s]);var o=c.useCallback(l=>{l&&setTimeout(()=>{a(n(r.current))},0)},[n]);return{ref:r,onOpenChange:o}}function Jn(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function sl(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Jn(a,r,i,s,o,"next",l)}function o(l){Jn(a,r,i,s,o,"throw",l)}s(void 0)})}}function Xe(n,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=c.useState(null),[a,s]=c.useState(null),[o,l]=c.useState(!1),d=c.useCallback(sl(function*(){l(!0);try{var h=yield n(...e);i(h),s(null)}catch(f){i(null),s(f)}finally{l(!1)}}),[n,...e]);return c.useEffect(()=>{t&&d()},[t,d]),{data:r,error:a,isError:a!=null,isLoading:o,reload:d}}function Qn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qn(Object(t),!0).forEach(function(r){ol(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ol(n,e,t){return e=ll(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ll(n){var e=ul(n,"string");return typeof e=="symbol"?e:String(e)}function ul(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function cl(n,e,t,r){var i=arguments.length===4;return c.useCallback(a=>{var s=i?a??r:a;t(Yn(Yn({},n),{},{[e]:s}))},[t,n,e,i,r])}function Yi(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=c.useRef(),i=c.useRef(0);return c.useCallback(a=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{var s=Math.floor(a.target.scrollTop/n);i.current!==s&&(i.current=s,e(s))},t)},[t,n,e])}function vt(n,e){var[t,r]=c.useState(n);return c.useEffect(()=>{var i=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(i)}},[n,e]),t}function ea(n,e){return c.useCallback(t=>{if(t!=null){var r=e==null?[t]:t.querySelectorAll(e);r.forEach(i=>{Object.entries(n).forEach(a=>{var[s,o]=a;i.setAttribute(s,o)})})}},[n,e])}function dl(n){var e=ea(No,n);return Ji(e,Hi)}function ta(){var{getKey:n=na}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[r,i]=c.useState(()=>new Set),a=c.useCallback(g=>b=>n(b)===g,[n]),s=c.useCallback(g=>{var b;return(b=e.find(a(g)))!==null&&b!==void 0?b:null},[e,a]),o=c.useCallback(g=>{var b=s(g);if(b==null)throw new Error("No item found matching key: ".concat(g));return b},[s]),l=c.useCallback(g=>{t(b=>[...b,...g])},[]),d=c.useCallback((g,b)=>{t(w=>[...w.slice(0,g),...b,...w.slice(g)])},[]),h=c.useCallback(g=>{var b=new Set(g);t(w=>w.filter(x=>!b.has(n(x))))},[n]),f=c.useCallback((g,b)=>{var w=e.findIndex(a(g));w!==-1&&t(x=>[...x.slice(0,w),b,...x.slice(w+1)])},[e,a]),p=c.useCallback(g=>{if(g.size!==0){var b=[],w=new Map;for(var x of g.keys()){var P=e.findIndex(a(x));b.push(P),w.set(P,x)}b.sort((k,O)=>k-O);var C=[];e.forEach((k,O)=>{if(b[0]===O){var A=w.get(b.shift()),N=g.get(A);C.push(N)}else C.push(k)}),t(C)}},[e,a]),v=c.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:p,findItem:s,getItem:o,insert:d,remove:h,setItems:t,setSelectedKeys:i,update:f}),[l,p,s,o,d,e,h,t,r,f]);return v}function na(n){var e=n!=null&&typeof n=="object"&&"key"in n;if(!e)throw new Error("Item does not have a `key` prop.");return n.key}const hl=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:$o,defaultGetKey:na,extractSpectrumHTMLElement:Hi,extractSpectrumLastChildHTMLElement:Fo,findSpectrumComboBoxScrollArea:Uo,getSelectedItemCountOrAll:_o,identityExtractHTMLElement:Gi,isSelectionEqual:Ui,isSelectionMaybeInvertedEqual:Bi,mapSelection:Vi,optimizeSelection:Ki,useAsyncInterval:Xo,useCallbackWithAction:Jo,useContextOrThrow:Je,useCopyToClipboard:Zi,useDebouncedCallback:ct,useDebouncedValue:vt,useDependentState:Qo,useEffectNTimesWhen:Yo,useFormWithDetachedSubmitButton:Xi,useForwardedRef:bn,useIsEqualMemo:zi,useIsMountedRef:Wi,useMappedRef:Ji,useMappedSelection:Qi,useOnScrollOffsetChangeCallback:Yi,useOnScrollRef:rl,usePopoverOnScrollRef:al,usePrevious:qi,usePromiseFactory:Xe,usePropChangeCallback:cl,useSetAttributesCallback:ea,useSpectrumDisableSpellcheckRef:dl,useWindowedListData:ta},Symbol.toStringTag,{value:"Module"})),fl="_spectrumActionBar_tmmkp_5",pl="_spectrumDialogComponentHeading_tmmkp_9",vl="_spectrumEllipsis_tmmkp_14",yn={spectrumActionBar:fl,spectrumDialogComponentHeading:pl,spectrumEllipsis:vl};function er(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function tt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?er(Object(t),!0).forEach(function(r){ml(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):er(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ml(n,e,t){return e=gl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gl(n){var e=bl(n,"string");return typeof e=="symbol"?e:String(e)}function bl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ra(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:s,submitButtonProps:o}=Xi();return u.jsxs(ps,{children:[u.jsx(ii,{level:3,UNSAFE_className:yn.spectrumDialogComponentHeading,children:e}),u.jsx(vs,{}),u.jsx(ai,{children:u.jsx(ms,tt(tt({},s),{},{children:r}))}),u.jsxs(gs,{children:[u.jsx(Kn,{variant:"secondary",onPress:i,children:"Cancel"}),u.jsx(Kn,tt(tt({},o),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function yl(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,onConfirm:s}=n,o=c.useCallback(l=>u.jsx(ra,{heading:t,confirmationButtonLabel:r,onCancel:l,onConfirm:()=>{l(),s()},children:a}),[a,r,t,s]);return u.jsx(Fi,{ariaLabel:e,icon:li,isHidden:i,isQuiet:!0,height:Li,children:o})}var wl=["icon","label"];function tr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tr(Object(t),!0).forEach(function(r){Cl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):tr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cl(n,e,t){return e=Sl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sl(n){var e=Ol(n,"string");return typeof e=="symbol"?e:String(e)}function Ol(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function xl(n,e){if(n==null)return{};var t=El(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function El(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function ia(n){var{icon:e,label:t}=n,r=xl(n,wl);return u.jsx(ni,nr(nr({},r),{},{"aria-label":t,isQuiet:!0,height:Li,children:u.jsx(un,{children:u.jsx(X,{icon:e})})}))}ia.displayName="IconActionButton";function rr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rr(Object(t),!0).forEach(function(r){Fe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fe(n,e,t){return e=Pl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pl(n){var e=Il(n,"string");return typeof e=="symbol"?e:String(e)}function Il(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wn extends c.Component{constructor(e){super(e),Fe(this,"element",void 0),Fe(this,"container",void 0),Fe(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=M.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:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Tl({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new bs(r||a,this.element,i),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:r,interactive:i,closeOnBlur:a}=this.props,{show:s}=this.state;return u.jsx(Ne,{in:s,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:o=>{o.stopPropagation()},onKeyDown:o=>{o.key==="Escape"&&this.hide()},className:I("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&si.createPortal(this.renderContent(),this.element)})}}Fe(wn,"propTypes",{children:m.node.isRequired,options:m.shape({}),className:m.string,timeout:m.number,onEntered:m.func,onExited:m.func,isShown:m.bool,closeOnBlur:m.bool,interactive:m.bool,referenceObject:m.shape({}),"data-testid":m.string});Fe(wn,"defaultProps",{options:{},className:"",timeout:fe.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const We=wn;function ir(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ml(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ir(Object(t),!0).forEach(function(r){le(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ir(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function le(n,e,t){return e=Nl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nl(n){var e=Dl(n,"string");return typeof e=="symbol"?e:String(e)}function Dl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jl=R.module("Tooltip");class z extends c.Component{static handleHidden(){z.shownTooltipCount-=1,z.shownTooltipCount===0&&(z.lastHiddenTime=Date.now())}static handleShown(){z.shownTooltipCount+=1}constructor(e){super(e),le(this,"container",void 0),le(this,"popper",void 0),le(this,"parent",void 0),le(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=M.createRef(),this.popper=M.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:r}=t,{isShown:i}=this.state;i!==r&&(i?z.handleShown():z.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&z.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){jl.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,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var a=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&r>=s.top&&r<=s.top+s.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(z.shownTooltipCount>0||Date.now()-z.lastHiddenTime<z.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}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:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":a,onEntered:s}=this.props,{isShown:o}=this.state,{options:l}=this.props;return l=Ml({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:u.jsx(We,{className:I(i),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",o&&t]})})})}}le(z,"defaultTimeout",500);le(z,"defaultReshowTimeout",100);le(z,"triggerReshowThreshold",300);le(z,"shownTooltipCount",0);le(z,"lastHiddenTime",Date.now());le(z,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:z.defaultReshowTimeout,timeout:z.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const mt=z;function ar(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Al(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ar(Object(t),!0).forEach(function(r){me(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ar(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function me(n,e,t){return e=kl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kl(n){var e=Ll(n,"string");return typeof e=="symbol"?e:String(e)}function Ll(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Rl=100,Kt;(function(n){n.UP="UP",n.DOWN="DOWN"})(Kt||(Kt={}));class oe extends c.Component{constructor(e){super(e),me(this,"popper",void 0),me(this,"cbContainer",void 0),me(this,"menuContainer",void 0),me(this,"input",void 0),me(this,"getCachedFilteredOptions",re((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=Al({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Ve(this.updateInputValue,Rl),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=M.createRef(),this.cbContainer=M.createRef(),this.menuContainer=M.createRef(),this.input=M.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,r=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return r.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:r[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:r,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(r,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:r}=this.props;r(e,t)}processFilterChange(e){var t,{options:r}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(r,e):r,s=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),s&&i){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:r,keyboardOptionIndex:i}=this.state,a=r[i];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(oe.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:r}=this.state,i=r;e===oe.MENU_NAVIGATION_DIRECTION.UP?r>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):r===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===oe.MENU_NAVIGATION_DIRECTION.DOWN&&r<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;r?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}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)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:I("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:r}=this.state;return t&&r.length===0?u.jsx("div",{className:"no-match",children:e}):r.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:r}=this.state,i="option-".concat(t,"-").concat(e.value);return u.jsx("button",{type:"button",className:I("aci-option-btn",{"keyboard-active":r===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultTitle:a,spellCheck:s,"data-testid":o}=this.props,{title:l,menuIsOpen:d,popperOptions:h,invalid:f}=this.state;return u.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:I("form-control",i,"aci-input",{"is-invalid":f&&!d}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:r,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o}),u.jsx(We,{ref:this.popper,options:h,className:I("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}me(oe,"propTypes",{options:m.arrayOf(m.shape({title:m.string.isRequired,value:m.string.isRequired})).isRequired,popperOptions:m.shape({}),onChange:m.func,inputPlaceholder:m.string,disabled:m.bool,className:m.string,defaultTitle:m.string,spellCheck:m.bool,onEnter:m.func,noMatchText:m.string,"data-testid":m.string});me(oe,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});me(oe,"MENU_NAVIGATION_DIRECTION",Kt);const _l=oe;function Cn(n){var{className:e="",value:t,onChange:r,spellCheck:i=!1,placeholder:a="",disabled:s=!1,delimiter:o="",id:l="","data-testid":d}=n,[h,f]=c.useState(t),[p,v]=c.useState(!1),g=c.useRef(null);c.useEffect(function(){f(t)},[t]);function b(N){return N.trim().split(o).filter(L=>L).join(`
7
7
  `.concat(o.trim()))}function w(N){return N.split(`
8
- `).map(L=>L.trim()).join(" ")}function x(){if(g.current){g.current.style.height="0";var N=g.current.scrollHeight+(g.current.offsetHeight-g.current.clientHeight);N>0&&(g.current.style.height="".concat(N,"px"))}}function P(N){var L=N.target.value;p&&(o&&(L=b(L)),v(!1)),f(L),r(L)}function C(){g.current&&(o&&(f(b(h)),x()),g.current.scrollLeft=0)}function k(){g.current&&document.activeElement!==g.current&&g.current.focus()}function O(){o&&(f(w(h)),r(w(h)))}function A(){v(!0)}return c.useEffect(function(){x()},[h]),u.jsx("textarea",{ref:g,id:l,className:I(e,"auto-resize-textarea form-control"),placeholder:a,value:h,rows:1,onChange:P,onFocus:C,onMouseDown:k,onBlur:O,onPaste:A,spellCheck:i,disabled:s,"data-testid":d})}Cn.propTypes={value:m.string.isRequired,onChange:m.func.isRequired,className:m.string,placeholder:m.string,spellCheck:m.bool,disabled:m.bool,delimiter:m.string,id:m.string,"data-testid":m.string};Cn.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function Ye(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:I("btn-group",t),style:r,role:"group","data-testid":i,children:e})}Ye.displayName="ButtonGroup";Ye.propTypes={children:m.node.isRequired,className:m.string,style:m.object,"data-testid":m.string};Ye.defaultProps={className:null,style:{},"data-testid":void 0};var Fl=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function sr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function or(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sr(Object(t),!0).forEach(function(r){Ul(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ul(n,e,t){return e=Vl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vl(n){var e=Bl(n,"string");return typeof e=="symbol"?e:String(e)}function Bl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Kl(n,e){if(n==null)return{};var t=Hl(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Hl(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var Gl=["primary","secondary","tertiary","success","danger","inline","ghost"],Wl=["group-end"];function zl(n,e){switch(n){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 I("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function ql(n){switch(n){case"group-end":return I("pl-2","pr-3")}}var gt=M.forwardRef((n,e)=>{var{kind:t,variant:r,type:i,tooltip:a,icon:s,disabled:o=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:f,onMouseUp:p,onMouseEnter:v,onMouseLeave:g,onKeyDown:b,className:w,style:x,children:P,tabIndex:C,"data-testid":k,"aria-label":O}=n,A=Kl(n,Fl),N=!!(s&&P==null),L=zl(t,N),W;r&&(W=ql(r));var S;s&&(S=M.isValidElement(s)?s:u.jsx(X,{icon:s}));var D;a!==void 0&&(D=typeof a=="string"?u.jsx(mt,{children:a}):a);var F=O;O===void 0&&N&&a!=null&&typeof a=="string"&&(F=a);var T=u.jsxs("button",or(or({"data-testid":k,ref:e,type:i,className:I("btn",L,W,{active:l},w),onClick:d,onContextMenu:h,onMouseUp:p,onMouseDown:f,onMouseEnter:v,onMouseLeave:g,onKeyDown:b,style:x,disabled:o,tabIndex:C,"aria-label":F},A),{},{children:[s&&S,P,a!=null&&!o&&D]}));return o?u.jsxs("span",{className:"btn-disabled-wrapper",children:[T,a!==void 0&&D]}):T});gt.displayName="Button";gt.propTypes={kind:m.oneOf(Gl).isRequired,variant:m.oneOf(Wl),type:m.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:r}=n;return e===void 0&&t!=null&&r==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!M.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:m.bool,active:m.bool,onClick(n){var{onClick:e,type:t}=n;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:m.func,onMouseUp:m.func,onMouseDown:m.func,onMouseEnter:m.func,onMouseLeave:m.func,onKeyDown:m.func,tabIndex:m.number,children:m.node,className:m.string,style:m.object,"data-testid":m.string};gt.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 ie=gt;function Zl(n){var{blockInteraction:e=!0,children:t,debounceMs:r,isOpen:i=!1}=n,a=vt(i,r);return u.jsxs(u.Fragment,{children:[e&&i&&u.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),M.cloneElement(t,{isOpen:i&&a})]})}function Xl(n){var{className:e,icon:t,isOpen:r=!1,subtitle:i,title:a}=n;return u.jsx(dn,{isOpen:r,className:e,children:u.jsx(hn,{children:u.jsxs("div",{className:"info-modal",children:[t!=null&&u.jsx("div",{className:"message-icon",children:u.jsx(X,{icon:t})}),u.jsx("div",{className:"message-header",children:a}),i!=null&&u.jsx("div",{className:"message-content",children:i})]})})})}function sa(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return u.jsx("div",{className:e,"data-testid":r,children:t})}function Sn(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:a,onDiscard:s,onModalDisable:o,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:f=!1,children:p,"data-testid":v}=n,g=c.useRef(null),b=c.useRef(null),w=c.useCallback(()=>{b.current!==null&&b.current.checked&&o&&o(),a()},[a,o]),x=c.useCallback(()=>{var C;(C=g.current)===null||C===void 0||C.focus()},[]),P="";return e&&(P=typeof r=="function"?r():r),u.jsxs(dn,{isOpen:e,className:"theme-bg-light",onOpened:x,children:[u.jsx(ci,{closeButton:!1,children:t}),u.jsx(hn,{children:P}),u.jsxs(sa,{children:[o&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:b,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(ie,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(ie,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs(Ye,{children:[u.jsx(ie,{kind:f?"danger":"primary",onClick:w,ref:g,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),p]})]})]})}Sn.propTypes={isOpen:m.bool.isRequired,headerText:m.string.isRequired,bodyText:m.oneOfType([m.string,m.func]).isRequired,onCancel:m.func,onConfirm:m.func.isRequired,onDiscard:m.func,onModalDisable:m.func,cancelButtonText:m.string,confirmButtonText:m.string,discardButtonText:m.string,children:m.node,"data-testid":m.string};Sn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var bt=M.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,onClick:a,style:s,id:o}=n;return u.jsx("button",{ref:e,type:"button",className:I("btn",r),onClick:a,style:s,disabled:i,id:o,children:t})});bt.displayName="Button";bt.propTypes={children:m.node,className:m.string,disabled:m.bool,onClick:m.func,style:m.shape({}),id:m.string};bt.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Jl=bt;function lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ur(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lr(Object(t),!0).forEach(function(r){Ql(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ql(n,e,t){return e=Yl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yl(n){var e=eu(n,"string");return typeof e=="symbol"?e:String(e)}function eu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function tu(n){var{styleProps:e,selectedItemCount:t,onClearSelection:r}=n;return u.jsx(ws,ur(ur({UNSAFE_className:yn.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:r}))}function nu(n){var{className:e,isFlipped:t,children:r,"data-testid":i}=n,a=d=>{if(r.length!==2)throw new Error("CardFlip requires 2 children to function");return r[d]},s=c.useRef(null),o=c.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=c.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return c.useEffect(function(){if(!s.current)throw Error("ref undefined");s.current.addEventListener("transitionstart",o);var h=s.current;return function(){if(h!=null)return h.removeEventListener("transitionstart",o)}},[o]),u.jsxs("div",{className:I(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[u.jsx("div",{className:"card-flip--back",children:a(0)}),u.jsx("div",{ref:s,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}var cr=R.module("GlobalContextAction");class ru extends c.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:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),cr.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!Q.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;cr.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const iu=ru;class au extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var a=e[i],{shortcut:s}=a;if(a.title!=null||a.menuElement||s){var o=u.jsx(iu,{action:a,"data-testid":t},"".concat(a.title,".").concat(s==null?void 0:s.id));r.push(o)}}return r}}const su=au;function oa(n,e,t){return e=ou(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ou(n){var e=lu(n,"string");return typeof e=="symbol"?e:String(e)}function lu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var nt=R.module("ContextActions");class la extends c.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var a=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}}constructor(e){super(e),oa(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=M.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!At(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!At(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}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 r=e.target,i=function(){var{classList:d}=r,h=t.find(f=>d.contains(f));if(h!==void 0)return nt.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement};r!=null;){var a=i();if(typeof a=="object")return a.v}if(Q.isContextActionEvent(e)||(e.contextActions=[]),!!Q.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var o=s;Array.isArray(o)&&(o=o.filter(l=>At(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(o)}nt.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!Q.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var a;nt.debug("Context hotkey matched!",e),(a=i.action)===null||a===void 0||a.call(i,e),e.stopPropagation(),e.preventDefault(),nt.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(su,{actions:t})})}}oa(la,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const uu=la;function ua(n,e,t){return e=cu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cu(n){var e=du(n,"string");return typeof e=="symbol"?e:String(e)}function du(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ce extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(ce.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(ce.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:r}=this.props;if(r!==void 0&&r){var i=t.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:t,in:r,"data-testid":i}=this.props;return u.jsx(Ne,{in:r,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:ce.handleEnter,onEntering:ce.handleEntering,onEntered:this.handleEntered,onExit:ce.handleExit,onExiting:ce.handleExiting,timeout:350,children:a=>u.jsx("div",{className:I({collapse:a==="exited"},t),"data-testid":i,children:e})})}}ua(ce,"propTypes",{className:m.string,in:m.bool.isRequired,children:m.node.isRequired,autoFocusOnShow:m.bool,"data-testid":m.string});ua(ce,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const hu=ce;var yt=M.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:a,inputClassName:s,isInvalid:o,labelClassName:l,name:d,onChange:h,"data-testid":f}=n,[p]=c.useState(Ee()),v=bn(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var g=c.useCallback(b=>{v.current&&(v.current.indeterminate=t===null),h&&h(b)},[v,t,h]);return u.jsxs("div",{className:I("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:I("custom-control-input",s,{"is-invalid":o}),disabled:a,id:p,name:d,onChange:g,"data-testid":f}),u.jsx("label",{className:I("custom-control-label",l),htmlFor:p,children:r})]})});yt.displayName="Checkbox";yt.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:m.node.isRequired,className:m.string,disabled:m.bool,inputClassName:m.string,isInvalid:m.bool,labelClassName:m.string,name:m.string,onChange:m.func,"data-testid":m.string};yt.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const dt=yt;function ca(n,e,t){return e=fu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fu(n){var e=pu(n,"string");return typeof e=="symbol"?e:String(e)}function pu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class da extends c.PureComponent{constructor(e){super(e),ca(this,"inputField",void 0),this.inputField=M.createRef()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:a,disabled:s,matchCount:o,id:l,onKeyDown:d,"data-testid":h}=this.props;return u.jsxs("div",{className:I("search-group",a),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:s,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),o!=null&&u.jsx("span",{className:"search-match",children:o}),u.jsx("span",{className:"search-icon",children:u.jsx(X,{icon:$s})})]})}}ca(da,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0});const wt=da;function dr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dr(Object(t),!0).forEach(function(r){te(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function te(n,e,t){return e=mu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mu(n){var e=gu(n,"string");return typeof e=="symbol"?e:String(e)}function gu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ht;(function(n){n.UP="UP",n.DOWN="DOWN"})(Ht||(Ht={}));class de extends c.Component{constructor(e){super(e),te(this,"popper",void 0),te(this,"cbContainer",void 0),te(this,"toggleButton",void 0),te(this,"menuContainer",void 0),te(this,"input",void 0),te(this,"searchInput",void 0),te(this,"getCachedFilteredOptions",re((t,r)=>t.filter(i=>i.title.toLowerCase().indexOf(r.toLowerCase())>=0||i.value.toLowerCase().indexOf(r.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=M.createRef(),this.cbContainer=M.createRef(),this.toggleButton=M.createRef(),this.menuContainer=M.createRef(),this.input=M.createRef(),this.searchInput=M.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,r,{filter:i,filteredOptions:a,keyboardOptionIndex:s}=this.state,{options:o}=this.props,l=i?a: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(),(r=this.input.current)===null||r===void 0||r.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(de.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(de.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":i!==""?(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:r,keyboardOptionIndex:i}=this.state,{options:a}=this.props,s=t?r:a,o=s.length,l=0;switch(e){case de.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case de.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(i+l+o)%o})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?r||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,r=Number(e.currentTarget.value),{filter:i,filteredOptions:a}=this.state,{options:s}=this.props,o=i?a:s;this.updateInputValue(o[r].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:r}=this.props,i=e.target.value,a=this.getCachedFilteredOptions(r,i);this.setState({filter:i,filteredOptions:a,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 r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:r}=this.state,{options:i}=this.props,a=t?r:i,s=a.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:r}=this.state;return u.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:r},onBlur:this.handleMenuBlur,children:[u.jsx("div",{className:"cb-search-input-container",children:u.jsx(wt,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u.jsx("div",{className:"cb-options-container",children:u.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:r,filteredOptions:i}=this.state,a=r?i:e;return a.map((s,o)=>{var l="option-".concat(o,"-").concat(s.value);return u.jsx("button",{type:"button",value:o,className:I("cb-option-btn",{"keyboard-active":t===o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:s.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultValue:a,spellCheck:s,"data-testid":o}=this.props,{value:l}=this.state,{popperOptions:d}=this.props;return d=vu({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},d),u.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:I("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:r,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o!==void 0?"".concat(o,"-input"):void 0}),u.jsx("div",{className:"input-group-append cb-dropdown",children:u.jsxs("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:r,"data-testid":o!==void 0?"".concat(o,"-btn"):void 0,children:[u.jsx(X,{icon:Fs}),u.jsx(We,{ref:this.popper,options:d,className:I("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}te(de,"MENU_NAVIGATION_DIRECTION",Ht);te(de,"DROP_DOWN_MENU_HEIGHT",200);te(de,"propTypes",{options:m.arrayOf(m.shape({title:m.string.isRequired,value:m.string.isRequired})).isRequired,popperOptions:m.shape({title:m.string.isRequired,value:m.string.isRequired}),onChange:m.func,inputPlaceholder:m.string,searchPlaceholder:m.string,disabled:m.bool,className:m.string,defaultValue:m.string,spellCheck:m.bool,onEnter:m.func,"data-testid":m.string});te(de,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const bu=de;function yu(n){var{copy:e,kind:t="ghost",tooltip:r="Copy",className:i,"data-testid":a,children:s}=n,[o,l]=Xi();return u.jsx(ie,{kind:t,className:i,"data-testid":a,icon:o?Us:Vs,tooltip:o?"Copied":r,onClick:()=>{l(typeof e=="function"?e():e)},children:s})}function Ct(n,e,t){return n.substring(0,e)+t+n.substring(e+1)}function ha(n,e,t){return n.length<t?"".concat(n).concat(e.substring(n.length,t)):n}function Gt(n,e){for(var{length:t}=n,r=n.length-1;r>=0&&e[r]===n[r];r-=1)t=r;return n.substring(0,t)}function hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function wu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hr(Object(t),!0).forEach(function(r){Cu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cu(n,e,t){return e=Su(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Su(n){var e=Ou(n,"string");return typeof e=="symbol"?e:String(e)}function Ou(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var se=R.module("MaskedInput"),Ae={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},rt=" ",fa=M.forwardRef((n,e)=>{var{className:t,example:r,getNextSegmentValue:i=(T,E,y)=>y,getPreferredReplacementString:a=Ct,onChange:s=()=>!1,onSelect:o=()=>!1,onSubmit:l,pattern:d,placeholder:h,selection:f,value:p,onFocus:v=()=>!1,onBlur:g=()=>!1,"data-testid":b}=n,w=bn(e),x=c.useMemo(()=>Array.isArray(r)?r:[r],[r]),P=c.useMemo(()=>x[0].replace(/[a-zA-Z0-9]/g,rt),[x]);c.useEffect(function(){if(f!=null){var E;se.debug("setting selection...",f);var{selectionStart:y,selectionEnd:j,selectionDirection:_}=f;(E=w.current)===null||E===void 0||E.setSelectionRange(y,j,_),se.debug("selection set!")}},[f,w]);var C=c.useCallback(T=>{for(var E=T,y=T,j=x.length>0?x[0]:p,_=E-1;_>=0&&/[a-zA-Z0-9]/g.test(j.charAt(_));_-=1)E=_;for(var K=y;K<j.length&&/[a-zA-Z0-9]/g.test(j.charAt(K));K+=1)y=K+1;var ae=E===y?Ae.NONE:Ae.BACKWARD;return{selectionStart:E,selectionEnd:y,selectionDirection:ae}},[x,p]);function k(T,E){for(var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T.length,j="",_=0;_<y;_+=1)T.charAt(_)!==rt?j=j.concat(T[_]):j=j.concat(E[_]);return j=j.concat(E.substring(y)),j}function O(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.length,y=new RegExp("^".concat(d,"$"));if(y.test(T))return!0;for(var j=0;j<x.length;j+=1){var _=k(T,x[j],E);if(y.test(_))return!0}return!1}function A(T){var E=C(T),y=E.selectionEnd+1;return y>=p.length?E:C(y)}function N(T){var E=C(T),y=E.selectionStart-1;return y<=0?E:C(y)}function L(T,E){var y=C(T),j=p.substring(y.selectionStart,y.selectionEnd),_=i(y,E,j,p),K=p.substring(0,y.selectionStart)+_+p.substring(y.selectionEnd);O(K,y.selectionEnd)&&(s(K),o(y))}var W=c.useCallback(T=>{var{selectionStart:E=0,selectionEnd:y=0,selectionDirection:j="none"}=T.target;if(E===null||y===null||j===null){se.error("Selection attempted on non-text input element",T.target);return}if(se.debug2("handleSelect",E,y,j),!(f!=null&&E===f.selectionStart&&y===f.selectionEnd)){if(f!=null&&E===p.length&&y===p.length&&T.nativeEvent.type!=="mouseup"){o(wu({},f));return}if(E===y){var _=C(E);se.debug("Selection segment from ",E,y,"=>",_),o(_)}else o({selectionStart:E,selectionEnd:y,selectionDirection:j})}},[C,o,f,p]),S=c.useCallback(T=>{var E;if(w.current){se.debug("handleSelectCapture",T);var y=(E=w.current.selectionStart)!==null&&E!==void 0?E:0;y===p.length&&f!=null&&y!==f.selectionStart&&(T.preventDefault(),T.stopPropagation())}},[w,f,p]);function D(T){if(T.preventDefault(),T.stopPropagation(),!!w.current){var{key:E}=T,{selectionStart:y=0,selectionEnd:j=0}=w.current;if(y===null||j===null){se.error("Selection arrow nvaigation attempted on non-text input element",T.target);return}E==="ArrowLeft"?o(N(y)):E==="ArrowRight"?o(A(j)):E==="ArrowUp"?L(y,-1):E==="ArrowDown"&&L(y,1)}}function F(T){if(w.current){se.debug("handleKeyDown",T);var{key:E}=T,{selectionStart:y=0,selectionEnd:j=0}=w.current;if(y===null||j===null){se.error("Selection key event on non-text input element",T.target);return}if(E==="Enter"){l==null||l(T);return}if(E.startsWith("Arrow")){D(T);return}if(E==="Delete"||E==="Backspace"){if(T.preventDefault(),T.stopPropagation(),j>=Gt(p,P).length){var _=p.substring(0,y===j?y-1:y),K=Gt(_,P);K!==p&&(s(K),o({selectionStart:K.length,selectionEnd:K.length,selectionDirection:Ae.NONE}));return}if(y!==j){var ae=p.substring(0,y)+p.substring(y,j).replace(/[a-zA-Z0-9]/g,rt)+p.substring(j);se.debug("Range ",y,j,"deleted, setting value",ae),s(ae),o({selectionStart:y,selectionEnd:y,selectionDirection:Ae.NONE})}else if(y>0)for(var U=y-1;U>=0;U-=1){var B=p.substring(0,U)+p.substring(U,y).replace(/[a-zA-Z0-9]/g,rt)+p.substring(y);if(B!==p){s(B),o({selectionStart:U,selectionEnd:U,selectionDirection:Ae.NONE});return}}return}if(!(T.altKey||T.metaKey||T.ctrlKey||E.length>1)){T.preventDefault(),T.stopPropagation();for(var V=Array.from(new Set([E,E.toUpperCase(),E.toLowerCase()])),Z=0;Z<V.length;Z+=1)for(var be=V[Z],et=/[a-zA-Z0-9]/g.test(be)?x[0].length-1:y,ye=y;ye<=et;ye+=1){var fs=ha(p,x[0],ye+1),Nt=a(fs,ye,be,y,j);if(O(Nt,ye+1)){var Vn=C(ye),Dt=ye+1,jt={selectionStart:Dt,selectionEnd:Dt,selectionDirection:Ae.NONE};if(Dt>=Vn.selectionEnd){var Bn=A(ye);Bn.selectionStart!==Vn.selectionStart&&(jt=Bn)}se.debug("handleKeyDown",E,"=>",Nt,jt),s(Nt),o(jt);return}}}}}return u.jsx("input",{ref:w,className:I("form-control masked-input",t),type:"text",pattern:d,placeholder:h,value:p,onChange:()=>{},onKeyDown:F,onSelect:W,onSelectCapture:S,onFocus:v,onBlur:g,"data-testid":b})});fa.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(n,e,t)=>t,getPreferredReplacementString:Ct,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const St=fa;var xu=R.module("TimeInput"),Eu="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Tu=["00:00:00","12:34:56","23:59:59"],pa=M.forwardRef((n,e)=>{var{allowValueWrapping:t=!0,className:r="",onChange:i=()=>!1,value:a=0,onFocus:s=()=>!1,onBlur:o=()=>!1,onSelect:l=()=>!1,"data-testid":d}=n,[h,f]=c.useState(qe.formatTime(a)),[p,v]=c.useState(),g=c.useRef(null);c.useImperativeHandle(e,()=>({focus:()=>{var C;(C=g.current)===null||C===void 0||C.focus()},setSelection:C=>{var k;(k=g.current)===null||k===void 0||k.focus(),v(C)}}),[]),c.useEffect(function(){f(qe.formatTime(a))},[a]);function b(C,k,O){var A=C.selectionStart===0?24:60,N=parseInt(O,10)-k;return Number.isNaN(N)?N=0:t?N=(N%A+A)%A:N=Math.min(Math.max(0,N),A-1),"".concat(N).padStart(2,"0")}function w(C,k,O,A,N){return A===0&&N===2&&k===1&&parseInt(O,10)>1?"0".concat(O).concat(C.substring(2)):Ct(C,k,O)}function x(C){xu.debug("handleChange",C),f(C),qe.isTimeString(C)&&i(qe.parseTime(C))}var P=c.useCallback(C=>{v(C),l(C)},[l]);return u.jsx(St,{ref:g,className:r,example:Tu,getNextSegmentValue:b,getPreferredReplacementString:w,onChange:x,onSelect:P,pattern:Eu,selection:p,value:h,onFocus:s,onBlur:o,"data-testid":d})});pa.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const ht=pa;function fr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Pu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fr(Object(t),!0).forEach(function(r){Ze(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):fr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ze(n,e,t){return e=Iu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Iu(n){var e=Mu(n,"string");return typeof e=="symbol"?e:String(e)}function Mu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let va=class extends c.PureComponent{constructor(e){var t;super(e),Ze(this,"container",void 0),Ze(this,"oldFocus",void 0),Ze(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=M.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,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=Q.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:Q.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var a;i=Q.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;i=Q.getNextMenuItem((s=i)!==null&&s!==void 0?s:0,1,t)}r!==i&&(i!==null?this.setKeyboardIndex(i):(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:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(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,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:a}=this.state,s=0;s<i.length;s+=1){var o=i[s];s>0&&o.group!==i[s-1].group&&e.push(u.jsx("hr",{},"".concat(s,".separator")));var l=u.jsx(Si,{isKeyboardSelected:r===s,isMouseSelected:a===s,menuItem:o,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:Pu({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};Ze(va,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const Nu=va;function pr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pr(Object(t),!0).forEach(function(r){Re(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Re(n,e,t){return e=Du(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Du(n){var e=ju(n,"string");return typeof e=="symbol"?e:String(e)}function ju(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ma extends c.PureComponent{constructor(e){super(e),Re(this,"container",void 0),Re(this,"parent",void 0),Re(this,"popper",void 0),Re(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=M.createRef(),this.parent=null,this.popper=M.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:r,"data-testid":i}=this.props,{menuStyle:a}=this.props,{options:s,popperOptions:o}=this.props;return o=vr({placement:"bottom"},o),s=vr({separateKeyboardMouse:!0},s),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(We,{ref:this.popper,options:o,className:I("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Nu,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:a})})})}}Re(ma,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const ga=ma;function mr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Au(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mr(Object(t),!0).forEach(function(r){xe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xe(n,e,t){return e=ku(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ku(n){var e=Lu(n,"string");return typeof e=="symbol"?e:String(e)}function Lu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var gr=-1,Wt;(function(n){n.UP="UP",n.DOWN="DOWN"})(Wt||(Wt={}));class Y extends c.Component{constructor(e){super(e),xe(this,"csContainer",void 0),xe(this,"menuContainer",void 0),xe(this,"button",void 0),xe(this,"input",void 0);var{value:t,valueToTime:r}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=M.createRef(),this.menuContainer=M.createRef(),this.button=M.createRef(),this.input=M.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:r(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:r}=this.props,{customTime:i}=this.state;if(t===null)return r;for(var a=0;a<e.length;a+=1){var s=e[a];if(s.value===t)return s.title}return qe.formatTime(i)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:r,inputFocused:i}=this.state,{options:a}=this.props;switch(e.key){case"Enter":case" ":i?this.updateFromCustom():this.updateInputValue(a[r].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:r}=this.state,{options:i}=this.props,a=i.length,s=t;switch(e){case Y.MENU_NAVIGATION_DIRECTION.UP:if(!r&&t===0){this.focusInput();break}else r&&this.focusOption(t);t>0&&!r?(s=(s-1)%a,this.setState({keyboardOptionIndex:s})):t===0&&(s=a-1,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break;case Y.MENU_NAVIGATION_DIRECTION.DOWN:if(!r&&t===a-1){this.focusInput();break}else r&&this.focusOption(t);t<a&&!(r&&t===0)&&(s=(s+1)%a,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:r,timeToValue:i}=this.props,{customTime:a}=this.state;if(t===gr){var s=i(a);this.updateAndClose(s)}else this.updateAndClose(r[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:r}=this.props,{keyboardOptionIndex:i}=this.state;this.scrollOptionIntoView(i);var a=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(a instanceof HTMLElement&&a.focus(),r!==null){var s=t.map(o=>o.value).indexOf(r);s<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,r=t(e);this.updateInputValue(r),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,r=e(t);this.updateInputValue(r)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var r=e.map(i=>i.value).indexOf(t);r>0&&this.setState({keyboardOptionIndex:r})}}scrollOptionIntoView(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.offsetTop>Y.DROP_DOWN_MENU_HEIGHT?r.scrollTop=i.offsetTop-Y.DROP_DOWN_MENU_HEIGHT:(i instanceof HTMLElement&&i.offsetTop<0||e===0)&&(r.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u.jsx("div",{className:"cs-options-container",children:u.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:r,customText:i}=this.props,{keyboardOptionIndex:a,customTime:s,inputFocused:o}=this.state,l=!1,d=[],h=0;h<e.length;h+=1){var f=e[h],p="option-".concat(h,"-").concat(f.value);l=l||f.value===t,d.push(u.jsxs("button",{type:"button",value:h,className:I("cs-option-btn",{"keyboard-active":a===h&&!o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[f.value===t&&u.jsx(X,{icon:r,className:"mr-2"}),f.value!==t&&u.jsx("span",{className:"mr-4"}),f.title]},p))}return d.push(u.jsx("hr",{className:"cs-divider"},"option-divider")),d.push(u.jsxs("button",{type:"button",value:gr,className:I("cs-option-btn",{"keyboard-active":o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u.jsx(X,{icon:r,className:"mr-2"}):u.jsx("span",{className:"mr-4"}),i]},"option-custom-label")),d.push(u.jsxs("div",{className:"cs-custom-container",children:[u.jsx("span",{className:"mr-2"}),u.jsx(ht,{ref:this.input,onChange:this.handleCustomInput,value:s,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u.jsx("span",{className:"ml-2"})]},"cs-custom-container")),d.push(u.jsx("hr",{className:"mb-2"},"option-end")),d}render(){var{disabled:e,invalid:t,value:r,"data-testid":i}=this.props,{menuIsOpen:a}=this.state,{popperOptions:s}=this.props;return s=Au({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},s),u.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":i,children:u.jsx("div",{className:I("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:u.jsxs("button",{type:"button",className:I("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u.jsx("span",{className:I({"text-muted":r===null}),children:this.getSelectedText()}),u.jsx("span",{children:u.jsx(X,{icon:di,className:"cs-caret"})}),u.jsx(ga,{isShown:a,actions:{menuElement:this.renderMenuElement()},popperOptions:s,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}xe(Y,"MENU_NAVIGATION_DIRECTION",Wt);xe(Y,"DROP_DOWN_MENU_HEIGHT",125);xe(Y,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:Bs,customText:"Custom",placeholder:"Select a time",valueToTime:n=>n===null?0:Math.round(n/1e3),timeToValue:n=>n*1e3,invalid:!1,"data-testid":void 0});const Ru=Y;function ke(n,e,t,r,i){var a=r-t+1,s=((parseInt(e,10)-n-t)%a+a)%a+t;return"".concat(s).padStart(i,"0")}function ba(n,e,t){var{selectionStart:r}=n;return r===0?ke(e,t,1900,2099,4):r===5?ke(e,t,1,12,2):r===8?ke(e,t,1,31,2):r===11?ke(e,t,0,23,2):r===17||r===14?ke(e,t,0,59,2):r===20||r===24||r===28?ke(e,t,0,999,3):t}function zt(n){var e=n.substring(0,23),t=n.substring(23,26),r=n.substring(26);return[e,t,r].filter(i=>i!=="").join("​")}var _u=R.module("DateTimeInput"),$u="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Fu="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}​[0-9]{3}​[0-9]{3}",Uu="".concat($u," ").concat(Fu),ot="2022-01-01",ya="".concat(ot," 00:00:00.000000000"),Vu="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function br(n){return n!=null&&n.length>=ot.length?"".concat(n.substring(0,ot.length)).concat(n.substring(ot.length).replace(/\u2007/g,"0")).concat(ya.substring(n.length)):n}function yr(n){return n.replace(/\u200B/g,"")}var Bu=[zt(ya)],On=M.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:s=()=>{},onSubmit:o,"data-testid":l}=n,[d,h]=c.useState(i.length>0?zt(i):""),[f,p]=c.useState(),v=c.useCallback(b=>{_u.debug("handleChange",b),h(b),r(br(yr(b)))},[r]),g=c.useCallback(()=>{var b=yr(d),w=br(b);w!==b&&h(zt(w)),s()},[d,s]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(St,{ref:e,className:I(t),example:Bu,getNextSegmentValue:ba,onChange:v,onSelect:p,onSubmit:o,pattern:Uu,placeholder:Vu,selection:f,value:d,onFocus:a,onBlur:g,"data-testid":l})})});On.displayName="DateTimeInput";On.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const Ku=On;var Hu=R.module("DateInput"),Gu="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Wu=["2000-01-01","2022-12-31"],zu="YYYY-MM-DD",xn=M.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:s=()=>{},"data-testid":o}=n,[l,d]=c.useState(i),[h,f]=c.useState(),p=c.useCallback(v=>{Hu.debug("handleChange",v),d(v),r(v)},[r]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(St,{ref:e,className:I(t),example:Wu,getNextSegmentValue:ba,onChange:p,onSelect:f,pattern:Gu,placeholder:zu,selection:h,value:l,onFocus:a,onBlur:s,"data-testid":o})})});xn.displayName="DateInput";xn.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const qu=xn;function wa(n,e,t){return e=Zu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zu(n){var e=Xu(n,"string");return typeof e=="symbol"?e:String(e)}function Xu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ca extends c.PureComponent{constructor(e){super(e),wa(this,"searchInput",void 0),this.searchInput=M.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Be(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":a}=this.props,{value:s}=this.state;return u.jsx(wt,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}wa(Ca,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Ju=Ca;function Sa(n,e,t){return e=Qu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qu(n){var e=Yu(n,"string");return typeof e=="symbol"?e:String(e)}function Yu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ec=R.module("ItemListItem");class Ot extends c.Component{static handleKeyDown(){return ec.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Sa(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=M.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:a,"data-testid":s}=this.props;return u.jsx("div",{className:I("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:Ot.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:a})}}Sa(Ot,"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 Oa=Ot;function wr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Cr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wr(Object(t),!0).forEach(function(r){ne(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ne(n,e,t){return e=tc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tc(n){var e=nc(n,"string");return typeof e=="symbol"?e:String(e)}function nc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sr=R.module("ItemList"),Or=5;class J extends c.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),ne(this,"list",void 0),ne(this,"listContainer",void 0),ne(this,"getItemSelected",re((i,a)=>ue.isSelected(a,i),{max:J.CACHE_SIZE})),ne(this,"getCachedItem",re((i,a,s,o,l,d,h,f)=>{var p=d({item:s,itemIndex:i,isFocused:o,isSelected:l,style:h});return u.jsx(Oa,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:f,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:o,isSelected:l,itemIndex:i,style:h,children:p},a)},{max:J.CACHE_SIZE})),ne(this,"getOuterElement",re(i=>{var a=M.forwardRef((s,o)=>u.jsx("div",Cr({ref:o,tabIndex:-1,onKeyDown:i,role:"presentation"},s)));return a.displayName="ItemListOuterElement",a})),ne(this,"getInnerElement",re(()=>{var i=M.forwardRef((a,s)=>u.jsx("div",Cr({className:"item-list-inner-element",ref:s},a)));return i.displayName="ItemListInnerElement",i})),ne(this,"getItemData",re((i,a,s)=>({items:i,selectedRanges:a,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=M.createRef(),this.listContainer=M.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:a,isStuckToBottom:s,scrollOffset:o,height:l,selectedRanges:d}=this.state;if(s&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(o!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(a!==t.focusIndex){var{onFocusChange:f}=this.props;f(a)}}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:r}=this.state,i=this.listContainer.current.querySelectorAll(t),a=e-r;return i[a]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=ue.isSelected(r,e),a=i||Q.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(a=>{var{selectedRanges:s}=a;return{selectedRanges:ue.selectRange(s,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.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){Sr.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){Sr.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:a}=this.props,{mouseDownIndex:s,selectedRanges:o,mouseX:l,mouseY:d}=this.state;if(!(s==null||a)){var h=Math.abs(t.clientX-(l??0)),f=Math.abs(t.clientY-(d??0));h>Or&&f>Or&&this.setState({isDragging:!0}),(r||s===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,o)&&!Q.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,Q.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:a}=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,d=Q.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&a(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:r,onSelect:i}=this.props,{focusIndex:a}=this.state,s=a;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&i(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=r-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,r-1):s=0;else return;if(a!==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 d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:a}=this.props,{height:s}=i,o=a&&this.isListAtBottom({scrollOffset:r,height:s});return{isStuckToBottom:o,scrollOffset:r}})}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,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:a}=this.props,{selectedRanges:s}=this.state;if(a&&t&&s.length>0){var o=s[s.length-1];this.selectRange([Math.min(o[0],e),Math.max(e,o[1])])}else a&&s.length===1&&s[0][0]===e&&s[0][1]===e?i&&this.deselectItem(e):a&&r?this.getItemSelected(e,s)?i&&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){ue.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ue.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){ue.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ue.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,a=Math.floor(e/i),s=a+Math.ceil(t/i);r(a,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:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:a,renderItem:s,disableSelect:o}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<a||t>=a+i.length)return null;var h=i[t-a];return this.getCachedItem(t,t,h,t===l&&!o,this.getItemSelected(t,d),s,r,o)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:a,"data-testid":s}=this.props,{selectedRanges:o,isStuckToBottom:l}=this.state;return u.jsx(Cs,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:f}=d;return u.jsx(Ss,{className:"item-list-scroll-pane",height:f,width:h,initialScrollOffset:l?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,o,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":s,children:this.renderInnerElement})}})}}ne(J,"CACHE_SIZE",1e3);ne(J,"DEFAULT_ROW_HEIGHT",20);ne(J,"DEFAULT_OVERSCAN",10);ne(J,"defaultProps",{offset:0,items:[],rowHeight:J.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:J.DEFAULT_OVERSCAN,renderItem:J.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function xr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ce(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(t),!0).forEach(function(r){Me(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Me(n,e,t){return e=rc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rc(n){var e=ic(n,"string");return typeof e=="symbol"?e:String(e)}function ic(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class he extends c.PureComponent{static renderHandle(){return u.jsxs("div",{children:[u.jsx(mt,{children:"Drag to re-order"}),u.jsx(X,{icon:Ks})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?u.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:r="",className:i=""}=e;return u.jsxs("div",{className:I("item-list-item-content","draggable-item-list-item-content",i),children:[u.jsx("span",{className:"title",children:t}),he.renderBadge({text:r}),he.renderHandle()]})}static renderItem(e){var t,r,{item:i,isClone:a,selectedCount:s}=e,o=i!=null?(t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i):"",l=a!==void 0&&a?"".concat(s):"",d=a!==void 0&&a?"item-list-item-clone":"";return he.renderTextItem({text:o,badgeText:l,className:d})}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),Me(this,"itemList",void 0),Me(this,"getCachedDraggableItem",re((t,r,i,a,s,o,l,d)=>u.jsx(Os,{draggableId:he.getDraggableId(t,a),index:a,isDragDisabled:l,children:h=>u.jsx("div",Ce(Ce(Ce({role:"menuitem",className:"draggable-item-list-item",ref:h.innerRef,tabIndex:-1},h.draggableProps),h.dragHandleProps),{},{children:r({item:i,itemIndex:a,isFocused:s,isSelected:o,style:d,isClone:!1})}))},a),{max:J.CACHE_SIZE})),Me(this,"getCachedRenderDraggableItem",re((t,r,i)=>a=>{var{item:s,itemIndex:o,isFocused:l,isSelected:d,style:h}=a;return this.getCachedDraggableItem(t,i,s,o,l,d,r,h)},{max:1})),Me(this,"getCachedRenderClone",re((t,r,i,a)=>(s,o,l)=>{var{selectedCount:d}=this.state,{draggableProps:h,dragHandleProps:f,innerRef:p}=s,{index:v}=l.source,g=r[v-i];return u.jsx("div",Ce(Ce(Ce({className:I("draggable-item-list-dragging-item-container",t)},h),f),{},{ref:p,children:u.jsx("div",{className:I("draggable-item-list-dragging-item",{"two-dragged":d===2},{"multiple-dragged":d>2}),children:a({item:g,itemIndex:v,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:d})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=M.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:ue.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:r,droppableId:i,isDoubleClickSelect:a,isDragDisabled:s,isDropDisabled:o,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:f,offset:p,onFocusChange:v,onSelect:g,onViewportChange:b,renderItem:w,rowHeight:x,selectedRanges:P,style:C,"data-testid":k}=this.props;return u.jsx(xs,{isDropDisabled:o,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(r,f,p,w),"data-testid":k,children:(O,A)=>u.jsx("div",Ce(Ce({role:"menu",className:I("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:C,ref:O.innerRef},O.droppableProps),{},{children:u.jsx(J,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:f,onFocusChange:v,onSelect:g,onSelectionChange:this.handleSelectionChange,onViewportChange:b,offset:p,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,s,w),rowHeight:x,selectedRanges:P})}))})}}Me(he,"DEFAULT_ROW_HEIGHT",30);Me(he,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:he.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:he.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const ac=he;class ft{static reorder(e,t,r,i){var a=e===r?ft.adjustDestinationIndex(i,t):i,s=ft.removeItems(e,t);return r.splice(a,0,...s),s}static removeItems(e,t){for(var r=[],i=t.map((h,f)=>({range:h,index:f})).sort((h,f)=>f.range[0]-h.range[0]),a=0;a<i.length;a+=1){var{range:s,index:o}=i[a],[l,d]=s;r[o]=e.splice(l,d-l+1)}return Es(r)}static adjustDestinationIndex(e,t){for(var r=e,i=0;i<t.length;i+=1){var[a,s]=t[i];if(a>e)break;r-=Math.min(s,e-1)-a+1}return r}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const sc=ft;function oc(n){var{isInvalid:e=!1,items:t,onAdd:r=()=>{},onDelete:i=()=>{},validate:a=()=>null}=n,[s,o]=c.useState(null),[l,d]=c.useState([]),[h,f]=c.useState(""),p=c.useCallback(C=>{d(C)},[]),v=c.useCallback(()=>{i(ue.getItemsInRanges(t,l)),d([])},[t,l,i]),g=c.useCallback(()=>{if(h!==""){var C=a(h);C==null?(r(h),f("")):o(C)}},[h,r,a]),b=c.useCallback(C=>{var{value:k}=C.target;f(k),o(k===""?null:a(k))},[a]),w=c.useCallback(()=>{d([])},[]),x=c.useCallback(C=>{C.key==="Enter"&&g()},[g]),P=c.useMemo(()=>14+Ts(t.length,1,6)*J.DEFAULT_ROW_HEIGHT,[t.length]);return u.jsxs("div",{className:I("editable-item-list-container",{"is-invalid":e}),children:[u.jsx("div",{style:{height:P},children:u.jsx(J,{itemCount:t.length,items:t.map((C,k)=>({value:C,isSelected:ue.isSelected(l,k)})),offset:0,selectedRanges:l,onSelectionChange:p,isMultiSelect:!0})}),u.jsxs("div",{className:"d-flex flex-row pt-2",children:[u.jsx("div",{className:"d-flex flex-grow-1",children:u.jsx("input",{className:I("form-control",{"is-invalid":s!=null}),placeholder:"Enter value",type:"text",value:h,onChange:b,onFocus:w,onKeyDown:x})}),u.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[u.jsx(ie,{kind:"ghost",onClick:g,disabled:s!=null||h==="",icon:Hs,tooltip:"Add new item","data-testid":"add-item-button"}),u.jsx(ie,{kind:"ghost",onClick:v,disabled:l.length===0,icon:ui,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}function lc(n,e,t){return e=uc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uc(n){var e=cc(n,"string");return typeof e=="symbol"?e:String(e)}function cc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ue extends c.Component{static isParentSelected(e,t){var r=t.get(e);if(r===void 0)return!1;if(typeof r=="boolean")return r;var i=Array.from(r.values()).includes(!0),a=Array.from(r.values()).includes(!1);return i&&a?null:i}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:r}=t;return{menuIsOpen:!r}})}toggleValueFor(e,t){var{valueMap:r,onUpdateValueMap:i}=this.props,a=new Map(r),s=a.get(e);if(s instanceof Map){var o=new Map(s);if(t!=null)o.set(t,s.get(t)===void 0);else{var l=Ue.isParentSelected(e,a),d=l==null||!l;s.forEach((p,v)=>o.set(v,d))}a.set(e,o)}else a.set(e,s==null||!s);var h=a.get(e);if(t===void 0&&h!==void 0&&typeof h!="boolean"){var f=Ue.isParentSelected(e,r);f!=null&&f?h.forEach((p,v)=>h.set(v,!1)):h.forEach((p,v)=>h.set(v,!0))}i(a)}setAllValues(e){var{valueMap:t,onUpdateValueMap:r}=this.props,i=new Map;t.forEach((a,s)=>{if(typeof a=="boolean")i.set(s,e);else{var o=new Map;a.forEach((l,d)=>o.set(d,e)),i.set(s,o)}}),r(i)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return u.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(r=>{var[i,a]=r;return u.jsxs("div",{children:[u.jsx(dt,{className:"hcm-parent",checked:Ue.isParentSelected(i,e),onChange:()=>this.toggleValueFor(i),children:i}),a!==void 0&&typeof a!="boolean"&&Array.from(a.entries()).map(s=>{var[o,l]=s;return u.jsx(dt,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(i,o),children:o},o)})]},i)}),u.jsx(ie,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),u.jsx(ie,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:r,id:i,"data-testid":a}=this.props,{menuIsOpen:s}=this.state;return u.jsxs("button",{type:"button",className:I("btn hcm-btn",t),onClick:this.toggleMenu,id:i,"data-testid":a,children:[u.jsxs("span",{children:[r&&u.jsx(X,{icon:r,className:"hcm-icon mr-1"}),e]}),u.jsx(X,{icon:di,className:"hcm-icon ml-1"}),u.jsx(We,{options:{placement:"bottom"},isShown:s,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}lc(Ue,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const dc=Ue;function xa(n){var{on:e,id:t,className:r,isInvalid:i,disabled:a=!1,onClick:s,"data-testid":o}=n;return u.jsx("button",{type:"button",className:I("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:s,disabled:a,"data-testid":o,children:u.jsx("div",{className:"handle"})})}function Er(n){return n.isOn!==void 0}function Ea(n){var{item:e,onSelect:t=()=>{},"data-testid":r}=n,{icon:i,subtitle:a,title:s}=e,o=c.useMemo(()=>Er(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return u.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:[i!==void 0&&u.jsx("div",{className:"icon",children:u.jsx(X,{icon:i})}),u.jsx("div",{className:"title",children:s}),a!==void 0&&u.jsx("div",{className:"shortcut",children:a}),u.jsx("div",{className:"accessory","data-testid":r,children:Er(e)?u.jsx(xa,{on:e.isOn,onClick:l=>{l.stopPropagation(),o()}}):u.jsx(X,{icon:Gs})})]})}function hc(n){var{items:e,onSelect:t=()=>{},"data-testid":r}=n;return u.jsx("div",{className:"navigation-menu-view","data-testid":r,children:u.jsx("ul",{className:"navigation-menu-list",children:e.map((i,a)=>u.jsx("li",{children:u.jsx(Ea,{item:i,onSelect:()=>{t(a)}})},i.title))})})}function fc(n){var{children:e,onBack:t,onClose:r,title:i,"data-testid":a}=n;return u.jsxs("div",{className:"navigation-page","data-testid":a,children:[u.jsxs("div",{className:"navigation-title-bar",children:[u.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&u.jsx(ie,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:t,icon:Ws,children:"Back"})}),u.jsx("div",{className:"navigation-title",children:i}),u.jsx("div",{className:"navigation-right-buttons",children:r!==void 0&&u.jsx(ie,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:r,icon:hi,tooltip:"Close"})})]}),u.jsx("div",{className:"navigation-content",children:e})]})}function pc(n){var{children:e,"data-testid":t}=n,r=c.useMemo(()=>M.Children.toArray(e),[e]),i=Zi(r),[a,s]=c.useState(r[r.length-1]),[o,l]=c.useState(null),[d,h]=c.useState(null);c.useEffect(function(){if(!(i===void 0||r===i)){var g=r[r.length-1];r.length===i.length||i.length===0||o!==null||d!==null?o!==null&&g!==o?l(g):g!==d&&g!==a&&s(g):r.length>i.length?l(g):r.length<i.length&&(s(g),h(i[i.length-1]))}},[r,i,o,d,a]);var f=c.useCallback(()=>{s(o),l(null)},[o]),p=c.useCallback(()=>{h(null)},[]);return u.jsxs("div",{className:"navigation-stack",children:[u.jsx("div",{className:"main-view","data-testid":t,children:a}),u.jsx(Ne,{in:d!=null,timeout:fe.transitionMidMs,classNames:"slide-right",onEntered:p,children:u.jsx(u.Fragment,{children:d!=null&&u.jsx("div",{className:"popping-view",children:d})})}),u.jsx(Ne,{in:o!=null,timeout:fe.transitionMidMs,classNames:"slide-left",onEntered:f,children:u.jsx(u.Fragment,{children:o!=null&&u.jsx("div",{className:"pushing-view",children:o})})})]})}function vc(n){var{children:e,disabled:t,value:r,"data-testid":i}=n;return u.jsx("option",{value:r,disabled:t,"data-testid":i,children:e})}function mc(n){var{children:e,disabled:t=!1,name:r,onChange:i,value:a="","data-testid":s}=n,[o]=c.useState(r??Ee());return u.jsx(u.Fragment,{children:M.Children.map(e,l=>{var d,h;return l?M.cloneElement(l,{name:o,onChange:(d=l.props.onChange)!==null&&d!==void 0?d:i,checked:a===l.props.value,disabled:(h=l.props.disabled)!==null&&h!==void 0?h:t,"data-testid":s}):null})})}var En=M.forwardRef((n,e)=>{var{checked:t,children:r,className:i="",disabled:a=!1,inputClassName:s="",isInvalid:o=!1,labelClassName:l="",name:d,onChange:h,value:f,"data-testid":p}=n,[v]=c.useState(Ee());return u.jsxs("div",{className:I("custom-control custom-radio",i),children:[u.jsx("input",{type:"radio",id:v,"data-testid":p,name:d,ref:e,className:I("custom-control-input",s,{"is-invalid":o}),checked:t,disabled:a,value:f,onChange:h}),u.jsx("label",{className:I("custom-control-label",l),htmlFor:v,children:r})]})});En.displayName="RadioItem";En.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const gc=En;var bc=.025,yc=.9,wc=.1,Cc=.618,Lt=fe["primary-dark"],Tr=80,Sc=fe["gray-800"],Oc=fe["gray-900"],Pe={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},Se=18,xc=250,Ec=60*1e3,Tc=M.memo(()=>{var n=c.useRef(null),e=c.useRef(null),[t,r]=c.useState(!1),i=window.devicePixelRatio,a,s,o,l,d,h=null,f=[];function p(){var S;e.current!=null&&(o=e.current.offsetWidth,l=e.current.offsetHeight),n.current!=null&&(n.current.style.width="".concat(o,"px"),n.current.style.height="".concat(l,"px"),n.current.width=o*i,n.current.height=l*i),(S=a)===null||S===void 0||S.scale(i,i)}function v(){var S=document.createElement("canvas");S.width=Pe.SIZE,S.height=Pe.SIZE;var D=S.getContext("2d");return D!=null&&(D.fillStyle=Lt,D.fillRect(0,0,Pe.DOT_SIZE,Pe.DOT_SIZE),D.fillStyle=Lt+Math.round(255*Pe.FILL_OPACITY).toString(16).padStart(2,"0"),D.fillRect(0,0,Pe.SIZE,Pe.SIZE)),D==null?void 0:D.createPattern(S,"repeat")}function g(S){var D=Math.random()-.5,F=bc*D;return S<wc?F=Math.abs(F):S>yc&&(F=-Math.abs(F)),S+F}function b(){for(var S=[],D=Cc,F=0;F<o+Se;F+=1)D=g(D),S.push(D);return S}function w(){for(;f.length>=o+Se;)f.pop();for(;f.length<o+Se;)f.push(g(f[f.length-1]))}function x(S,D){D.beginPath(),D.moveTo(-1,l+1),D.lineTo(-1,l*S[0]);for(var F=0;F<S.length;F+=1)D.lineTo(F,l*S[F]);D.lineTo(o+Se,l*S[S.length-1]),D.lineTo(o+Se,l+1),D.closePath()}function P(S){S.beginPath();for(var D=1;D<o;D+=Tr)S.moveTo(D,0),S.lineTo(D,l);for(var F=1;F<l;F+=Tr)S.moveTo(0,F),S.lineTo(o,F)}function C(S){var D,F,T;h=(D=h)!==null&&D!==void 0?D:S,zs(a),a.fillStyle=Oc,a.fillRect(0,0,o,l),P(a),a.lineWidth=1,a.strokeStyle=Sc,a.stroke();var E=(((F=h)!==null&&F!==void 0?F:0)-(S??0))/(1e3/Se);if(a.translate(E,0),x(f,a),a.lineWidth=2,a.strokeStyle=Lt,a.stroke(),a.translate(-E,0),s!=null&&(a.fillStyle=s),a.fill(),a.setTransform(i,0,0,i,0,0),(S??0)-((T=h)!==null&&T!==void 0?T:0)>1e3/Se){for(var y,j=Math.floor(((S??0)-((y=h)!==null&&y!==void 0?y:0))/(1e3/Se)),_=0;_<j;_+=1)f.shift(),f.push(g(f[f.length-1]));h=S}d!=null&&cancelAnimationFrame(d),d=requestAnimationFrame(C)}var k=Be(()=>{d=requestAnimationFrame(S=>{p(),w(),r(!1),C(S)})},xc,{leading:!0});function O(){r(!0),d!=null&&cancelAnimationFrame(d),d=null,h=null}var A=Be(()=>{O()},Ec);function N(){d==null&&(r(!1),p(),w(),d=requestAnimationFrame(C)),A()}function L(){document.hasFocus()&&N()}function W(){d!=null&&cancelAnimationFrame(d),A(),k()}return c.useEffect(()=>{var S;return a=(S=n.current)===null||S===void 0?void 0:S.getContext("2d",{alpha:!1}),p(),f=b(),s=v(),C(),A(),window.addEventListener("resize",W),window.addEventListener("focus",N),window.addEventListener("blur",O),window.addEventListener("mousemove",L),window.addEventListener("keydown",L),()=>{d!=null&&cancelAnimationFrame(d),window.removeEventListener("resize",W),window.removeEventListener("focus",N),window.removeEventListener("blur",O),window.removeEventListener("mousemove",L),window.removeEventListener("keydown",L),A.cancel(),k.cancel()}},[]),u.jsx("div",{className:"random-area-plot-animation-container",ref:e,children:u.jsx("canvas",{ref:n,className:t?"shade":""})})});const Ta=Tc;function Pa(n){var{text:e,placement:t="top-start"}=n,r=c.useMemo(()=>({placement:t}),[t]);return u.jsxs(u.Fragment,{children:[u.jsx(ii,{UNSAFE_className:yn.spectrumEllipsis,children:e??u.jsx(u.Fragment,{children:" "})}),e==null||e===""?null:u.jsx(mt,{options:r,children:e})]})}var Pc=["scrollRef","getItemDisplayText","getKey"];function Pr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ir(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pr(Object(t),!0).forEach(function(r){Ic(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ic(n,e,t){return e=Mc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mc(n){var e=Nc(n,"string");return typeof e=="symbol"?e:String(e)}function Nc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Dc(n,e){if(n==null)return{};var t=jc(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function jc(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Ac(n){var{scrollRef:e,getItemDisplayText:t,getKey:r}=n,i=Dc(n,Pc),a=c.useCallback(s=>{var o=r(s),l=t(s);return u.jsx(Ps,{textValue:l??String(o),children:u.jsx(Pa,{text:l})},o)},[t,r]);return u.jsx(Is,Ir(Ir({},i),{},{ref:e,menuTrigger:"focus",onSelectionChange:i.onSelectionChange,children:a}))}function kc(n){var{children:e,onBlur:t,onChange:r,className:i,defaultValue:a,name:s,value:o,disabled:l,"data-testid":d}=n,h=c.useCallback(f=>{r(f.target.value)},[r]);return u.jsx("select",{className:I("custom-select",i),onBlur:t,onChange:h,defaultValue:a,value:o,name:s,disabled:l,"data-testid":d,children:e})}function Le(n,e,t){return e=Lc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lc(n){var e=Rc(n,"string");return typeof e=="symbol"?e:String(e)}function Rc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ia extends c.PureComponent{constructor(e){super(e),Le(this,"list",void 0),Le(this,"topRow",void 0),Le(this,"bottomRow",void 0),Le(this,"getCachedItem",re((t,r,i,a,s,o,l)=>{var d={height:s},h=a??i;return u.jsx("li",{className:"value-list-item",style:d,tabIndex:-1,children:u.jsx(dt,{checked:o,disabled:l,onChange:()=>this.handleSelect(t),children:h})},r)},{max:1e3})),Le(this,"getCachedItems",re((t,r,i,a)=>{for(var s=[],o=0;o<t.length;o+=1){var l=t[o],{value:d,displayValue:h,isSelected:f}=l,p=i+o,v=p,g=this.getCachedItem(p,v,d,h,r,f,a);s.push(g)}return s},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=M.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:r,onSelect:i}=this.props,a=e-r;if(a>=0&&a<t.length){var s=t[a],{value:o}=s;i(e,o)}else i(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,r=this.list.current.scrollTop,i=r+this.list.current.clientHeight,a=Math.floor(r/t),s=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==s)&&(this.topRow=a,this.bottomRow=s,e(a,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:r,items:i,itemCount:a,offset:s,rowHeight:o,"data-testid":l}=this.props,d=this.getCachedItems(i,o,s,t);return u.jsx("div",{className:I("select-value-list-scroll-pane h-100 w-100",{"is-invalid":r},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:u.jsx("div",{className:"select-value-list",style:{height:a*o},children:u.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*o,top:s*o,left:0},children:d})})})}}Le(Ia,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const Ma=Ia;function Oe(n,e,t){return e=_c(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _c(n){var e=$c(n,"string");return typeof e=="symbol"?e:String(e)}function $c(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mr=R.module("Shortcut"),q;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(q||(q={}));var $;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})($||($={}));var Fc=new Set([$.ENTER,$.DELETE,$.F1,$.F2,$.F3,$.F4,$.F5,$.F6,$.F7,$.F8,$.F9,$.F10,$.F11,$.F12]);class H extends cn{static isAllowedKey(e){return Object.values($).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!H.isMacPlatform&&e.metaKey||!H.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||Fc.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case q.CTRL:t.ctrlKey=!0;break;case q.ALT:case q.OPTION:t.altKey=!0;break;case q.CMD:t.metaKey=!0;break;case q.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!H.isAllowedKey(t)&&H.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,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===$.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 $.ENTER:t+="⏎";break;case $.ESCAPE:t+="⎋";break;case $.BACKSPACE:t+="⌫";break;case $.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":H.isMacPlatform?H.getMacDisplayText(e):H.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:a=!0,name:s,tooltip:o}=e;super(),Oe(this,"id",void 0),Oe(this,"name",void 0),Oe(this,"tooltip",void 0),Oe(this,"isEditable",void 0),Oe(this,"defaultKeyState",void 0),Oe(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=o,this.isEditable=a;var l=H.isMacPlatform,d=l?i:r;this.defaultKeyState=H.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return H.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){H.isValidKeyState(e)?(Mr.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new ki("onUpdate",{detail:this}))):Mr.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return H.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(H.NULL_KEY_STATE)}isNull(){return H.doKeyStatesMatch(this.keyState,H.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return H.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(H.getKeyStateFromEvent(e))}}Oe(H,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Oe(H,"isMacPlatform",Q.isMacPlatform());function Nr(n,e,t){return e=Uc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uc(n){var e=Vc(n,"string");return typeof e=="symbol"?e:String(e)}function Vc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Dr=R.module("ShortcutRegistry");class Bc extends cn{constructor(){super(...arguments),Nr(this,"shortcutMap",new Map),Nr(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new H(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Dr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Dr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",a=>{var{detail:s}=a;return this.dispatchEvent(new ki("onUpdate",{detail:s}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[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 Kc=Object.freeze(new Bc);const Ie=Kc;var Hc={COPY:Ie.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[q.CTRL,$.C],macShortcut:[q.CMD,$.C],isEditable:!1}),PASTE:Ie.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[q.CTRL,$.V],macShortcut:[q.CMD,$.V],isEditable:!1}),SAVE:Ie.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[q.CTRL,$.S],macShortcut:[q.CMD,$.S],isEditable:!1}),SELECT_ALL:Ie.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[q.CTRL,$.A],macShortcut:[q.CMD,$.A],isEditable:!1}),LINKER:Ie.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[q.CTRL,$.L],macShortcut:[q.CMD,$.L]}),LINKER_CLOSE:Ie.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[$.ESCAPE],macShortcut:[$.ESCAPE],isEditable:!1})};const Gc=Hc;var Tn=M.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,id:a,isLinked:s,isLinkedSource:o,isInvalid:l,onClick:d,onMouseEnter:h,onMouseLeave:f,style:p,"data-testid":v}=n;return u.jsxs("button",{ref:e,type:"button",className:I("btn-socketed",{"btn-socketed-linked":s!==void 0&&s||o},{"btn-socketed-linked-source":o},{"is-invalid":l},r),id:a,onClick:d,onMouseEnter:h,onMouseLeave:f,style:p,disabled:i,"data-testid":v,children:[t,u.jsx(X,{icon:qs,className:"linked btn-socketed-icon",transform:"down-1"}),u.jsx(X,{icon:Zs,className:"is-invalid btn-socketed-icon"})]})});Tn.displayName="SocketedButton";Tn.defaultProps={children:void 0,className:"",disabled:!1,id:void 0,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Wc=Tn,zc={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_1qqxl_5"},qc={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_oc9vy_5"};function jr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function it(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jr(Object(t),!0).forEach(function(r){Zc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Zc(n,e,t){return e=Xc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xc(n){var e=Jc(n,"string");return typeof e=="symbol"?e:String(e)}function Jc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var{global:Qc,light:Yc,dark:ed,medium:td,large:nd}=Ms,rd={global:Qc,light:it(it({},Yc),qc),dark:it(it({},ed),zc),medium:td,large:nd},id=500;function ad(n){var{heading:e,content:t,delayMs:r=id}=n,[i,a]=c.useState(!1);return c.useEffect(()=>{window.setTimeout(()=>{a(!0)},r)},[r]),i?u.jsxs(Ns,{children:[u.jsx(un,{size:"XXL",children:u.jsx(X,{icon:Xs})}),u.jsx(ai,{children:e}),t==null?null:u.jsx(si,{children:t})]}):null}var Pn=c.createContext(null),Ar=R.module("useInitializeThemeContextValue");function Na(){var[n,e]=c.useState(()=>{var s,o;return(s=(o=fi())===null||o===void 0?void 0:o.themeKey)!==null&&s!==void 0?s:pi}),[t,r]=c.useState(null),i=c.useMemo(()=>t==null?null:vi(n,t),[n,t]),a=c.useCallback(s=>{Ar.debug("Registering themes",s),r(s)},[]);return c.useEffect(()=>{i!=null&&(Ar.debug("Active themes:",i.map(s=>s.themeKey)),mi({themeKey:n,preloadStyleContent:gi()}))},[i,n,t]),c.useMemo(()=>({activeThemes:i,selectedThemeKey:n,registerThemes:a,setSelectedThemeKey:e}),[i,a,n])}function sd(){return Je(Pn,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}const od="_track_1ermw_30",ld="_handle_1ermw_13",ud="_ticks_1ermw_98",Da={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_1ermw_3","time-slider-popovers":"_time-slider-popovers_1ermw_8","handle-popper":"_handle-popper_1ermw_13","flex-spacer":"_flex-spacer_1ermw_26",track:od,"track-fills":"_track-fills_1ermw_37","track-fill":"_track-fill_1ermw_37","track-fill-start":"_track-fill-start_1ermw_55","track-fill-middle":"_track-fill-middle_1ermw_56","track-fill-end":"_track-fill-end_1ermw_59","handle-track":"_handle-track_1ermw_62",handle:ld,ticks:ud,"tick-labels":"_tick-labels_1ermw_116","tick-label":"_tick-label_1ermw_116","tick-label-wrapper":"_tick-label-wrapper_1ermw_132"};var at=parseInt(Da["handle-size"],10),kr=parseInt(Da["popover-width"],10),ee=24*60*60-1,Lr=5*60;function cd(n){var{startTime:e,endTime:t,onChange:r,isStartModified:i=!1,isEndModified:a=!1,"data-testid":s}=n,[o,l]=c.useState(e),[d,h]=c.useState(t),f=c.useRef(null);c.useEffect(function(){l(e),h(t)},[e,t]);var p=c.useCallback((b,w)=>{var x=b,P=w;x===P&&(P<ee?P+=1:x-=1),l(x),h(P),r({startTime:x,endTime:P})},[l,h,r]),v=c.useCallback(b=>{p(b,d)},[p,d]),g=c.useCallback(b=>{p(o,b)},[p,o]);return u.jsxs("div",{className:"time-slider","data-testid":s,children:[u.jsx(dd,{startTime:o,endTime:d,onStartTimeChange:v,onEndTimeChange:g,isStartModified:i,isEndModified:a}),u.jsxs("div",{className:"track",ref:f,children:[u.jsx(hd,{startTime:o,endTime:d}),u.jsx("div",{className:"ticks",children:Array(24).fill(null).map((b,w)=>u.jsx("div",{className:"tick"},w))}),u.jsx(Rr,{track:f,time:o,setTime:v}),u.jsx(Rr,{track:f,time:d,setTime:g})]}),u.jsxs("div",{className:"tick-labels",children:[u.jsx("div",{className:"tick-label",children:"0:00"}),u.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((b,w)=>u.jsx("div",{className:"tick-label",children:"".concat(w+1,":00")},w))})]})]})}function dd(n){var{startTime:e,endTime:t,onStartTimeChange:r,onEndTimeChange:i,isStartModified:a,isEndModified:s,"data-testid":o}=n,l=e>t,[d,h]=c.useState(l?t:e),[f,p]=c.useState(l?e:t),v=c.useRef(null),g=c.useRef(null),b=c.useRef(null),w=c.useRef(null);c.useEffect(function(){h(e>t?t:e),p(e>t?e:t)},[e,t]),c.useEffect(function(){if(b.current!==null){var A;(A=g.current)===null||A===void 0||A.setSelection(b.current)}if(w.current!==null){var N;(N=v.current)===null||N===void 0||N.setSelection(w.current)}},[l]);function x(O){e<=t?r(O):i(O)}function P(O){e<=t?i(O):r(O)}var C=c.useCallback(O=>{b.current=O,w.current=null},[]),k=c.useCallback(O=>{b.current=null,w.current=O},[]);return u.jsxs("div",{className:"time-slider-popovers",children:[u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(d/ee*100,"% - ").concat(kr/2,"px)")}}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:I({modified:l?s:a}),children:l?"End Time":"Start Time"}),u.jsx(ht,{ref:v,allowValueWrapping:!1,value:d,onChange:x,onSelect:C,"data-testid":o!==void 0?"".concat(o,"-input-1"):void 0})]}),u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:I({modified:l?a:s}),children:l?"Start Time":"End Time"}),u.jsx(ht,{ref:g,allowValueWrapping:!1,value:f,onChange:P,onSelect:k,"data-testid":o!==void 0?"".concat(o,"-input-2"):void 0})]}),u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((ee-f)/ee*100,"% - ").concat(kr/2,"px)")}})]})}function hd(n){var{startTime:e,endTime:t,"data-testid":r}=n;return u.jsxs("div",{className:"track-fills","data-testid":r,children:[e>t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/ee,")")}}),u.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((ee-e)/ee,")")}})]}),e<t&&u.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/ee*100,"%) scaleX(").concat((t-e)/ee,")")}})]})}function Rr(n){var{track:e,time:t,setTime:r,"data-testid":i}=n,a=c.useMemo(()=>{var p=3600,v=at/2;return t<p?v=t/p*(at/2):t>23*p&&(v=at/2+1/(ee-23*p)*(t-23*p)*(at/2)),"translateX(calc(".concat(t/ee*100,"% - ").concat(v,"px))")},[t]),s=c.useCallback(p=>{if(!e.current)return 0;var v=e.current.getBoundingClientRect(),g=Math.max(p-v.left,0),b=ee*Math.min(1,g/v.width),w=Lr*Math.round(b/Lr),x=Math.min(ee,w);return x},[e]),o=c.useCallback(p=>{var{clientX:v}=p;r(s(v))},[r,s]),l=c.useCallback(p=>{var{clientX:v}=p;r(s(v)),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[r,s,o]),d=c.useCallback(()=>{window.addEventListener("mousemove",o),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[o,l]),h=c.useCallback(()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[o,l]),f=c.useCallback(()=>{d()},[d]);return c.useEffect(function(){return()=>{h()}},[h]),u.jsx("div",{className:"handle-track",style:{transform:a},children:u.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:f,"data-testid":i})})}function ja(n){var{buttons:e,isShown:t=!1,classNames:r,message:i,type:a,onClick:s,onDismiss:o,"data-testid":l}=n,d=e&&e.length!==0;return u.jsx(Ne,{in:t,timeout:fe.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:u.jsxs("div",{className:I("toast-notification",r,a),role:"presentation",onClick:s,onKeyPress:s,"data-testid":l,children:[u.jsx("div",{className:"message-container",children:u.jsx("span",{className:"message",children:i})}),u.jsx(Ne,{in:d,timeout:fe.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx("div",{className:"buttons-container",children:e})}),o&&u.jsx(ie,{kind:"ghost",icon:hi,tooltip:"Close notification",className:"my-2",onClick:o})]})})}ja.TYPE=Object.freeze({ERROR:"error"});function fd(n){var{children:e,className:t,labelText:r,hintText:i,isModified:a,validationError:s,showValidationError:o=!0,"data-testid":l,id:d}=n,{current:h}=c.useRef(d??Ee());return u.jsxs(u.Fragment,{children:[u.jsx("label",{className:I("validate-label",t,{modified:a}),htmlFor:h,"data-testid":l,children:r}),M.Children.toArray(e).map(f=>M.isValidElement(f)?M.cloneElement(f,{className:I(f.props.className,{"is-invalid":s})}):u.jsx("div",{className:I(t),children:f})),i!==void 0&&u.jsx("small",{className:"form-text text-muted",children:i}),s!==void 0&&o&&u.jsx("p",{className:"validate-label-error text-danger",children:s})]})}const pd=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:Ui,AutoCompleteInput:$l,AutoResizeTextarea:Cn,BasicModal:Sn,BulkActionBar:tu,Button:ie,ButtonGroup:Ye,ButtonOld:Jl,CardFlip:nu,Checkbox:dt,Collapse:hu,ComboBox:bu,ConfirmActionButton:wl,ConfirmationDialog:ia,ContextActionUtils:Q,ContextActions:uu,ContextMenuItem:Si,ContextMenuRoot:no,CopyButton:yu,CustomTimeSelect:Ru,DEFAULT_DARK_THEME_KEY:pi,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Ct,DEFAULT_LIGHT_THEME_KEY:Js,DEFAULT_PRELOAD_DATA_VARIABLES:Qs,DateInput:qu,DateTimeInput:Ku,DebouncedModal:Zl,DebouncedSearchInput:Ju,DragUtils:sc,DraggableItemList:ac,DropdownMenu:ga,EditableItemList:oc,GLOBAL_SHORTCUTS:Gc,HierarchicalCheckboxMenu:dc,IconActionButton:aa,InfoModal:Xl,ItemList:J,ItemListItem:Oa,get KEY(){return $},LoadingOverlay:De,LoadingSpinner:bi,get MODIFIER(){return q},MaskedInput:St,Menu:hc,MenuItem:Ea,Modal:dn,ModalBody:hn,ModalFooter:sa,ModalHeader:ci,Option:vc,Page:fc,Popper:We,RadioGroup:mc,RadioItem:gc,RandomAreaPlotAnimation:Ta,SearchInput:wt,SearchableCombobox:Ac,Select:kc,SelectValueList:Ma,Shortcut:H,ShortcutRegistry:Ie,SocketedButton:Wc,Stack:pc,THEME_CACHE_LOCAL_STORAGE_KEY:Ys,TableViewEmptyState:ad,TextWithTooltip:Pa,ThemeContext:Pn,ThemeExport:fe,TimeInput:ht,TimeSlider:cd,ToastNotification:ja,Tooltip:mt,UISwitch:xa,ValidateLabelInput:fd,calculatePreloadStyleContent:gi,fillToLength:ha,getActiveThemes:vi,getDefaultBaseThemes:yi,getThemeKey:wi,getThemePreloadData:fi,preloadTheme:eo,setThemePreloadData:mi,themeDHDefault:rd,trimTrailingMask:Gt,useInitializeThemeContextValue:Na,useTheme:sd},Symbol.toStringTag,{value:"Module"})),vd=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:to,ApiContext:Ci,ClientBootstrap:Oi,ClientContext:ro,useApi:Te,useClient:Ge},Symbol.toStringTag,{value:"Module"}));var Aa=1e4;function md(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Aa;return new Promise((r,i)=>{var a,s=setTimeout(()=>{var l;(l=a)===null||l===void 0||l(),i(new xi("Variable ".concat(e," not found")))},t);function o(l){var d=l.created.find(f=>f.title===e);if(d!=null){var h;clearTimeout(s),(h=a)===null||h===void 0||h(),r(d)}}a=n.subscribeToFieldUpdates(o)})}function _r(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function gd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){_r(a,r,i,s,o,"next",l)}function o(l){_r(a,r,i,s,o,"throw",l)}s(void 0)})}}var Rt=R.module("MessageUtils"),ka="io.deephaven.message.LoginOptions.request",La="io.deephaven.message.SessionDetails.request",Ra="io.deephaven.broadcast",In="io.deephaven.broadcast.Login",_a="io.deephaven.broadcast.Logout";function xt(n){var e=n;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function $a(n){return xt(n)&&n.message===In}function Fa(n){return xt(n)&&n.message===_a}function Ua(n){var e=n;return e!=null&&typeof e.id=="string"}function Mn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee(),t=arguments.length>2?arguments[2]:void 0;return{message:n,id:e,payload:t}}function bd(n,e){return{id:n,payload:e}}function Nn(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Dn(n){return qt.apply(this,arguments)}function qt(){return qt=gd(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=Nn();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,s=Ee(),o=l=>{var{data:d}=l;if(!Ua(d)){Rt.debug("Ignoring non-deephaven response",d);return}if(Rt.debug("Received message",d),(d==null?void 0:d.id)!==s){Rt.debug("Ignore message, id doesn't match",d);return}window.clearTimeout(a),window.removeEventListener("message",o),r(d.payload)};window.addEventListener("message",o),a=window.setTimeout(()=>{window.removeEventListener("message",o),i(new xi("Request timed out"))},e),t.postMessage(Mn(n,s),"*")})}),qt.apply(this,arguments)}function yd(n,e,t){return e=wd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wd(n){var e=Cd(n,"string");return typeof e=="symbol"?e:String(e)}function Cd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Va extends Error{constructor(){super(...arguments),yd(this,"isNoConsolesError",!0)}}function Ba(n){return n.isNoConsolesError}function $r(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Et(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){$r(a,r,i,s,o,"next",l)}function o(l){$r(a,r,i,s,o,"throw",l)}s(void 0)})}}var _e=R.module("SessionUtils");function Sd(n,e){return _e.info("Starting connection to '".concat(e,"'...")),new n.IdeConnection(e)}function Ka(n,e,t){return Zt.apply(this,arguments)}function Zt(){return Zt=Et(function*(n,e,t){_e.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new Va("No console types available");_e.info("Available types:",r);var i=r[0];_e.info("Starting session with type",i);var a=yield e.startSession(i),s={type:i,id:Ee.generate()};return _e.info("Console session established",s),{session:a,config:s,connection:e,details:t,dh:n}}),Zt.apply(this,arguments)}function Od(n,e,t){return _e.info("createCoreClient",e),new n.CoreClient(e,t)}function xd(n){return n!=null&&typeof n=="object"}function Ed(){return Xt.apply(this,arguments)}function Xt(){return Xt=Et(function*(){var n=yield Dn(La);if(!xd(n))throw new Error("Unexpected session details response: ".concat(n));return n}),Xt.apply(this,arguments)}function Td(){return Jt.apply(this,arguments)}function Jt(){return Jt=Et(function*(){var n=new URLSearchParams(window.location.search);switch(n.get("authProvider")){case"parent":return Ed()}return{}}),Jt.apply(this,arguments)}function Pd(n,e,t){return Qt.apply(this,arguments)}function Qt(){return Qt=Et(function*(n,e,t){var r;try{r=yield Ka(n,e,t)}catch(i){if(!Ba(i))throw i}return r}),Qt.apply(this,arguments)}const Id=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:Ra,BROADCAST_LOGIN_MESSAGE:In,BROADCAST_LOGOUT_MESSAGE:_a,BooleanColumnFormatter:io,CharColumnFormatter:ao,DateTimeColumnFormatter:so,DateUtils:oo,DecimalColumnFormatter:lo,DefaultColumnFormatter:uo,FETCH_TIMEOUT:Aa,Formatter:Ei,FormatterUtils:Vt,IntegerColumnFormatter:co,LOGIN_OPTIONS_REQUEST:ka,NoConsolesError:Va,SESSION_DETAILS_REQUEST:La,StringColumnFormatter:ho,TableColumnFormatter:fo,TableUtils:Ti,createComboboxFilterArgs:po,createConnection:Sd,createCoreClient:Od,createFilterConditionFactory:fn,createKeyFromOffsetRow:vo,createNotNullOrEmptyFilterCondition:Pi,createOnTableUpdatedHandler:Ii,createSearchTextFilter:pn,createSelectedValuesFilter:vn,createSessionWrapper:Ka,createShowOnlyEmptyFilterCondition:Mi,createValueFilter:Ni,defaultRowDeserializer:Di,fetchVariableDefinition:md,generateEmptyKeyedItems:ji,getColumnFormats:mo,getDateTimeFormatterOptions:go,getSessionDetails:Td,getSize:mn,getWindowParent:Nn,isBroadcastLoginMessage:$a,isBroadcastLogoutMessage:Fa,isClosed:lt,isCustomColumnFormatDefined:bo,isMessage:xt,isNoConsolesError:Ba,isResponse:Ua,loadSessionWrapper:Pd,makeMessage:Mn,makeResponse:bd,padFirstAndLastRow:Ai,requestParentResponse:Dn},Symbol.toStringTag,{value:"Module"}));function Md(n){return function(t){var{children:r}=t;return u.jsx(Ci.Provider,{value:n,children:r})}}var Fr=R.module("useTableListener"),Nd=(n,e,t)=>c.useEffect(function(){if(n==null){Fr.debug2("Emitter undefined, skipping addEventListener",e);return}return Fr.debug2("Adding listener",e),n.addEventListener(e,t)},[n,e,t]);const Ve=Nd;function Dd(n,e,t){return e=jd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jd(n){var e=Ad(n,"string");return typeof e=="symbol"?e:String(e)}function Ad(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class kd extends Error{constructor(){super(...arguments),Dd(this,"isColumnNameError",!0)}}const Ld=kd;function Rd(n,e,t){return e=_d(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _d(n){var e=$d(n,"string");return typeof e=="symbol"?e:String(e)}function $d(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fd extends Error{constructor(){super(...arguments),Rd(this,"isTableDisconnectError",!0)}}const Ud=Fd;var st=R.module("useTable"),Vd=(n,e,t,r)=>{var i=Te(),[a,s]=c.useState(void 0),[o,l]=c.useState([]),[d,h]=c.useState(null),[f,p]=c.useState(null);c.useEffect(()=>{if(r===void 0){s(n==null?void 0:n.columns),h(null);return}try{s(n==null?void 0:n.findColumns(r)),h(null)}catch(w){st.error("Column not found",w,r),h(new Ld("Invalid columnNames argument"))}},[n,r]),c.useEffect(()=>{if(!a||!n){st.debug2("Table or column not initialized, skip viewport update.");return}st.debug2("Setting viewport",e,t),n.setViewport(e,t,a)},[a,n,e,t]);var v=c.useCallback(w=>{var{detail:x}=w;if(!a){st.error("Columns not initialized.");return}var P=a.map(C=>x.rows.map(k=>k.get(C)));l(P)},[a]),g=c.useCallback(()=>{p(new Ud("Table disconnected"))},[]),b=c.useCallback(()=>{p(null)},[]);return Ve(n,i.Table.EVENT_UPDATED,v),Ve(n,i.Table.EVENT_DISCONNECT,g),Ve(n,i.Table.EVENT_RECONNECT,b),{columns:a,data:o,error:f??d}};const Ha=Vd;var Bd=(n,e,t,r)=>{var i=c.useMemo(()=>[r],[r]),{columns:a=[],data:s=[],error:o}=Ha(n,e,t,i);return{column:a[0],data:s[0],error:o}};const Ga=Bd;function Ur(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Kd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Ur(a,r,i,s,o,"next",l)}function o(l){Ur(a,r,i,s,o,"throw",l)}s(void 0)})}}var pe=R.module("TableInput"),_t=250;function jn(n){var e,t,{className:r=void 0,columnName:i,settings:a,defaultValue:s=[],isInvalid:o=!1,onChange:l=()=>!1,onBlur:d=()=>!1,table:h}=n,f=c.useRef(null),p=Te(),v=c.useMemo(()=>{var U=Vt.getColumnFormats(a),B=Vt.getDateTimeFormatterOptions(a),{defaultDecimalFormatOptions:V={},defaultIntegerFormatOptions:Z={}}=a;return new Ei(p,U,B,V,Z)},[p,a]),[g,b]=c.useState(""),[w,x]=c.useState(new Set(s)),[P,C]=c.useState(),k=c.useRef(null),O=Math.min((e=P==null?void 0:P.size)!==null&&e!==void 0?e:0,_t),{column:A,data:N,error:L}=Ga(P,0,_t-1,i),W=c.useCallback(U=>A?v.getFormattedString(U,A.type,A.name):"".concat(U),[A,v]),[S,D]=c.useMemo(()=>{var U=new Set(w),B=[];if(N==null)return[B,null];if(N.forEach(Z=>{var be="".concat(Z),et=w.has(be);et&&U.delete(be),B.push({value:be,displayValue:W(Z),isSelected:et})}),U.size>0){pe.debug2("Selection has items that are missing from the viewport");var V=new Set(w);return Array.from(U).forEach(Z=>{V.delete(Z)}),[B,V]}return[B,null]},[N,w,W]);c.useEffect(()=>{D!==null&&(x(D),l(Array.from(D)))},[l,D]);var F=c.useCallback(function(){var U=Kd(function*(B){try{var V=yield B;pe.debug("Table resolved",V),C(V)}catch(Z){if(Hn.isCanceled(Z))return;pe.error(Z)}});return function(B){return U.apply(this,arguments)}}(),[]);c.useEffect(()=>{var U=Hn.makeCancelable(h);return F(U),()=>{pe.debug2("Cancel table promise"),U.cancel()}},[h,F]);var T=c.useCallback(U=>{var{value:B}=U.target;b(B);var V=S.findIndex(be=>be.displayValue.includes(B));if(V>-1){var Z;pe.debug2("Found ".concat(B," at index ").concat(V)),(Z=k.current)===null||Z===void 0||Z.scrollIntoView(V)}else pe.debug2("".concat(B," not found"))},[S,k]),E=c.useCallback(U=>{if(pe.debug("handleSelect",U),U>=S.length){pe.error("Invalid index",U);return}var B=S[U].value,V=new Set(w);S[U].isSelected?V.delete(B):V.add(B),x(V),l(Array.from(V))},[l,S,w]),y=c.useCallback(()=>{var U=S.map(V=>V.value),B=new Set(U);x(B),l(U)},[S,l]),j=c.useCallback(()=>{x(new Set),l([])},[l]),_=c.useCallback(()=>{},[]),K=c.useCallback(U=>{var B,{relatedTarget:V}=U;pe.debug("handleChildBlur",V,V instanceof HTMLElement,f.current,(B=f.current)===null||B===void 0?void 0:B.contains(V)),(!V||f.current&&V instanceof HTMLElement&&!f.current.contains(V))&&d()},[d]),ae=S.length===0;return u.jsxs("div",{ref:f,className:I("table-input-container d-flex flex-column position-relative",r),children:[u.jsx(wt,{disabled:!!L||ae,value:g,placeholder:"Search",onChange:T,className:"mb-2 d-flex",onBlur:K}),u.jsx(Ma,{className:"table-input-list",disabled:P===void 0||ae,isInvalid:o,items:ae?[{value:"Empty",isSelected:!1}]:S,itemCount:O,offset:0,onSelect:E,onViewportChange:_,ref:k,onBlur:K}),P&&u.jsxs("div",{className:"meta-row",children:[u.jsx("div",{className:"d-flex align-items-center text-muted small",children:P!=null&&P.size>O&&u.jsxs(u.Fragment,{children:["Table is too large, showing the first ",_t," items."]})}),u.jsxs("div",{children:[u.jsx("button",{type:"button",className:"btn btn-link",onBlur:K,onClick:y,children:"Select All"}),u.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:K,onClick:j,children:"Clear"})]})]}),P==null||L&&u.jsx("div",{className:"h-100 w-100 position-absolute",children:u.jsx(De,{isLoaded:P!=null,isLoading:P==null&&L==null,errorMessage:(t=L==null?void 0:L.message)!==null&&t!==void 0?t:null})})]})}jn.displayName="TableInput";jn.defaultProps={isInvalid:!1,className:void 0};var Vr=R.module("useBroadcastChannel");function An(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yo,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ra,t=c.useMemo(()=>new BroadcastChannel(e),[e]);return c.useEffect(()=>()=>{t.close()},[t]),c.useEffect(()=>{function r(i){var{data:a}=i;if(!xt(a)){Vr.debug("Ignoring non-deephaven message",a);return}Vr.debug("event received",a),n(i)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}},[t,n]),t}function Tt(n,e){var t=c.useCallback(r=>{$a(r.data)?n==null||n(r.data):Fa(r.data)&&(e==null||e(r.data))},[n,e]);An(t)}var pt="io.deephaven.web.client.auth.refreshToken",Wa=c.createContext(null),Hd=R.module("RefreshTokenUtils");function Yt(){var n=Ke.get(pt);try{if(n!=null)return JSON.parse(n)}catch(e){Hd.error("Error parsing refresh token",n,e)}return null}function en(n){if(n==null){Ke.remove(pt);return}var e=JSON.stringify({bytes:n.bytes,expiry:n.expiry}),t=new Date(n.expiry);Ke.set(pt,e,{secure:!0,sameSite:"strict",expires:t})}function za(n){var{children:e}=n,t=Te(),r=Ge(),[i,a]=c.useState(Yt());c.useEffect(function(){var d=r.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,h=>{var{detail:f}=h;en(f),a(f)});return d},[t,r,i]);var s=c.useCallback(()=>{a(Yt())},[]),o=c.useCallback(()=>{en(null),a(null)},[]);return Tt(s,o),u.jsx(Wa.Provider,{value:i,children:e})}function ge(){var n=Te();return c.useMemo(()=>new Ti(n),[n])}function Gd(n,e,t,r){var i=ge(),[a,s]=c.useState(""),o=vt(a,t),l=c.useCallback(p=>{s(p.trim())},[]),{data:d,isLoading:h}=Xe(i.doesColumnValueExist,[n,e,o,r]),f=h||a!==o?null:d;return{valueTrimmed:a,valueTrimmedDebounced:o,valueExists:f,trimAndUpdateValue:l}}var Br=R.module("useDebouncedViewportSearch"),Wd=200;function zd(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wd,r=ge(),{table:i,applyFiltersAndRefresh:a}=n,s=c.useMemo(()=>Be(o=>{if(Br.debug("Applying debounced searchText '".concat(o,"'")),i!=null){var l=o.trim();if(l===""){a([]);return}var d=i.findColumn(e),h=r.makeFilterValue(d.type,l),f=[d.filter().contains(h)];a(f)}},t),[a,e,t,i,r]);return c.useEffect(()=>()=>{Br.debug("Cancelling debounced search function"),s.cancel()},[s]),s}var qa=300;function qd(n){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:r,mapItemToValue:i}=n,a=ge(),s=Yi(e,i),o=vt(s,qa),l=qi(o,Bi);return c.useMemo(()=>vn(a,t,l.selection,r,l.isInverted),[t,l,r,a])}function kn(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return c.useMemo(()=>wo(...t.map(i=>i(n))),[n,...t])}function Zd(n,e,t,r){var i=c.useRef("");return i.current=t,c.useMemo(()=>{var a=n.length>0&&n[0].item==null;return!a&&r!=null&&(i.current===""||r.toLowerCase().includes(i.current.toLowerCase()))?[{key:r,item:{[e]:r}},...n]:n},[r,e,n])}function Kr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Xd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Kr(a,r,i,s,o,"next",l)}function o(l){Kr(a,r,i,s,o,"throw",l)}s(void 0)})}}function Jd(n){var{table:e,columnName:t,defaultValue:r,itemHeight:i,topOffset:a=0,value:s}=n;return c.useCallback(Xd(function*(){if(e==null||s===""||s===r)return a;var o=e.findColumn(t),l=yield e.seekRow(0,o,"String",s),d=r==null?0:1;return(l+d)*i+a}),[t,r,i,e,a,s])}function Ln(n){var[,e]=c.useState(0),t=Te();return Ve(n,t.Table.EVENT_SIZECHANGED,()=>{e(r=>r+1)}),mn(n)}var Qd=R.module("useInitializeViewportData");function Za(n){var e=na({}),t=Math.max(0,Ln(n));return c.useEffect(()=>{var r=e.items.length;t!==r&&(Qd.debug("size changed:",{currentSize:r,targetSize:t}),e.setItems(Array.from(ji(0,t-1))))},[t,n]),e}function Xa(n,e,t){return c.useCallback(function(i){var[a,s]=Ai(i,e,t,mn(n));n==null||n.setViewport(a,s)},[n,t,e])}var Hr=R.module("useViewportData");function Rn(n){var{table:e,itemHeight:t=1,scrollDebounce:r=No,viewportSize:i=10,viewportPadding:a=50,deserializeRow:s=Di}=n,o=Za(e),l=Xa(e,i,a),d=c.useCallback(b=>{e&&!lt(e)?l(b):Hr.debug("setViewport called on closed table.",e)},[e,l]),h=c.useCallback(b=>{e&&!lt(e)?(e.applyFilter(b),d(0)):Hr.debug("applyFiltersAndRefresh called on closed table.",e)},[d,e]),f=Te(),p=c.useMemo(()=>Ii(o,s),[s,o]);Ve(e,f.Table.EVENT_UPDATED,p);var v=Ln(e);c.useEffect(()=>{d(0)},[e,d,v]);var g=ea(t,d,r);return c.useMemo(()=>({viewportData:o,size:v,table:e,applyFiltersAndRefresh:h,setViewport:d,onScroll:g}),[h,g,d,v,e,o])}function _n(n,e){var{applyFiltersAndRefresh:t}=n;c.useEffect(()=>{t(e)},[t,e])}function Yd(n,e){for(var t=ge(),[r,i]=c.useState(""),a=c.useMemo(()=>pn(t,e,r),[e,r,t]),s=ct(i,_i),o=Rn({table:n,itemHeight:Mo,viewportSize:$i,viewportPadding:Fi}),l=arguments.length,d=new Array(l>2?l-2:0),h=2;h<l;h++)d[h-2]=arguments[h];var f=kn(o.table,a,...d);return _n(o,f),{list:o,onSearchTextChange:s}}function eh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=ge(),r=c.useMemo(()=>Pi(t),[t]);return c.useMemo(()=>fn(n,r,e),[n,e,r])}function Ja(n){c.useEffect(()=>()=>{n!=null&&(lt(n)||n.close())},[n])}function th(n,e,t){for(var r=ge(),[i,a]=c.useState(""),[s,o]=c.useState(""),[l,d]=c.useState(null),[h,f]=c.useState(()=>new Map),{data:p,isLoading:v}=Xe(r.doesColumnValueExist,[n,e,s,!1]),g=v||s!==i?null:p,b=c.useMemo(()=>pn(r,e,s),[e,s,r]),w=c.useMemo(()=>vn(r,e,new Set(h.keys()),!1,!0),[e,h,r]),x=arguments.length,P=new Array(x>3?x-3:0),C=3;C<x;C++)P[C-3]=arguments[C];var{data:k}=Xe(r.createDistinctSortedColumnTable,[n,e,"asc",...P]);Ja(k);var O=Rn({table:k,itemHeight:Io,viewportSize:$i,viewportPadding:Fi}),A=i.length>0&&O.size===0,N=h.has(i),L=ct(o,_i),W=c.useCallback(y=>{a(y),L(y)},[L]),S=ct(d,0),D=c.useCallback(y=>{if(a(""),o(""),d(y),S(null),y!=null){var j=O.viewportData.findItem(y);if(j!=null){var _=t(j);f(K=>{var ae=new Map(K);return ae.set(_,{value:_}),ae})}}},[S,O.viewportData,t]),F=c.useCallback(y=>{f(j=>{if(y.size===0)return j;var _=new Map(j);for(var K of y)_.set(K,{value:K});return _})},[]),T=c.useCallback(y=>{f(j=>{if(y==="all")return new Map;var _=new Map(j);for(var K of y)_.delete(K);return _})},[]),E=kn(O.table,b,w);return _n(O,E),c.useMemo(()=>({list:O,hasSearchTextWithZeroResults:A,searchText:i,searchTextExists:g,searchTextIsInSelectedValues:N,selectedKey:l,selectedValueMap:h,onSearchTextChange:W,onSelectKey:D,onAddValues:F,onRemoveValues:T}),[A,O,F,T,W,D,i,g,N,l,h])}function Gr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function nh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Gr(a,r,i,s,o,"next",l)}function o(l){Gr(a,r,i,s,o,"throw",l)}s(void 0)})}}function rh(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=c.useCallback(nh(function*(){var d;return(d=n==null?void 0:n.selectDistinct(n.findColumns(t)))!==null&&d!==void 0?d:null}),[n,...t]),{data:a,error:s,isError:o,isLoading:l}=Xe(i,[]);return c.useEffect(()=>()=>{a==null||a.close()},[a]),{distinctTable:a,error:s,isError:o,isLoading:l}}function ih(n,e){var t=ge(),r=c.useMemo(()=>Mi(t,n),[n,t]);return c.useMemo(()=>fn(e,r),[e,r])}function ah(n,e,t){var r=ge();return c.useMemo(()=>Ni(r,n,e,t),[n,t,r,e])}const sh=Object.freeze(Object.defineProperty({__proto__:null,DEBOUNCE_MS:qa,REFRESH_TOKEN_KEY:pt,RefreshTokenBootstrap:za,RefreshTokenContext:Wa,TableInput:jn,makeApiContextWrapper:Md,readRefreshToken:Yt,storeRefreshToken:en,useBroadcastChannel:An,useBroadcastLoginListener:Tt,useCheckIfExistsValue:Gd,useDebouncedViewportSearch:zd,useDebouncedViewportSelectionFilter:qd,useFilterConditionFactories:kn,useFilteredItemsWithDefaultValue:Zd,useGetItemPosition:Jd,useInitializeViewportData:Za,useNotNullOrEmptyFilter:eh,usePickerWithSelectedValues:th,useSearchableViewportData:Yd,useSelectDistinctTable:rh,useSetPaddedViewportCallback:Xa,useShowOnlyEmptyFilter:ih,useTable:Ha,useTableClose:Ja,useTableColumn:Ga,useTableListener:Ve,useTableSize:Ln,useTableUtils:ge,useValueFilter:ah,useViewportData:Rn,useViewportFilter:_n},Symbol.toStringTag,{value:"Module"}));var Qa=c.createContext(!1);function oh(n){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=n,[r,i]=c.useState(!1);return c.useEffect(function(){document.fonts.ready.then(()=>{i(!0)})},[]),u.jsxs(u.Fragment,{children:[u.jsx(Qa.Provider,{value:r,children:t}),u.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(a=>u.jsx("p",{className:a,children:"preload"},a))})]})}var Pt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function lh(n){return"DashboardPlugin"in n}function tn(n){return"AuthPlugin"in n}function Ya(n){return"TablePlugin"in n}function uh(n){return lh(n)||tn(n)||Ya(n)}function ch(n){return"type"in n&&n.type===Pt.TABLE_PLUGIN}function dh(n){return"type"in n&&n.type===Pt.AUTH_PLUGIN}function hh(n){return"type"in n&&n.type===Pt.THEME_PLUGIN}function fh(n){if(n==null)return!1;var e=n;return e.Component!==void 0&&typeof e.isAvailable=="function"}var es="io.deephaven.auth.AnonymousAuthenticationHandler",ph="io.deephaven.authentication.psk.PskAuthenticationHandler";function Wr(n,e,t){return e=vh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vh(n){var e=mh(n,"string");return typeof e=="symbol"?e:String(e)}function mh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gh extends Error{constructor(){super(...arguments),Wr(this,"name","AuthenticationError"),Wr(this,"isAuthenticationError",!0)}}const ts=gh;function zr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function bh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){zr(a,r,i,s,o,"next",l)}function o(l){zr(a,r,i,s,o,"throw",l)}s(void 0)})}}var qr=R.module("AuthPluginBase");function $n(n){var{children:e,getLoginOptions:t}=n,r=Ge(),[i,a]=c.useState(),[s,o]=c.useState(!1);return c.useEffect(()=>{var l=!1;function d(){if(l)throw new Co("Login canceled.")}function h(){return f.apply(this,arguments)}function f(){return f=bh(function*(){try{var p=yield t();d(),qr.info("Logging in..."),yield r.login(p),d(),o(!0)}catch(b){if(!l){var v;qr.error("Unable to login:",b);var g=(v=He(b))!==null&&v!==void 0?v:"Unable to login. Verify credentials.";a(new ts(g)),o(!1)}}}),f.apply(this,arguments)}return h(),()=>{l=!0}},[r,t]),s?u.jsx(u.Fragment,{children:e}):u.jsx(De,{"data-testid":"auth-base-loading",isLoading:i==null,isLoaded:!1,errorMessage:He(i)})}var ns=c.createContext({}),It=c.createContext({}),Fn=c.createContext(null),yh={canLogout:!1};function wh(n){var{children:e}=n,t=Te(),r=c.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return u.jsx($n,{getLoginOptions:r,children:u.jsx(It.Provider,{value:yh,children:e})})}var Ch={Component:wh,isAvailable:n=>n.includes(es)};const rs=Ch;function Zr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Sh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Zr(a,r,i,s,o,"next",l)}function o(l){Zr(a,r,i,s,o,"throw",l)}s(void 0)})}}var Oh=R.module("AuthPluginParent"),xh={canLogout:!1};function Eh(n){return n!=null&&typeof n.type=="string"}function Th(){return nn.apply(this,arguments)}function nn(){return nn=Sh(function*(){Oh.info("Logging in by delegating to parent window...");var n=yield Dn(ka);if(!Eh(n))throw new Error("Unexpected login options response: ".concat(n));return n}),nn.apply(this,arguments)}function Ph(){var n;return(n=new URLSearchParams(window.location.search).get("authProvider"))!==null&&n!==void 0?n:""}function Ih(n){var{children:e}=n;return u.jsx($n,{getLoginOptions:Th,children:u.jsx(It.Provider,{value:xh,children:e})})}var Mh={Component:Ih,isAvailable:()=>Nn()!=null&&Ph()==="parent"};const is=Mh;function as(n){var{children:e,errorMessage:t,isLoggingIn:r=!1,onSubmit:i}=n;return u.jsxs("form",{className:"login-form",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),i==null||i(a)},children:[u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"flex-wrapper",children:[u.jsx("fieldset",{disabled:r,className:"container-fluid",children:e}),u.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:u.jsxs("button",{type:"submit",className:I("btn btn-primary",{"btn-spinner":r},{"btn-cancelable":r}),"data-testid":"btn-login",children:[r&&u.jsxs("span",{children:[u.jsx(bi,{className:"loading-spinner-vertical-align"}),u.jsx("span",{className:"btn-normal-content",children:"Logging in"}),u.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!r&&"Login"]})})]}),u.jsx("div",{className:"flex-spacer",children:t!=null&&u.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function ss(n){var{children:e,logoPath:t="./logo.png"}=n;return u.jsxs("div",{className:"login-container",children:[u.jsx(Ta,{}),u.jsxs("div",{className:"login-box",children:[u.jsx("div",{className:"logo",children:u.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,u.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function Xr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function $t(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Xr(a,r,i,s,o,"next",l)}function o(l){Xr(a,r,i,s,o,"throw",l)}s(void 0)})}}var rn="io.deephaven.authentication.psk.PskAuthenticationHandler",os="psk",an="io.deephaven.web.client.auth.psk.token",$e=R.module("AuthPluginPsk");function Nh(){return new URLSearchParams(window.location.search).get(os)}function Dh(){$e.debug2("clearWindowToken");var n=new URL(window.location.href);n.searchParams.delete(os),window.history.replaceState(null,"",n.href)}function Jr(){var n;return(n=Ke.get(an))!==null&&n!==void 0?n:null}function Ft(n){$e.debug2("Storing token in cookie",n),n!=null?Ke.set(an,n,{secure:!0,sameSite:"strict"}):Ke.remove(an)}function jh(n){var{children:e,logoPath:t}=n,r=Ge(),i=c.useRef(null),a=c.useRef(null),[s,o]=c.useState(),[l,d]=c.useState(!1),[h,f]=c.useState(!1),[p,v]=c.useState(!1),[g,b]=c.useState(""),w=c.useCallback(function(){var O=$t(function*(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;$e.info("Logging in..."),v(!0);var L=null;try{if(L=r.login({type:rn,token:A}),a.current=L,yield L,$e.info("Logged in successfully"),a.current!==L)return;Ft(A),f(!0)}catch(D){if(a.current!==L)return;if(d(!0),N){var W;$e.error("Unable to login",D);var S=(W=He(D))!==null&&W!==void 0?W:"Unable to login: Verify credentials.";o(new ts(S))}}v(!1)});return function(A){return O.apply(this,arguments)}}(),[r]),x=c.useCallback(()=>{a.current=null,v(!1)},[]),P=c.useCallback($t(function*(){$e.debug("onLogin");var O=Jr();h||p||O==null||w(O,!1)}),[h,p,w]),C=c.useCallback(()=>{Ft(null)},[]);Tt(P,C),c.useEffect(()=>{var O=!1;function A(){return N.apply(this,arguments)}function N(){return N=$t(function*(){var L,W=(L=Nh())!==null&&L!==void 0?L:Jr();if(Dh(),W==null){d(!0);return}v(!0);try{yield r.login({type:rn,token:W}),O||(Ft(W),f(!0),v(!1))}catch{O||(d(!0),v(!1))}}),N.apply(this,arguments)}return A(),()=>{O=!0}},[r]);var k=c.useCallback(()=>{p?x():w(g)},[x,p,w,g]);return c.useEffect(function(){var A;(A=i.current)===null||A===void 0||A.focus()},[i,l]),u.jsxs(u.Fragment,{children:[h&&e,l&&u.jsx(Ne,{in:!h,timeout:fe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(ss,{logoPath:t,children:u.jsx(as,{errorMessage:He(s),isLoggingIn:p,onSubmit:k,children:u.jsxs("div",{className:"form-group",children:[u.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),u.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:i,value:g,onChange:O=>{o(void 0),b(O.target.value)}})]})})})}),u.jsx(De,{"data-testid":"auth-psk-loading",isLoaded:h||l,isLoading:!h&&!l})]})}var Ah={Component:jh,isAvailable:n=>n.includes(rn)};const ls=Ah;function Qr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(t),!0).forEach(function(r){kh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function kh(n,e,t){return e=Lh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lh(n){var e=Rh(n,"string");return typeof e=="symbol"?e:String(e)}function Rh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _h=R.module("UserUtils");function us(n,e){return n.get("internal.webClient.appInit.".concat(e))}function cs(n){var e,t,r,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function o(w){return us(n,w)}function l(w,x){var P=o(w);return P==="true"?!0:P==="false"?!1:(P!==void 0&&_h.warn("Unexpected value for ".concat(w,": ").concat(P)),x)}var d=(e=o("name"))!==null&&e!==void 0?e:"",h=(t=o("operateAs"))!==null&&t!==void 0?t:d,f=(r=(i=o("groups"))===null||i===void 0?void 0:i.split(","))!==null&&r!==void 0?r:[],p=l("canCopy",!0),v=l("canDownloadCsv",!0),g=l("canUsePanels",!0),b=l("canLogout",!0);return Ut(Ut({name:d,operateAs:h,groups:f},a),{},{permissions:Ut({canUsePanels:g,canCopy:p,canDownloadCsv:v,canLogout:b},s)})}const $h=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:es,AUTH_HANDLER_TYPE_PSK:ph,AuthPluginAnonymous:rs,AuthPluginBase:$n,AuthPluginParent:is,AuthPluginPsk:ls,Login:ss,LoginForm:as,UserContext:Fn,UserOverrideContext:ns,UserPermissionsOverrideContext:It,getAppInitValue:us,getUserFromConfig:cs,isAuthPlugin:fh},Symbol.toStringTag,{value:"Module"}));var ds={react:M,"react-dom":oi,redux:Ds,"react-redux":js,"@deephaven/auth-plugins":$h,"@deephaven/components":pd,"@deephaven/jsapi-bootstrap":vd,"@deephaven/jsapi-components":sh,"@deephaven/jsapi-utils":Id,"@deephaven/log":Zo,"@deephaven/react-hooks":fl},Fh=As.createRequires(ds),Uh=ks({requires:Fh});const Vh=Uh;function Yr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Un(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Yr(a,r,i,s,o,"next",l)}function o(l){Yr(a,r,i,s,o,"throw",l)}s(void 0)})}}var ve=R.module("@deephaven/app-utils.PluginUtils");function Bh(n){return sn.apply(this,arguments)}function sn(){return sn=Un(function*(n){var e=yield Vh(n);return e}),sn.apply(this,arguments)}function Kh(n){return on.apply(this,arguments)}function on(){return on=Un(function*(n){var e=yield fetch(n);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),on.apply(this,arguments)}function Hh(n){return ln.apply(this,arguments)}function ln(){return ln=Un(function*(n){ve.debug("Loading plugins...");try{var e=yield Kh("".concat(n,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");ve.debug("Plugin manifest loaded:",e);for(var t=[],r=0;r<e.plugins.length;r+=1){var{name:i,main:a}=e.plugins[r],s="".concat(n,"/").concat(i,"/").concat(a);t.push(Bh(s))}for(var o=yield Promise.allSettled(t),l=new Map,d=0;d<o.length;d+=1){var h=o[d],{name:f}=e.plugins[d];if(h.status==="fulfilled"){var p,v=uh(h.value)?h.value:(p=h.value.default)!==null&&p!==void 0?p:h.value;v==null?ve.error("Plugin '".concat(f,"' is missing an exported value.")):l.set(f,v)}else ve.error("Unable to load plugin '".concat(f,"'"),h.reason)}return ve.info("Plugins loaded:",l),l}catch(g){return ve.error("Unable to load plugins:",g),new Map}}),ln.apply(this,arguments)}function Gh(n){var e,t;return(e=(t=n.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function Wh(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,r=Gh(e),i=[...n.entries(),...t.entries()].filter(l=>{var[,d]=l;return dh(d)||tn(d)}).map(l=>{var[d,h]=l;return tn(h)?{type:Pt.AUTH_PLUGIN,name:d,component:h.AuthPlugin.Component,isAvailable:h.AuthPlugin.isAvailable}:h}),a=i.filter(l=>{var{isAvailable:d}=l;return d(r,e)});if(a.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(r));a.length>1&&ve.warn("More than one login plugin available, will use the first one: ",a.map(l=>{var{name:d}=l;return d}).join(", "));var{name:s,component:o}=a[0];return ve.info("Using LoginPlugin",s),o}function zh(n){var e=[...n.entries()].filter(t=>hh(t[1]));return ve.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,a=Array.isArray(i.themes)?i.themes:[i.themes];return a.map(s=>{var{name:o,baseTheme:l,styleContent:d}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:wi(r,o),name:o,styleContent:d}})}).flat()}var qh=li.createRequires(()=>ds),Zh=li.createRemoteComponent({requires:qh});const bf=Zh;function ei(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Xh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){ei(a,r,i,s,o,"next",l)}function o(l){ei(a,r,i,s,o,"throw",l)}s(void 0)})}}var Mt=c.createContext(null);function Jh(n){var{pluginsUrl:e,getCorePlugins:t,children:r}=n,[i,a]=c.useState(null);return c.useEffect(function(){var o=!1;function l(){return d.apply(this,arguments)}function d(){return d=Xh(function*(){var h,f=(h=yield t==null?void 0:t())!==null&&h!==void 0?h:[],p=yield Hh(e);if(!o){var v=f.map(g=>[g.name,g]);a(new Map([...v,...p]))}}),d.apply(this,arguments)}return l(),()=>{o=!0}},[e,t]),u.jsx(Mt.Provider,{value:i,children:r})}function Qh(){var n=An();return c.useEffect(function(){n.postMessage(Mn(In))},[n]),null}function ti(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Yh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){ti(a,r,i,s,o,"next",l)}function o(l){ti(a,r,i,s,o,"throw",l)}s(void 0)})}}var ef=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:is}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:ls}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:rs}]]);function tf(n){var{children:e}=n,t=Ge(),r=c.useContext(Mt),[i,a]=c.useState(),[s,o]=c.useState();c.useEffect(function(){var f=!1;function p(){return v.apply(this,arguments)}function v(){return v=Yh(function*(){try{var g=yield t.getAuthConfigValues();f||a(new Map(g))}catch(b){f||o(b)}}),v.apply(this,arguments)}return p(),()=>{f=!0}},[t]);var l=c.useMemo(()=>{if(!(r==null||i==null))try{return Wh(r,i,ef)}catch(h){o(h)}},[i,r]),d=l==null||i==null;return d||s!=null?u.jsx(De,{isLoading:d&&s==null,errorMessage:He(s)}):u.jsx(l,{authConfigValues:i,children:u.jsxs(u.Fragment,{children:[u.jsx(Qh,{}),e]})})}function yf(n){return new URL(n,"".concat(window.location))}function nf(){var n=new URLSearchParams(window.location.search);return n.get("envoyPrefix")}function rf(){var n=nf();return n!=null?{headers:{"envoy-prefix":n}}:{headers:{}}}function af(n){var{children:e}=n,t=c.useContext(Qa);return t?u.jsx(u.Fragment,{children:e}):u.jsx(De,{"data-testid":"fonts-loaded-loading"})}function ni(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function sf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){ni(a,r,i,s,o,"next",l)}function o(l){ni(a,r,i,s,o,"throw",l)}s(void 0)})}}var hs=c.createContext(null);function of(n){var{children:e}=n,t=Ge(),[r,i]=c.useState(),[a,s]=c.useState();c.useEffect(function(){var d=!1;function h(){return f.apply(this,arguments)}function f(){return f=sf(function*(){try{var p=yield t.getServerConfigValues();d||i(new Map(p))}catch(v){d||s(v)}}),f.apply(this,arguments)}return h(),()=>{d=!0}},[t]);var o=r==null;return o||a!=null?u.jsx(De,{isLoading:o&&a==null,errorMessage:He(a)}):u.jsx(hs.Provider,{value:r,children:e})}function lf(){return Je(hs,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function uf(n){var{children:e}=n,t=lf(),r=c.useContext(ns),i=c.useContext(It),a=cs(t,r,i);return u.jsx(Fn.Provider,{value:a,children:e})}function cf(n){var e,{children:t}=n,r=Na(),i=c.useContext(Mt),{registerThemes:a}=r;return c.useEffect(()=>{i!=null&&a({base:yi(),custom:zh(i)})},[i,a]),u.jsxs(Pn.Provider,{value:r,children:[(e=r.activeThemes)===null||e===void 0?void 0:e.map(s=>u.jsx("style",{"data-theme-key":s.themeKey,children:s.styleContent},s.themeKey)),t]})}function wf(n){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:r,serverUrl:i,children:a}=n,s=c.useMemo(()=>rf(),[]),[o,l]=c.useState(0),d=c.useCallback(()=>{},[]),h=c.useCallback(()=>{l(f=>f+1)},[]);return Tt(d,h),u.jsx(oh,{fontClassNames:e,children:u.jsx(Jh,{getCorePlugins:r,pluginsUrl:t,children:u.jsx(cf,{children:u.jsx(Oi,{serverUrl:i,options:s,children:u.jsx(za,{children:u.jsx(tf,{children:u.jsx(of,{children:u.jsx(uf,{children:u.jsx(So,{children:u.jsx(af,{children:a})})})})})})},o)})})})}function df(){return Je(Mt,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsBootstrap or PluginsContext.Provider.")}function Cf(){return Je(Fn,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}var hf=R.module("@deephaven/app-utils/useTablePlugin");function Sf(){var n=df(),e=c.useCallback(t=>{var r=n.get(t);if(r!=null){if(ch(r))return r.component;if(Ya(r))return r.TablePlugin}var i="Unable to find table plugin ".concat(t,".");throw hf.error(i),new Error(i)},[n]);return e}export{wf as AppBootstrap,tf as AuthBootstrap,So as ConnectionBootstrap,Ef as ConnectionContext,oh as FontBootstrap,af as FontsLoaded,Qa as FontsLoadedContext,Jh as PluginsBootstrap,Mt as PluginsContext,bf as RemoteComponent,cf as ThemeBootstrap,Gh as getAuthHandlers,Wh as getAuthPluginComponent,yf as getBaseUrl,rf as getConnectOptions,nf as getEnvoyPrefix,zh as getThemeDataFromPlugins,Kh as loadJson,Bh as loadModulePlugin,Hh as loadModulePlugins,Tf as useConnection,Sf as useLoadTablePlugin,df as usePlugins,lf as useServerConfig,Cf as useUser};
9
- //# sourceMappingURL=index-549429e9.js.map
8
+ `).map(L=>L.trim()).join(" ")}function x(){if(g.current){g.current.style.height="0";var N=g.current.scrollHeight+(g.current.offsetHeight-g.current.clientHeight);N>0&&(g.current.style.height="".concat(N,"px"))}}function P(N){var L=N.target.value;p&&(o&&(L=b(L)),v(!1)),f(L),r(L)}function C(){g.current&&(o&&(f(b(h)),x()),g.current.scrollLeft=0)}function k(){g.current&&document.activeElement!==g.current&&g.current.focus()}function O(){o&&(f(w(h)),r(w(h)))}function A(){v(!0)}return c.useEffect(function(){x()},[h]),u.jsx("textarea",{ref:g,id:l,className:I(e,"auto-resize-textarea form-control"),placeholder:a,value:h,rows:1,onChange:P,onFocus:C,onMouseDown:k,onBlur:O,onPaste:A,spellCheck:i,disabled:s,"data-testid":d})}Cn.propTypes={value:m.string.isRequired,onChange:m.func.isRequired,className:m.string,placeholder:m.string,spellCheck:m.bool,disabled:m.bool,delimiter:m.string,id:m.string,"data-testid":m.string};Cn.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function Ye(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:I("btn-group",t),style:r,role:"group","data-testid":i,children:e})}Ye.displayName="ButtonGroup";Ye.propTypes={children:m.node.isRequired,className:m.string,style:m.object,"data-testid":m.string};Ye.defaultProps={className:null,style:{},"data-testid":void 0};var $l=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function sr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function or(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sr(Object(t),!0).forEach(function(r){Fl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fl(n,e,t){return e=Ul(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ul(n){var e=Bl(n,"string");return typeof e=="symbol"?e:String(e)}function Bl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Vl(n,e){if(n==null)return{};var t=Kl(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Kl(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var Hl=["primary","secondary","tertiary","success","danger","inline","ghost"],Gl=["group-end"];function Wl(n,e){switch(n){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 I("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function zl(n){switch(n){case"group-end":return I("pl-2","pr-3")}}var gt=M.forwardRef((n,e)=>{var{kind:t,variant:r,type:i,tooltip:a,icon:s,disabled:o=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:f,onMouseUp:p,onMouseEnter:v,onMouseLeave:g,onKeyDown:b,className:w,style:x,children:P,tabIndex:C,"data-testid":k,"aria-label":O}=n,A=Vl(n,$l),N=!!(s&&P==null),L=Wl(t,N),W;r&&(W=zl(r));var S;s&&(S=M.isValidElement(s)?s:u.jsx(X,{icon:s}));var D;a!==void 0&&(D=typeof a=="string"?u.jsx(mt,{children:a}):a);var F=O;O===void 0&&N&&a!=null&&typeof a=="string"&&(F=a);var T=u.jsxs("button",or(or({"data-testid":k,ref:e,type:i,className:I("btn",L,W,{active:l},w),onClick:d,onContextMenu:h,onMouseUp:p,onMouseDown:f,onMouseEnter:v,onMouseLeave:g,onKeyDown:b,style:x,disabled:o,tabIndex:C,"aria-label":F},A),{},{children:[s&&S,P,a!=null&&!o&&D]}));return o?u.jsxs("span",{className:"btn-disabled-wrapper",children:[T,a!==void 0&&D]}):T});gt.displayName="Button";gt.propTypes={kind:m.oneOf(Hl).isRequired,variant:m.oneOf(Gl),type:m.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:r}=n;return e===void 0&&t!=null&&r==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!M.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:m.bool,active:m.bool,onClick(n){var{onClick:e,type:t}=n;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:m.func,onMouseUp:m.func,onMouseDown:m.func,onMouseEnter:m.func,onMouseLeave:m.func,onKeyDown:m.func,tabIndex:m.number,children:m.node,className:m.string,style:m.object,"data-testid":m.string};gt.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 ie=gt;function ql(n){var{blockInteraction:e=!0,children:t,debounceMs:r,isOpen:i=!1}=n,a=vt(i,r);return u.jsxs(u.Fragment,{children:[e&&i&&u.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),M.cloneElement(t,{isOpen:i&&a})]})}function Zl(n){var{className:e,icon:t,isOpen:r=!1,subtitle:i,title:a}=n;return u.jsx(dn,{isOpen:r,className:e,children:u.jsx(hn,{children:u.jsxs("div",{className:"info-modal",children:[t!=null&&u.jsx("div",{className:"message-icon",children:u.jsx(X,{icon:t})}),u.jsx("div",{className:"message-header",children:a}),i!=null&&u.jsx("div",{className:"message-content",children:i})]})})})}function aa(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return u.jsx("div",{className:e,"data-testid":r,children:t})}function Sn(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:a,onDiscard:s,onModalDisable:o,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:f=!1,children:p,"data-testid":v}=n,g=c.useRef(null),b=c.useRef(null),w=c.useCallback(()=>{b.current!==null&&b.current.checked&&o&&o(),a()},[a,o]),x=c.useCallback(()=>{var C;(C=g.current)===null||C===void 0||C.focus()},[]),P="";return e&&(P=typeof r=="function"?r():r),u.jsxs(dn,{isOpen:e,className:"theme-bg-light",onOpened:x,children:[u.jsx(ui,{closeButton:!1,children:t}),u.jsx(hn,{children:P}),u.jsxs(aa,{children:[o&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:b,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(ie,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(ie,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs(Ye,{children:[u.jsx(ie,{kind:f?"danger":"primary",onClick:w,ref:g,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),p]})]})]})}Sn.propTypes={isOpen:m.bool.isRequired,headerText:m.string.isRequired,bodyText:m.oneOfType([m.string,m.func]).isRequired,onCancel:m.func,onConfirm:m.func.isRequired,onDiscard:m.func,onModalDisable:m.func,cancelButtonText:m.string,confirmButtonText:m.string,discardButtonText:m.string,children:m.node,"data-testid":m.string};Sn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var bt=M.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,onClick:a,style:s,id:o}=n;return u.jsx("button",{ref:e,type:"button",className:I("btn",r),onClick:a,style:s,disabled:i,id:o,children:t})});bt.displayName="Button";bt.propTypes={children:m.node,className:m.string,disabled:m.bool,onClick:m.func,style:m.shape({}),id:m.string};bt.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Xl=bt;function lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ur(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lr(Object(t),!0).forEach(function(r){Jl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Jl(n,e,t){return e=Ql(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ql(n){var e=Yl(n,"string");return typeof e=="symbol"?e:String(e)}function Yl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function eu(n){var{styleProps:e,selectedItemCount:t,onClearSelection:r}=n;return u.jsx(ys,ur(ur({UNSAFE_className:yn.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:r}))}function tu(n){var{className:e,isFlipped:t,children:r,"data-testid":i}=n,a=d=>{if(r.length!==2)throw new Error("CardFlip requires 2 children to function");return r[d]},s=c.useRef(null),o=c.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=c.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return c.useEffect(function(){if(!s.current)throw Error("ref undefined");s.current.addEventListener("transitionstart",o);var h=s.current;return function(){if(h!=null)return h.removeEventListener("transitionstart",o)}},[o]),u.jsxs("div",{className:I(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[u.jsx("div",{className:"card-flip--back",children:a(0)}),u.jsx("div",{ref:s,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}var cr=R.module("GlobalContextAction");class nu extends c.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:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),cr.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!Q.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;cr.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const ru=nu;class iu extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var a=e[i],{shortcut:s}=a;if(a.title!=null||a.menuElement||s){var o=u.jsx(ru,{action:a,"data-testid":t},"".concat(a.title,".").concat(s==null?void 0:s.id));r.push(o)}}return r}}const au=iu;function sa(n,e,t){return e=su(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function su(n){var e=ou(n,"string");return typeof e=="symbol"?e:String(e)}function ou(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var nt=R.module("ContextActions");class oa extends c.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var a=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}}constructor(e){super(e),sa(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=M.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!At(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!At(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}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 r=e.target,i=function(){var{classList:d}=r,h=t.find(f=>d.contains(f));if(h!==void 0)return nt.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement};r!=null;){var a=i();if(typeof a=="object")return a.v}if(Q.isContextActionEvent(e)||(e.contextActions=[]),!!Q.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var o=s;Array.isArray(o)&&(o=o.filter(l=>At(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(o)}nt.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!Q.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var a;nt.debug("Context hotkey matched!",e),(a=i.action)===null||a===void 0||a.call(i,e),e.stopPropagation(),e.preventDefault(),nt.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(au,{actions:t})})}}sa(oa,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const lu=oa;function la(n,e,t){return e=uu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uu(n){var e=cu(n,"string");return typeof e=="symbol"?e:String(e)}function cu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ce extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(ce.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(ce.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:r}=this.props;if(r!==void 0&&r){var i=t.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:t,in:r,"data-testid":i}=this.props;return u.jsx(Ne,{in:r,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:ce.handleEnter,onEntering:ce.handleEntering,onEntered:this.handleEntered,onExit:ce.handleExit,onExiting:ce.handleExiting,timeout:350,children:a=>u.jsx("div",{className:I({collapse:a==="exited"},t),"data-testid":i,children:e})})}}la(ce,"propTypes",{className:m.string,in:m.bool.isRequired,children:m.node.isRequired,autoFocusOnShow:m.bool,"data-testid":m.string});la(ce,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const du=ce;var yt=M.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:a,inputClassName:s,isInvalid:o,labelClassName:l,name:d,onChange:h,"data-testid":f}=n,[p]=c.useState(Ee()),v=bn(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var g=c.useCallback(b=>{v.current&&(v.current.indeterminate=t===null),h&&h(b)},[v,t,h]);return u.jsxs("div",{className:I("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:I("custom-control-input",s,{"is-invalid":o}),disabled:a,id:p,name:d,onChange:g,"data-testid":f}),u.jsx("label",{className:I("custom-control-label",l),htmlFor:p,children:r})]})});yt.displayName="Checkbox";yt.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:m.node.isRequired,className:m.string,disabled:m.bool,inputClassName:m.string,isInvalid:m.bool,labelClassName:m.string,name:m.string,onChange:m.func,"data-testid":m.string};yt.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const dt=yt;function ua(n,e,t){return e=hu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hu(n){var e=fu(n,"string");return typeof e=="symbol"?e:String(e)}function fu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ca extends c.PureComponent{constructor(e){super(e),ua(this,"inputField",void 0),this.inputField=M.createRef()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:a,disabled:s,matchCount:o,id:l,onKeyDown:d,"data-testid":h}=this.props;return u.jsxs("div",{className:I("search-group",a),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:s,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),o!=null&&u.jsx("span",{className:"search-match",children:o}),u.jsx("span",{className:"search-icon",children:u.jsx(X,{icon:_s})})]})}}ua(ca,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0});const wt=ca;function dr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function pu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dr(Object(t),!0).forEach(function(r){te(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function te(n,e,t){return e=vu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vu(n){var e=mu(n,"string");return typeof e=="symbol"?e:String(e)}function mu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ht;(function(n){n.UP="UP",n.DOWN="DOWN"})(Ht||(Ht={}));class de extends c.Component{constructor(e){super(e),te(this,"popper",void 0),te(this,"cbContainer",void 0),te(this,"toggleButton",void 0),te(this,"menuContainer",void 0),te(this,"input",void 0),te(this,"searchInput",void 0),te(this,"getCachedFilteredOptions",re((t,r)=>t.filter(i=>i.title.toLowerCase().indexOf(r.toLowerCase())>=0||i.value.toLowerCase().indexOf(r.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=M.createRef(),this.cbContainer=M.createRef(),this.toggleButton=M.createRef(),this.menuContainer=M.createRef(),this.input=M.createRef(),this.searchInput=M.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,r,{filter:i,filteredOptions:a,keyboardOptionIndex:s}=this.state,{options:o}=this.props,l=i?a: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(),(r=this.input.current)===null||r===void 0||r.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(de.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(de.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":i!==""?(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:r,keyboardOptionIndex:i}=this.state,{options:a}=this.props,s=t?r:a,o=s.length,l=0;switch(e){case de.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case de.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(i+l+o)%o})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?r||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,r=Number(e.currentTarget.value),{filter:i,filteredOptions:a}=this.state,{options:s}=this.props,o=i?a:s;this.updateInputValue(o[r].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:r}=this.props,i=e.target.value,a=this.getCachedFilteredOptions(r,i);this.setState({filter:i,filteredOptions:a,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 r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:r}=this.state,{options:i}=this.props,a=t?r:i,s=a.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:r}=this.state;return u.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:r},onBlur:this.handleMenuBlur,children:[u.jsx("div",{className:"cb-search-input-container",children:u.jsx(wt,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u.jsx("div",{className:"cb-options-container",children:u.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:r,filteredOptions:i}=this.state,a=r?i:e;return a.map((s,o)=>{var l="option-".concat(o,"-").concat(s.value);return u.jsx("button",{type:"button",value:o,className:I("cb-option-btn",{"keyboard-active":t===o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:s.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultValue:a,spellCheck:s,"data-testid":o}=this.props,{value:l}=this.state,{popperOptions:d}=this.props;return d=pu({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},d),u.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:I("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:r,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o!==void 0?"".concat(o,"-input"):void 0}),u.jsx("div",{className:"input-group-append cb-dropdown",children:u.jsxs("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:r,"data-testid":o!==void 0?"".concat(o,"-btn"):void 0,children:[u.jsx(X,{icon:$s}),u.jsx(We,{ref:this.popper,options:d,className:I("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}te(de,"MENU_NAVIGATION_DIRECTION",Ht);te(de,"DROP_DOWN_MENU_HEIGHT",200);te(de,"propTypes",{options:m.arrayOf(m.shape({title:m.string.isRequired,value:m.string.isRequired})).isRequired,popperOptions:m.shape({title:m.string.isRequired,value:m.string.isRequired}),onChange:m.func,inputPlaceholder:m.string,searchPlaceholder:m.string,disabled:m.bool,className:m.string,defaultValue:m.string,spellCheck:m.bool,onEnter:m.func,"data-testid":m.string});te(de,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const gu=de;function bu(n){var{copy:e,kind:t="ghost",tooltip:r="Copy",className:i,"data-testid":a,children:s}=n,[o,l]=Zi();return u.jsx(ie,{kind:t,className:i,"data-testid":a,icon:o?Fs:Us,tooltip:o?"Copied":r,onClick:()=>{l(typeof e=="function"?e():e)},children:s})}function Ct(n,e,t){return n.substring(0,e)+t+n.substring(e+1)}function da(n,e,t){return n.length<t?"".concat(n).concat(e.substring(n.length,t)):n}function Gt(n,e){for(var{length:t}=n,r=n.length-1;r>=0&&e[r]===n[r];r-=1)t=r;return n.substring(0,t)}function hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hr(Object(t),!0).forEach(function(r){wu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function wu(n,e,t){return e=Cu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cu(n){var e=Su(n,"string");return typeof e=="symbol"?e:String(e)}function Su(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var se=R.module("MaskedInput"),Ae={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},rt=" ",ha=M.forwardRef((n,e)=>{var{className:t,example:r,getNextSegmentValue:i=(T,E,y)=>y,getPreferredReplacementString:a=Ct,onChange:s=()=>!1,onSelect:o=()=>!1,onSubmit:l,pattern:d,placeholder:h,selection:f,value:p,onFocus:v=()=>!1,onBlur:g=()=>!1,"data-testid":b}=n,w=bn(e),x=c.useMemo(()=>Array.isArray(r)?r:[r],[r]),P=c.useMemo(()=>x[0].replace(/[a-zA-Z0-9]/g,rt),[x]);c.useEffect(function(){if(f!=null){var E;se.debug("setting selection...",f);var{selectionStart:y,selectionEnd:j,selectionDirection:_}=f;(E=w.current)===null||E===void 0||E.setSelectionRange(y,j,_),se.debug("selection set!")}},[f,w]);var C=c.useCallback(T=>{for(var E=T,y=T,j=x.length>0?x[0]:p,_=E-1;_>=0&&/[a-zA-Z0-9]/g.test(j.charAt(_));_-=1)E=_;for(var K=y;K<j.length&&/[a-zA-Z0-9]/g.test(j.charAt(K));K+=1)y=K+1;var ae=E===y?Ae.NONE:Ae.BACKWARD;return{selectionStart:E,selectionEnd:y,selectionDirection:ae}},[x,p]);function k(T,E){for(var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T.length,j="",_=0;_<y;_+=1)T.charAt(_)!==rt?j=j.concat(T[_]):j=j.concat(E[_]);return j=j.concat(E.substring(y)),j}function O(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.length,y=new RegExp("^".concat(d,"$"));if(y.test(T))return!0;for(var j=0;j<x.length;j+=1){var _=k(T,x[j],E);if(y.test(_))return!0}return!1}function A(T){var E=C(T),y=E.selectionEnd+1;return y>=p.length?E:C(y)}function N(T){var E=C(T),y=E.selectionStart-1;return y<=0?E:C(y)}function L(T,E){var y=C(T),j=p.substring(y.selectionStart,y.selectionEnd),_=i(y,E,j,p),K=p.substring(0,y.selectionStart)+_+p.substring(y.selectionEnd);O(K,y.selectionEnd)&&(s(K),o(y))}var W=c.useCallback(T=>{var{selectionStart:E=0,selectionEnd:y=0,selectionDirection:j="none"}=T.target;if(E===null||y===null||j===null){se.error("Selection attempted on non-text input element",T.target);return}if(se.debug2("handleSelect",E,y,j),!(f!=null&&E===f.selectionStart&&y===f.selectionEnd)){if(f!=null&&E===p.length&&y===p.length&&T.nativeEvent.type!=="mouseup"){o(yu({},f));return}if(E===y){var _=C(E);se.debug("Selection segment from ",E,y,"=>",_),o(_)}else o({selectionStart:E,selectionEnd:y,selectionDirection:j})}},[C,o,f,p]),S=c.useCallback(T=>{var E;if(w.current){se.debug("handleSelectCapture",T);var y=(E=w.current.selectionStart)!==null&&E!==void 0?E:0;y===p.length&&f!=null&&y!==f.selectionStart&&(T.preventDefault(),T.stopPropagation())}},[w,f,p]);function D(T){if(T.preventDefault(),T.stopPropagation(),!!w.current){var{key:E}=T,{selectionStart:y=0,selectionEnd:j=0}=w.current;if(y===null||j===null){se.error("Selection arrow nvaigation attempted on non-text input element",T.target);return}E==="ArrowLeft"?o(N(y)):E==="ArrowRight"?o(A(j)):E==="ArrowUp"?L(y,-1):E==="ArrowDown"&&L(y,1)}}function F(T){if(w.current){se.debug("handleKeyDown",T);var{key:E}=T,{selectionStart:y=0,selectionEnd:j=0}=w.current;if(y===null||j===null){se.error("Selection key event on non-text input element",T.target);return}if(E==="Enter"){l==null||l(T);return}if(E.startsWith("Arrow")){D(T);return}if(E==="Delete"||E==="Backspace"){if(T.preventDefault(),T.stopPropagation(),j>=Gt(p,P).length){var _=p.substring(0,y===j?y-1:y),K=Gt(_,P);K!==p&&(s(K),o({selectionStart:K.length,selectionEnd:K.length,selectionDirection:Ae.NONE}));return}if(y!==j){var ae=p.substring(0,y)+p.substring(y,j).replace(/[a-zA-Z0-9]/g,rt)+p.substring(j);se.debug("Range ",y,j,"deleted, setting value",ae),s(ae),o({selectionStart:y,selectionEnd:y,selectionDirection:Ae.NONE})}else if(y>0)for(var U=y-1;U>=0;U-=1){var V=p.substring(0,U)+p.substring(U,y).replace(/[a-zA-Z0-9]/g,rt)+p.substring(y);if(V!==p){s(V),o({selectionStart:U,selectionEnd:U,selectionDirection:Ae.NONE});return}}return}if(!(T.altKey||T.metaKey||T.ctrlKey||E.length>1)){T.preventDefault(),T.stopPropagation();for(var B=Array.from(new Set([E,E.toUpperCase(),E.toLowerCase()])),Z=0;Z<B.length;Z+=1)for(var be=B[Z],et=/[a-zA-Z0-9]/g.test(be)?x[0].length-1:y,ye=y;ye<=et;ye+=1){var hs=da(p,x[0],ye+1),Nt=a(hs,ye,be,y,j);if(O(Nt,ye+1)){var Bn=C(ye),Dt=ye+1,jt={selectionStart:Dt,selectionEnd:Dt,selectionDirection:Ae.NONE};if(Dt>=Bn.selectionEnd){var Vn=A(ye);Vn.selectionStart!==Bn.selectionStart&&(jt=Vn)}se.debug("handleKeyDown",E,"=>",Nt,jt),s(Nt),o(jt);return}}}}}return u.jsx("input",{ref:w,className:I("form-control masked-input",t),type:"text",pattern:d,placeholder:h,value:p,onChange:()=>{},onKeyDown:F,onSelect:W,onSelectCapture:S,onFocus:v,onBlur:g,"data-testid":b})});ha.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(n,e,t)=>t,getPreferredReplacementString:Ct,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const St=ha;var Ou=R.module("TimeInput"),xu="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Eu=["00:00:00","12:34:56","23:59:59"],fa=M.forwardRef((n,e)=>{var{allowValueWrapping:t=!0,className:r="",onChange:i=()=>!1,value:a=0,onFocus:s=()=>!1,onBlur:o=()=>!1,onSelect:l=()=>!1,"data-testid":d}=n,[h,f]=c.useState(qe.formatTime(a)),[p,v]=c.useState(),g=c.useRef(null);c.useImperativeHandle(e,()=>({focus:()=>{var C;(C=g.current)===null||C===void 0||C.focus()},setSelection:C=>{var k;(k=g.current)===null||k===void 0||k.focus(),v(C)}}),[]),c.useEffect(function(){f(qe.formatTime(a))},[a]);function b(C,k,O){var A=C.selectionStart===0?24:60,N=parseInt(O,10)-k;return Number.isNaN(N)?N=0:t?N=(N%A+A)%A:N=Math.min(Math.max(0,N),A-1),"".concat(N).padStart(2,"0")}function w(C,k,O,A,N){return A===0&&N===2&&k===1&&parseInt(O,10)>1?"0".concat(O).concat(C.substring(2)):Ct(C,k,O)}function x(C){Ou.debug("handleChange",C),f(C),qe.isTimeString(C)&&i(qe.parseTime(C))}var P=c.useCallback(C=>{v(C),l(C)},[l]);return u.jsx(St,{ref:g,className:r,example:Eu,getNextSegmentValue:b,getPreferredReplacementString:w,onChange:x,onSelect:P,pattern:xu,selection:p,value:h,onFocus:s,onBlur:o,"data-testid":d})});fa.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const ht=fa;function fr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fr(Object(t),!0).forEach(function(r){Ze(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):fr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ze(n,e,t){return e=Pu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pu(n){var e=Iu(n,"string");return typeof e=="symbol"?e:String(e)}function Iu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let pa=class extends c.PureComponent{constructor(e){var t;super(e),Ze(this,"container",void 0),Ze(this,"oldFocus",void 0),Ze(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=M.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,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=Q.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:Q.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var a;i=Q.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;i=Q.getNextMenuItem((s=i)!==null&&s!==void 0?s:0,1,t)}r!==i&&(i!==null?this.setKeyboardIndex(i):(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:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(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,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:a}=this.state,s=0;s<i.length;s+=1){var o=i[s];s>0&&o.group!==i[s-1].group&&e.push(u.jsx("hr",{},"".concat(s,".separator")));var l=u.jsx(Ci,{isKeyboardSelected:r===s,isMouseSelected:a===s,menuItem:o,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:Tu({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};Ze(pa,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const Mu=pa;function pr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pr(Object(t),!0).forEach(function(r){Re(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Re(n,e,t){return e=Nu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nu(n){var e=Du(n,"string");return typeof e=="symbol"?e:String(e)}function Du(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class va extends c.PureComponent{constructor(e){super(e),Re(this,"container",void 0),Re(this,"parent",void 0),Re(this,"popper",void 0),Re(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=M.createRef(),this.parent=null,this.popper=M.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:r,"data-testid":i}=this.props,{menuStyle:a}=this.props,{options:s,popperOptions:o}=this.props;return o=vr({placement:"bottom"},o),s=vr({separateKeyboardMouse:!0},s),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(We,{ref:this.popper,options:o,className:I("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Mu,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:a})})})}}Re(va,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const ma=va;function mr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ju(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mr(Object(t),!0).forEach(function(r){xe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xe(n,e,t){return e=Au(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Au(n){var e=ku(n,"string");return typeof e=="symbol"?e:String(e)}function ku(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var gr=-1,Wt;(function(n){n.UP="UP",n.DOWN="DOWN"})(Wt||(Wt={}));class Y extends c.Component{constructor(e){super(e),xe(this,"csContainer",void 0),xe(this,"menuContainer",void 0),xe(this,"button",void 0),xe(this,"input",void 0);var{value:t,valueToTime:r}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=M.createRef(),this.menuContainer=M.createRef(),this.button=M.createRef(),this.input=M.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:r(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:r}=this.props,{customTime:i}=this.state;if(t===null)return r;for(var a=0;a<e.length;a+=1){var s=e[a];if(s.value===t)return s.title}return qe.formatTime(i)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:r,inputFocused:i}=this.state,{options:a}=this.props;switch(e.key){case"Enter":case" ":i?this.updateFromCustom():this.updateInputValue(a[r].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Y.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:r}=this.state,{options:i}=this.props,a=i.length,s=t;switch(e){case Y.MENU_NAVIGATION_DIRECTION.UP:if(!r&&t===0){this.focusInput();break}else r&&this.focusOption(t);t>0&&!r?(s=(s-1)%a,this.setState({keyboardOptionIndex:s})):t===0&&(s=a-1,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break;case Y.MENU_NAVIGATION_DIRECTION.DOWN:if(!r&&t===a-1){this.focusInput();break}else r&&this.focusOption(t);t<a&&!(r&&t===0)&&(s=(s+1)%a,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:r,timeToValue:i}=this.props,{customTime:a}=this.state;if(t===gr){var s=i(a);this.updateAndClose(s)}else this.updateAndClose(r[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:r}=this.props,{keyboardOptionIndex:i}=this.state;this.scrollOptionIntoView(i);var a=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(a instanceof HTMLElement&&a.focus(),r!==null){var s=t.map(o=>o.value).indexOf(r);s<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,r=t(e);this.updateInputValue(r),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,r=e(t);this.updateInputValue(r)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var r=e.map(i=>i.value).indexOf(t);r>0&&this.setState({keyboardOptionIndex:r})}}scrollOptionIntoView(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.offsetTop>Y.DROP_DOWN_MENU_HEIGHT?r.scrollTop=i.offsetTop-Y.DROP_DOWN_MENU_HEIGHT:(i instanceof HTMLElement&&i.offsetTop<0||e===0)&&(r.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u.jsx("div",{className:"cs-options-container",children:u.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:r,customText:i}=this.props,{keyboardOptionIndex:a,customTime:s,inputFocused:o}=this.state,l=!1,d=[],h=0;h<e.length;h+=1){var f=e[h],p="option-".concat(h,"-").concat(f.value);l=l||f.value===t,d.push(u.jsxs("button",{type:"button",value:h,className:I("cs-option-btn",{"keyboard-active":a===h&&!o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[f.value===t&&u.jsx(X,{icon:r,className:"mr-2"}),f.value!==t&&u.jsx("span",{className:"mr-4"}),f.title]},p))}return d.push(u.jsx("hr",{className:"cs-divider"},"option-divider")),d.push(u.jsxs("button",{type:"button",value:gr,className:I("cs-option-btn",{"keyboard-active":o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u.jsx(X,{icon:r,className:"mr-2"}):u.jsx("span",{className:"mr-4"}),i]},"option-custom-label")),d.push(u.jsxs("div",{className:"cs-custom-container",children:[u.jsx("span",{className:"mr-2"}),u.jsx(ht,{ref:this.input,onChange:this.handleCustomInput,value:s,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u.jsx("span",{className:"ml-2"})]},"cs-custom-container")),d.push(u.jsx("hr",{className:"mb-2"},"option-end")),d}render(){var{disabled:e,invalid:t,value:r,"data-testid":i}=this.props,{menuIsOpen:a}=this.state,{popperOptions:s}=this.props;return s=ju({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},s),u.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":i,children:u.jsx("div",{className:I("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:u.jsxs("button",{type:"button",className:I("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u.jsx("span",{className:I({"text-muted":r===null}),children:this.getSelectedText()}),u.jsx("span",{children:u.jsx(X,{icon:ci,className:"cs-caret"})}),u.jsx(ma,{isShown:a,actions:{menuElement:this.renderMenuElement()},popperOptions:s,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}xe(Y,"MENU_NAVIGATION_DIRECTION",Wt);xe(Y,"DROP_DOWN_MENU_HEIGHT",125);xe(Y,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:Bs,customText:"Custom",placeholder:"Select a time",valueToTime:n=>n===null?0:Math.round(n/1e3),timeToValue:n=>n*1e3,invalid:!1,"data-testid":void 0});const Lu=Y;function ke(n,e,t,r,i){var a=r-t+1,s=((parseInt(e,10)-n-t)%a+a)%a+t;return"".concat(s).padStart(i,"0")}function ga(n,e,t){var{selectionStart:r}=n;return r===0?ke(e,t,1900,2099,4):r===5?ke(e,t,1,12,2):r===8?ke(e,t,1,31,2):r===11?ke(e,t,0,23,2):r===17||r===14?ke(e,t,0,59,2):r===20||r===24||r===28?ke(e,t,0,999,3):t}function zt(n){var e=n.substring(0,23),t=n.substring(23,26),r=n.substring(26);return[e,t,r].filter(i=>i!=="").join("​")}var Ru=R.module("DateTimeInput"),_u="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",$u="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}​[0-9]{3}​[0-9]{3}",Fu="".concat(_u," ").concat($u),ot="2022-01-01",ba="".concat(ot," 00:00:00.000000000"),Uu="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function br(n){return n!=null&&n.length>=ot.length?"".concat(n.substring(0,ot.length)).concat(n.substring(ot.length).replace(/\u2007/g,"0")).concat(ba.substring(n.length)):n}function yr(n){return n.replace(/\u200B/g,"")}var Bu=[zt(ba)],On=M.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:s=()=>{},onSubmit:o,"data-testid":l}=n,[d,h]=c.useState(i.length>0?zt(i):""),[f,p]=c.useState(),v=c.useCallback(b=>{Ru.debug("handleChange",b),h(b),r(br(yr(b)))},[r]),g=c.useCallback(()=>{var b=yr(d),w=br(b);w!==b&&h(zt(w)),s()},[d,s]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(St,{ref:e,className:I(t),example:Bu,getNextSegmentValue:ga,onChange:v,onSelect:p,onSubmit:o,pattern:Fu,placeholder:Uu,selection:f,value:d,onFocus:a,onBlur:g,"data-testid":l})})});On.displayName="DateTimeInput";On.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const Vu=On;var Ku=R.module("DateInput"),Hu="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Gu=["2000-01-01","2022-12-31"],Wu="YYYY-MM-DD",xn=M.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:s=()=>{},"data-testid":o}=n,[l,d]=c.useState(i),[h,f]=c.useState(),p=c.useCallback(v=>{Ku.debug("handleChange",v),d(v),r(v)},[r]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(St,{ref:e,className:I(t),example:Gu,getNextSegmentValue:ga,onChange:p,onSelect:f,pattern:Hu,placeholder:Wu,selection:h,value:l,onFocus:a,onBlur:s,"data-testid":o})})});xn.displayName="DateInput";xn.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const zu=xn;function ya(n,e,t){return e=qu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qu(n){var e=Zu(n,"string");return typeof e=="symbol"?e:String(e)}function Zu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wa extends c.PureComponent{constructor(e){super(e),ya(this,"searchInput",void 0),this.searchInput=M.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Ve(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":a}=this.props,{value:s}=this.state;return u.jsx(wt,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}ya(wa,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Xu=wa;function Ca(n,e,t){return e=Ju(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ju(n){var e=Qu(n,"string");return typeof e=="symbol"?e:String(e)}function Qu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yu=R.module("ItemListItem");class Ot extends c.Component{static handleKeyDown(){return Yu.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Ca(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=M.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:a,"data-testid":s}=this.props;return u.jsx("div",{className:I("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:Ot.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:a})}}Ca(Ot,"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 Sa=Ot;function wr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Cr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wr(Object(t),!0).forEach(function(r){ne(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ne(n,e,t){return e=ec(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ec(n){var e=tc(n,"string");return typeof e=="symbol"?e:String(e)}function tc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sr=R.module("ItemList"),Or=5;class J extends c.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),ne(this,"list",void 0),ne(this,"listContainer",void 0),ne(this,"getItemSelected",re((i,a)=>ue.isSelected(a,i),{max:J.CACHE_SIZE})),ne(this,"getCachedItem",re((i,a,s,o,l,d,h,f)=>{var p=d({item:s,itemIndex:i,isFocused:o,isSelected:l,style:h});return u.jsx(Sa,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:f,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:o,isSelected:l,itemIndex:i,style:h,children:p},a)},{max:J.CACHE_SIZE})),ne(this,"getOuterElement",re(i=>{var a=M.forwardRef((s,o)=>u.jsx("div",Cr({ref:o,tabIndex:-1,onKeyDown:i,role:"presentation"},s)));return a.displayName="ItemListOuterElement",a})),ne(this,"getInnerElement",re(()=>{var i=M.forwardRef((a,s)=>u.jsx("div",Cr({className:"item-list-inner-element",ref:s},a)));return i.displayName="ItemListInnerElement",i})),ne(this,"getItemData",re((i,a,s)=>({items:i,selectedRanges:a,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=M.createRef(),this.listContainer=M.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:a,isStuckToBottom:s,scrollOffset:o,height:l,selectedRanges:d}=this.state;if(s&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(o!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(a!==t.focusIndex){var{onFocusChange:f}=this.props;f(a)}}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:r}=this.state,i=this.listContainer.current.querySelectorAll(t),a=e-r;return i[a]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=ue.isSelected(r,e),a=i||Q.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(a=>{var{selectedRanges:s}=a;return{selectedRanges:ue.selectRange(s,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.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){Sr.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){Sr.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:a}=this.props,{mouseDownIndex:s,selectedRanges:o,mouseX:l,mouseY:d}=this.state;if(!(s==null||a)){var h=Math.abs(t.clientX-(l??0)),f=Math.abs(t.clientY-(d??0));h>Or&&f>Or&&this.setState({isDragging:!0}),(r||s===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,o)&&!Q.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,Q.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:a}=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,d=Q.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&a(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:r,onSelect:i}=this.props,{focusIndex:a}=this.state,s=a;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&i(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=r-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,r-1):s=0;else return;if(a!==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 d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:a}=this.props,{height:s}=i,o=a&&this.isListAtBottom({scrollOffset:r,height:s});return{isStuckToBottom:o,scrollOffset:r}})}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,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:a}=this.props,{selectedRanges:s}=this.state;if(a&&t&&s.length>0){var o=s[s.length-1];this.selectRange([Math.min(o[0],e),Math.max(e,o[1])])}else a&&s.length===1&&s[0][0]===e&&s[0][1]===e?i&&this.deselectItem(e):a&&r?this.getItemSelected(e,s)?i&&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){ue.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ue.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){ue.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ue.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,a=Math.floor(e/i),s=a+Math.ceil(t/i);r(a,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:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:a,renderItem:s,disableSelect:o}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<a||t>=a+i.length)return null;var h=i[t-a];return this.getCachedItem(t,t,h,t===l&&!o,this.getItemSelected(t,d),s,r,o)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:a,"data-testid":s}=this.props,{selectedRanges:o,isStuckToBottom:l}=this.state;return u.jsx(ws,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:f}=d;return u.jsx(Cs,{className:"item-list-scroll-pane",height:f,width:h,initialScrollOffset:l?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,o,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":s,children:this.renderInnerElement})}})}}ne(J,"CACHE_SIZE",1e3);ne(J,"DEFAULT_ROW_HEIGHT",20);ne(J,"DEFAULT_OVERSCAN",10);ne(J,"defaultProps",{offset:0,items:[],rowHeight:J.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:J.DEFAULT_OVERSCAN,renderItem:J.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function xr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ce(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(t),!0).forEach(function(r){Me(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Me(n,e,t){return e=nc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nc(n){var e=rc(n,"string");return typeof e=="symbol"?e:String(e)}function rc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class he extends c.PureComponent{static renderHandle(){return u.jsxs("div",{children:[u.jsx(mt,{children:"Drag to re-order"}),u.jsx(X,{icon:Vs})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?u.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:r="",className:i=""}=e;return u.jsxs("div",{className:I("item-list-item-content","draggable-item-list-item-content",i),children:[u.jsx("span",{className:"title",children:t}),he.renderBadge({text:r}),he.renderHandle()]})}static renderItem(e){var t,r,{item:i,isClone:a,selectedCount:s}=e,o=i!=null?(t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i):"",l=a!==void 0&&a?"".concat(s):"",d=a!==void 0&&a?"item-list-item-clone":"";return he.renderTextItem({text:o,badgeText:l,className:d})}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),Me(this,"itemList",void 0),Me(this,"getCachedDraggableItem",re((t,r,i,a,s,o,l,d)=>u.jsx(Ss,{draggableId:he.getDraggableId(t,a),index:a,isDragDisabled:l,children:h=>u.jsx("div",Ce(Ce(Ce({role:"menuitem",className:"draggable-item-list-item",ref:h.innerRef,tabIndex:-1},h.draggableProps),h.dragHandleProps),{},{children:r({item:i,itemIndex:a,isFocused:s,isSelected:o,style:d,isClone:!1})}))},a),{max:J.CACHE_SIZE})),Me(this,"getCachedRenderDraggableItem",re((t,r,i)=>a=>{var{item:s,itemIndex:o,isFocused:l,isSelected:d,style:h}=a;return this.getCachedDraggableItem(t,i,s,o,l,d,r,h)},{max:1})),Me(this,"getCachedRenderClone",re((t,r,i,a)=>(s,o,l)=>{var{selectedCount:d}=this.state,{draggableProps:h,dragHandleProps:f,innerRef:p}=s,{index:v}=l.source,g=r[v-i];return u.jsx("div",Ce(Ce(Ce({className:I("draggable-item-list-dragging-item-container",t)},h),f),{},{ref:p,children:u.jsx("div",{className:I("draggable-item-list-dragging-item",{"two-dragged":d===2},{"multiple-dragged":d>2}),children:a({item:g,itemIndex:v,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:d})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=M.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:ue.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:r,droppableId:i,isDoubleClickSelect:a,isDragDisabled:s,isDropDisabled:o,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:f,offset:p,onFocusChange:v,onSelect:g,onViewportChange:b,renderItem:w,rowHeight:x,selectedRanges:P,style:C,"data-testid":k}=this.props;return u.jsx(Os,{isDropDisabled:o,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(r,f,p,w),"data-testid":k,children:(O,A)=>u.jsx("div",Ce(Ce({role:"menu",className:I("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:C,ref:O.innerRef},O.droppableProps),{},{children:u.jsx(J,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:l,isStickyBottom:d,itemCount:h,items:f,onFocusChange:v,onSelect:g,onSelectionChange:this.handleSelectionChange,onViewportChange:b,offset:p,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,s,w),rowHeight:x,selectedRanges:P})}))})}}Me(he,"DEFAULT_ROW_HEIGHT",30);Me(he,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:he.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:he.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const ic=he;class ft{static reorder(e,t,r,i){var a=e===r?ft.adjustDestinationIndex(i,t):i,s=ft.removeItems(e,t);return r.splice(a,0,...s),s}static removeItems(e,t){for(var r=[],i=t.map((h,f)=>({range:h,index:f})).sort((h,f)=>f.range[0]-h.range[0]),a=0;a<i.length;a+=1){var{range:s,index:o}=i[a],[l,d]=s;r[o]=e.splice(l,d-l+1)}return xs(r)}static adjustDestinationIndex(e,t){for(var r=e,i=0;i<t.length;i+=1){var[a,s]=t[i];if(a>e)break;r-=Math.min(s,e-1)-a+1}return r}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const ac=ft;function sc(n){var{isInvalid:e=!1,items:t,onAdd:r=()=>{},onDelete:i=()=>{},validate:a=()=>null}=n,[s,o]=c.useState(null),[l,d]=c.useState([]),[h,f]=c.useState(""),p=c.useCallback(C=>{d(C)},[]),v=c.useCallback(()=>{i(ue.getItemsInRanges(t,l)),d([])},[t,l,i]),g=c.useCallback(()=>{if(h!==""){var C=a(h);C==null?(r(h),f("")):o(C)}},[h,r,a]),b=c.useCallback(C=>{var{value:k}=C.target;f(k),o(k===""?null:a(k))},[a]),w=c.useCallback(()=>{d([])},[]),x=c.useCallback(C=>{C.key==="Enter"&&g()},[g]),P=c.useMemo(()=>14+Es(t.length,1,6)*J.DEFAULT_ROW_HEIGHT,[t.length]);return u.jsxs("div",{className:I("editable-item-list-container",{"is-invalid":e}),children:[u.jsx("div",{style:{height:P},children:u.jsx(J,{itemCount:t.length,items:t.map((C,k)=>({value:C,isSelected:ue.isSelected(l,k)})),offset:0,selectedRanges:l,onSelectionChange:p,isMultiSelect:!0})}),u.jsxs("div",{className:"d-flex flex-row pt-2",children:[u.jsx("div",{className:"d-flex flex-grow-1",children:u.jsx("input",{className:I("form-control",{"is-invalid":s!=null}),placeholder:"Enter value",type:"text",value:h,onChange:b,onFocus:w,onKeyDown:x})}),u.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[u.jsx(ie,{kind:"ghost",onClick:g,disabled:s!=null||h==="",icon:Ks,tooltip:"Add new item","data-testid":"add-item-button"}),u.jsx(ie,{kind:"ghost",onClick:v,disabled:l.length===0,icon:li,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}function oc(n,e,t){return e=lc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lc(n){var e=uc(n,"string");return typeof e=="symbol"?e:String(e)}function uc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ue extends c.Component{static isParentSelected(e,t){var r=t.get(e);if(r===void 0)return!1;if(typeof r=="boolean")return r;var i=Array.from(r.values()).includes(!0),a=Array.from(r.values()).includes(!1);return i&&a?null:i}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:r}=t;return{menuIsOpen:!r}})}toggleValueFor(e,t){var{valueMap:r,onUpdateValueMap:i}=this.props,a=new Map(r),s=a.get(e);if(s instanceof Map){var o=new Map(s);if(t!=null)o.set(t,s.get(t)===void 0);else{var l=Ue.isParentSelected(e,a),d=l==null||!l;s.forEach((p,v)=>o.set(v,d))}a.set(e,o)}else a.set(e,s==null||!s);var h=a.get(e);if(t===void 0&&h!==void 0&&typeof h!="boolean"){var f=Ue.isParentSelected(e,r);f!=null&&f?h.forEach((p,v)=>h.set(v,!1)):h.forEach((p,v)=>h.set(v,!0))}i(a)}setAllValues(e){var{valueMap:t,onUpdateValueMap:r}=this.props,i=new Map;t.forEach((a,s)=>{if(typeof a=="boolean")i.set(s,e);else{var o=new Map;a.forEach((l,d)=>o.set(d,e)),i.set(s,o)}}),r(i)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return u.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(r=>{var[i,a]=r;return u.jsxs("div",{children:[u.jsx(dt,{className:"hcm-parent",checked:Ue.isParentSelected(i,e),onChange:()=>this.toggleValueFor(i),children:i}),a!==void 0&&typeof a!="boolean"&&Array.from(a.entries()).map(s=>{var[o,l]=s;return u.jsx(dt,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(i,o),children:o},o)})]},i)}),u.jsx(ie,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),u.jsx(ie,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:r,id:i,"data-testid":a}=this.props,{menuIsOpen:s}=this.state;return u.jsxs("button",{type:"button",className:I("btn hcm-btn",t),onClick:this.toggleMenu,id:i,"data-testid":a,children:[u.jsxs("span",{children:[r&&u.jsx(X,{icon:r,className:"hcm-icon mr-1"}),e]}),u.jsx(X,{icon:ci,className:"hcm-icon ml-1"}),u.jsx(We,{options:{placement:"bottom"},isShown:s,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}oc(Ue,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const cc=Ue;function Oa(n){var{on:e,id:t,className:r,isInvalid:i,disabled:a=!1,onClick:s,"data-testid":o}=n;return u.jsx("button",{type:"button",className:I("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:s,disabled:a,"data-testid":o,children:u.jsx("div",{className:"handle"})})}function Er(n){return n.isOn!==void 0}function xa(n){var{item:e,onSelect:t=()=>{},"data-testid":r}=n,{icon:i,subtitle:a,title:s}=e,o=c.useMemo(()=>Er(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return u.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:[i!==void 0&&u.jsx("div",{className:"icon",children:u.jsx(X,{icon:i})}),u.jsx("div",{className:"title",children:s}),a!==void 0&&u.jsx("div",{className:"shortcut",children:a}),u.jsx("div",{className:"accessory","data-testid":r,children:Er(e)?u.jsx(Oa,{on:e.isOn,onClick:l=>{l.stopPropagation(),o()}}):u.jsx(X,{icon:Hs})})]})}function dc(n){var{items:e,onSelect:t=()=>{},"data-testid":r}=n;return u.jsx("div",{className:"navigation-menu-view","data-testid":r,children:u.jsx("ul",{className:"navigation-menu-list",children:e.map((i,a)=>u.jsx("li",{children:u.jsx(xa,{item:i,onSelect:()=>{t(a)}})},i.title))})})}function hc(n){var{children:e,onBack:t,onClose:r,title:i,"data-testid":a}=n;return u.jsxs("div",{className:"navigation-page","data-testid":a,children:[u.jsxs("div",{className:"navigation-title-bar",children:[u.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&u.jsx(ie,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:t,icon:Gs,children:"Back"})}),u.jsx("div",{className:"navigation-title",children:i}),u.jsx("div",{className:"navigation-right-buttons",children:r!==void 0&&u.jsx(ie,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:r,icon:di,tooltip:"Close"})})]}),u.jsx("div",{className:"navigation-content",children:e})]})}function fc(n){var{children:e,"data-testid":t}=n,r=c.useMemo(()=>M.Children.toArray(e),[e]),i=qi(r),[a,s]=c.useState(r[r.length-1]),[o,l]=c.useState(null),[d,h]=c.useState(null);c.useEffect(function(){if(!(i===void 0||r===i)){var g=r[r.length-1];r.length===i.length||i.length===0||o!==null||d!==null?o!==null&&g!==o?l(g):g!==d&&g!==a&&s(g):r.length>i.length?l(g):r.length<i.length&&(s(g),h(i[i.length-1]))}},[r,i,o,d,a]);var f=c.useCallback(()=>{s(o),l(null)},[o]),p=c.useCallback(()=>{h(null)},[]);return u.jsxs("div",{className:"navigation-stack",children:[u.jsx("div",{className:"main-view","data-testid":t,children:a}),u.jsx(Ne,{in:d!=null,timeout:fe.transitionMidMs,classNames:"slide-right",onEntered:p,children:u.jsx(u.Fragment,{children:d!=null&&u.jsx("div",{className:"popping-view",children:d})})}),u.jsx(Ne,{in:o!=null,timeout:fe.transitionMidMs,classNames:"slide-left",onEntered:f,children:u.jsx(u.Fragment,{children:o!=null&&u.jsx("div",{className:"pushing-view",children:o})})})]})}function pc(n){var{children:e,disabled:t,value:r,"data-testid":i}=n;return u.jsx("option",{value:r,disabled:t,"data-testid":i,children:e})}function vc(n){var{children:e,disabled:t=!1,name:r,onChange:i,value:a="","data-testid":s}=n,[o]=c.useState(r??Ee());return u.jsx(u.Fragment,{children:M.Children.map(e,l=>{var d,h;return l?M.cloneElement(l,{name:o,onChange:(d=l.props.onChange)!==null&&d!==void 0?d:i,checked:a===l.props.value,disabled:(h=l.props.disabled)!==null&&h!==void 0?h:t,"data-testid":s}):null})})}var En=M.forwardRef((n,e)=>{var{checked:t,children:r,className:i="",disabled:a=!1,inputClassName:s="",isInvalid:o=!1,labelClassName:l="",name:d,onChange:h,value:f,"data-testid":p}=n,[v]=c.useState(Ee());return u.jsxs("div",{className:I("custom-control custom-radio",i),children:[u.jsx("input",{type:"radio",id:v,"data-testid":p,name:d,ref:e,className:I("custom-control-input",s,{"is-invalid":o}),checked:t,disabled:a,value:f,onChange:h}),u.jsx("label",{className:I("custom-control-label",l),htmlFor:v,children:r})]})});En.displayName="RadioItem";En.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const mc=En;var gc=.025,bc=.9,yc=.1,wc=.618,Lt=fe["primary-dark"],Tr=80,Cc=fe["gray-800"],Sc=fe["gray-900"],Pe={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},Se=18,Oc=250,xc=60*1e3,Ec=M.memo(()=>{var n=c.useRef(null),e=c.useRef(null),[t,r]=c.useState(!1),i=window.devicePixelRatio,a,s,o,l,d,h=null,f=[];function p(){var S;e.current!=null&&(o=e.current.offsetWidth,l=e.current.offsetHeight),n.current!=null&&(n.current.style.width="".concat(o,"px"),n.current.style.height="".concat(l,"px"),n.current.width=o*i,n.current.height=l*i),(S=a)===null||S===void 0||S.scale(i,i)}function v(){var S=document.createElement("canvas");S.width=Pe.SIZE,S.height=Pe.SIZE;var D=S.getContext("2d");return D!=null&&(D.fillStyle=Lt,D.fillRect(0,0,Pe.DOT_SIZE,Pe.DOT_SIZE),D.fillStyle=Lt+Math.round(255*Pe.FILL_OPACITY).toString(16).padStart(2,"0"),D.fillRect(0,0,Pe.SIZE,Pe.SIZE)),D==null?void 0:D.createPattern(S,"repeat")}function g(S){var D=Math.random()-.5,F=gc*D;return S<yc?F=Math.abs(F):S>bc&&(F=-Math.abs(F)),S+F}function b(){for(var S=[],D=wc,F=0;F<o+Se;F+=1)D=g(D),S.push(D);return S}function w(){for(;f.length>=o+Se;)f.pop();for(;f.length<o+Se;)f.push(g(f[f.length-1]))}function x(S,D){D.beginPath(),D.moveTo(-1,l+1),D.lineTo(-1,l*S[0]);for(var F=0;F<S.length;F+=1)D.lineTo(F,l*S[F]);D.lineTo(o+Se,l*S[S.length-1]),D.lineTo(o+Se,l+1),D.closePath()}function P(S){S.beginPath();for(var D=1;D<o;D+=Tr)S.moveTo(D,0),S.lineTo(D,l);for(var F=1;F<l;F+=Tr)S.moveTo(0,F),S.lineTo(o,F)}function C(S){var D,F,T;h=(D=h)!==null&&D!==void 0?D:S,Ws(a),a.fillStyle=Sc,a.fillRect(0,0,o,l),P(a),a.lineWidth=1,a.strokeStyle=Cc,a.stroke();var E=(((F=h)!==null&&F!==void 0?F:0)-(S??0))/(1e3/Se);if(a.translate(E,0),x(f,a),a.lineWidth=2,a.strokeStyle=Lt,a.stroke(),a.translate(-E,0),s!=null&&(a.fillStyle=s),a.fill(),a.setTransform(i,0,0,i,0,0),(S??0)-((T=h)!==null&&T!==void 0?T:0)>1e3/Se){for(var y,j=Math.floor(((S??0)-((y=h)!==null&&y!==void 0?y:0))/(1e3/Se)),_=0;_<j;_+=1)f.shift(),f.push(g(f[f.length-1]));h=S}d!=null&&cancelAnimationFrame(d),d=requestAnimationFrame(C)}var k=Ve(()=>{d=requestAnimationFrame(S=>{p(),w(),r(!1),C(S)})},Oc,{leading:!0});function O(){r(!0),d!=null&&cancelAnimationFrame(d),d=null,h=null}var A=Ve(()=>{O()},xc);function N(){d==null&&(r(!1),p(),w(),d=requestAnimationFrame(C)),A()}function L(){document.hasFocus()&&N()}function W(){d!=null&&cancelAnimationFrame(d),A(),k()}return c.useEffect(()=>{var S;return a=(S=n.current)===null||S===void 0?void 0:S.getContext("2d",{alpha:!1}),p(),f=b(),s=v(),C(),A(),window.addEventListener("resize",W),window.addEventListener("focus",N),window.addEventListener("blur",O),window.addEventListener("mousemove",L),window.addEventListener("keydown",L),()=>{d!=null&&cancelAnimationFrame(d),window.removeEventListener("resize",W),window.removeEventListener("focus",N),window.removeEventListener("blur",O),window.removeEventListener("mousemove",L),window.removeEventListener("keydown",L),A.cancel(),k.cancel()}},[]),u.jsx("div",{className:"random-area-plot-animation-container",ref:e,children:u.jsx("canvas",{ref:n,className:t?"shade":""})})});const Ea=Ec;function Ta(n){var{text:e,placement:t="top-start"}=n,r=c.useMemo(()=>({placement:t}),[t]);return u.jsxs(u.Fragment,{children:[u.jsx(ri,{UNSAFE_className:yn.spectrumEllipsis,children:e??u.jsx(u.Fragment,{children:" "})}),e==null||e===""?null:u.jsx(mt,{options:r,children:e})]})}var Tc=["scrollRef","getItemDisplayText","getKey"];function Pr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ir(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pr(Object(t),!0).forEach(function(r){Pc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Pc(n,e,t){return e=Ic(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ic(n){var e=Mc(n,"string");return typeof e=="symbol"?e:String(e)}function Mc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Nc(n,e){if(n==null)return{};var t=Dc(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Dc(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function jc(n){var{scrollRef:e,getItemDisplayText:t,getKey:r}=n,i=Nc(n,Tc),a=c.useCallback(s=>{var o=r(s),l=t(s);return u.jsx(Ts,{textValue:l??String(o),children:u.jsx(Ta,{text:l})},o)},[t,r]);return u.jsx(Ps,Ir(Ir({},i),{},{ref:e,menuTrigger:"focus",onSelectionChange:i.onSelectionChange,children:a}))}function Ac(n){var{children:e,onBlur:t,onChange:r,className:i,defaultValue:a,name:s,value:o,disabled:l,"data-testid":d}=n,h=c.useCallback(f=>{r(f.target.value)},[r]);return u.jsx("select",{className:I("custom-select",i),onBlur:t,onChange:h,defaultValue:a,value:o,name:s,disabled:l,"data-testid":d,children:e})}function Le(n,e,t){return e=kc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kc(n){var e=Lc(n,"string");return typeof e=="symbol"?e:String(e)}function Lc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pa extends c.PureComponent{constructor(e){super(e),Le(this,"list",void 0),Le(this,"topRow",void 0),Le(this,"bottomRow",void 0),Le(this,"getCachedItem",re((t,r,i,a,s,o,l)=>{var d={height:s},h=a??i;return u.jsx("li",{className:"value-list-item",style:d,tabIndex:-1,children:u.jsx(dt,{checked:o,disabled:l,onChange:()=>this.handleSelect(t),children:h})},r)},{max:1e3})),Le(this,"getCachedItems",re((t,r,i,a)=>{for(var s=[],o=0;o<t.length;o+=1){var l=t[o],{value:d,displayValue:h,isSelected:f}=l,p=i+o,v=p,g=this.getCachedItem(p,v,d,h,r,f,a);s.push(g)}return s},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=M.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:r,onSelect:i}=this.props,a=e-r;if(a>=0&&a<t.length){var s=t[a],{value:o}=s;i(e,o)}else i(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,r=this.list.current.scrollTop,i=r+this.list.current.clientHeight,a=Math.floor(r/t),s=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==s)&&(this.topRow=a,this.bottomRow=s,e(a,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:r,items:i,itemCount:a,offset:s,rowHeight:o,"data-testid":l}=this.props,d=this.getCachedItems(i,o,s,t);return u.jsx("div",{className:I("select-value-list-scroll-pane h-100 w-100",{"is-invalid":r},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:u.jsx("div",{className:"select-value-list",style:{height:a*o},children:u.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*o,top:s*o,left:0},children:d})})})}}Le(Pa,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const Ia=Pa;function Oe(n,e,t){return e=Rc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rc(n){var e=_c(n,"string");return typeof e=="symbol"?e:String(e)}function _c(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mr=R.module("Shortcut"),q;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(q||(q={}));var $;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})($||($={}));var $c=new Set([$.ENTER,$.DELETE,$.F1,$.F2,$.F3,$.F4,$.F5,$.F6,$.F7,$.F8,$.F9,$.F10,$.F11,$.F12]);class H extends cn{static isAllowedKey(e){return Object.values($).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!H.isMacPlatform&&e.metaKey||!H.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||$c.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case q.CTRL:t.ctrlKey=!0;break;case q.ALT:case q.OPTION:t.altKey=!0;break;case q.CMD:t.metaKey=!0;break;case q.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!H.isAllowedKey(t)&&H.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,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===$.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 $.ENTER:t+="⏎";break;case $.ESCAPE:t+="⎋";break;case $.BACKSPACE:t+="⌫";break;case $.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":H.isMacPlatform?H.getMacDisplayText(e):H.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:a=!0,name:s,tooltip:o}=e;super(),Oe(this,"id",void 0),Oe(this,"name",void 0),Oe(this,"tooltip",void 0),Oe(this,"isEditable",void 0),Oe(this,"defaultKeyState",void 0),Oe(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=o,this.isEditable=a;var l=H.isMacPlatform,d=l?i:r;this.defaultKeyState=H.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return H.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){H.isValidKeyState(e)?(Mr.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Ai("onUpdate",{detail:this}))):Mr.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return H.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(H.NULL_KEY_STATE)}isNull(){return H.doKeyStatesMatch(this.keyState,H.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return H.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(H.getKeyStateFromEvent(e))}}Oe(H,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Oe(H,"isMacPlatform",Q.isMacPlatform());function Nr(n,e,t){return e=Fc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fc(n){var e=Uc(n,"string");return typeof e=="symbol"?e:String(e)}function Uc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Dr=R.module("ShortcutRegistry");class Bc extends cn{constructor(){super(...arguments),Nr(this,"shortcutMap",new Map),Nr(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new H(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Dr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Dr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",a=>{var{detail:s}=a;return this.dispatchEvent(new Ai("onUpdate",{detail:s}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[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 Vc=Object.freeze(new Bc);const Ie=Vc;var Kc={COPY:Ie.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[q.CTRL,$.C],macShortcut:[q.CMD,$.C],isEditable:!1}),PASTE:Ie.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[q.CTRL,$.V],macShortcut:[q.CMD,$.V],isEditable:!1}),SAVE:Ie.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[q.CTRL,$.S],macShortcut:[q.CMD,$.S],isEditable:!1}),SELECT_ALL:Ie.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[q.CTRL,$.A],macShortcut:[q.CMD,$.A],isEditable:!1}),LINKER:Ie.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[q.CTRL,$.L],macShortcut:[q.CMD,$.L]}),LINKER_CLOSE:Ie.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[$.ESCAPE],macShortcut:[$.ESCAPE],isEditable:!1})};const Hc=Kc;var Tn=M.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,id:a,isLinked:s,isLinkedSource:o,isInvalid:l,onClick:d,onMouseEnter:h,onMouseLeave:f,style:p,"data-testid":v}=n;return u.jsxs("button",{ref:e,type:"button",className:I("btn-socketed",{"btn-socketed-linked":s!==void 0&&s||o},{"btn-socketed-linked-source":o},{"is-invalid":l},r),id:a,onClick:d,onMouseEnter:h,onMouseLeave:f,style:p,disabled:i,"data-testid":v,children:[t,u.jsx(X,{icon:zs,className:"linked btn-socketed-icon",transform:"down-1"}),u.jsx(X,{icon:qs,className:"is-invalid btn-socketed-icon"})]})});Tn.displayName="SocketedButton";Tn.defaultProps={children:void 0,className:"",disabled:!1,id:void 0,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Gc=Tn,Wc={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_1qqxl_5"},zc={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_oc9vy_5"};function jr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function it(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jr(Object(t),!0).forEach(function(r){qc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qc(n,e,t){return e=Zc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zc(n){var e=Xc(n,"string");return typeof e=="symbol"?e:String(e)}function Xc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var{global:Jc,light:Qc,dark:Yc,medium:ed,large:td}=Is,nd={global:Jc,light:it(it({},Qc),zc),dark:it(it({},Yc),Wc),medium:ed,large:td},rd=500;function id(n){var{heading:e,content:t,delayMs:r=rd}=n,[i,a]=c.useState(!1);return c.useEffect(()=>{window.setTimeout(()=>{a(!0)},r)},[r]),i?u.jsxs(Ms,{children:[u.jsx(un,{size:"XXL",children:u.jsx(X,{icon:Zs})}),u.jsx(ii,{children:e}),t==null?null:u.jsx(ai,{children:t})]}):null}var ad=R.module("ThemeProvider"),Pn=c.createContext(null);function Ma(n){var{themes:e,children:t}=n,r=c.useMemo(()=>hi(),[]),[i,a]=c.useState(()=>{var l,d;return(l=(d=fi())===null||d===void 0?void 0:d.themeKey)!==null&&l!==void 0?l:pi}),s=c.useMemo(()=>e==null?null:vi(i,{base:r,custom:e??[]}),[r,i,e]);c.useEffect(function(){ad.debug("Active themes:",s==null?void 0:s.map(d=>d.themeKey)),mi({themeKey:i,preloadStyleContent:gi()})},[s,i]);var o=c.useMemo(()=>({activeThemes:s,selectedThemeKey:i,setSelectedThemeKey:a}),[s,i]);return u.jsxs(Pn.Provider,{value:o,children:[s==null?void 0:s.map(l=>u.jsx("style",{"data-theme-key":l.themeKey,children:l.styleContent},l.themeKey)),t]})}function sd(){return Je(Pn,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}const od="_track_1ermw_30",ld="_handle_1ermw_13",ud="_ticks_1ermw_98",Na={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_1ermw_3","time-slider-popovers":"_time-slider-popovers_1ermw_8","handle-popper":"_handle-popper_1ermw_13","flex-spacer":"_flex-spacer_1ermw_26",track:od,"track-fills":"_track-fills_1ermw_37","track-fill":"_track-fill_1ermw_37","track-fill-start":"_track-fill-start_1ermw_55","track-fill-middle":"_track-fill-middle_1ermw_56","track-fill-end":"_track-fill-end_1ermw_59","handle-track":"_handle-track_1ermw_62",handle:ld,ticks:ud,"tick-labels":"_tick-labels_1ermw_116","tick-label":"_tick-label_1ermw_116","tick-label-wrapper":"_tick-label-wrapper_1ermw_132"};var at=parseInt(Na["handle-size"],10),Ar=parseInt(Na["popover-width"],10),ee=24*60*60-1,kr=5*60;function cd(n){var{startTime:e,endTime:t,onChange:r,isStartModified:i=!1,isEndModified:a=!1,"data-testid":s}=n,[o,l]=c.useState(e),[d,h]=c.useState(t),f=c.useRef(null);c.useEffect(function(){l(e),h(t)},[e,t]);var p=c.useCallback((b,w)=>{var x=b,P=w;x===P&&(P<ee?P+=1:x-=1),l(x),h(P),r({startTime:x,endTime:P})},[l,h,r]),v=c.useCallback(b=>{p(b,d)},[p,d]),g=c.useCallback(b=>{p(o,b)},[p,o]);return u.jsxs("div",{className:"time-slider","data-testid":s,children:[u.jsx(dd,{startTime:o,endTime:d,onStartTimeChange:v,onEndTimeChange:g,isStartModified:i,isEndModified:a}),u.jsxs("div",{className:"track",ref:f,children:[u.jsx(hd,{startTime:o,endTime:d}),u.jsx("div",{className:"ticks",children:Array(24).fill(null).map((b,w)=>u.jsx("div",{className:"tick"},w))}),u.jsx(Lr,{track:f,time:o,setTime:v}),u.jsx(Lr,{track:f,time:d,setTime:g})]}),u.jsxs("div",{className:"tick-labels",children:[u.jsx("div",{className:"tick-label",children:"0:00"}),u.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((b,w)=>u.jsx("div",{className:"tick-label",children:"".concat(w+1,":00")},w))})]})]})}function dd(n){var{startTime:e,endTime:t,onStartTimeChange:r,onEndTimeChange:i,isStartModified:a,isEndModified:s,"data-testid":o}=n,l=e>t,[d,h]=c.useState(l?t:e),[f,p]=c.useState(l?e:t),v=c.useRef(null),g=c.useRef(null),b=c.useRef(null),w=c.useRef(null);c.useEffect(function(){h(e>t?t:e),p(e>t?e:t)},[e,t]),c.useEffect(function(){if(b.current!==null){var A;(A=g.current)===null||A===void 0||A.setSelection(b.current)}if(w.current!==null){var N;(N=v.current)===null||N===void 0||N.setSelection(w.current)}},[l]);function x(O){e<=t?r(O):i(O)}function P(O){e<=t?i(O):r(O)}var C=c.useCallback(O=>{b.current=O,w.current=null},[]),k=c.useCallback(O=>{b.current=null,w.current=O},[]);return u.jsxs("div",{className:"time-slider-popovers",children:[u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(d/ee*100,"% - ").concat(Ar/2,"px)")}}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:I({modified:l?s:a}),children:l?"End Time":"Start Time"}),u.jsx(ht,{ref:v,allowValueWrapping:!1,value:d,onChange:x,onSelect:C,"data-testid":o!==void 0?"".concat(o,"-input-1"):void 0})]}),u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:I({modified:l?a:s}),children:l?"Start Time":"End Time"}),u.jsx(ht,{ref:g,allowValueWrapping:!1,value:f,onChange:P,onSelect:k,"data-testid":o!==void 0?"".concat(o,"-input-2"):void 0})]}),u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((ee-f)/ee*100,"% - ").concat(Ar/2,"px)")}})]})}function hd(n){var{startTime:e,endTime:t,"data-testid":r}=n;return u.jsxs("div",{className:"track-fills","data-testid":r,children:[e>t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/ee,")")}}),u.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((ee-e)/ee,")")}})]}),e<t&&u.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/ee*100,"%) scaleX(").concat((t-e)/ee,")")}})]})}function Lr(n){var{track:e,time:t,setTime:r,"data-testid":i}=n,a=c.useMemo(()=>{var p=3600,v=at/2;return t<p?v=t/p*(at/2):t>23*p&&(v=at/2+1/(ee-23*p)*(t-23*p)*(at/2)),"translateX(calc(".concat(t/ee*100,"% - ").concat(v,"px))")},[t]),s=c.useCallback(p=>{if(!e.current)return 0;var v=e.current.getBoundingClientRect(),g=Math.max(p-v.left,0),b=ee*Math.min(1,g/v.width),w=kr*Math.round(b/kr),x=Math.min(ee,w);return x},[e]),o=c.useCallback(p=>{var{clientX:v}=p;r(s(v))},[r,s]),l=c.useCallback(p=>{var{clientX:v}=p;r(s(v)),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[r,s,o]),d=c.useCallback(()=>{window.addEventListener("mousemove",o),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[o,l]),h=c.useCallback(()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[o,l]),f=c.useCallback(()=>{d()},[d]);return c.useEffect(function(){return()=>{h()}},[h]),u.jsx("div",{className:"handle-track",style:{transform:a},children:u.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:f,"data-testid":i})})}function Da(n){var{buttons:e,isShown:t=!1,classNames:r,message:i,type:a,onClick:s,onDismiss:o,"data-testid":l}=n,d=e&&e.length!==0;return u.jsx(Ne,{in:t,timeout:fe.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:u.jsxs("div",{className:I("toast-notification",r,a),role:"presentation",onClick:s,onKeyPress:s,"data-testid":l,children:[u.jsx("div",{className:"message-container",children:u.jsx("span",{className:"message",children:i})}),u.jsx(Ne,{in:d,timeout:fe.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx("div",{className:"buttons-container",children:e})}),o&&u.jsx(ie,{kind:"ghost",icon:di,tooltip:"Close notification",className:"my-2",onClick:o})]})})}Da.TYPE=Object.freeze({ERROR:"error"});function fd(n){var{children:e,className:t,labelText:r,hintText:i,isModified:a,validationError:s,showValidationError:o=!0,"data-testid":l,id:d}=n,{current:h}=c.useRef(d??Ee());return u.jsxs(u.Fragment,{children:[u.jsx("label",{className:I("validate-label",t,{modified:a}),htmlFor:h,"data-testid":l,children:r}),M.Children.toArray(e).map(f=>M.isValidElement(f)?M.cloneElement(f,{className:I(f.props.className,{"is-invalid":s})}):u.jsx("div",{className:I(t),children:f})),i!==void 0&&u.jsx("small",{className:"form-text text-muted",children:i}),s!==void 0&&o&&u.jsx("p",{className:"validate-label-error text-danger",children:s})]})}const pd=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:Fi,AutoCompleteInput:_l,AutoResizeTextarea:Cn,BasicModal:Sn,BulkActionBar:eu,Button:ie,ButtonGroup:Ye,ButtonOld:Xl,CardFlip:tu,Checkbox:dt,Collapse:du,ComboBox:gu,ConfirmActionButton:yl,ConfirmationDialog:ra,ContextActionUtils:Q,ContextActions:lu,ContextMenuItem:Ci,ContextMenuRoot:to,CopyButton:bu,CustomTimeSelect:Lu,DEFAULT_DARK_THEME_KEY:pi,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Ct,DEFAULT_LIGHT_THEME_KEY:Xs,DEFAULT_PRELOAD_DATA_VARIABLES:Js,DateInput:zu,DateTimeInput:Vu,DebouncedModal:ql,DebouncedSearchInput:Xu,DragUtils:ac,DraggableItemList:ic,DropdownMenu:ma,EditableItemList:sc,GLOBAL_SHORTCUTS:Hc,HierarchicalCheckboxMenu:cc,IconActionButton:ia,InfoModal:Zl,ItemList:J,ItemListItem:Sa,get KEY(){return $},LoadingOverlay:De,LoadingSpinner:bi,get MODIFIER(){return q},MaskedInput:St,Menu:dc,MenuItem:xa,Modal:dn,ModalBody:hn,ModalFooter:aa,ModalHeader:ui,Option:pc,Page:hc,Popper:We,RadioGroup:vc,RadioItem:mc,RandomAreaPlotAnimation:Ea,SearchInput:wt,SearchableCombobox:jc,Select:Ac,SelectValueList:Ia,Shortcut:H,ShortcutRegistry:Ie,SocketedButton:Gc,Stack:fc,THEME_CACHE_LOCAL_STORAGE_KEY:Qs,TableViewEmptyState:id,TextWithTooltip:Ta,ThemeContext:Pn,ThemeExport:fe,ThemeProvider:Ma,TimeInput:ht,TimeSlider:cd,ToastNotification:Da,Tooltip:mt,UISwitch:Oa,ValidateLabelInput:fd,calculatePreloadStyleContent:gi,fillToLength:da,getActiveThemes:vi,getDefaultBaseThemes:hi,getThemeKey:yi,getThemePreloadData:fi,preloadTheme:Ys,setThemePreloadData:mi,themeDHDefault:nd,trimTrailingMask:Gt,useTheme:sd},Symbol.toStringTag,{value:"Module"})),vd=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:eo,ApiContext:wi,ClientBootstrap:Si,ClientContext:no,useApi:Te,useClient:Ge},Symbol.toStringTag,{value:"Module"}));var ja=1e4;function md(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ja;return new Promise((r,i)=>{var a,s=setTimeout(()=>{var l;(l=a)===null||l===void 0||l(),i(new Oi("Variable ".concat(e," not found")))},t);function o(l){var d=l.created.find(f=>f.title===e);if(d!=null){var h;clearTimeout(s),(h=a)===null||h===void 0||h(),r(d)}}a=n.subscribeToFieldUpdates(o)})}function Rr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function gd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Rr(a,r,i,s,o,"next",l)}function o(l){Rr(a,r,i,s,o,"throw",l)}s(void 0)})}}var Rt=R.module("MessageUtils"),Aa="io.deephaven.message.LoginOptions.request",ka="io.deephaven.message.SessionDetails.request",La="io.deephaven.broadcast",In="io.deephaven.broadcast.Login",Ra="io.deephaven.broadcast.Logout";function xt(n){var e=n;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function _a(n){return xt(n)&&n.message===In}function $a(n){return xt(n)&&n.message===Ra}function Fa(n){var e=n;return e!=null&&typeof e.id=="string"}function Mn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee(),t=arguments.length>2?arguments[2]:void 0;return{message:n,id:e,payload:t}}function bd(n,e){return{id:n,payload:e}}function Nn(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Dn(n){return qt.apply(this,arguments)}function qt(){return qt=gd(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=Nn();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,s=Ee(),o=l=>{var{data:d}=l;if(!Fa(d)){Rt.debug("Ignoring non-deephaven response",d);return}if(Rt.debug("Received message",d),(d==null?void 0:d.id)!==s){Rt.debug("Ignore message, id doesn't match",d);return}window.clearTimeout(a),window.removeEventListener("message",o),r(d.payload)};window.addEventListener("message",o),a=window.setTimeout(()=>{window.removeEventListener("message",o),i(new Oi("Request timed out"))},e),t.postMessage(Mn(n,s),"*")})}),qt.apply(this,arguments)}function yd(n,e,t){return e=wd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wd(n){var e=Cd(n,"string");return typeof e=="symbol"?e:String(e)}function Cd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ua extends Error{constructor(){super(...arguments),yd(this,"isNoConsolesError",!0)}}function Ba(n){return n.isNoConsolesError}function _r(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Et(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){_r(a,r,i,s,o,"next",l)}function o(l){_r(a,r,i,s,o,"throw",l)}s(void 0)})}}var _e=R.module("SessionUtils");function Sd(n,e){return _e.info("Starting connection to '".concat(e,"'...")),new n.IdeConnection(e)}function Va(n,e,t){return Zt.apply(this,arguments)}function Zt(){return Zt=Et(function*(n,e,t){_e.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new Ua("No console types available");_e.info("Available types:",r);var i=r[0];_e.info("Starting session with type",i);var a=yield e.startSession(i),s={type:i,id:Ee.generate()};return _e.info("Console session established",s),{session:a,config:s,connection:e,details:t,dh:n}}),Zt.apply(this,arguments)}function Od(n,e,t){return _e.info("createCoreClient",e),new n.CoreClient(e,t)}function xd(n){return n!=null&&typeof n=="object"}function Ed(){return Xt.apply(this,arguments)}function Xt(){return Xt=Et(function*(){var n=yield Dn(ka);if(!xd(n))throw new Error("Unexpected session details response: ".concat(n));return n}),Xt.apply(this,arguments)}function Td(){return Jt.apply(this,arguments)}function Jt(){return Jt=Et(function*(){var n=new URLSearchParams(window.location.search);switch(n.get("authProvider")){case"parent":return Ed()}return{}}),Jt.apply(this,arguments)}function Pd(n,e,t){return Qt.apply(this,arguments)}function Qt(){return Qt=Et(function*(n,e,t){var r;try{r=yield Va(n,e,t)}catch(i){if(!Ba(i))throw i}return r}),Qt.apply(this,arguments)}const Id=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:La,BROADCAST_LOGIN_MESSAGE:In,BROADCAST_LOGOUT_MESSAGE:Ra,BooleanColumnFormatter:ro,CharColumnFormatter:io,DateTimeColumnFormatter:ao,DateUtils:so,DecimalColumnFormatter:oo,DefaultColumnFormatter:lo,FETCH_TIMEOUT:ja,Formatter:xi,FormatterUtils:Bt,IntegerColumnFormatter:uo,LOGIN_OPTIONS_REQUEST:Aa,NoConsolesError:Ua,SESSION_DETAILS_REQUEST:ka,StringColumnFormatter:co,TableColumnFormatter:ho,TableUtils:Ei,createComboboxFilterArgs:fo,createConnection:Sd,createCoreClient:Od,createFilterConditionFactory:fn,createKeyFromOffsetRow:po,createNotNullOrEmptyFilterCondition:Ti,createOnTableUpdatedHandler:Pi,createSearchTextFilter:pn,createSelectedValuesFilter:vn,createSessionWrapper:Va,createShowOnlyEmptyFilterCondition:Ii,createValueFilter:Mi,defaultRowDeserializer:Ni,fetchVariableDefinition:md,generateEmptyKeyedItems:Di,getColumnFormats:vo,getDateTimeFormatterOptions:mo,getSessionDetails:Td,getSize:mn,getWindowParent:Nn,isBroadcastLoginMessage:_a,isBroadcastLogoutMessage:$a,isClosed:lt,isCustomColumnFormatDefined:go,isMessage:xt,isNoConsolesError:Ba,isResponse:Fa,loadSessionWrapper:Pd,makeMessage:Mn,makeResponse:bd,padFirstAndLastRow:ji,requestParentResponse:Dn},Symbol.toStringTag,{value:"Module"}));function Md(n){return function(t){var{children:r}=t;return u.jsx(wi.Provider,{value:n,children:r})}}var $r=R.module("useTableListener"),Nd=(n,e,t)=>c.useEffect(function(){if(n==null){$r.debug2("Emitter undefined, skipping addEventListener",e);return}return $r.debug2("Adding listener",e),n.addEventListener(e,t)},[n,e,t]);const Be=Nd;function Dd(n,e,t){return e=jd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jd(n){var e=Ad(n,"string");return typeof e=="symbol"?e:String(e)}function Ad(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class kd extends Error{constructor(){super(...arguments),Dd(this,"isColumnNameError",!0)}}const Ld=kd;function Rd(n,e,t){return e=_d(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _d(n){var e=$d(n,"string");return typeof e=="symbol"?e:String(e)}function $d(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fd extends Error{constructor(){super(...arguments),Rd(this,"isTableDisconnectError",!0)}}const Ud=Fd;var st=R.module("useTable"),Bd=(n,e,t,r)=>{var i=Te(),[a,s]=c.useState(void 0),[o,l]=c.useState([]),[d,h]=c.useState(null),[f,p]=c.useState(null);c.useEffect(()=>{if(r===void 0){s(n==null?void 0:n.columns),h(null);return}try{s(n==null?void 0:n.findColumns(r)),h(null)}catch(w){st.error("Column not found",w,r),h(new Ld("Invalid columnNames argument"))}},[n,r]),c.useEffect(()=>{if(!a||!n){st.debug2("Table or column not initialized, skip viewport update.");return}st.debug2("Setting viewport",e,t),n.setViewport(e,t,a)},[a,n,e,t]);var v=c.useCallback(w=>{var{detail:x}=w;if(!a){st.error("Columns not initialized.");return}var P=a.map(C=>x.rows.map(k=>k.get(C)));l(P)},[a]),g=c.useCallback(()=>{p(new Ud("Table disconnected"))},[]),b=c.useCallback(()=>{p(null)},[]);return Be(n,i.Table.EVENT_UPDATED,v),Be(n,i.Table.EVENT_DISCONNECT,g),Be(n,i.Table.EVENT_RECONNECT,b),{columns:a,data:o,error:f??d}};const Ka=Bd;var Vd=(n,e,t,r)=>{var i=c.useMemo(()=>[r],[r]),{columns:a=[],data:s=[],error:o}=Ka(n,e,t,i);return{column:a[0],data:s[0],error:o}};const Ha=Vd;function Fr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Kd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Fr(a,r,i,s,o,"next",l)}function o(l){Fr(a,r,i,s,o,"throw",l)}s(void 0)})}}var pe=R.module("TableInput"),_t=250;function jn(n){var e,t,{className:r=void 0,columnName:i,settings:a,defaultValue:s=[],isInvalid:o=!1,onChange:l=()=>!1,onBlur:d=()=>!1,table:h}=n,f=c.useRef(null),p=Te(),v=c.useMemo(()=>{var U=Bt.getColumnFormats(a),V=Bt.getDateTimeFormatterOptions(a),{defaultDecimalFormatOptions:B={},defaultIntegerFormatOptions:Z={}}=a;return new xi(p,U,V,B,Z)},[p,a]),[g,b]=c.useState(""),[w,x]=c.useState(new Set(s)),[P,C]=c.useState(),k=c.useRef(null),O=Math.min((e=P==null?void 0:P.size)!==null&&e!==void 0?e:0,_t),{column:A,data:N,error:L}=Ha(P,0,_t-1,i),W=c.useCallback(U=>A?v.getFormattedString(U,A.type,A.name):"".concat(U),[A,v]),[S,D]=c.useMemo(()=>{var U=new Set(w),V=[];if(N==null)return[V,null];if(N.forEach(Z=>{var be="".concat(Z),et=w.has(be);et&&U.delete(be),V.push({value:be,displayValue:W(Z),isSelected:et})}),U.size>0){pe.debug2("Selection has items that are missing from the viewport");var B=new Set(w);return Array.from(U).forEach(Z=>{B.delete(Z)}),[V,B]}return[V,null]},[N,w,W]);c.useEffect(()=>{D!==null&&(x(D),l(Array.from(D)))},[l,D]);var F=c.useCallback(function(){var U=Kd(function*(V){try{var B=yield V;pe.debug("Table resolved",B),C(B)}catch(Z){if(Hn.isCanceled(Z))return;pe.error(Z)}});return function(V){return U.apply(this,arguments)}}(),[]);c.useEffect(()=>{var U=Hn.makeCancelable(h);return F(U),()=>{pe.debug2("Cancel table promise"),U.cancel()}},[h,F]);var T=c.useCallback(U=>{var{value:V}=U.target;b(V);var B=S.findIndex(be=>be.displayValue.includes(V));if(B>-1){var Z;pe.debug2("Found ".concat(V," at index ").concat(B)),(Z=k.current)===null||Z===void 0||Z.scrollIntoView(B)}else pe.debug2("".concat(V," not found"))},[S,k]),E=c.useCallback(U=>{if(pe.debug("handleSelect",U),U>=S.length){pe.error("Invalid index",U);return}var V=S[U].value,B=new Set(w);S[U].isSelected?B.delete(V):B.add(V),x(B),l(Array.from(B))},[l,S,w]),y=c.useCallback(()=>{var U=S.map(B=>B.value),V=new Set(U);x(V),l(U)},[S,l]),j=c.useCallback(()=>{x(new Set),l([])},[l]),_=c.useCallback(()=>{},[]),K=c.useCallback(U=>{var V,{relatedTarget:B}=U;pe.debug("handleChildBlur",B,B instanceof HTMLElement,f.current,(V=f.current)===null||V===void 0?void 0:V.contains(B)),(!B||f.current&&B instanceof HTMLElement&&!f.current.contains(B))&&d()},[d]),ae=S.length===0;return u.jsxs("div",{ref:f,className:I("table-input-container d-flex flex-column position-relative",r),children:[u.jsx(wt,{disabled:!!L||ae,value:g,placeholder:"Search",onChange:T,className:"mb-2 d-flex",onBlur:K}),u.jsx(Ia,{className:"table-input-list",disabled:P===void 0||ae,isInvalid:o,items:ae?[{value:"Empty",isSelected:!1}]:S,itemCount:O,offset:0,onSelect:E,onViewportChange:_,ref:k,onBlur:K}),P&&u.jsxs("div",{className:"meta-row",children:[u.jsx("div",{className:"d-flex align-items-center text-muted small",children:P!=null&&P.size>O&&u.jsxs(u.Fragment,{children:["Table is too large, showing the first ",_t," items."]})}),u.jsxs("div",{children:[u.jsx("button",{type:"button",className:"btn btn-link",onBlur:K,onClick:y,children:"Select All"}),u.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:K,onClick:j,children:"Clear"})]})]}),P==null||L&&u.jsx("div",{className:"h-100 w-100 position-absolute",children:u.jsx(De,{isLoaded:P!=null,isLoading:P==null&&L==null,errorMessage:(t=L==null?void 0:L.message)!==null&&t!==void 0?t:null})})]})}jn.displayName="TableInput";jn.defaultProps={isInvalid:!1,className:void 0};var Ur=R.module("useBroadcastChannel");function An(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bo,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:La,t=c.useMemo(()=>new BroadcastChannel(e),[e]);return c.useEffect(()=>()=>{t.close()},[t]),c.useEffect(()=>{function r(i){var{data:a}=i;if(!xt(a)){Ur.debug("Ignoring non-deephaven message",a);return}Ur.debug("event received",a),n(i)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}},[t,n]),t}function Tt(n,e){var t=c.useCallback(r=>{_a(r.data)?n==null||n(r.data):$a(r.data)&&(e==null||e(r.data))},[n,e]);An(t)}var pt="io.deephaven.web.client.auth.refreshToken",Ga=c.createContext(null),Hd=R.module("RefreshTokenUtils");function Yt(){var n=Ke.get(pt);try{if(n!=null)return JSON.parse(n)}catch(e){Hd.error("Error parsing refresh token",n,e)}return null}function en(n){if(n==null){Ke.remove(pt);return}var e=JSON.stringify({bytes:n.bytes,expiry:n.expiry}),t=new Date(n.expiry);Ke.set(pt,e,{secure:!0,sameSite:"strict",expires:t})}function Wa(n){var{children:e}=n,t=Te(),r=Ge(),[i,a]=c.useState(Yt());c.useEffect(function(){var d=r.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,h=>{var{detail:f}=h;en(f),a(f)});return d},[t,r,i]);var s=c.useCallback(()=>{a(Yt())},[]),o=c.useCallback(()=>{en(null),a(null)},[]);return Tt(s,o),u.jsx(Ga.Provider,{value:i,children:e})}function ge(){var n=Te();return c.useMemo(()=>new Ei(n),[n])}function Gd(n,e,t,r){var i=ge(),[a,s]=c.useState(""),o=vt(a,t),l=c.useCallback(p=>{s(p.trim())},[]),{data:d,isLoading:h}=Xe(i.doesColumnValueExist,[n,e,o,r]),f=h||a!==o?null:d;return{valueTrimmed:a,valueTrimmedDebounced:o,valueExists:f,trimAndUpdateValue:l}}var Br=R.module("useDebouncedViewportSearch"),Wd=200;function zd(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wd,r=ge(),{table:i,applyFiltersAndRefresh:a}=n,s=c.useMemo(()=>Ve(o=>{if(Br.debug("Applying debounced searchText '".concat(o,"'")),i!=null){var l=o.trim();if(l===""){a([]);return}var d=i.findColumn(e),h=r.makeFilterValue(d.type,l),f=[d.filter().contains(h)];a(f)}},t),[a,e,t,i,r]);return c.useEffect(()=>()=>{Br.debug("Cancelling debounced search function"),s.cancel()},[s]),s}var za=300;function qd(n){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:r,mapItemToValue:i}=n,a=ge(),s=Qi(e,i),o=vt(s,za),l=zi(o,Bi);return c.useMemo(()=>vn(a,t,l.selection,r,l.isInverted),[t,l,r,a])}function kn(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return c.useMemo(()=>yo(...t.map(i=>i(n))),[n,...t])}function Zd(n,e,t,r){var i=c.useRef("");return i.current=t,c.useMemo(()=>{var a=n.length>0&&n[0].item==null;return!a&&r!=null&&(i.current===""||r.toLowerCase().includes(i.current.toLowerCase()))?[{key:r,item:{[e]:r}},...n]:n},[r,e,n])}function Vr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Xd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Vr(a,r,i,s,o,"next",l)}function o(l){Vr(a,r,i,s,o,"throw",l)}s(void 0)})}}function Jd(n){var{table:e,columnName:t,defaultValue:r,itemHeight:i,topOffset:a=0,value:s}=n;return c.useCallback(Xd(function*(){if(e==null||s===""||s===r)return a;var o=e.findColumn(t),l=yield e.seekRow(0,o,"String",s),d=r==null?0:1;return(l+d)*i+a}),[t,r,i,e,a,s])}function Ln(n){var[,e]=c.useState(0),t=Te();return Be(n,t.Table.EVENT_SIZECHANGED,()=>{e(r=>r+1)}),mn(n)}var Qd=R.module("useInitializeViewportData");function qa(n){var e=ta({}),t=Math.max(0,Ln(n));return c.useEffect(()=>{var r=e.items.length;t!==r&&(Qd.debug("size changed:",{currentSize:r,targetSize:t}),e.setItems(Array.from(Di(0,t-1))))},[t,n]),e}function Za(n,e,t){return c.useCallback(function(i){var[a,s]=ji(i,e,t,mn(n));n==null||n.setViewport(a,s)},[n,t,e])}var Kr=R.module("useViewportData");function Rn(n){var{table:e,itemHeight:t=1,scrollDebounce:r=Mo,viewportSize:i=10,viewportPadding:a=50,deserializeRow:s=Ni}=n,o=qa(e),l=Za(e,i,a),d=c.useCallback(b=>{e&&!lt(e)?l(b):Kr.debug("setViewport called on closed table.",e)},[e,l]),h=c.useCallback(b=>{e&&!lt(e)?(e.applyFilter(b),d(0)):Kr.debug("applyFiltersAndRefresh called on closed table.",e)},[d,e]),f=Te(),p=c.useMemo(()=>Pi(o,s),[s,o]);Be(e,f.Table.EVENT_UPDATED,p);var v=Ln(e);c.useEffect(()=>{d(0)},[e,d,v]);var g=Yi(t,d,r);return c.useMemo(()=>({viewportData:o,size:v,table:e,applyFiltersAndRefresh:h,setViewport:d,onScroll:g}),[h,g,d,v,e,o])}function _n(n,e){var{applyFiltersAndRefresh:t}=n;c.useEffect(()=>{t(e)},[t,e])}function Yd(n,e){for(var t=ge(),[r,i]=c.useState(""),a=c.useMemo(()=>pn(t,e,r),[e,r,t]),s=ct(i,Ri),o=Rn({table:n,itemHeight:Io,viewportSize:_i,viewportPadding:$i}),l=arguments.length,d=new Array(l>2?l-2:0),h=2;h<l;h++)d[h-2]=arguments[h];var f=kn(o.table,a,...d);return _n(o,f),{list:o,onSearchTextChange:s}}function eh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=ge(),r=c.useMemo(()=>Ti(t),[t]);return c.useMemo(()=>fn(n,r,e),[n,e,r])}function Xa(n){c.useEffect(()=>()=>{n!=null&&(lt(n)||n.close())},[n])}function th(n,e,t){for(var r=ge(),[i,a]=c.useState(""),[s,o]=c.useState(""),[l,d]=c.useState(null),[h,f]=c.useState(()=>new Map),{data:p,isLoading:v}=Xe(r.doesColumnValueExist,[n,e,s,!1]),g=v||s!==i?null:p,b=c.useMemo(()=>pn(r,e,s),[e,s,r]),w=c.useMemo(()=>vn(r,e,new Set(h.keys()),!1,!0),[e,h,r]),x=arguments.length,P=new Array(x>3?x-3:0),C=3;C<x;C++)P[C-3]=arguments[C];var{data:k}=Xe(r.createDistinctSortedColumnTable,[n,e,"asc",...P]);Xa(k);var O=Rn({table:k,itemHeight:Po,viewportSize:_i,viewportPadding:$i}),A=i.length>0&&O.size===0,N=h.has(i),L=ct(o,Ri),W=c.useCallback(y=>{a(y),L(y)},[L]),S=ct(d,0),D=c.useCallback(y=>{if(a(""),o(""),d(y),S(null),y!=null){var j=O.viewportData.findItem(y);if(j!=null){var _=t(j);f(K=>{var ae=new Map(K);return ae.set(_,{value:_}),ae})}}},[S,O.viewportData,t]),F=c.useCallback(y=>{f(j=>{if(y.size===0)return j;var _=new Map(j);for(var K of y)_.set(K,{value:K});return _})},[]),T=c.useCallback(y=>{f(j=>{if(y==="all")return new Map;var _=new Map(j);for(var K of y)_.delete(K);return _})},[]),E=kn(O.table,b,w);return _n(O,E),c.useMemo(()=>({list:O,hasSearchTextWithZeroResults:A,searchText:i,searchTextExists:g,searchTextIsInSelectedValues:N,selectedKey:l,selectedValueMap:h,onSearchTextChange:W,onSelectKey:D,onAddValues:F,onRemoveValues:T}),[A,O,F,T,W,D,i,g,N,l,h])}function Hr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function nh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Hr(a,r,i,s,o,"next",l)}function o(l){Hr(a,r,i,s,o,"throw",l)}s(void 0)})}}function rh(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=c.useCallback(nh(function*(){var d;return(d=n==null?void 0:n.selectDistinct(n.findColumns(t)))!==null&&d!==void 0?d:null}),[n,...t]),{data:a,error:s,isError:o,isLoading:l}=Xe(i,[]);return c.useEffect(()=>()=>{a==null||a.close()},[a]),{distinctTable:a,error:s,isError:o,isLoading:l}}function ih(n,e){var t=ge(),r=c.useMemo(()=>Ii(t,n),[n,t]);return c.useMemo(()=>fn(e,r),[e,r])}function ah(n,e,t){var r=ge();return c.useMemo(()=>Mi(r,n,e,t),[n,t,r,e])}const sh=Object.freeze(Object.defineProperty({__proto__:null,DEBOUNCE_MS:za,REFRESH_TOKEN_KEY:pt,RefreshTokenBootstrap:Wa,RefreshTokenContext:Ga,TableInput:jn,makeApiContextWrapper:Md,readRefreshToken:Yt,storeRefreshToken:en,useBroadcastChannel:An,useBroadcastLoginListener:Tt,useCheckIfExistsValue:Gd,useDebouncedViewportSearch:zd,useDebouncedViewportSelectionFilter:qd,useFilterConditionFactories:kn,useFilteredItemsWithDefaultValue:Zd,useGetItemPosition:Jd,useInitializeViewportData:qa,useNotNullOrEmptyFilter:eh,usePickerWithSelectedValues:th,useSearchableViewportData:Yd,useSelectDistinctTable:rh,useSetPaddedViewportCallback:Za,useShowOnlyEmptyFilter:ih,useTable:Ka,useTableClose:Xa,useTableColumn:Ha,useTableListener:Be,useTableSize:Ln,useTableUtils:ge,useValueFilter:ah,useViewportData:Rn,useViewportFilter:_n},Symbol.toStringTag,{value:"Module"}));var Ja=c.createContext(!1);function oh(n){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=n,[r,i]=c.useState(!1);return c.useEffect(function(){document.fonts.ready.then(()=>{i(!0)})},[]),u.jsxs(u.Fragment,{children:[u.jsx(Ja.Provider,{value:r,children:t}),u.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(a=>u.jsx("p",{className:a,children:"preload"},a))})]})}var Pt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function lh(n){return"DashboardPlugin"in n}function tn(n){return"AuthPlugin"in n}function Qa(n){return"TablePlugin"in n}function uh(n){return lh(n)||tn(n)||Qa(n)}function ch(n){return"type"in n&&n.type===Pt.TABLE_PLUGIN}function dh(n){return"type"in n&&n.type===Pt.AUTH_PLUGIN}function hh(n){return"type"in n&&n.type===Pt.THEME_PLUGIN}function fh(n){if(n==null)return!1;var e=n;return e.Component!==void 0&&typeof e.isAvailable=="function"}var Ya="io.deephaven.auth.AnonymousAuthenticationHandler",ph="io.deephaven.authentication.psk.PskAuthenticationHandler";function Gr(n,e,t){return e=vh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vh(n){var e=mh(n,"string");return typeof e=="symbol"?e:String(e)}function mh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gh extends Error{constructor(){super(...arguments),Gr(this,"name","AuthenticationError"),Gr(this,"isAuthenticationError",!0)}}const es=gh;function Wr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function bh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Wr(a,r,i,s,o,"next",l)}function o(l){Wr(a,r,i,s,o,"throw",l)}s(void 0)})}}var zr=R.module("AuthPluginBase");function $n(n){var{children:e,getLoginOptions:t}=n,r=Ge(),[i,a]=c.useState(),[s,o]=c.useState(!1);return c.useEffect(()=>{var l=!1;function d(){if(l)throw new wo("Login canceled.")}function h(){return f.apply(this,arguments)}function f(){return f=bh(function*(){try{var p=yield t();d(),zr.info("Logging in..."),yield r.login(p),d(),o(!0)}catch(b){if(!l){var v;zr.error("Unable to login:",b);var g=(v=He(b))!==null&&v!==void 0?v:"Unable to login. Verify credentials.";a(new es(g)),o(!1)}}}),f.apply(this,arguments)}return h(),()=>{l=!0}},[r,t]),s?u.jsx(u.Fragment,{children:e}):u.jsx(De,{"data-testid":"auth-base-loading",isLoading:i==null,isLoaded:!1,errorMessage:He(i)})}var ts=c.createContext({}),It=c.createContext({}),Fn=c.createContext(null),yh={canLogout:!1};function wh(n){var{children:e}=n,t=Te(),r=c.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return u.jsx($n,{getLoginOptions:r,children:u.jsx(It.Provider,{value:yh,children:e})})}var Ch={Component:wh,isAvailable:n=>n.includes(Ya)};const ns=Ch;function qr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Sh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){qr(a,r,i,s,o,"next",l)}function o(l){qr(a,r,i,s,o,"throw",l)}s(void 0)})}}var Oh=R.module("AuthPluginParent"),xh={canLogout:!1};function Eh(n){return n!=null&&typeof n.type=="string"}function Th(){return nn.apply(this,arguments)}function nn(){return nn=Sh(function*(){Oh.info("Logging in by delegating to parent window...");var n=yield Dn(Aa);if(!Eh(n))throw new Error("Unexpected login options response: ".concat(n));return n}),nn.apply(this,arguments)}function Ph(){var n;return(n=new URLSearchParams(window.location.search).get("authProvider"))!==null&&n!==void 0?n:""}function Ih(n){var{children:e}=n;return u.jsx($n,{getLoginOptions:Th,children:u.jsx(It.Provider,{value:xh,children:e})})}var Mh={Component:Ih,isAvailable:()=>Nn()!=null&&Ph()==="parent"};const rs=Mh;function is(n){var{children:e,errorMessage:t,isLoggingIn:r=!1,onSubmit:i}=n;return u.jsxs("form",{className:"login-form",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),i==null||i(a)},children:[u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"flex-wrapper",children:[u.jsx("fieldset",{disabled:r,className:"container-fluid",children:e}),u.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:u.jsxs("button",{type:"submit",className:I("btn btn-primary",{"btn-spinner":r},{"btn-cancelable":r}),"data-testid":"btn-login",children:[r&&u.jsxs("span",{children:[u.jsx(bi,{className:"loading-spinner-vertical-align"}),u.jsx("span",{className:"btn-normal-content",children:"Logging in"}),u.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!r&&"Login"]})})]}),u.jsx("div",{className:"flex-spacer",children:t!=null&&u.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function as(n){var{children:e,logoPath:t="./logo.png"}=n;return u.jsxs("div",{className:"login-container",children:[u.jsx(Ea,{}),u.jsxs("div",{className:"login-box",children:[u.jsx("div",{className:"logo",children:u.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,u.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function Zr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function $t(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Zr(a,r,i,s,o,"next",l)}function o(l){Zr(a,r,i,s,o,"throw",l)}s(void 0)})}}var rn="io.deephaven.authentication.psk.PskAuthenticationHandler",ss="psk",an="io.deephaven.web.client.auth.psk.token",$e=R.module("AuthPluginPsk");function Nh(){return new URLSearchParams(window.location.search).get(ss)}function Dh(){$e.debug2("clearWindowToken");var n=new URL(window.location.href);n.searchParams.delete(ss),window.history.replaceState(null,"",n.href)}function Xr(){var n;return(n=Ke.get(an))!==null&&n!==void 0?n:null}function Ft(n){$e.debug2("Storing token in cookie",n),n!=null?Ke.set(an,n,{secure:!0,sameSite:"strict"}):Ke.remove(an)}function jh(n){var{children:e,logoPath:t}=n,r=Ge(),i=c.useRef(null),a=c.useRef(null),[s,o]=c.useState(),[l,d]=c.useState(!1),[h,f]=c.useState(!1),[p,v]=c.useState(!1),[g,b]=c.useState(""),w=c.useCallback(function(){var O=$t(function*(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;$e.info("Logging in..."),v(!0);var L=null;try{if(L=r.login({type:rn,token:A}),a.current=L,yield L,$e.info("Logged in successfully"),a.current!==L)return;Ft(A),f(!0)}catch(D){if(a.current!==L)return;if(d(!0),N){var W;$e.error("Unable to login",D);var S=(W=He(D))!==null&&W!==void 0?W:"Unable to login: Verify credentials.";o(new es(S))}}v(!1)});return function(A){return O.apply(this,arguments)}}(),[r]),x=c.useCallback(()=>{a.current=null,v(!1)},[]),P=c.useCallback($t(function*(){$e.debug("onLogin");var O=Xr();h||p||O==null||w(O,!1)}),[h,p,w]),C=c.useCallback(()=>{Ft(null)},[]);Tt(P,C),c.useEffect(()=>{var O=!1;function A(){return N.apply(this,arguments)}function N(){return N=$t(function*(){var L,W=(L=Nh())!==null&&L!==void 0?L:Xr();if(Dh(),W==null){d(!0);return}v(!0);try{yield r.login({type:rn,token:W}),O||(Ft(W),f(!0),v(!1))}catch{O||(d(!0),v(!1))}}),N.apply(this,arguments)}return A(),()=>{O=!0}},[r]);var k=c.useCallback(()=>{p?x():w(g)},[x,p,w,g]);return c.useEffect(function(){var A;(A=i.current)===null||A===void 0||A.focus()},[i,l]),u.jsxs(u.Fragment,{children:[h&&e,l&&u.jsx(Ne,{in:!h,timeout:fe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(as,{logoPath:t,children:u.jsx(is,{errorMessage:He(s),isLoggingIn:p,onSubmit:k,children:u.jsxs("div",{className:"form-group",children:[u.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),u.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:i,value:g,onChange:O=>{o(void 0),b(O.target.value)}})]})})})}),u.jsx(De,{"data-testid":"auth-psk-loading",isLoaded:h||l,isLoading:!h&&!l})]})}var Ah={Component:jh,isAvailable:n=>n.includes(rn)};const os=Ah;function Jr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(t),!0).forEach(function(r){kh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function kh(n,e,t){return e=Lh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lh(n){var e=Rh(n,"string");return typeof e=="symbol"?e:String(e)}function Rh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _h=R.module("UserUtils");function ls(n,e){return n.get("internal.webClient.appInit.".concat(e))}function us(n){var e,t,r,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function o(w){return ls(n,w)}function l(w,x){var P=o(w);return P==="true"?!0:P==="false"?!1:(P!==void 0&&_h.warn("Unexpected value for ".concat(w,": ").concat(P)),x)}var d=(e=o("name"))!==null&&e!==void 0?e:"",h=(t=o("operateAs"))!==null&&t!==void 0?t:d,f=(r=(i=o("groups"))===null||i===void 0?void 0:i.split(","))!==null&&r!==void 0?r:[],p=l("canCopy",!0),v=l("canDownloadCsv",!0),g=l("canUsePanels",!0),b=l("canLogout",!0);return Ut(Ut({name:d,operateAs:h,groups:f},a),{},{permissions:Ut({canUsePanels:g,canCopy:p,canDownloadCsv:v,canLogout:b},s)})}const $h=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:Ya,AUTH_HANDLER_TYPE_PSK:ph,AuthPluginAnonymous:ns,AuthPluginBase:$n,AuthPluginParent:rs,AuthPluginPsk:os,Login:as,LoginForm:is,UserContext:Fn,UserOverrideContext:ts,UserPermissionsOverrideContext:It,getAppInitValue:ls,getUserFromConfig:us,isAuthPlugin:fh},Symbol.toStringTag,{value:"Module"}));var cs={react:M,"react-dom":si,redux:Ns,"react-redux":Ds,"@deephaven/auth-plugins":$h,"@deephaven/components":pd,"@deephaven/jsapi-bootstrap":vd,"@deephaven/jsapi-components":sh,"@deephaven/jsapi-utils":Id,"@deephaven/log":qo,"@deephaven/react-hooks":hl},Fh=js.createRequires(cs),Uh=As({requires:Fh});const Bh=Uh;function Qr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Un(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Qr(a,r,i,s,o,"next",l)}function o(l){Qr(a,r,i,s,o,"throw",l)}s(void 0)})}}var ve=R.module("@deephaven/app-utils.PluginUtils");function Vh(n){return sn.apply(this,arguments)}function sn(){return sn=Un(function*(n){var e=yield Bh(n);return e}),sn.apply(this,arguments)}function Kh(n){return on.apply(this,arguments)}function on(){return on=Un(function*(n){var e=yield fetch(n);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),on.apply(this,arguments)}function Hh(n){return ln.apply(this,arguments)}function ln(){return ln=Un(function*(n){ve.debug("Loading plugins...");try{var e=yield Kh("".concat(n,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");ve.debug("Plugin manifest loaded:",e);for(var t=[],r=0;r<e.plugins.length;r+=1){var{name:i,main:a}=e.plugins[r],s="".concat(n,"/").concat(i,"/").concat(a);t.push(Vh(s))}for(var o=yield Promise.allSettled(t),l=new Map,d=0;d<o.length;d+=1){var h=o[d],{name:f}=e.plugins[d];if(h.status==="fulfilled"){var p,v=uh(h.value)?h.value:(p=h.value.default)!==null&&p!==void 0?p:h.value;v==null?ve.error("Plugin '".concat(f,"' is missing an exported value.")):l.set(f,v)}else ve.error("Unable to load plugin '".concat(f,"'"),h.reason)}return ve.info("Plugins loaded:",l),l}catch(g){return ve.error("Unable to load plugins:",g),new Map}}),ln.apply(this,arguments)}function Gh(n){var e,t;return(e=(t=n.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function Wh(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,r=Gh(e),i=[...n.entries(),...t.entries()].filter(l=>{var[,d]=l;return dh(d)||tn(d)}).map(l=>{var[d,h]=l;return tn(h)?{type:Pt.AUTH_PLUGIN,name:d,component:h.AuthPlugin.Component,isAvailable:h.AuthPlugin.isAvailable}:h}),a=i.filter(l=>{var{isAvailable:d}=l;return d(r,e)});if(a.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(r));a.length>1&&ve.warn("More than one login plugin available, will use the first one: ",a.map(l=>{var{name:d}=l;return d}).join(", "));var{name:s,component:o}=a[0];return ve.info("Using LoginPlugin",s),o}function zh(n){var e=[...n.entries()].filter(t=>hh(t[1]));return ve.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,a=Array.isArray(i.themes)?i.themes:[i.themes];return a.map(s=>{var{name:o,baseTheme:l,styleContent:d}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:yi(r,o),name:o,styleContent:d}})}).flat()}var qh=oi.createRequires(()=>cs),Zh=oi.createRemoteComponent({requires:qh});const bf=Zh;function Yr(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Xh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){Yr(a,r,i,s,o,"next",l)}function o(l){Yr(a,r,i,s,o,"throw",l)}s(void 0)})}}var Mt=c.createContext(null);function Jh(n){var{pluginsUrl:e,getCorePlugins:t,children:r}=n,[i,a]=c.useState(null);return c.useEffect(function(){var o=!1;function l(){return d.apply(this,arguments)}function d(){return d=Xh(function*(){var h,f=(h=yield t==null?void 0:t())!==null&&h!==void 0?h:[],p=yield Hh(e);if(!o){var v=f.map(g=>[g.name,g]);a(new Map([...v,...p]))}}),d.apply(this,arguments)}return l(),()=>{o=!0}},[e,t]),u.jsx(Mt.Provider,{value:i,children:r})}function Qh(){var n=An();return c.useEffect(function(){n.postMessage(Mn(In))},[n]),null}function ei(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function Yh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){ei(a,r,i,s,o,"next",l)}function o(l){ei(a,r,i,s,o,"throw",l)}s(void 0)})}}var ef=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:rs}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:os}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:ns}]]);function tf(n){var{children:e}=n,t=Ge(),r=c.useContext(Mt),[i,a]=c.useState(),[s,o]=c.useState();c.useEffect(function(){var f=!1;function p(){return v.apply(this,arguments)}function v(){return v=Yh(function*(){try{var g=yield t.getAuthConfigValues();f||a(new Map(g))}catch(b){f||o(b)}}),v.apply(this,arguments)}return p(),()=>{f=!0}},[t]);var l=c.useMemo(()=>{if(!(r==null||i==null))try{return Wh(r,i,ef)}catch(h){o(h)}},[i,r]),d=l==null||i==null;return d||s!=null?u.jsx(De,{isLoading:d&&s==null,errorMessage:He(s)}):u.jsx(l,{authConfigValues:i,children:u.jsxs(u.Fragment,{children:[u.jsx(Qh,{}),e]})})}function yf(n){return new URL(n,"".concat(window.location))}function nf(){var n=new URLSearchParams(window.location.search);return n.get("envoyPrefix")}function rf(){var n=nf();return n!=null?{headers:{"envoy-prefix":n}}:{headers:{}}}function af(n){var{children:e}=n,t=c.useContext(Ja);return t?u.jsx(u.Fragment,{children:e}):u.jsx(De,{"data-testid":"fonts-loaded-loading"})}function ti(n,e,t,r,i,a,s){try{var o=n[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(r,i)}function sf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function s(l){ti(a,r,i,s,o,"next",l)}function o(l){ti(a,r,i,s,o,"throw",l)}s(void 0)})}}var ds=c.createContext(null);function of(n){var{children:e}=n,t=Ge(),[r,i]=c.useState(),[a,s]=c.useState();c.useEffect(function(){var d=!1;function h(){return f.apply(this,arguments)}function f(){return f=sf(function*(){try{var p=yield t.getServerConfigValues();d||i(new Map(p))}catch(v){d||s(v)}}),f.apply(this,arguments)}return h(),()=>{d=!0}},[t]);var o=r==null;return o||a!=null?u.jsx(De,{isLoading:o&&a==null,errorMessage:He(a)}):u.jsx(ds.Provider,{value:r,children:e})}function lf(){return Je(ds,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function uf(n){var{children:e}=n,t=lf(),r=c.useContext(ts),i=c.useContext(It),a=us(t,r,i);return u.jsx(Fn.Provider,{value:a,children:e})}function cf(n){var{children:e}=n,t=c.useContext(Mt),r=c.useMemo(()=>t==null?null:zh(t),[t]);return u.jsx(Ma,{themes:r,children:e})}function wf(n){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:r,serverUrl:i,children:a}=n,s=c.useMemo(()=>rf(),[]),[o,l]=c.useState(0),d=c.useCallback(()=>{},[]),h=c.useCallback(()=>{l(f=>f+1)},[]);return Tt(d,h),u.jsx(oh,{fontClassNames:e,children:u.jsx(Jh,{getCorePlugins:r,pluginsUrl:t,children:u.jsx(cf,{children:u.jsx(Si,{serverUrl:i,options:s,children:u.jsx(Wa,{children:u.jsx(tf,{children:u.jsx(of,{children:u.jsx(uf,{children:u.jsx(Co,{children:u.jsx(af,{children:a})})})})})})},o)})})})}function df(){return Je(Mt,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsBootstrap or PluginsContext.Provider.")}function Cf(){return Je(Fn,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}var hf=R.module("@deephaven/app-utils/useTablePlugin");function Sf(){var n=df(),e=c.useCallback(t=>{var r=n.get(t);if(r!=null){if(ch(r))return r.component;if(Qa(r))return r.TablePlugin}var i="Unable to find table plugin ".concat(t,".");throw hf.error(i),new Error(i)},[n]);return e}export{wf as AppBootstrap,tf as AuthBootstrap,Co as ConnectionBootstrap,Ef as ConnectionContext,oh as FontBootstrap,af as FontsLoaded,Ja as FontsLoadedContext,Jh as PluginsBootstrap,Mt as PluginsContext,bf as RemoteComponent,cf as ThemeBootstrap,Gh as getAuthHandlers,Wh as getAuthPluginComponent,yf as getBaseUrl,rf as getConnectOptions,nf as getEnvoyPrefix,zh as getThemeDataFromPlugins,Kh as loadJson,Vh as loadModulePlugin,Hh as loadModulePlugins,Tf as useConnection,Sf as useLoadTablePlugin,df as usePlugins,lf as useServerConfig,Cf as useUser};
9
+ //# sourceMappingURL=index-3cd57fe9.js.map