@deephaven/embed-chart 0.19.2-beta.0 → 0.19.2-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.html CHANGED
@@ -48,12 +48,12 @@
48
48
  })();
49
49
  </script>
50
50
  <title>Deephaven Embedded Chart</title>
51
- <script type="module" crossorigin src="./assets/index.e19382e7.js"></script>
51
+ <script type="module" crossorigin src="./assets/index.5ec0b496.js"></script>
52
52
  <link rel="modulepreload" crossorigin href="./assets/helpers.162e09a8.js">
53
53
  <link rel="modulepreload" crossorigin href="./assets/vendor.d4f8636b.js">
54
54
  <link rel="modulepreload" crossorigin href="./assets/plotly.3009bed8.js">
55
55
  <link rel="stylesheet" href="./assets/vendor.c53844f2.css">
56
- <link rel="stylesheet" href="./assets/index.6cddd8fc.css">
56
+ <link rel="stylesheet" href="./assets/index.8f27a8bf.css">
57
57
  </head>
58
58
  <body>
59
59
  <noscript> You need to enable JavaScript to run this app. </noscript>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/embed-chart",
3
- "version": "0.19.2-beta.0+63ca6c5",
3
+ "version": "0.19.2-beta.4+e0d6f07",
4
4
  "description": "Deephaven Embedded Chart",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -16,11 +16,11 @@
16
16
  "build"
17
17
  ],
18
18
  "dependencies": {
19
- "@deephaven/chart": "^0.19.2-beta.0+63ca6c5",
20
- "@deephaven/components": "^0.19.2-beta.0+63ca6c5",
21
- "@deephaven/jsapi-shim": "^0.19.2-beta.0+63ca6c5",
22
- "@deephaven/jsapi-utils": "^0.19.2-beta.0+63ca6c5",
23
- "@deephaven/log": "^0.19.2-beta.0+63ca6c5",
19
+ "@deephaven/chart": "^0.19.2-beta.4+e0d6f07",
20
+ "@deephaven/components": "^0.19.2-beta.4+e0d6f07",
21
+ "@deephaven/jsapi-shim": "^0.19.2-beta.4+e0d6f07",
22
+ "@deephaven/jsapi-utils": "^0.19.2-beta.4+e0d6f07",
23
+ "@deephaven/log": "^0.19.2-beta.4+e0d6f07",
24
24
  "fira": "mozilla/fira#4.202",
25
25
  "react": "^17.0.2",
26
26
  "react-dom": "^17.0.2"
@@ -32,11 +32,11 @@
32
32
  "preview": "vite preview"
33
33
  },
34
34
  "devDependencies": {
35
- "@deephaven/eslint-config": "^0.19.2-beta.0+63ca6c5",
36
- "@deephaven/mocks": "^0.19.2-beta.0+63ca6c5",
37
- "@deephaven/prettier-config": "^0.19.2-beta.0+63ca6c5",
38
- "@deephaven/stylelint-config": "^0.19.2-beta.0+63ca6c5",
39
- "@deephaven/tsconfig": "^0.19.2-beta.0+63ca6c5",
35
+ "@deephaven/eslint-config": "^0.19.2-beta.4+e0d6f07",
36
+ "@deephaven/mocks": "^0.19.2-beta.4+e0d6f07",
37
+ "@deephaven/prettier-config": "^0.19.2-beta.4+e0d6f07",
38
+ "@deephaven/stylelint-config": "^0.19.2-beta.4+e0d6f07",
39
+ "@deephaven/tsconfig": "^0.19.2-beta.4+e0d6f07",
40
40
  "@vitejs/plugin-react": "^2.0.0",
41
41
  "vite": "^3.1.0"
42
42
  },
@@ -49,5 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "63ca6c5694f2dc0ff7e6f07772f36aa80d548fef"
52
+ "gitHead": "e0d6f07bcc9aeebab96cc25589081099aa935413"
53
53
  }
@@ -1,2 +0,0 @@
1
- import{A as u,B as kt,z as x,C as Sn,R as D,D as ke,E as h,F as rt,G,P as Tn,H as at,I as v,J as L,K as Rt,L as X,M as En,N as Lt,O as Mn,Q as Cn,S as In,T as xn,U as Pt}from"./vendor.d4f8636b.js";import{P as qe,b as Dn,h as wn,p as Nn,o as vn,s as Fn,t as An,c as Je}from"./plotly.3009bed8.js";import"./helpers.162e09a8.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var On={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},kn={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},Rn={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},Ln={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},Pn={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},_t={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},_n={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},Vn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},Un={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},Hn={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},$n={prefix:"dh",iconName:"graph-line-down",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm67.2 -291.2 -22.4 22.4 108.8 112 70.4 -64 108.8 124.8H320v32h112l16 -16V224h-32v70.4L288 150.4l-70.4 64z"]},Vt={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Bn={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};class W{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}W.TYPE_GLOBAL="type-global";W.TYPE_CONTEXT_PRESET="type-context-preset";W.TYPE_CONTEXT_CUSTOM="type-context-custom";class Wn extends W{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class qn extends W{format(t){return String.fromCharCode(t)}}const{dh:c}=globalThis,Ke=u.exports.shape({name:u.exports.string.isRequired,type:u.exports.string.isRequired,description:u.exports.string,constituentType:u.exports.string}),Ut=u.exports.shape({not:u.exports.func.isRequired,and:u.exports.func.isRequired,or:u.exports.func.isRequired}),Kn=u.exports.shape({asc:u.exports.func.isRequired,desc:u.exports.func.isRequired,abs:u.exports.func.isRequired,column:Ke.isRequired,direction:u.exports.string.isRequired,isAbs:u.exports.bool.isRequired}),zn=u.exports.shape({columns:u.exports.arrayOf(Ke).isRequired,customColumns:u.exports.arrayOf(u.exports.string).isRequired,filter:u.exports.arrayOf(Ut),addEventListener:u.exports.func.isRequired,removeEventListener:u.exports.func.isRequired,size:u.exports.number.isRequired,sort:u.exports.arrayOf(u.exports.any),copy:u.exports.func.isRequired,applyFilter:u.exports.func.isRequired,applySort:u.exports.func.isRequired,applyCustomColumns:u.exports.func.isRequired,description:u.exports.string}),Gn=u.exports.shape({columns:u.exports.arrayOf(Ke),filter:u.exports.arrayOf(u.exports.any),isExpanded:u.exports.func.isRequired,saveExpandedState:u.exports.func.isRequired,addEventListener:u.exports.func.isRequired,removeEventListener:u.exports.func.isRequired,size:u.exports.number.isRequired,sort:u.exports.arrayOf(u.exports.any),applyFilter:u.exports.func.isRequired,applySort:u.exports.func.isRequired}),Be=u.exports.shape({name:u.exports.string.isRequired,type:u.exports.string.isRequired}),jn=u.exports.shape({created:u.exports.arrayOf(Be).isRequired,updated:u.exports.arrayOf(Be).isRequired,removed:u.exports.arrayOf(Be).isRequired}),Zn=u.exports.shape({groupingColumns:u.exports.arrayOf(u.exports.string),aggregations:u.exports.shape({}),includeConstituents:u.exports.bool,includeOriginalColumns:u.exports.bool,includeDescriptions:u.exports.bool}),Xn=u.exports.shape({addEventListener:u.exports.func.isRequired,removeEventListener:u.exports.func.isRequired,onLogMessage:u.exports.func,getTable:u.exports.func.isRequired,runCode:u.exports.func.isRequired});Object.freeze({Column:Ke,FilterCondition:Ut,IdeSession:Xn,RollupConfig:Zn,Sort:Kn,Table:zn,TreeTable:Gn,VariableChanges:jn,VariableDefinition:Be});const Qn=-1,Ht=0,$t=1,lt=2,Bt=3,Wt=4;Object.freeze({SILENT:Qn,ERROR:Ht,WARN:$t,INFO:lt,DEBUG:Bt,DEBUG2:Wt});const ee=()=>{};class Mt{constructor(t,n){this.name=t,this.prefix=t?`[${t}]`:"",this.error=ee,this.warn=ee,this.log=ee,this.info=ee,this.debug=ee,this.debug2=ee,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=Ht?console.error.bind(console,this.prefix):ee,this.warn=t>=$t?console.warn.bind(console,this.prefix):ee,this.log=t>=lt?console.log.bind(console,this.prefix):ee,this.info=this.log,this.debug=t>=Bt?console.debug.bind(console,this.prefix):ee,this.debug2=t>=Wt?console.debug.bind(console,this.prefix):ee}}class Jn extends Mt{constructor(t=lt){super(null,t),this.modules={}}module(t){return this.modules[t]||(this.modules[t]=new Mt(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),!this.modules)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const $=new Jn,Ct=$.module("DateTimeColumnFormatter"),be=class extends W{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=be.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const i=e||be.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=c.i18n.TimeZone.getTimeZone(i)}catch{Ct.error("Unsupported time zone id",i),this.dhTimeZone=c.i18n.TimeZone.getTimeZone(be.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=be.makeFormatStringMap(t,n)}static isValid(e){try{return c.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=W.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getGlobalFormats(e,t){return[...be.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${s}`],["MM-dd-yyyy",`MM-dd-yyyy${s}`],["HH:mm:ss",`HH:mm:ss${s}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${s}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${s}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getFormats(e,t){return[...be.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)||e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return c.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{Ct.error("Invalid format arguments")}return""}};let ct=be;ct.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";ct.DEFAULT_TIME_ZONE_ID="America/New_York";const Yn=$.module("DecimalColumnFormatter"),re=class extends W{constructor({defaultFormatString:e=re.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return c.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=W.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return re.makeFormat(e,t,W.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return re.makeFormat("Custom Format",e,W.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return c.i18n.NumberFormat.format(n,s)}catch{Yn.error("Invalid format arguments")}return""}};let ge=re;ge.DEFAULT_FORMAT_STRING="###,##0.0000";ge.FORMAT_PERCENT=re.makePresetFormat("Percent","##0.00%");ge.FORMAT_BASIS_POINTS=re.makePresetFormat("Basis Points","###,##0 bp",1e4);ge.FORMAT_MILLIONS=re.makePresetFormat("Millions","###,##0.000 mm",1e-6);ge.FORMAT_ROUND=re.makePresetFormat("Round","###,##0");ge.FORMAT_ROUND_TWO_DECIMALS=re.makePresetFormat("0.00","###,##0.00");ge.FORMAT_ROUND_FOUR_DECIMALS=re.makePresetFormat("0.0000","###,##0.0000");class es extends W{format(t){return`${t}`}}const ts=$.module("IntegerColumnFormatter"),Pe=class extends W{constructor({defaultFormatString:e=Pe.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return c.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=W.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Pe.makeFormat(e,t,W.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Pe.makeFormat("Custom Format",e,W.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return c.i18n.NumberFormat.format(n,s)}catch{ts.error("Invalid format arguments")}return""}};let ut=Pe;ut.DEFAULT_FORMAT_STRING="###,##0";ut.FORMAT_MILLIONS=Pe.makePresetFormat("Millions","###,##0.000 mm",1e-6);class ns extends W{format(t){return t}}const Q=class{static makeDateWrapper(e,t,n=0,s=1,i=0,o=0,r=0,a=0){if(!e)throw new Error("No timezone provided");const l=`${t}`.padStart(4,"0"),d=`${n+1}`.padStart(2,"0"),p=`${s}`.padStart(2,"0"),m=`${i}`.padStart(2,"0"),b=`${o}`.padStart(2,"0"),y=`${r}`.padStart(2,"0"),w=`${a}`.padStart(9,"0"),C=`${l}-${d}-${p} ${m}:${b}:${y}.${w}`;return c.i18n.DateTimeFormat.parse(Q.FULL_DATE_FORMAT,C,c.i18n.TimeZone.getTimeZone(e))}static getNextNanos(e){const t=parseInt(e,10),n="0".repeat(9-e.length),s=`${t+1}${n}`;return parseInt(s,10)}static getNextDate(e,t,n){let{year:s,month:i,date:o,hours:r,minutes:a,seconds:l,nanos:d}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;d=Q.getNextNanos(e.nanos),d>999999999&&(l+=1,d=0)}else e.seconds!=null?l+=1:e.minutes!=null?a+=1:e.hours!=null?r+=1:e.date!=null?o+=1:e.month!=null?i+=1:s+=1;const p=new Date(s,i,o,r,a,l);return Q.makeDateWrapper(n,p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds(),d)}static parseMonth(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;const n=e.trim().toLowerCase();if(n.length>=3){for(let s=0;s<Q.months.length;s+=1)if(Q.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,i,o,r){const a=parseInt(e,10),l=t!=null?this.parseMonth(t):0,d=n!=null?parseInt(n,10):1,p=s!=null?parseInt(s,10):0,m=i!=null?parseInt(i,10):0,b=o!=null?parseInt(o,10):0,y=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(a)||Number.isNaN(l)||Number.isNaN(d)||Number.isNaN(p)||Number.isNaN(m)||Number.isNaN(b)||Number.isNaN(y)?null:{year:a,month:l,date:d,hours:p,minutes:m,seconds:b,nanos:y}}static parseDateTimeString(e){const n=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(e);if(n==null)throw new Error(`Unexpected date string: ${e}`);const[,s,,i,,o,,r,,a,,l,,d,p]=n;if(p!=null&&p.length>0)throw new Error(`Unexpected characters after date string '${e}': ${p}`);return{year:s,month:i,date:o,hours:r,minutes:a,seconds:l,nanos:d}}static parseDateRange(e,t){const n=e.trim().toLowerCase();if(n.length===0)throw new Error("Cannot parse date range from empty string");if(n==="null")return[null,null];if(n==="today"){const a=new Date(Date.now()),l=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate()),d=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate()+1);return[l,d]}if(n==="yesterday"){const a=new Date(Date.now()),l=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate()-1),d=Q.makeDateWrapper(t,a.getFullYear(),a.getMonth(),a.getDate());return[l,d]}if(n==="now"){const a=new Date(Date.now());return[c.DateWrapper.ofJsDate(a),null]}const s=Q.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const i=Q.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(i==null)throw new Error(`Unable to extract date values from ${s}`);const o=Q.makeDateWrapper(t,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),r=Q.getNextDate(s,i,t);return[o,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let _e=Q;_e.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";_e.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class Ve{}Ve.not="not";Ve.and="and";Ve.or="or";class f{}f.eq="eq";f.eqIgnoreCase="eqIgnoreCase";f.notEq="notEq";f.notEqIgnoreCase="notEqIgnoreCase";f.greaterThan="greaterThan";f.greaterThanOrEqualTo="greaterThanOrEqualTo";f.lessThan="lessThan";f.lessThanOrEqualTo="lessThanOrEqualTo";f.in="in";f.inIgnoreCase="inIgnoreCase";f.notIn="notIn";f.notInIgnoreCase="notInIgnoreCase";f.isTrue="isTrue";f.isFalse="isFalse";f.isNull="isNull";f.invoke="invoke";f.contains="contains";f.notContains="notContains";f.startsWith="startsWith";f.endsWith="endsWith";f.containsAny="containsAny";class Ye extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class qt extends CustomEvent{constructor(t,n){super(t,n)}}class Kt extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class st{static makeCancelable(t,n){let s=!1,i;const o=new Promise((r,a)=>{Promise.resolve(t).then(l=>{s?(n&&n(l),a(new Ye)):(i=l,r(l))},l=>a(s?new Ye:l))});return o.cancel=()=>{s=!0,i!=null&&n&&n(i)},o}static isCanceled(t){return t instanceof Ye}static isTimedOut(t){return t instanceof Kt}}function et(e){if(e==null)throw new Error("Value is null or undefined")}class oe{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!oe.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const i=t[s],o=i[0],r=i[1];if(o<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,i]=n;const o=[...t];for(let r=o.length-1;r>=0;r-=1){const a=o[r],l=a[0],d=a[1];if(l<=s&&i<=d)return o;s<=d&&l<=i&&(s=Math.min(s,l),i=Math.max(i,d),o.splice(r,1))}return o.push([s,i]),o}static deselectRange(t,n){const[s,i]=n,o=[...t];for(let r=o.length-1;r>=0;r-=1){const a=o[r],l=a[0],d=a[1];if(!(i<l||d<s))if(l<s&&i<d){o[r]=[l,s-1],o.splice(r+1,0,[i+1,d]);break}else s<=l&&d<=i?o.splice(r,1):l<s?o[r]=[l,s-1]:o[r]=[i+1,d]}return o}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class ss{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),i=t[t.length-1];return`${s}, ${n} ${i}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const zt=class{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;return`${t>0?`${t}h `:""}${n>0||t>0?`${n}m `:""}${e>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),s=String(Math.floor(n/60)).padStart(2,"0"),i=n%60,o=String(Math.ceil(i)).padStart(2,"0");return`${t}:${s}:${o}`}static isTimeString(e){return new RegExp(zt.TIME_PATTERN).test(e)}static parseTime(e){if(!e||typeof e!="string")throw new Error(`${e} is not a valid string`);const t=e.split(":");if(t.length!==3)throw new Error(`${e} is not a time string that can be parsed`);return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}};let Ee=zt;Ee.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Ee.TIME_ZONES=Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC\u22125",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]);const le=$.module("TableUtils"),g=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=g.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return g.isBooleanType(e)?[f.isTrue,f.isFalse,f.isNull]:g.isCharType(e)||g.isNumberType(e)||g.isDateType(e)?[f.eq,f.notEq,f.greaterThan,f.greaterThanOrEqualTo,f.lessThan,f.lessThanOrEqualTo]:g.isTextType(e)?[f.eq,f.eqIgnoreCase,f.notEq,f.notEqIgnoreCase,f.contains,f.notContains,f.startsWith,f.endsWith]:[]}static getNextSort(e,t,n){if(!e||n<0||n>=e.length)return null;const s=g.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===g.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(!e||t<0||t>=e.length||n===g.sortDirection.none)return null;let i=e[t].sort();switch(n){case g.sortDirection.ascending:i=i.asc();break;case g.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const i=g.getNextSort(t,e,n);return g.setSortForColumn(e,n,i,s)}static sortColumn(e,t,n,s,i,o){if(!e||n<0||n>=t.length)return[];const r=g.makeColumnSort(t,n,s,i);return g.setSortForColumn(e,n,r,o)}static setSortForColumn(e,t,n,s=!1){const i=g.getSortIndex(e,t);let o=[];return s&&(o=o.concat(e.filter(({direction:r})=>r!==g.sortDirection.reverse)),i!==null&&o.splice(i,1)),n!==null&&o.push(n),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case g.dataType.BOOLEAN:return g.dataType.BOOLEAN;case"char":case"java.lang.Character":case g.dataType.CHAR:return g.dataType.CHAR;case"java.lang.String":case g.dataType.STRING:return g.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case g.dataType.DATETIME:return g.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case g.dataType.DECIMAL:return g.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case g.dataType.INT:return g.dataType.INT;default:return g.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return g.isIntegerType(e)||g.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return g.getNormalizedType(e)===g.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let i=null;for(let o=0;o<s.length;o+=1){const a=s[o].split("&&");let l=null;for(let d=0;d<a.length;d+=1){const p=a[d].trim();if(p.length>0){const m=g.makeQuickFilterFromComponent(e,p,n);if(m)l?l=l.and(m):l=m;else throw new Error(`Unable to parse quick filter from text ${t}`)}}i&&l?i=i.or(l):i=l}return i}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return g.isNumberType(s)?this.makeQuickNumberFilter(e,t):g.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n&&g.isDateType(s)?this.makeQuickDateFilter(e,t,n):g.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,a=null,l=null,d=null,p=null;if(o!==null&&o.length>3&&([,r,a,l,d,p]=o),p!=null&&p.trim().length>0)return null;if(r==null&&(r="="),d!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(d=d.trim().toLowerCase(),d){case"null":s=n.isNull();break;case"nan":s=c.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":a!=null?s=c.FilterCondition.invoke("isInf",n).and(n.lessThan(c.FilterValue.ofNumber(0))):s=c.FilterCondition.invoke("isInf",n).and(n.greaterThan(c.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(l==null)return null;if(l=g.removeCommas(l),g.isLongType(e.type))try{l=c.FilterValue.ofNumber(c.LongWrapper.ofString(`${a!=null?"-":""}${l}`))}catch(m){return le.warn("Unable to create long filter",m),null}else{if(l=parseFloat(l),l==null||Number.isNaN(l))return null;l=c.FilterValue.ofNumber(a!=null?0-l:l)}return s=e.filter(),g.makeRangeFilterWithOperation(s,r,l)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(n);let o=null,r=null;if(i!==null&&i.length>2&&([,o,r]=i,r!=null&&(r=r.trim())),r==null||r.length===0)return null;o==null&&(o="=");const a=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}let l=null,d=null;switch(r.startsWith("*")?(l="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(d="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),o){case"~":return a.isNull().not().and(a.invoke("matches",c.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return a.isNull().or(a.invoke("matches",c.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return l==="*"?a.isNull().or(a.invoke("matches",c.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):d==="*"?a.isNull().or(a.invoke("matches",c.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):a.notEqIgnoreCase(c.FilterValue.ofString(r.toLowerCase()));case"=":return l==="*"?a.isNull().not().and(a.invoke("matches",c.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):d==="*"?a.isNull().not().and(a.invoke("matches",c.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):a.eqIgnoreCase(c.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,i,o]=s,r=i==="!"||i==="!=",a=o.trim().toLowerCase();let l=e.filter();try{const d=g.makeBooleanValue(a);return d?l=l.isTrue():d===null?l=l.isNull():l=l.isFalse(),r?l.not():l}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(o==null||o.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,a=null;[,r,a]=o;let l=f.eq;switch(r){case"<":l=f.lessThan;break;case"<=":case"=<":l=f.lessThanOrEqualTo;break;case">":l=f.greaterThan;break;case">=":case"=>":l=f.greaterThanOrEqualTo;break;case"!=":case"!":l=f.notEq;break;case"=":case"==":default:l=f.eq;break}return g.makeQuickDateFilterWithOperation(e,a,l,n)}static makeQuickDateFilterWithOperation(e,t,n=f.eq,s){if(e==null)throw new Error("Column is null");const[i,o]=_e.parseDateRange(t,s),r=i!=null?c.FilterValue.ofNumber(i):null,a=o!=null?c.FilterValue.ofNumber(o):null,l=e.filter();if(r==null)return n===f.notEq?l.isNull().not():l.isNull();switch(n){case f.eq:{if(a!=null){const d=l.greaterThanOrEqualTo(r),p=l.lessThan(a);return d.and(p)}return l.eq(r)}case f.lessThan:return l.lessThan(r);case f.lessThanOrEqualTo:return a!=null?l.lessThan(a):l.lessThanOrEqualTo(r);case f.greaterThan:return a!=null?l.greaterThanOrEqualTo(a):l.greaterThan(r);case f.greaterThanOrEqualTo:return l.greaterThanOrEqualTo(r);case f.notEq:{if(a!=null){const d=l.lessThan(r),p=l.greaterThanOrEqualTo(a);return d.or(p)}return l.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:`"${e}"`}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(n);let o=null,r=null,a=null;if(i!==null&&i.length>3&&([,o,r,a]=i),a!=null&&a.trim().length>0||r==null||r.length===0)return null;o==null&&(o="=");const l=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}const d=c.FilterValue.ofString(g.isRangeOperation(o)?g.quoteValue(r):r);return g.makeRangeFilterWithOperation(l,o,d)}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return st.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t,n=0,s=null){let i,o,r=!0;const a=new Promise((l,d)=>{o=setTimeout(()=>{i(),r=!1,d(new Kt(`Event "${t}" timed out.`))},n),i=e.addEventListener(t,p=>{if(s!=null&&!s(p)){le.debug2("Event triggered, but matcher returned false.");return}le.debug2("Event triggered, resolving."),i(),clearTimeout(o),r=!1,l(p)})});return a.cancel=()=>{if(r){le.debug2("Pending promise cleanup."),i(),clearTimeout(o),r=!1;return}le.debug2("Ignoring non-pending promise cancel.")},a}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:i,invertSelection:o,selectedValues:r}=t;let a=null;for(let d=0;d<s.length;d+=1){const p=s[d],{selectedType:m,value:b}=p;if(m!=null&&m.length>0&&b!=null&&b.length>0)try{const y=g.makeAdvancedValueFilter(e,m,b,n);if(y!=null){if(d===0)a=y;else if(a!==null&&d-1<i.length){const w=i[d-1];if(w===Ve.and)a=a.and(y);else if(w===Ve.or)a=a.or(y);else{le.error("Unexpected filter operator",w,y),a=null;break}}}else le.debug2("Empty filter ignored for",m,b)}catch(y){le.error("Unable to create filter",y),a=null;break}}const l=g.makeSelectValueFilter(e,r,o);return l!=null&&(a!=null?a=a.and(l):a=l),a}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=g.getBaseType(e);return g.isTextType(n)?c.FilterValue.ofString(t):g.isLongType(n)?c.FilterValue.ofNumber(c.LongWrapper.ofString(g.removeCommas(t))):c.FilterValue.ofNumber(g.removeCommas(t))}static makeFilterRawValue(e,t){return g.isTextType(e)?c.FilterValue.ofString(t):g.isBooleanType(e)?c.FilterValue.ofBoolean(t):c.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(g.isTextType(e))return t;if(g.isLongType(e))return c.LongWrapper.ofString(g.removeCommas(t));if(g.isBooleanType(e))return g.makeBooleanValue(t,!0);if(g.isDateType(e)){const[s]=_e.parseDateRange(t,n);return s}return g.isNumberType(e)?g.makeNumberValue(t):(le.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error(`Invalid boolean '${e}'`)}}static makeNumberValue(e){if(e==null||e==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=g.removeCommas(t);if(g.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static getFilterOperatorString(e){switch(e){case f.eq:return"=";case f.notEq:return"!=";case f.greaterThan:return">";case f.greaterThanOrEqualTo:return">=";case f.lessThan:return"<";case f.lessThanOrEqualTo:return"<=";case f.contains:return"~";case f.notContains:return"!~";default:throw new Error(`Unexpected filter type ${e}`)}}static makeAdvancedValueFilter(e,t,n,s){if(g.isDateType(e.type))return g.makeQuickDateFilterWithOperation(e,n,t,s);if(g.isNumberType(e.type)||g.isCharType(e.type))return g.makeQuickFilter(e,`${g.getFilterOperatorString(t)}${n}`);const i=g.makeFilterValue(e.type,n),o=e.filter();switch(t){case f.eq:return o.eq(i);case f.eqIgnoreCase:return o.eqIgnoreCase(i);case f.notEq:return o.notEq(i);case f.notEqIgnoreCase:return o.notEqIgnoreCase(i);case f.greaterThan:return o.greaterThan(i);case f.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(i);case f.lessThan:return o.lessThan(i);case f.lessThanOrEqualTo:return o.lessThanOrEqualTo(i);case f.isTrue:return o.isTrue();case f.isFalse:return o.isFalse();case f.isNull:return o.isNull();case f.contains:return o.isNull().not().and(o.invoke("matches",c.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case f.notContains:return o.isNull().or(o.invoke("matches",c.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case f.startsWith:return o.isNull().not().and(o.invoke("matches",c.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case f.endsWith:return o.isNull().not().and(o.invoke("matches",c.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case f.in:case f.inIgnoreCase:case f.notIn:case f.notInIgnoreCase:case f.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let o=null;g.isTextType(e.type)?o=c.FilterValue.ofString("a"):g.isBooleanType(e.type)?o=c.FilterValue.ofBoolean(!0):g.isDateType(e.type)?o=c.FilterValue.ofNumber(c.DateWrapper.ofJsDate(new Date)):o=c.FilterValue.ofNumber(0);const r=e.filter().eq(o),a=e.filter().notEq(o);return r.and(a)}const s=[];let i=!1;for(let o=0;o<t.length;o+=1){const r=t[o];r==null?i=!0:g.isTextType(e.type)?s.push(c.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):g.isBooleanType(e.type)?s.push(c.FilterValue.ofBoolean(!!r)):s.push(c.FilterValue.ofNumber(r))}return i?s.length>0?n?e.filter().isNull().not().and(e.filter().notIn(s)):e.filter().isNull().or(e.filter().in(s)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(s):e.filter().in(s)}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e,t=!0){return[...e].sort((n,s)=>{const i=n.name.toUpperCase(),o=s.name.toUpperCase();return ss.sort(i,o,t)})}};let K=g;K.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};K.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};K.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});K.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class dt{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const i=K.getNormalizedType(s.columnType);if(i===null)return n;n.has(i)||n.set(i,new Map);const o=n.get(i);return o==null||o.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,i,o=!1){this.defaultColumnFormatter=new es,this.typeFormatterMap=new Map([[K.dataType.BOOLEAN,new Wn],[K.dataType.CHAR,new qn],[K.dataType.DATETIME,new ct(n)],[K.dataType.DECIMAL,new ge(s)],[K.dataType.INT,new ut(i)],[K.dataType.STRING,new ns]]),this.columnFormatMap=dt.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(t,n=!1){const s=K.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var i;const s=this.getColumnFormatMapForType(t);return(i=s==null?void 0:s.get(n))!=null?i:null}getColumnTypeFormatter(t){var i;const n=K.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(i=this.typeFormatterMap.get(n))!=null?i:s),s}getFormattedString(t,n,s="",i){if(t==null)return"";const o=this.getColumnTypeFormatter(n),r=i||this.getColumnFormat(n,s);return o.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(K.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}function is(e){if(e&&e.formatter){const{formatter:t}=e;return t}}function os(e){return{timeZone:e==null?void 0:e.timeZone,defaultDateTimeFormatString:e==null?void 0:e.defaultDateTimeFormat,showTimeZone:e==null?void 0:e.showTimeZone,showTSeparator:e==null?void 0:e.showTSeparator}}function rs(e,t,n){const s=e.getColumnFormat(n,t);return s!=null&&(s.type===W.TYPE_CONTEXT_PRESET||s.type===W.TYPE_CONTEXT_CUSTOM)}const tt={getColumnFormats:is,getDateTimeFormatterOptions:os,isCustomColumnFormatDefined:rs};qe.register([Dn,wn,Nn,vn,Fn,An]);const as=typeof Je=="function"?Je(qe):Je.default(qe),ce=class{constructor(){this.listeners=[],this.isDownsamplingDisabled=!1}getData(){return[]}getDefaultTitle(){return""}getLayout(){return{}}getFilterColumnMap(){return new Map}isFilterRequired(){return!1}setFilter(e){}close(){}setFormatter(e){this.formatter=e}setDownsamplingDisabled(e){this.isDownsamplingDisabled=e}setDimensions(e){this.rect=e}setTitle(e){this.title=e}subscribe(e){this.listeners.push(e)}unsubscribe(e){this.listeners=this.listeners.filter(t=>t!==e)}fireEvent(e){for(let t=0;t<this.listeners.length;t+=1)this.listeners[t](e)}fireUpdate(e){this.fireEvent(new CustomEvent(ce.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(ce.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(ce.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(ce.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(ce.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(ce.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(ce.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(ce.EVENT_LOADFINISHED))}};let z=ce;z.EVENT_UPDATED="ChartModel.EVENT_UPDATED";z.EVENT_DISCONNECT="ChartModel.EVENT_DISCONNECT";z.EVENT_RECONNECT="ChartModel.EVENT_RECONNECT";z.EVENT_DOWNSAMPLESTARTED="ChartModel.EVENT_DOWNSAMPLESTARTED";z.EVENT_DOWNSAMPLEFINISHED="ChartModel.EVENT_DOWNSAMPLEFINISHED";z.EVENT_DOWNSAMPLEFAILED="ChartModel.EVENT_DOWNSAMPLEFAILED";z.EVENT_DOWNSAMPLENEEDED="ChartModel.EVENT_DOWNSAMPLENEEDED";z.EVENT_LOADFINISHED="ChartModel.EVENT_LOADFINISHED";const ls="#76d9e4 #9edc6f #fcd65b #aa9af4 #f37e3f #f95d84 #f0f0ee",cs="#403e41",us="#5b5a5c",ds="#c0bfbf",hs="#4878ea",ps="rgba(91, 90, 92, 0.7)",j={"paper-bgcolor":"#2d2a2e","plot-bgcolor":"#322f33","title-color":"#f0f0ee",colorway:ls,gridcolor:cs,linecolor:us,zerolinecolor:ds,activecolor:hs,rangebgcolor:ps,"area-color":"#76d9e4","trend-color":"#d5f0c1","line-color":"#9edc6f","error-band-line-color":"white","error-band-fill-color":"rgba(213, 240, 193, 0.1)","ohlc-increasing":"#9edc6f","ohlc-decreasing":"#f95d84"},de=Object.freeze({paper_bgcolor:j["paper-bgcolor"],plot_bgcolor:j["plot-bgcolor"],title_color:j["title-color"],colorway:j.colorway,gridcolor:j.gridcolor,linecolor:j.linecolor,zerolinecolor:j.zerolinecolor,activecolor:j.activecolor,rangebgcolor:j.rangebgcolor,area_color:j["area-color"],trend_color:j["trend-color"],line_color:j["line-color"],error_band_line_color:j["error-band-line-color"],error_band_fill_color:j["error-band-fill-color"],ohlc_increasing:j["ohlc-increasing"],ohlc_decreasing:j["ohlc-decreasing"]}),Ue=$.module("ChartUtils"),pe=Object.freeze(c.calendar.DayOfWeek.values()),It="io.deephaven.time.DateTime",ms=36e5,fs=1e6;function gs(e){return e.asDate!==void 0}function ys(e){return e.asNumber!==void 0}function xt(e){return e.dhTimeZone!==void 0}function bs(e){return e!=null&&e.range&&!e.autorange}const T=class{static getPlotlyChartType(e,t){switch(e){case c.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case c.plot.SeriesPlotStyle.LINE:return"scatter";case c.plot.SeriesPlotStyle.BAR:case c.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case c.plot.SeriesPlotStyle.PIE:return"pie";case c.plot.SeriesPlotStyle.TREEMAP:return"treemap";case c.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case c.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}static getPlotlyChartMode(e){switch(e){case c.plot.SeriesPlotStyle.SCATTER:return"markers";case c.plot.SeriesPlotStyle.LINE:return"lines";default:return}}static getPlotlyProperty(e,t){switch(e){case c.plot.SeriesPlotStyle.PIE:switch(t){case c.plot.SourceType.X:return"labels";case c.plot.SourceType.Y:return"values"}break;case c.plot.SeriesPlotStyle.OHLC:switch(t){case c.plot.SourceType.TIME:return"x"}break;case c.plot.SeriesPlotStyle.TREEMAP:switch(t){case c.plot.SourceType.X:return"ids";case c.plot.SourceType.Y:return"values";case c.plot.SourceType.LABEL:return"labels";case c.plot.SourceType.PARENT:return"parents";case c.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case c.plot.SourceType.X:return"x";case c.plot.SourceType.Y:return"y";case c.plot.SourceType.Z:return"z";case c.plot.SourceType.X_LOW:return"xLow";case c.plot.SourceType.X_HIGH:return"xHigh";case c.plot.SourceType.Y_LOW:return"yLow";case c.plot.SourceType.Y_HIGH:return"yHigh";case c.plot.SourceType.TIME:return"time";case c.plot.SourceType.OPEN:return"open";case c.plot.SourceType.HIGH:return"high";case c.plot.SourceType.LOW:return"low";case c.plot.SourceType.CLOSE:return"close";case c.plot.SourceType.SHAPE:return"shape";case c.plot.SourceType.SIZE:return"size";case c.plot.SourceType.LABEL:return"label";case c.plot.SourceType.COLOR:return"color";case c.plot.SourceType.PARENT:return"parent";case c.plot.SourceType.HOVER_TEXT:return"hovertext";case c.plot.SourceType.TEXT:return"text";default:throw new Error(`Unrecognized source type: ${t}`)}}static getPlotlySeriesOrientation(e){var n,s;const{sources:t}=e;return t.length===2&&((s=(n=t[0])==null?void 0:n.axis)==null?void 0:s.type)===c.plot.AxisType.Y?T.ORIENTATION.HORIZONTAL:T.ORIENTATION.VERTICAL}static getPlotlyErrorBars(e,t,n){const s=n.map((o,r)=>o-e[r]),i=t.map((o,r)=>e[r]-o);return{type:"data",symmetric:!1,array:s,arrayminus:i}}static getPlotlyDateFormat(e,t,n){const s=n==null?void 0:n.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z","");let i;const o=e==null?void 0:e.getColumnTypeFormatter(t);return o!=null&&xt(o)&&o.dhTimeZone!=null&&o.showTimeZone&&(i=c.i18n.DateTimeFormat.format(" z",new Date,o.dhTimeZone)),{tickformat:s,ticksuffix:i,automargin:!0}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,n){if(!n)return null;const i=n.split(";")[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);et(i);const[,o,r,a,,l,d,p,m,b]=i,y=a.replace(",","").length,C=r.indexOf(",")>=0||a.indexOf(",")>=0?",":"",E=m||(p?"e":"f"),F=l.length+d.length,O=`0${y}${C}.${F}${E}`,_=T.convertNumberPrefix(o),V=T.convertNumberPrefix(b);return{tickformat:O,tickprefix:_,ticksuffix:V,automargin:!0}}static getPlotlyAxisFormat(e,t=null){const{axis:n,columnType:s}=e,{formatPattern:i}=n;let o=null;return K.isDateType(s)?(o=T.getPlotlyDateFormat(t,s,i),o=T.addTickSpacing(o,n,!0)):K.isNumberType(s)&&(o=T.getPlotlyNumberFormat(t,s,i),o=T.addTickSpacing(o,n,!1)),n.formatType===c.plot.AxisFormatType.CATEGORY&&(o?o.type="category":o={type:"category",tickformat:void 0,ticksuffix:void 0}),o}static addTickSpacing(e,t,n){const{gapBetweenMajorTicks:s}=t;if(s>0){const i=e||{};let o=s;return n&&(o=s/fs),t.log&&(o=Math.log(o)),i.tickmode="linear",i.dtick=o,i}return e}static getSourceForAxis(e,t){for(let n=0;n<e.series.length;n+=1){const s=e.series[n];for(let i=0;i<s.sources.length;i+=1){const o=s.sources[i];if(o.axis===t)return o}}return null}static getSeriesVisibility(e,t){var n;return(n=t==null?void 0:t.hiddenSeries)!=null&&n.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,n,s=T.ORIENTATION.VERTICAL){return{type:e,mode:t,name:n,orientation:s}}static makeSeriesDataFromSeries(e,t,n,s=de){const{name:i,plotStyle:o,lineColor:r,shapeColor:a,sources:l}=e,d=l.some(w=>{var C;return(C=w.axis)==null?void 0:C.businessCalendar}),p=T.getChartType(o,d),m=T.getPlotlyChartMode(o),b=T.getPlotlySeriesOrientation(e),y=T.makeSeriesData(p,m,i,b);return T.addSourcesToSeriesData(y,o,l,t),T.addStylingToSeriesData(y,o,s,r,a,n),y}static addSourcesToSeriesData(e,t,n,s){const i=e;for(let o=0;o<n.length;o+=1){const r=n[o],{axis:a,type:l}=r,d=T.getPlotlyProperty(t,l);kt(i,d,[]);const p=a?T.getAxisPropertyName(a.type):null;if(p!=null){const m=s.get(a.type);if(m){const b=m.indexOf(a),y=b>0?`${b+1}`:"";i[`${p}axis`]=`${p}${y}`}}}}static addStylingToSeriesData(e,t,n=de,s=null,i=null,o=null){const r=e;r.marker={line:{}},r.line={width:1},t===c.plot.SeriesPlotStyle.AREA?r.fill="tozeroy":t===c.plot.SeriesPlotStyle.STACKED_AREA?r.stackgroup="stack":t===c.plot.SeriesPlotStyle.STEP?r.line.shape="hv":t===c.plot.SeriesPlotStyle.HISTOGRAM?(r.width=[],Object.assign(r.marker.line,{color:n.paper_bgcolor,width:1})):t===c.plot.SeriesPlotStyle.OHLC?(r.increasing={line:{color:n.ohlc_increasing}},r.decreasing={line:{color:n.ohlc_decreasing}}):t===c.plot.SeriesPlotStyle.PIE?(r.textinfo="label+percent",r.outsidetextfont={color:n.title_color}):t===c.plot.SeriesPlotStyle.TREEMAP&&(r.hoverinfo="text",r.textinfo="label+text",r.tiling={packing:"squarify",pad:0},r.textposition="middle center",r.outsidetextfont={color:n.title_color}),s!=null&&(t===c.plot.SeriesPlotStyle.BAR?r.marker.color=s:r.line.color=s),i!=null&&(r.marker.color=i),o!=null&&t!==c.plot.SeriesPlotStyle.PIE&&(r.visible=o)}static getAxisFormats(e,t){const n=new Map,s={tickformat:null,ticksuffix:null},{charts:i}=e;for(let o=0;o<i.length;o+=1){const r=i[o],a=T.groupArray(r.axes,"type");for(let l=0;l<r.series.length;l+=1){const d=r.series[l],{sources:p}=d,m=p.filter(b=>b.axis);for(let b=0;b<m.length;b+=1){const y=m[b],{axis:w}=y,{type:C}=w,k=a.get(C);et(k);const E=k.indexOf(w),F=T.getAxisPropertyName(C);if(F!=null){const N=T.getAxisLayoutProperty(F,E);if(n.has(N))Ue.debug(`${N} already added.`);else{Ue.debug(`Adding ${N} to axisFormats.`);const O=T.getPlotlyAxisFormat(y,t);if(O===null)n.set(N,s);else{n.set(N,O);const{businessCalendar:_}=w;if(_){const V=[],{businessPeriods:H,businessDays:se,holidays:ae,timeZone:Ie}=_,xe=t==null?void 0:t.getColumnTypeFormatter(It);let I;xt(xe)&&(I=xe.dhTimeZone);const M=I?(Ie.standardOffset-I.standardOffset)/60:0;ae.length>0&&V.push(...T.createRangeBreakValuesFromHolidays(ae,Ie,I)),H.forEach(S=>V.push({pattern:"hour",bounds:[T.periodToDecimal(S.close)+M,T.periodToDecimal(S.open)+M]})),se.length<pe.length&&T.createBoundsFromDays(se).forEach(S=>V.push({pattern:"day of week",bounds:S})),O.rangebreaks=V}if(n.size===r.axes.length)return n}}}}}}return n}static getChartType(e,t){switch(e){case c.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return T.getPlotlyChartType(e,t)}}static getAxisPropertyName(e){switch(e){case c.plot.AxisType.X:return"x";case c.plot.AxisType.Y:return"y";default:return null}}static getAxisSide(e){switch(e){case c.plot.AxisPosition.BOTTOM:return"bottom";case c.plot.AxisPosition.TOP:return"top";case c.plot.AxisPosition.LEFT:return"left";case c.plot.AxisPosition.RIGHT:return"right";default:return}}static getChartForSeries(e,t){const{charts:n}=e;for(let s=0;s<n.length;s+=1){const i=n[s];for(let o=0;o<i.series.length;o+=1)if(t===i.series[o])return i}return null}static getLayoutRanges(e){const t={},n=Object.keys(e).filter(s=>s.indexOf("axis")>=0);for(let s=0;s<n.length;s+=1){const i=n[s],o=e[i];bs(o)&&(t[i]=[...o.range])}return t}static updateLayoutAxes(e,t,n=0,s=0,i=null,o=de){const r=n>0?Math.max(T.MIN_AXIS_SIZE,Math.min(T.AXIS_SIZE_PX/s,T.MAX_AXIS_SIZE)):T.DEFAULT_AXIS_SIZE,a=s>0?Math.max(T.MIN_AXIS_SIZE,Math.min(T.AXIS_SIZE_PX/n,T.MAX_AXIS_SIZE)):T.DEFAULT_AXIS_SIZE,l={left:0,bottom:0,top:1,right:1},d=T.groupArray(t,"position");(d.get(c.plot.AxisPosition.RIGHT)||[]).length>0&&(n>0?l.right=1-Math.max(0,Math.min(T.LEGEND_WIDTH_PX/n,T.MAX_LEGEND_SIZE)):l.right=1-T.DEFAULT_AXIS_SIZE);const m=e,b=T.groupArray(t,"type"),y=[...b.keys()];for(let w=0;w<y.length;w+=1){const C=y[w],k=T.getAxisPropertyName(C);if(k!=null){const E=b.get(C),N=C===c.plot.AxisType.Y?s:n;et(E);let O=0;for(O=0;O<E.length;O+=1){const V=E[O],H=T.getAxisLayoutProperty(k,O);m[H]==null&&(m[H]=T.makeLayoutAxis(C,o));const se=m[H];if(se!=null){T.updateLayoutAxis(se,V,O,d,r,a,l);const{range:ae,autorange:Ie}=se;if(i&&ae&&!Ie){const xe=i(V),[I,M]=xe(ae);Ue.debug("Setting downsample range",N,I,M),V.range(N,I,M)}else V.range(N)}}let _=T.getAxisLayoutProperty(k,O);for(;m[_]!=null;)delete m[_],O+=1,_=T.getAxisLayoutProperty(k,O)}}}static getAxisLayoutProperty(e,t){const n=t>0?`${t+1}`:"";return`${e!=null?e:""}axis${n}`}static updateLayoutAxis(e,t,n,s,i,o,r){var m,b,y;const l=t.type===c.plot.AxisType.Y?o:i,d=e,p=(m=t.label)!=null?m:"";if(d.title!==void 0&&typeof d.title!="string"?d.title.text=p:d.title={text:p},t.log&&(d.type="log"),d.side=T.getAxisSide(t.position),n>0){d.overlaying=(b=T.getAxisPropertyName(t.type))!=null?b:void 0;const w=(y=s.get(t.position))!=null?y:[],C=w.indexOf(t);C>0&&(d.anchor="free",t.position===c.plot.AxisPosition.RIGHT?d.position=r.right+(C-w.length+1)*l:t.position===c.plot.AxisPosition.TOP?d.position=r.top+(C-w.length+1)*l:t.position===c.plot.AxisPosition.BOTTOM?d.position=r.bottom+(w.length-C+1)*l:t.position===c.plot.AxisPosition.LEFT&&(d.position=r.left+(w.length-C+1)*l))}else if(t.type===c.plot.AxisType.X){const w=s.get(c.plot.AxisPosition.LEFT)||[],C=s.get(c.plot.AxisPosition.RIGHT)||[],k=Math.max(r.left,r.left+(w.length-1)*o),E=Math.min(r.right-(C.length-1)*o,r.right);d.domain=[k,E]}else if(t.type===c.plot.AxisType.Y){const w=s.get(c.plot.AxisPosition.BOTTOM)||[],C=s.get(c.plot.AxisPosition.TOP)||[],k=Math.max(r.bottom,r.bottom+(w.length-1)*i),E=Math.min(r.top-(C.length-1)*i,r.top);d.domain=[k,E]}}static periodToDecimal(e){const t=e.split(":");return Number(t[0])+Number(t[1])/60}static createBoundsFromDays(e){const t=e.map(o=>pe.indexOf(o)),n=pe.filter(o=>!e.includes(o)).map(o=>pe.indexOf(o)),s=new Set;n.forEach(o=>{for(let r=o+1;r<o+pe.length;r+=1){const a=r%pe.length;if(t.includes(a)){s.add(a);break}}});const i=[];return s.forEach(o=>{for(let r=o-1;r>o-pe.length;r-=1){const a=r<0?r+pe.length:r;if(t.includes(a)){const l=(a+1)%7;i.push([l,o]);break}}}),i}static createRangeBreakValuesFromHolidays(e,t,n){const s=[],i=[];return e.forEach(o=>{o.businessPeriods.length>0?i.push(...T.createPartialHoliday(o,t,n)):s.push(T.createFullHoliday(o,t,n))}),[{values:s},...i]}static createFullHoliday(e,t,n){return T.adjustDateForTimeZone(`${e.date.toString()} 00:00:00.000000`,t,n)}static createPartialHoliday(e,t,n){const s=e.date.toString(),i=["00:00"];e.businessPeriods.forEach(r=>{i.push(r.open),i.push(r.close)}),i.push("24:00");const o=[];for(let r=0;r<i.length;r+=2){const a=i[r],l=i[r+1];if(a!==l){const d=[T.adjustDateForTimeZone(`${s} ${a}:00.000000`,t,n)],p=ms*(T.periodToDecimal(l)-T.periodToDecimal(a));o.push({values:d,dvalue:p})}}return o}static adjustDateForTimeZone(e,t,n){return n&&n.standardOffset!==t.standardOffset?T.unwrapValue(T.wrapValue(e,It,t),n):e}static groupArray(e,t){return e.reduce((n,s)=>{const i=s[t],o=n.get(i)||[];return o.push(s),n.set(i,o),n},new Map)}static unwrapValue(e,t){if(e!=null){if(gs(e))return c.i18n.DateTimeFormat.format(T.DATE_FORMAT,e,t);if(ys(e))return e.asNumber()}return e}static wrapValue(e,t,n=null){if(K.isDateType(t)&&typeof e=="string"){const s=e,i=T.DATE_FORMAT.substr(0,e.length),o=c.i18n.DateTimeFormat.parse(i,s);if(!n)return o;const r=`${i} Z`,a=c.i18n.DateTimeFormat.format("Z",o,n),l=c.i18n.DateTimeFormat.parse(r,`${s} ${a}`),d=c.i18n.DateTimeFormat.format("Z",l,n);return c.i18n.DateTimeFormat.parse(r,`${s} ${d}`)}return e}static makeLayoutAxis(e,t=de){const n={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}}};return e===c.plot.AxisType.X?Object.assign(n,{showgrid:!0}):e===c.plot.AxisType.Y&&Object.assign(n,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),n}static getColorwayFromTheme(e=de){let t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):Ue.warn(`Unable to handle colorway property: ${e.colorway}`)),t}static makeDefaultLayout(e=de){const t={...e,autosize:!0,colorway:T.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif"},title:{font:{color:e.title_color},yanchor:"top",pad:{...T.DEFAULT_TITLE_PADDING},y:1},legend:{font:{color:e.title_color}},margin:{...T.DEFAULT_MARGIN},xaxis:T.makeLayoutAxis(c.plot.AxisType.X,e),yaxis:T.makeLayoutAxis(c.plot.AxisType.Y,e)};return t.datarevision=0,t}static hydrateSettings(e){return{...e,type:c.plot.SeriesPlotStyle[e.type]}}static titleFromSettings(e){const{series:t,xAxis:n,title:s=`${t.join(", ")} by ${n}`}=e;return s}static makeFigureSettings(e,t){const{series:n,xAxis:s,type:i}=e,o=T.titleFromSettings(e),r={formatType:`${c.plot.AxisFormatType.NUMBER}`,type:`${c.plot.AxisType.X}`,position:`${c.plot.AxisPosition.BOTTOM}`},a={formatType:`${c.plot.AxisFormatType.NUMBER}`,type:`${c.plot.AxisType.Y}`,position:`${c.plot.AxisPosition.LEFT}`};return{charts:[{chartType:`${c.plot.ChartType.XY}`,axes:[r,a],series:n.map(l=>({plotStyle:`${i}`,name:l,dataSources:[{type:`${c.plot.SourceType.X}`,columnName:s,axis:r,table:t},{type:`${c.plot.SourceType.Y}`,columnName:l,axis:a,table:t}]}))}],title:o}}};let R=T;R.DEFAULT_AXIS_SIZE=.15;R.MIN_AXIS_SIZE=.025;R.MAX_AXIS_SIZE=.2;R.AXIS_SIZE_PX=75;R.LEGEND_WIDTH_PX=50;R.MAX_LEGEND_SIZE=.25;R.ORIENTATION=Object.freeze({HORIZONTAL:"h",VERTICAL:"v"});R.DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSS";R.DEFAULT_MARGIN=Object.freeze({l:60,r:50,t:30,b:60,pad:0});R.DEFAULT_TITLE_PADDING=Object.freeze({t:8});R.SUBTITLE_LINE_HEIGHT=25;const me=$.module("Chart"),Re=class extends x.exports.Component{constructor(e){super(e),this.getCachedConfig=Sn((t,n,s,i)=>{const o=[];if(t&&o.push({name:`Downsampling failed: ${t}`,click:()=>{},icon:Re.convertIcon(Bn),attr:"fill-warning"}),n||s||i||t){const r=Re.downsampleButtonTitle(s,i),a=Re.downsampleButtonAttr(s,i),l=s?_t:$n;o.push({name:r,icon:Re.convertIcon(l),click:this.handleDownsampleClick,attr:a})}return{displaylogo:!1,displayModeBar:s||t?!0:"hover",modeBarButtons:[o,["toImage"],["zoom2d","pan2d"],["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]]}}),this.handleAfterPlot=this.handleAfterPlot.bind(this),this.handleDownsampleClick=this.handleDownsampleClick.bind(this),this.handleModelEvent=this.handleModelEvent.bind(this),this.handlePlotUpdate=this.handlePlotUpdate.bind(this),this.handleRelayout=this.handleRelayout.bind(this),this.handleRestyle=this.handleRestyle.bind(this),this.plot=D.createRef(),this.plotWrapper=D.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,this.state={data:null,downsamplingError:null,isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,layout:{datarevision:0},revision:0}}static convertIcon(e){const[t,,,,n]=e.icon,s=`${n}`;return{width:t,path:s,ascent:t,descent:0,transform:"matrix(1, 0, 0, 1, 0, 0)"}}static downsampleButtonTitle(e,t){return e?"Downsampling in progress...":t?"Downsampling disabled, click to enable":"Downsampling enabled, click to disable"}static downsampleButtonAttr(e,t){return e?"animation-spin":t?void 0:"fill-active"}componentDidMount(){this.updateDimensions(),this.updateModelDimensions(),this.initData(),this.initFormatter();const{isActive:e}=this.props;e&&this.subscribe()}componentDidUpdate(e){const{isActive:t,settings:n}=this.props;this.updateFormatterSettings(n),t!==e.isActive&&(t?this.subscribe():this.unsubscribe())}componentWillUnmount(){this.unsubscribe()}getPlotRect(){var e,t;return(t=(e=this.plotWrapper.current)==null?void 0:e.getBoundingClientRect())!=null?t:null}initData(){const{model:e}=this.props,{layout:t}=this.state;this.setState({data:e.getData(),layout:{...t,...e.getLayout()}})}subscribe(){if(this.isSubscribed)return;const{model:e}=this.props;if(!this.rect||this.rect.width===0||this.rect.height===0){me.debug2("Delaying subscription until model dimensions are set");return}e.subscribe(this.handleModelEvent),this.isSubscribed=!0}unsubscribe(){if(!this.isSubscribed)return;const{model:e}=this.props;e.unsubscribe(this.handleModelEvent),this.isSubscribed=!1}handleAfterPlot(){this.plot.current}handleDownsampleClick(){this.setState(({isDownsamplingDisabled:e})=>({downsamplingError:null,isDownsampleInProgress:!1,isDownsampleFinished:!1,isDownsamplingDisabled:!e}),()=>{const{model:e}=this.props,{isDownsamplingDisabled:t}=this.state;e.setDownsamplingDisabled(t)})}handleModelEvent(e){const{type:t,detail:n}=e;switch(me.debug2("Received data update",t,n),t){case z.EVENT_UPDATED:{this.currentSeries+=1,this.setState(i=>{const{layout:o,revision:r}=i;return typeof o.datarevision=="number"&&(o.datarevision+=1),{data:n,layout:o,revision:r+1}});const{onUpdate:s}=this.props;s({isLoading:!this.isLoadedFired});break}case z.EVENT_LOADFINISHED:{const{onUpdate:s}=this.props;this.isLoadedFired=!0,s({isLoading:!1});break}case z.EVENT_DISCONNECT:{const{onDisconnect:s}=this.props;s();break}case z.EVENT_RECONNECT:{const{onReconnect:s}=this.props;s();break}case z.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case z.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case z.EVENT_DOWNSAMPLENEEDED:case z.EVENT_DOWNSAMPLEFAILED:{const s=n.message?n.message:n;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:s});const{onError:i}=this.props;i(new Error(s));break}default:me.debug("Unknown event type",t,e)}}handlePlotUpdate(e){const{layout:t}=e,n=R.getLayoutRanges(t);!ke(n,this.ranges)&&(this.ranges=n,this.updateModelDimensions(!0))}handleRelayout(e){if(me.debug("handleRelayout",e),e.hiddenlabels!=null){const{onSettingsChanged:t}=this.props,n=[...e.hiddenlabels];t({hiddenSeries:n})}this.updateModelDimensions()}handleRestyle([e,t]){if(me.debug("handleRestyle",e,t),Object.keys(e).includes("visible")){const{data:n}=this.state,{onSettingsChanged:s}=this.props;if(n!=null){const i=n.reduce((o,{name:r,visible:a})=>r!=null&&a==="legendonly"?[...o,r]:o,[]);s({hiddenSeries:i})}}}updateModelDimensions(e=!1){const t=this.getPlotRect();if(!t){me.warn("Unable to get plotting rect");return}if(!this.rect||this.rect.width!==t.width||this.rect.height!==t.height||e){this.rect=t;const{isActive:s,model:i}=this.props;i.setDimensions(t),s&&this.subscribe()}}initFormatter(){const{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){const t=tt.getColumnFormats(e),n=tt.getDateTimeFormatterOptions(e),{decimalFormatOptions:s={},integerFormatOptions:i={}}=e;(!ke(this.columnFormats,t)||!ke(this.dateTimeFormatterOptions,n)||!ke(this.decimalFormatOptions,s)||!ke(this.integerFormatOptions,i))&&(this.columnFormats=tt.getColumnFormats(e),this.dateTimeFormatterOptions=n,this.decimalFormatOptions=s,this.integerFormatOptions=i,this.updateFormatter())}updateFormatter(){const e=new dt(this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions),{model:t}=this.props;t.setFormatter(e)}updateDimensions(){const e=this.getPlotRect();this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&qe.relayout(this.plot.current.el,{autosize:!0}).catch(t=>{me.debug("Unable to resize, promise rejected",t)})}render(){const{data:e,downsamplingError:t,isDownsampleFinished:n,isDownsampleInProgress:s,isDownsamplingDisabled:i,layout:o,revision:r}=this.state,a=this.getCachedConfig(t,n,s,i),l=e!=null;return h("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:l&&h(as,{ref:this.plot,data:e,layout:o,revision:r,config:a,onAfterPlot:this.handleAfterPlot,onError:me.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}})})}};let Gt=Re;Gt.defaultProps={isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:_e.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}};const Z=$.module("FigureChartModel"),jt=class extends z{constructor(e,t={},n=de){super(),this.addPendingSeries=rt(()=>{const{pendingSeries:s}=this;for(let i=0;i<s.length;i+=1){const o=s[i];this.addSeries(o),o.subscribe()}this.pendingSeries=[]},jt.ADD_SERIES_DEBOUNCE),this.getTimeZone=G((s,i)=>{if(i!=null){const o=i.getColumnTypeFormatter(s);if(o!=null)return o.dhTimeZone}return null}),this.getValueTranslator=G((s,i)=>{const o=this.getTimeZone(s,i);return r=>R.unwrapValue(r,o)}),this.getValueParser=G((s,i)=>{const o=this.getTimeZone(s,i);return r=>R.wrapValue(r,s,o)}),this.getRangeParser=G((s,i)=>o=>{let[r,a]=o;const l=this.getValueParser(s,i);return r=l(r),a=l(a),[r,a]}),this.getAxisRangeParser=G((s,i)=>o=>{const r=R.getSourceForAxis(s,o);return r?this.getRangeParser(r.columnType,i):a=>a}),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.figure=e,this.settings=t,this.theme=n,this.data=[],this.layout=R.makeDefaultLayout(n),this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){return this.figure.charts.length>0?this.figure.charts[0].title:""}initAllSeries(){this.oneClicks=[],this.filterColumnMap.clear();const{charts:e}=this.figure,t=[];for(let i=0;i<e.length;i+=1){const o=e[i];for(let r=0;r<o.series.length;r+=1){const a=o.series[r];t.push(a.name),this.addSeries(a)}}const s=[...this.seriesDataMap.keys()].filter(i=>t.indexOf(i)<0);for(let i=0;i<s.length;i+=1){const o=s[i];this.seriesDataMap.delete(o)}this.seriesToProcess=new Set([...this.seriesDataMap.keys()])}addSeries(e){const t=R.getChartForSeries(this.figure,e);if(t==null){Z.error("Unable to find matching chart for series",e);return}const n=R.groupArray(t.axes,"type"),s=R.makeSeriesDataFromSeries(e,n,R.getSeriesVisibility(e.name,this.settings),this.theme);if(this.seriesDataMap.set(e.name,s),this.data=[...this.seriesDataMap.values()],e.plotStyle===c.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===c.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=R.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===c.plot.SeriesPlotStyle.PIE,e.oneClick){const{oneClick:i}=e,{columns:o}=i;for(let r=0;r<o.length;r+=1)this.filterColumnMap.set(o[r].name,o[r]);this.oneClicks.push(i)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){Z.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?c.plot.DownsampleOptions.DISABLE:c.plot.DownsampleOptions.DEFAULT)}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){this.figure.addEventListener(c.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(c.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(c.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(c.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(c.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(c.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(c.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(c.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(c.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){this.figure.removeEventListener(c.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(c.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(c.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(c.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(c.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(c.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(c.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(c.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(c.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){Z.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){Z.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){Z.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){Z.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){const{detail:t}=e,{series:n}=t;Z.debug2("handleFigureUpdated",n);for(let i=0;i<n.length;i+=1){const o=n[i];Z.debug2("handleFigureUpdated updating series",o.name);const{sources:r}=o;for(let a=0;a<r.length;a+=1){const l=r[a],{columnType:d,type:p}=l,m=this.getValueTranslator(d,this.formatter),b=t.getArray(o,p,m);this.setDataArrayForSeries(o,p,b)}this.seriesToProcess.delete(o.name),this.seriesToProcess.size===0&&this.fireLoadFinished(),this.cleanSeries(o)}const{data:s}=this;this.fireUpdate(s)}handleRequestFailed(e){Z.error("Request failed",e)}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){Z.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){Z.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){const{detail:t}=e;Z.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var s,i;super.setTitle(e);const t=(i=(s=(e!=null?e:"").match(/<br>/g))==null?void 0:s.length)!=null?i:0,n=R.DEFAULT_MARGIN.t+t*R.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=n:this.layout.margin={t:n},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title={...this.layout.title},this.layout.title.text=e,this.layout.title.pad={...this.layout.title.pad},this.layout.title.pad.t=R.DEFAULT_TITLE_PADDING.t+t*R.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,n,s;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((t=(e=this.layout.margin)==null?void 0:e.l)!=null?t:0)-((s=(n=this.layout.margin)==null?void 0:n.r)!=null?s:0),0)}getPlotHeight(){var e,t,n,s;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((t=(e=this.layout.margin)==null?void 0:e.t)!=null?t:0)-((s=(n=this.layout.margin)==null?void 0:n.b)!=null?s:0),0)}updateAxisPositions(){const e=this.getPlotWidth(),t=this.getPlotHeight();for(let n=0;n<this.figure.charts.length;n+=1){const s=this.figure.charts[n],i=this.getAxisRangeParser(s,this.formatter);R.updateLayoutAxes(this.layout,s.axes,e,t,i,this.theme)}}updateLayoutFormats(){if(!this.formatter)return;R.getAxisFormats(this.figure,this.formatter).forEach((t,n)=>{Z.debug(`Assigning ${n}`,this.layout[n],t),this.layout[n]!=null?Object.assign(this.layout[n],t):Z.debug(`Ignoring null layout.${n}`)})}setDataArrayForSeries(e,t,n){const{name:s,plotStyle:i}=e,o=this.seriesDataMap.get(s),r=R.getPlotlyProperty(i,t);o&&kt(o,r,n)}cleanSeries(e){const{name:t,plotStyle:n}=e,s=this.seriesDataMap.get(t);if(s!=null){if(n===c.plot.SeriesPlotStyle.HISTOGRAM){const{xLow:i,xHigh:o}=s;if(i&&o&&i.length===o.length){const r=[];for(let a=0;a<i.length;a+=1)r.push(o[a]-i[a]);s.width=r}}else if(n===c.plot.SeriesPlotStyle.LINE){const{x:i,xLow:o,xHigh:r,y:a,yLow:l,yHigh:d}=s;o&&r&&o!==i&&(s.error_x=R.getPlotlyErrorBars(i,o,r)),l&&d&&l!==a&&(s.error_y=R.getPlotlyErrorBars(a,l,d))}else if(n===c.plot.SeriesPlotStyle.TREEMAP){const{ids:i,labels:o}=s;i!==void 0&&o===void 0&&(s.labels=i)}}}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){return new Map(this.filterColumnMap)}isFilterRequired(){return this.oneClicks.find(e=>e.requireAllFiltersToDisplay)!=null}setFilter(e){if(this.oneClicks.length===0){Z.warn("Trying to set a filter, but no one click!");return}Z.debug("setFilter",e);for(let t=0;t<this.oneClicks.length;t+=1){const n=this.oneClicks[t],{columns:s}=n;new Set([...e.keys(),...this.lastFilter.keys()]).forEach(o=>{const r=e.get(o);this.lastFilter.get(o)!==r&&s.find(a=>a.name===o)!=null&&n.setValueForColumn(o,r)})}this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}};let it=jt;it.ADD_SERIES_DEBOUNCE=50;class ht{static async makeModelFromSettings(t,n,s=de){const i=await ht.makeFigureFromSettings(t,n);return new it(i,t,s)}static async makeFigureFromSettings(t,n){const s=await n.copy();return s.applyCustomColumns(n.customColumns),s.applyFilter(n.filter),s.applySort(n.sort),c.plot.Figure.create(R.makeFigureSettings(t,s))}static async makeModel(t,n,s=de){return new it(n,t,s)}}const Ss="#1a171a",Ts="#f0f0ee",Es="#fcd65b",Ms="#9edc6f",Cs="#76d9e4",Is="#aa9af4",xs="#f37e3f",Ds="#f95d84",ws="#4878ea",Ns="#5b5a5c",vs="#9edc6f",Fs="#fcd65b",As="#f37e3f",Os="#f95d84",ks="#fcfcfa",Rs="#929192",Ls="#373438",Ps="#f0f0ee",_s="#1a171a",Vs="#2d2a2e",Us="#1a171a",Hs="#f0f0ee",$s="0.15s",Bs={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:Ss,white:Ts,yellow:Es,green:Ms,blue:Cs,purple:Is,orange:xs,red:Ds,primary:ws,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:Ns,success:vs,info:Fs,warning:As,danger:Os,light:ks,mid:Rs,dark:Ls,"text-muted":"#929192",interfacewhite:Ps,interfaceblack:_s,interfacegray:Vs,"content-bg":"#2d2a2e",background:Us,foreground:Hs,transition:$s},Zt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...Bs});class Ce extends x.exports.Component{constructor(t){super(t),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=D.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",...i},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),t=new Tn(s||o,this.element,i),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:i,closeOnBlur:o}=this.props,{show:r}=this.state;return h(at,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:h("div",{onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:v("popper",{interactive:i},t),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:L("div",{className:"popper-content",children:[n,h("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return h("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Rt.createPortal(this.renderContent(),this.element)})}}Ce.propTypes={children:u.exports.node.isRequired,options:u.exports.shape({}),className:u.exports.string,timeout:u.exports.number,onEntered:u.exports.func,onExited:u.exports.func,isShown:u.exports.bool,closeOnBlur:u.exports.bool,interactive:u.exports.bool,referenceObject:u.exports.shape({}),"data-testid":u.exports.string};Ce.defaultProps={options:{},className:"",timeout:Zt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const Ws=$.module("Tooltip"),Y=class extends x.exports.Component{constructor(e){super(e),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=D.createRef(),this.popper=D.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){Y.shownTooltipCount-=1,Y.shownTooltipCount===0&&(Y.lastHiddenTime=Date.now())}static handleShown(){Y.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:s}=this.state;s!==n&&(s?Y.handleShown():Y.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&Y.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Ws.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){!this.parent||(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:s}=this.state;if(!this.popper.current||!this.parent)return;const i=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(Y.shownTooltipCount>0||Date.now()-Y.lastHiddenTime<Y.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:i,"data-testid":o,onEntered:r}=this.props,{isShown:a}=this.state;return h("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:h(Ce,{className:v(i),options:n,ref:this.popper,onEntered:r,onExited:this.handleExited,interactive:e,referenceObject:s,children:L("div",{className:"tooltip-content",children:[" ",a&&t]})})})}};let ye=Y;ye.defaultTimeout=500;ye.defaultReshowTimeout=100;ye.triggerReshowThreshold=300;ye.shownTooltipCount=0;ye.lastHiddenTime=Date.now();ye.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:Y.defaultReshowTimeout,timeout:Y.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0};const qs=100;var Xt=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Xt||{});const Se=class extends x.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=G((n,s)=>n.filter(i=>i.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=rt(this.updateInputValue,qs),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=D.createRef(),this.cbContainer=D.createRef(),this.menuContainer=D.createRef(),this.input=D.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(s=>s.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:s}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,s)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){var o;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,i=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),i&&n){this.closeMenu();return}(o=this.popper.current)==null||o.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(i=this.input.current)==null||i.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let s=n;e===Se.MENU_NAVIGATION_DIRECTION.UP?n>0?(s=(s-1)%t.length,this.setState({keyboardOptionIndex:s})):n===0&&(s=t.length-1,this.setState({keyboardOptionIndex:s})):e===Se.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(s=(s+1)%t.length,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuBlur(e){var t;e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return h("div",{className:v("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?h("div",{className:"no-match",children:e}):n.map((s,i)=>this.renderOption(s,i))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return h("button",{type:"button",className:v("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},s)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultTitle:i,spellCheck:o,"data-testid":r}=this.props,{title:a,menuIsOpen:l,popperOptions:d,invalid:p}=this.state;return L("div",{className:"aci-container",ref:this.cbContainer,children:[h("input",{value:a||i,className:v("form-control",s,"aci-input",{"is-invalid":p&&!l}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r}),h(Ce,{ref:this.popper,options:d,className:v("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let pt=Se;pt.propTypes={options:u.exports.arrayOf(u.exports.shape({title:u.exports.string.isRequired,value:u.exports.string.isRequired})).isRequired,popperOptions:u.exports.shape({}),onChange:u.exports.func,inputPlaceholder:u.exports.string,disabled:u.exports.bool,className:u.exports.string,defaultTitle:u.exports.string,spellCheck:u.exports.bool,onEnter:u.exports.func,noMatchText:u.exports.string,"data-testid":u.exports.string};pt.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};pt.MENU_NAVIGATION_DIRECTION=Xt;u.exports.string.isRequired,u.exports.func.isRequired,u.exports.string,u.exports.string,u.exports.bool,u.exports.bool,u.exports.string,u.exports.string,u.exports.string;u.exports.node.isRequired,u.exports.string,u.exports.object,u.exports.string;const Ks=["primary","secondary","tertiary","success","danger","inline","ghost"],zs=["group-end"];function Gs(e,t){switch(e){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return v("btn-link",{"btn-link-icon":t,"px-2":t})}}function js(e){switch(e){case"group-end":return v("pl-2","pr-3")}}const mt=D.forwardRef((e,t)=>{const{kind:n,variant:s,type:i,tooltip:o,icon:r,disabled:a,active:l,onClick:d,className:p,style:m,children:b,"data-testid":y,"aria-label":w}=e,k=Gs(n,r&&!b);let E;s&&(E=js(s));let F;r&&(F=D.isValidElement(r)?r:h(X,{icon:r}));let N;o&&(N=typeof o=="string"?h(ye,{children:o}):o);const O=L("button",{"data-testid":y,ref:t,type:i,className:v("btn",k,E,{active:l},p),onClick:d,style:m,disabled:a,"aria-label":w,children:[r&&F,b,o&&!a&&N]});return a?L("span",{className:"btn-disabled-wrapper",children:[O,o&&N]}):O});mt.displayName="Button";mt.propTypes={kind:u.exports.oneOf(Ks).isRequired,variant:u.exports.oneOf(zs),type:u.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return!t&&n&&!s?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return!n&&!t?new Error("Icon is required if no children are provided"):!t&&!D.isValidElement(n)&&!(n!=null&&n.iconName)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:u.exports.bool,active:u.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},children:u.exports.node,className:u.exports.string,style:u.exports.object,"data-testid":u.exports.string};mt.defaultProps={type:"button",onClick:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};u.exports.bool.isRequired,u.exports.string.isRequired,u.exports.oneOfType([u.exports.string,u.exports.func]).isRequired,u.exports.func,u.exports.func.isRequired,u.exports.func,u.exports.func,u.exports.string,u.exports.string,u.exports.string,u.exports.node,u.exports.string;const ft=D.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,onClick:o,style:r,id:a}=e;return h("button",{ref:t,type:"button",className:v("btn",s),onClick:o,style:r,disabled:i,id:a,children:n})});ft.displayName="Button";ft.propTypes={children:u.exports.node,className:u.exports.string,disabled:u.exports.bool,onClick:u.exports.func,style:u.exports.shape({}),id:u.exports.string};ft.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function nt(e){return e.then!==void 0}const fe=class{static disableAllActions(){fe.actionsDisabled=!0}static enableAllActions(){fe.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){return e.group!==t.group?(e.group||0)>(t.group||0)?1:-1:e.order!==t.order?(e.order||0)>(t.order||0)?1:-1:e.title!==t.title?(e.title||"")>(t.title||"")?1:-1:e!==t?e>t?1:-1:0}static sortActions(e){if(!e||!Array.isArray(e))return[];const t=e.slice();return t.sort(fe.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return fe.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=fe.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(fe.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{fe.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const o=s[i];let r;typeof o=="function"?r=o():r=o,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(i=>i.title||i.then||i.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let i=1;i<n.length+1;i+=1){const o=(s+t*i+n.length)%n.length,r=n[o];if(!(r instanceof Promise)&&r.disabled!==!0)return o}return e}};let U=fe;U.actionsDisabled=!1;const Dt=$.module("GlobalContextAction");class Zs extends x.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(t){const n=t;n.contextActions||(n.contextActions=[]);const{action:s}=this.props;!s.title&&!s.menuElement||(n.contextActions||(n.contextActions=[]),n.contextActions.push(s),Dt.debug("Received context menu event at global action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s,i;const{action:n}=this.props;if(!U.actionsDisabled&&((s=n.shortcut)==null?void 0:s.matchesEvent(t))){Dt.debug("Global hotkey matched!",t);const o=(i=n.action)==null?void 0:i.call(n,t);(o||o===void 0)&&(t.preventDefault(),t.stopPropagation())}}render(){return null}}class Xs extends x.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let i=0;i<t.length;i+=1){const o=t[i],{shortcut:r}=o;if(o.title||o.menuElement||r){const a=h(Zs,{action:o,"data-testid":n},`${o.title}.${r==null?void 0:r.id}`);s.push(a)}}return s}}const He=$.module("ContextActions");class Qs extends x.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=D.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,i){if(!t||!n||!s||!i)return;const o=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});o.contextActions=i,t.dispatchEvent(o)}static getDerivedStateFromProps(t){if(!t.actions||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(i=>!nt(i)&&typeof i!="function"&&i.isGlobal),s=t.actions.filter(i=>!nt(i)&&typeof i!="function"&&!i.isGlobal&&i.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let i=t.target;for(;i!=null;){const{classList:o}=i,r=n.find(a=>o.contains(a));if(r!==void 0){He.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}i=i.parentElement}}if(U.isContextActionEvent(t)||(t.contextActions=[]),!U.isContextActionEvent(t))return;const{actions:s}=this.props;if(s){let i=s;Array.isArray(i)&&(i=i.filter(o=>nt(o)||typeof o=="function"||!o.isGlobal)),t.contextActions=t.contextActions.concat(i)}He.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s,i;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o];if(!U.actionsDisabled&&((s=r.shortcut)==null?void 0:s.matchesEvent(t))){He.debug("Context hotkey matched!",t);const a=(i=r.action)==null?void 0:i.call(r,t);if(a||a===void 0){t.stopPropagation(),t.preventDefault();return}He.debug2("Matched hotkey returned false, key event not consumed")}}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return h("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:h(Xs,{actions:n})})}}Qs.groups={default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100};const ze=D.forwardRef((e,t)=>{var k;function n(E){const{menuItem:F,onMenuItemClick:N}=e;N(F,E)}function s(E){const{menuItem:F,onMenuItemMouseMove:N}=e;N(F,E)}function i(E){const{menuItem:F,onMenuItemContextMenu:N}=e;N(F,E)}function o(E,F,N){if(typeof E.type=="string")return E;const{closeMenu:O,menuItem:_,isKeyboardSelected:V,isMouseSelected:H,"data-testid":se}=e,ae={menuItem:_,closeMenu:O,isKeyboardSelected:V,isMouseSelected:H,iconElement:F,displayShortcut:N,"data-testid":se};return D.cloneElement(E,{forwardedProps:ae})}const{children:r,menuItem:a,isKeyboardSelected:l,isMouseSelected:d,"data-testid":p}=e,m=(k=a.shortcut)==null?void 0:k.getDisplayText();let b=null;if(a.icon){const E=a.icon;if(D.isValidElement(E))b=E;else{let F;a.iconColor&&!a.disabled&&(F={color:a.iconColor}),b=h(X,{icon:E,style:F})}}let y=null;const w=!!r;a.actions&&(y=h(X,{icon:kn}));let C=null;if(a.menuElement)C=h("div",{className:"custom-menu-item",onMouseMove:s,children:o(a.menuElement,b,m)});else{const E=a.disabled,F=a.iconOutline;C=h("button",{type:"button",className:v("btn-context-menu",{disabled:E},{active:(w||d)&&!E},{"keyboard-active":l&&!E}),onClick:n,onMouseMove:s,onContextMenu:i,title:a.description||"",children:L("div",{className:"btn-context-menu-wrapper",children:[h("span",{className:v("icon",{outline:F}),children:b}),h("span",{className:"title",children:a.title}),m&&h("span",{className:"shortcut",children:m}),y&&h("span",{className:v("submenu-indicator",{disabled:E}),children:y})]})})}return L("div",{className:"context-menu-item",ref:t,"data-testid":p,children:[r,C]})});ze.displayName="ContextMenuItem";ze.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const Qt=({className:e="","data-testid":t})=>L("div",{className:v("loading-spinner fa-layers",e),"data-testid":t,children:[h(X,{icon:Rn,className:"text-white-50"}),h(X,{icon:_t,className:"text-primary",spin:!0})]}),wt=$.module("ContextMenu"),ot=class extends x.exports.PureComponent{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=D.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=D.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var i,o,r;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(i=this.container.current)==null||i.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(o=this.container.current)!=null&&o.contains(document.activeElement)||(r=this.container.current)==null||r.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);const{options:e}=this.props;let t=e.initialKeyboardIndex;t===void 0&&(t=-1);const{actions:n}=this.props,s=U.getMenuItems(n),i=[];for(let o=s.length-1;o>=0;o-=1){const r=s[o];r instanceof Promise?this.initMenuPromise(r):i.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:U.sortActions(i)})}initMenuPromise(e){const t=st.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{menuItems:U.sortActions(s.menuItems.concat(n)),pendingItems:o}}return null})},n=>{st.isCanceled(n)||(this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{pendingItems:o}}return null}),wt.error(n))})}cancelPromises(){const{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current===null)return;const e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}verifyPosition(){var m,b,y,w;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:i,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition)return;let{top:r,left:a}=this.initialPosition;const{width:l,height:d}=(b=(m=this.container.current)==null?void 0:m.getBoundingClientRect())!=null?b:{width:0,height:0},p=((w=(y=this.container.current)==null?void 0:y.scrollHeight)!=null?w:0)>window.innerHeight;d===0||l===0||(r+d>window.innerHeight&&(r-d-s>0?r-=d-s:r=window.innerHeight-d),a+l>window.innerWidth&&(a=a-l-n),(o!==a||i!==r)&&(this.setState({hasOverflow:p}),t(r,a)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){wt.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,n=!1;for(;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){const{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n,i=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?i=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=U.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=U.getNextMenuItem(s,1,t)),i){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:n}=this.state,s=t[e].actions?e:null;n!==s&&this.setState({activeSubMenu:s,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:n}=this.state;e!=null&&!e.disabled&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&!e.disabled&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:i,keyboardIndex:o,menuItems:r,mouseIndex:a,pendingItems:l,subMenuTop:d,subMenuLeft:p,subMenuParentWidth:m,subMenuParentHeight:b}=this.state;for(let E=0;E<r.length;E+=1){const F=r[E];E>0&&F.group!==r[E-1].group&&e.push(h("hr",{},`${E}.separator`));const N=h(ze,{ref:s===E?this.activeSubMenuRef:null,isKeyboardSelected:o===E,isMouseSelected:a===E,menuItem:F,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},E);e.push(N)}let y=null;l.length>0&&(y=h("div",{className:"loading",children:h(Qt,{})}));const{menuStyle:w,"data-testid":C}=this.props,k=s!==null&&d!==null&&p!==null;return L(En,{children:[L("div",{className:v({"has-overflow":i},"context-menu-container"),style:{top:t,left:n,...w},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:ot.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":C,children:[e,y]}),k&&s!==null&&d!==null&&p!==null&&h(ot,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:d,left:p,updatePosition:(E,F)=>{this.setState({subMenuTop:E,subMenuLeft:F})},subMenuParentWidth:m,subMenuParentHeight:b},`sub-${s}`)]})}};let Jt=ot;Jt.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class Js extends x.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=D.createRef(),this.openMenu=D.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!U.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=U.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),i=t.clientY-s.top,o=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),a=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(a)});return}return}t.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(t=h(Jt,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,a)=>{this.setState({top:r,left:a})},"data-testid":n})),h("div",{className:v("context-menu-root",{active:s}),ref:this.container,children:t})}}const Te=class extends x.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${Te.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${Te.getHeight(t)}px`}static getHeight(e){const t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){const t=e;t.style.height="";const{autoFocusOnShow:n}=this.props;if(n){const s=t.querySelector("input, select, textarea");s&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return h(at,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Te.handleEnter,onEntering:Te.handleEntering,onEntered:this.handleEntered,onExit:Te.handleExit,onExiting:Te.handleExiting,timeout:350,children:i=>h("div",{className:v({collapse:i==="exited"},t),"data-testid":s,children:e})})}};let Yt=Te;Yt.propTypes={className:u.exports.string,in:u.exports.bool.isRequired,children:u.exports.node.isRequired,autoFocusOnShow:u.exports.bool,"data-testid":u.exports.string};Yt.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function en(e){const t=x.exports.useRef(null);return x.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const Ae=D.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:i,disabled:o,inputClassName:r,isInvalid:a,labelClassName:l,name:d,onChange:p,"data-testid":m}=e,[b]=x.exports.useState(Lt()),y=en(t);x.exports.useEffect(function(){y.current&&(y.current.indeterminate=n===null)},[y,n]);const w=x.exports.useCallback(C=>{y.current&&(y.current.indeterminate=n===null),p&&p(C)},[y,n,p]);return L("div",{className:v("custom-control custom-checkbox",i),children:[h("input",{type:"checkbox",ref:y,checked:n!=null?n:!1,className:v("custom-control-input",r,{"is-invalid":a}),disabled:o,id:b,name:d,onChange:w,"data-testid":m}),h("label",{className:v("custom-control-label",l),htmlFor:b,children:s})]})});Ae.displayName="Checkbox";Ae.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:u.exports.node.isRequired,className:u.exports.string,disabled:u.exports.bool,inputClassName:u.exports.string,isInvalid:u.exports.bool,labelClassName:u.exports.string,name:u.exports.string,onChange:u.exports.func,"data-testid":u.exports.string};Ae.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class gt extends x.exports.PureComponent{constructor(t){super(t),this.inputField=D.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onBlur:s,onChange:i,className:o,disabled:r,matchCount:a,id:l,onKeyDown:d,"data-testid":p}=this.props;return L("div",{className:v("search-group",o),children:[h("input",{type:"search",value:t,onBlur:s,onChange:i,onKeyDown:d,className:"form-control",disabled:r,placeholder:n,ref:this.inputField,id:l,"data-testid":p}),a!=null&&h("span",{className:"search-match",children:a}),h("span",{className:"search-icon",children:h(X,{icon:_n})})]})}}gt.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var tn=(e=>(e.UP="UP",e.DOWN="DOWN",e))(tn||{});const Le=class extends x.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=G((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.toLowerCase())>=0)),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=D.createRef(),this.cbContainer=D.createRef(),this.toggleButton=D.createRef(),this.menuContainer=D.createRef(),this.input=D.createRef(),this.searchInput=D.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,a;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,o=t?n:i;switch(e.key){case"Enter":((r=o[s])==null?void 0:r.value)!=null&&this.updateInputValue(o[s].value),this.closeMenu(),(a=this.input.current)==null||a.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Le.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Le.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,r=(t?n:i).length;let a=0;switch(e){case Le.MENU_NAVIGATION_DIRECTION.UP:a=-1;break;case Le.MENU_NAVIGATION_DIRECTION.DOWN:a=1;break}a!==0&&this.setState({keyboardOptionIndex:(s+a+r)%r})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:i}=this.props,o=n?s:i;this.updateInputValue(o[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var i;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(i=this.popper.current)==null||i.scheduleUpdate()}handleMenuBlur(e){var t;e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,o=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return L("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[h("div",{className:"cb-search-input-container",children:h(gt,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),h("div",{className:"cb-options-container",children:h("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:s}=this.state;return(n?s:e).map((o,r)=>{const a=`option-${r}-${o.value}`;return h("button",{type:"button",value:r,className:v("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},a)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:i,spellCheck:o,"data-testid":r}=this.props,{value:a}=this.state;let{popperOptions:l}=this.props;return l={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...l},L("div",{className:"input-group cb-container",ref:this.cbContainer,children:[h("input",{value:a||i,className:v("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0]&&e[0].title,disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r?`${r}-input`:void 0}),h("div",{className:"input-group-append cb-dropdown",children:L("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r?`${r}-btn`:void 0,children:[h(X,{icon:Vn}),h(Ce,{ref:this.popper,options:l,className:v("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Ge=Le;Ge.MENU_NAVIGATION_DIRECTION=tn;Ge.DROP_DOWN_MENU_HEIGHT=200;Ge.propTypes={options:u.exports.arrayOf(u.exports.shape({title:u.exports.string.isRequired,value:u.exports.string.isRequired})).isRequired,popperOptions:u.exports.shape({title:u.exports.string.isRequired,value:u.exports.string.isRequired}),onChange:u.exports.func,inputPlaceholder:u.exports.string,searchPlaceholder:u.exports.string,disabled:u.exports.bool,className:u.exports.string,defaultValue:u.exports.string,spellCheck:u.exports.bool,onEnter:u.exports.func,"data-testid":u.exports.string};Ge.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const te=$.module("MaskedInput"),De={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},$e="\u2007";function yt(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}function Ys(e,t,n){return e.length<n?`${e}${t.substring(e.length,n)}`:e}function Nt(e,t){let{length:n}=e;for(let s=e.length-1;s>=0&&t[s]===e[s];s-=1)n=s;return e.substring(0,n)}const je=D.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:i=(I,M,S)=>S,getPreferredReplacementString:o=yt,onChange:r=()=>!1,onSelect:a=()=>!1,pattern:l,placeholder:d,selection:p,value:m,onFocus:b=()=>!1,onBlur:y=()=>!1,"data-testid":w}=e,C=en(t),k=x.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]),E=x.exports.useMemo(()=>k[0].replace(/[a-zA-Z0-9]/g,$e),[k]);x.exports.useEffect(function(){var M;if(p!=null){te.debug("setting selection...",p);const{selectionStart:S,selectionEnd:A,selectionDirection:B}=p;(M=C.current)==null||M.setSelectionRange(S,A,B),te.debug("selection set!")}},[p,C]);const F=x.exports.useCallback(I=>{let M=I,S=I;const A=k.length>0?k[0]:m;for(let P=M-1;P>=0&&/[a-zA-Z0-9]/g.test(A.charAt(P));P-=1)M=P;for(let P=S;P<A.length&&/[a-zA-Z0-9]/g.test(A.charAt(P));P+=1)S=P+1;const B=M===S?De.NONE:De.BACKWARD;return{selectionStart:M,selectionEnd:S,selectionDirection:B}},[k,m]);function N(I,M,S=I.length){let A="";for(let B=0;B<S;B+=1)I.charAt(B)!==$e?A=A.concat(I[B]):A=A.concat(M[B]);return A=A.concat(M.substring(S)),A}function O(I,M=I.length){const S=new RegExp(`^${l}$`);if(S.test(I))return!0;for(let A=0;A<k.length;A+=1){const B=N(I,k[A],M);if(S.test(B))return!0}return!1}function _(I){const M=F(I),S=M.selectionEnd+1;return S>=m.length?M:F(S)}function V(I){const M=F(I),S=M.selectionStart-1;return S<=0?M:F(S)}function H(I,M){const S=F(I),A=m.substring(S.selectionStart,S.selectionEnd),B=i(S,M,A,m),P=m.substring(0,S.selectionStart)+B+m.substring(S.selectionEnd);O(P,S.selectionEnd)&&(r(P),a(S))}const se=x.exports.useCallback(I=>{const{selectionStart:M=0,selectionEnd:S=0,selectionDirection:A="none"}=I.target;if(M===null||S===null||A===null){te.error("Selection attempted on non-text input element",I.target);return}if(te.debug2("handleSelect",M,S,A),!(p!=null&&M===p.selectionStart&&S===p.selectionEnd)){if(p!=null&&M===m.length&&S===m.length&&I.nativeEvent.type!=="mouseup"){a({...p});return}if(M===S){const B=F(M);te.debug("Selection segment from ",M,S,"=>",B),a(B)}else a({selectionStart:M,selectionEnd:S,selectionDirection:A})}},[F,a,p,m]),ae=x.exports.useCallback(I=>{if(!C.current)return;te.debug("handleSelectCapture",I);const M=C.current.selectionStart||0;M===m.length&&p!=null&&M!==p.selectionStart&&(I.preventDefault(),I.stopPropagation())},[C,p,m]);function Ie(I){if(I.preventDefault(),I.stopPropagation(),!C.current)return;const{key:M}=I,{selectionStart:S=0,selectionEnd:A=0}=C.current;if(S===null||A===null){te.error("Selection arrow nvaigation attempted on non-text input element",I.target);return}M==="ArrowLeft"?a(V(S)):M==="ArrowRight"?a(_(A)):M==="ArrowUp"?H(S,-1):M==="ArrowDown"&&H(S,1)}function xe(I){if(!C.current)return;te.debug("handleKeyDown",I);const{key:M}=I,{selectionStart:S=0,selectionEnd:A=0}=C.current;if(S===null||A===null){te.error("Selection key event on non-text input element",I.target);return}if(M.startsWith("Arrow")){Ie(I);return}if(M==="Delete"||M==="Backspace"){if(I.preventDefault(),I.stopPropagation(),A>=Nt(m,E).length){const P=m.substring(0,S===A?S-1:S),ie=Nt(P,E);ie!==m&&(r(ie),a({selectionStart:ie.length,selectionEnd:ie.length,selectionDirection:De.NONE}));return}if(S!==A){const P=m.substring(0,S)+m.substring(S,A).replace(/[a-zA-Z0-9]/g,$e)+m.substring(A);te.debug("Range ",S,A,"deleted, setting value",P),r(P),a({selectionStart:S,selectionEnd:S,selectionDirection:De.NONE})}else if(S>0)for(let P=S-1;P>=0;P-=1){const ie=m.substring(0,P)+m.substring(P,S).replace(/[a-zA-Z0-9]/g,$e)+m.substring(S);if(ie!==m){r(ie),a({selectionStart:P,selectionEnd:P,selectionDirection:De.NONE});return}}return}if(I.altKey||I.metaKey||I.ctrlKey||M.length>1)return;I.preventDefault(),I.stopPropagation();const B=Array.from(new Set([M,M.toUpperCase(),M.toLowerCase()]));for(let P=0;P<B.length;P+=1){const ie=B[P],yn=/[a-zA-Z0-9]/g.test(ie)?k[0].length-1:S;for(let he=S;he<=yn;he+=1){const bn=Ys(m,k[0],he+1),Ze=o(bn,he,ie,S,A);if(O(Ze,he+1)){const Tt=F(he),Xe=he+1;let Qe={selectionStart:Xe,selectionEnd:Xe,selectionDirection:De.NONE};if(Xe>=Tt.selectionEnd){const Et=_(he);Et.selectionStart!==Tt.selectionStart&&(Qe=Et)}te.debug("handleKeyDown",M,"=>",Ze,Qe),r(Ze),a(Qe);return}}}}return h("input",{ref:C,className:v("form-control masked-input",n),type:"text",pattern:l,placeholder:d,value:m,onChange:()=>{},onKeyDown:xe,onSelect:se,onSelectCapture:ae,onFocus:b,onBlur:y,"data-testid":w})});je.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:yt,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const ei=$.module("TimeInput"),ti="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",ni=["00:00:00","12:34:56","23:59:59"],nn=D.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:i=()=>!1,value:o=0,onFocus:r=()=>!1,onBlur:a=()=>!1,onSelect:l=()=>!1,"data-testid":d}=e,[p,m]=x.exports.useState(Ee.formatTime(o)),[b,y]=x.exports.useState(),w=x.exports.useRef(null);x.exports.useImperativeHandle(t,()=>({focus:()=>{var N;(N=w.current)==null||N.focus()},setSelection:N=>{var O;(O=w.current)==null||O.focus(),y(N)}}),[]),x.exports.useEffect(function(){m(Ee.formatTime(o))},[o]);function C(N,O,_){const V=N.selectionStart===0?24:60;let H=parseInt(_,10)-O;return Number.isNaN(H)?H=0:n?H=(H%V+V)%V:H=Math.min(Math.max(0,H),V-1),`${H}`.padStart(2,"0")}function k(N,O,_,V,H){return V===0&&H===2&&O===1&&parseInt(_,10)>1?`0${_}${N.substring(2)}`:yt(N,O,_)}function E(N){ei.debug("handleChange",N),m(N),Ee.isTimeString(N)&&i(Ee.parseTime(N))}const F=x.exports.useCallback(N=>{y(N),l(N)},[l]);return h(je,{ref:w,className:s,example:ni,getNextSegmentValue:C,getPreferredReplacementString:k,onChange:E,onSelect:F,pattern:ti,selection:b,value:p,onFocus:r,onBlur:a,"data-testid":d})});nn.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class sn extends x.exports.PureComponent{constructor(t){var i;super(t),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=D.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(i=n.initialKeyboardIndex)!=null?i:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=U.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:U.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let i=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?i=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?i=U.getNextMenuItem(i!=null?i:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(i=U.getNextMenuItem(i!=null?i:0,1,n)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&!t.disabled&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:o}=this.state;for(let a=0;a<i.length;a+=1){const l=i[a];a>0&&l.group!==i[a-1].group&&t.push(h("hr",{},`${a}.separator`));const d=h(ze,{isKeyboardSelected:s===a,isMouseSelected:o===a,menuItem:l,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},a);t.push(d)}const{menuStyle:r}=this.props;return h("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}sn.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class on extends x.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=D.createRef(),this.parent=null,this.popper=D.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":i}=this.props,{menuStyle:o}=this.props;let{options:r,popperOptions:a}=this.props;return a={placement:"bottom",...a},r={separateKeyboardMouse:!0,...r},h("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:h(Ce,{ref:this.popper,options:a,className:v("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:h(sn,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:o})})})}}on.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const vt=-1;var rn=(e=>(e.UP="UP",e.DOWN="DOWN",e))(rn||{});const ue=class extends x.exports.Component{constructor(e){super(e);const{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=D.createRef(),this.menuContainer=D.createRef(),this.button=D.createRef(),this.input=D.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let i=0;i<e.length;i+=1){const o=e[i];if(o.value===t)return o.title}return Ee.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(s[t].value),this.closeMenu(),(i=this.button.current)==null||i.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(ue.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(ue.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(ue.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(ue.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props,i=s.length;let o=t;switch(e){case ue.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%i,this.setState({keyboardOptionIndex:o})):t===0&&(o=i-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case ue.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(o=(o+1)%i,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:i}=this.state;if(t===vt){const o=s(i);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var o;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>ue.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-ue.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return h("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:h("div",{className:"cs-options-container",children:h("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:i,customTime:o,inputFocused:r}=this.state;let a=!1;const l=[];for(let d=0;d<e.length;d+=1){const p=e[d],m=`option-${d}-${p.value}`;a=a||p.value===t,l.push(L("button",{type:"button",value:d,className:v("cs-option-btn",{"keyboard-active":i===d&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[p.value===t&&h(X,{icon:n,className:"mr-2"}),p.value!==t&&h("span",{className:"mr-4"}),p.title]},m))}return l.push(h("hr",{className:"cs-divider"},"option-divider")),l.push(L("button",{type:"button",value:vt,className:v("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!a&&t!==null?h(X,{icon:n,className:"mr-2"}):h("span",{className:"mr-4"}),s]},"option-custom-label")),l.push(L("div",{className:"cs-custom-container",children:[h("span",{className:"mr-2"}),h(nn,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),h("span",{className:"ml-2"})]},"cs-custom-container")),l.push(h("hr",{className:"mb-2"},"option-end")),l}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:i}=this.state;let{popperOptions:o}=this.props;return o={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...o},h("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:h("div",{className:v("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:L("button",{type:"button",className:v("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[h("span",{className:v({"text-muted":n===null}),children:this.getSelectedText()}),h("span",{children:h(X,{icon:Vt,className:"cs-caret"})}),h(on,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let bt=ue;bt.MENU_NAVIGATION_DIRECTION=rn;bt.DROP_DOWN_MENU_HEIGHT=125;bt.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:On,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0};function we(e,t,n,s,i){const o=s-n+1;return`${((parseInt(t,10)-e-n)%o+o)%o+n}`.padStart(i,"0")}function an(e,t,n){const{selectionStart:s}=e;return s===0?we(t,n,1900,2099,4):s===5?we(t,n,1,12,2):s===8?we(t,n,1,31,2):s===11?we(t,n,0,23,2):s===17||s===14?we(t,n,0,59,2):s===20||s===24||s===28?we(t,n,0,999,3):n}const si=$.module("DateTimeInput"),ii="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",oi="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}\u200B[0-9]{3}\u200B[0-9]{3}",ri=`${ii} ${oi}`,ai="2022-01-01 00:00:00.000000000",li="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function ln(e){const t=e.substring(0,23),n=e.substring(23,26),s=e.substring(26);return[t,n,s].filter(i=>i!=="").join("\u200B")}const ci=e=>e.replace(/\u200B/g,""),ui=[ln(ai)],cn=D.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:i="",onFocus:o=()=>{},onBlur:r=()=>{},"data-testid":a}=e,[l,d]=x.exports.useState(i.length>0?ln(i):""),[p,m]=x.exports.useState(),b=x.exports.useCallback(y=>{si.debug("handleChange",y),d(y),s(ci(y))},[s]);return h("div",{className:"d-flex flex-row align-items-center",children:h(je,{ref:t,className:v(n),example:ui,getNextSegmentValue:an,onChange:b,onSelect:m,pattern:ri,placeholder:li,selection:p,value:l,onFocus:o,onBlur:r,"data-testid":a})})});cn.displayName="DateTimeInput";cn.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const di=$.module("DateInput"),hi="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",pi=["2000-01-01","2022-12-31"],mi="YYYY-MM-DD",un=D.forwardRef((e,t)=>{const{className:n="",onChange:s=()=>{},defaultValue:i="",onFocus:o=()=>{},onBlur:r=()=>{},"data-testid":a}=e,[l,d]=x.exports.useState(i),[p,m]=x.exports.useState(),b=x.exports.useCallback(y=>{di.debug("handleChange",y),d(y),s(y)},[s]);return h("div",{className:"d-flex flex-row align-items-center",children:h(je,{ref:t,className:v(n),example:pi,getNextSegmentValue:an,onChange:b,onSelect:m,pattern:hi,placeholder:mi,selection:p,value:l,onFocus:o,onBlur:r,"data-testid":a})})});un.displayName="DateInput";un.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class fi extends x.exports.PureComponent{constructor(t){super(t),this.searchInput=D.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=rt(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:i,"data-testid":o}=this.props,{value:r}=this.state;return h(gt,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:i,"data-testid":o})}}fi.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const gi=$.module("ItemListItem"),dn=class extends x.exports.Component{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=D.createRef()}static handleKeyDown(){return gi.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:i,"data-testid":o}=this.props;return h("div",{className:v("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:dn.handleKeyDown,onContextMenu:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:i})}};let hn=dn;hn.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Ft=$.module("ItemList"),Fe=class extends x.exports.PureComponent{constructor(e){super(e),this.getItemSelected=G((s,i)=>oe.isSelected(i,s),{max:Fe.CACHE_SIZE}),this.getCachedItem=G((s,i,o,r,a,l,d,p)=>{const m=l({item:o,itemIndex:s,isFocused:r,isSelected:a,style:d});return h(hn,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:p,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:a,itemIndex:s,style:d,children:m},i)},{max:Fe.CACHE_SIZE}),this.getOuterElement=G(s=>{const i=D.forwardRef((o,r)=>h("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...o}));return i.displayName="ItemListOuterElement",i}),this.getInnerElement=G(()=>{const s=D.forwardRef((i,o)=>h("div",{className:"item-list-inner-element",ref:o,...i}));return s.displayName="ItemListInnerElement",s}),this.getItemData=G((s,i,o)=>({items:s,selectedRanges:i,renderItem:o})),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=D.createRef(),this.listContainer=D.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null}}static renderItem({item:e}){return h("div",{className:"item-list-item-content",children:e&&(e.displayValue||e.value||`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:i,scrollOffset:o,height:r,selectedRanges:a}=this.state;if(i&&!this.isListAtBottom()&&this.scrollToBottom(),(o!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==a)this.setSelectedRanges(n);else if(a!==t.selectedRanges){const{onSelectionChange:l}=this.props;l(a)}if(s!==t.focusIndex){const{onFocusChange:l}=this.props;l(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),i=e-n;return s[i]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,i=oe.isSelected(n,e)||U.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:i})=>({selectedRanges:oe.selectRange(i,[e,e])}),()=>{s(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Ft.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){Ft.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:s}=n;return s!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:s,disableSelect:i}=this.props,{mouseDownIndex:o,selectedRanges:r}=this.state;o==null||i||(this.setState({isDragging:!0}),(n||o===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!U.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,U.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:i}=this.props,{mouseDownIndex:o,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!r){const a=t.shiftKey,l=U.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,a,l,n),!s&&!a&&!l&&i(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:i}=this.state;let o=i;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&s(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=n-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,n-1):o=0;else return;if(i!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){const l=a[a.length-1];this.selectRange([Math.min(o,l[0]),Math.max(o,l[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:i}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:i}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n,s=!0){const{isMultiSelect:i}=this.props,{selectedRanges:o}=this.state;if(i&&t&&o.length>0){const r=o[o.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else i&&o.length===1&&o[0][0]===e&&o[0][1]===e?s&&this.deselectItem(e):i&&n?this.getItemSelected(e,o)?s&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){oe.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:oe.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){oe.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:oe.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:s}=this.props,i=Math.floor(e/s),o=i+Math.ceil(t/s);n(i,o)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:s}=this.props;return e+t>=n*s}renderInnerElement({index:e,style:t}){const{items:n,offset:s,renderItem:i,disableSelect:o}=this.props,{focusIndex:r,selectedRanges:a}=this.state;if(e<s||e>=s+n.length)return null;const l=n[e-s];return this.getCachedItem(e,e,l,e===r&&!o,this.getItemSelected(e,a),i,t,o)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:i,"data-testid":o}=this.props,{selectedRanges:r}=this.state;return h(Mn,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:a,height:l})=>h(Cn,{className:"item-list-scroll-pane",height:l,width:a,itemCount:t,itemSize:i,itemData:this.getItemData(e,r,s),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":o,children:this.renderInnerElement})})}};let Oe=Fe;Oe.CACHE_SIZE=1e3;Oe.DEFAULT_ROW_HEIGHT=20;Oe.DEFAULT_OVERSCAN=10;Oe.defaultProps={offset:0,items:[],rowHeight:Fe.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Fe.DEFAULT_OVERSCAN,renderItem:Fe.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const Me=class extends x.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=G((t,n,s,i,o,r,a,l)=>h(In,{draggableId:Me.getDraggableId(t,i),index:i,isDragDisabled:a,children:d=>h("div",{role:"menuitem",className:"draggable-item-list-item",ref:d.innerRef,tabIndex:-1,...d.draggableProps,...d.dragHandleProps,children:n({item:s,itemIndex:i,isFocused:o,isSelected:r,style:l,isClone:!1})})},i),{max:Oe.CACHE_SIZE}),this.getCachedRenderDraggableItem=G((t,n,s)=>({item:i,itemIndex:o,isFocused:r,isSelected:a,style:l})=>this.getCachedDraggableItem(t,s,i,o,r,a,n,l),{max:1}),this.getCachedRenderClone=G((t,n,s,i)=>(o,r,a)=>{const{selectedCount:l}=this.state,{index:d}=a.source,p=n[d-s];return h("div",{className:v("draggable-item-list-dragging-item-container",t),...o.draggableProps,...o.dragHandleProps,ref:o.innerRef,children:h("div",{className:v("draggable-item-list-dragging-item",{"two-dragged":l===2},{"multiple-dragged":l>2}),children:i({item:p,itemIndex:d,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:l})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=D.createRef(),this.state={selectedCount:0}}static renderHandle(){return L("div",{children:[h(ye,{children:"Drag to re-order"}),h(X,{icon:Ln})]})}static renderBadge({text:e}){return e?h("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return L("div",{className:v("item-list-item-content","draggable-item-list-item-content",n),children:[h("span",{className:"title",children:e}),Me.renderBadge({text:t}),Me.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e&&(e.displayValue||e.value||`${e}`),i=t?`${n}`:"",o=t?"item-list-item-clone":"";return Me.renderTextItem({text:s,badgeText:i,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){return parseInt(e.split("/").pop()||"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:oe.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:i,isDragDisabled:o,isDropDisabled:r,isMultiSelect:a,isStickyBottom:l,itemCount:d,items:p,offset:m,onFocusChange:b,onSelect:y,onViewportChange:w,renderItem:C,rowHeight:k,selectedRanges:E,style:F,"data-testid":N}=this.props;return h(xn,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,p,m,C),"data-testid":N,children:(O,_)=>h("div",{role:"menu",className:v("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":o,"is-dragging-from-this":_.draggingFromThisWith,"is-dragging-over":_.isDraggingOver,"is-dropping":_.draggingOverWith}),style:F,ref:O.innerRef,...O.droppableProps,children:h(Oe,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:a,isStickyBottom:l,itemCount:d,items:p,onFocusChange:b,onSelect:y,onSelectionChange:this.handleSelectionChange,onViewportChange:w,offset:m,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,C),rowHeight:k,selectedRanges:E})})})}};let pn=Me;pn.DEFAULT_ROW_HEIGHT=30;pn.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:Me.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:Me.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};const We=class extends x.exports.Component{static isParentSelected(e,t){const n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;const s=Array.from(n.values()).includes(!0),i=Array.from(n.values()).includes(!1);return s&&i?null:s}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{const{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){const{valueMap:n,onUpdateValueMap:s}=this.props,i=new Map(n),o=i.get(e);if(o instanceof Map){const a=new Map(o);if(t!=null)a.set(t,!o.get(t));else{const l=!We.isParentSelected(e,i);o.forEach((d,p)=>a.set(p,l))}i.set(e,a)}else i.set(e,!o);const r=i.get(e);t===void 0&&r!==void 0&&typeof r!="boolean"&&(We.isParentSelected(e,n)?r.forEach((a,l)=>r.set(l,!1)):r.forEach((a,l)=>r.set(l,!0))),s(i)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((i,o)=>{if(typeof i=="boolean")s.set(o,e);else{const r=new Map;i.forEach((a,l)=>r.set(l,e)),s.set(o,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return L("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>L("div",{children:[h(Ae,{className:"hcm-parent",checked:We.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([i,o])=>h(Ae,{className:"hcm-child",checked:o,onChange:()=>this.toggleValueFor(n,i),children:i},i))]},n)),h("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,"data-testid":t?`${t}-btn-select-all`:void 0,children:"Select All"}),h("button",{type:"button",className:"btn btn-link",onClick:this.clear,"data-testid":t?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":i}=this.props,{menuIsOpen:o}=this.state;return L("button",{type:"button",className:v("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":i,children:[L("span",{children:[n&&h(X,{icon:n,className:"hcm-icon mr-1"}),e]}),h(X,{icon:Vt,className:"hcm-icon ml-1"}),h(Ce,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let yi=We;yi.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const bi=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>h(at,{in:!!n||!e||t,timeout:Zt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:h("div",{className:"fill-parent-absolute","data-testid":s,children:h("div",{className:v("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:L("div",{className:"message-content",children:[L("div",{className:"message-icon",children:[t&&h(Qt,{}),!t&&n&&h(X,{icon:Un})]}),h("div",{className:"message-text",children:n})]})})})});const mn=D.forwardRef((e,t)=>{const{checked:n,children:s,className:i="",disabled:o=!1,inputClassName:r="",isInvalid:a=!1,labelClassName:l="",name:d,onChange:p,value:m,"data-testid":b}=e,[y]=x.exports.useState(Lt());return L("div",{className:v("custom-control custom-radio",i),children:[h("input",{type:"radio",id:y,"data-testid":b,name:d,ref:t,className:v("custom-control-input",r,{"is-invalid":a}),checked:n,disabled:o,value:m,onChange:p}),h("label",{className:v("custom-control-label",l),htmlFor:y,children:s})]})});mn.displayName="RadioItem";mn.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};class Si extends x.exports.PureComponent{constructor(t){super(t),this.getCachedItem=G((n,s,i,o,r,a,l)=>{const d={height:r},p=o!=null?o:i;return h("li",{className:"value-list-item",style:d,tabIndex:-1,children:h(Ae,{checked:a,disabled:l,onChange:()=>this.handleSelect(n),children:p})},s)},{max:1e3}),this.getCachedItems=G((n,s,i,o)=>{const r=[];for(let a=0;a<n.length;a+=1){const l=n[a],{value:d,displayValue:p,isSelected:m}=l,b=i+a,y=b,w=this.getCachedItem(b,y,d,p,s,m,o);r.push(w)}return r},{max:1}),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=D.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(t){if(!t.relatedTarget||this.list.current&&t.relatedTarget instanceof HTMLElement&&!this.list.current.contains(t.relatedTarget)){const{onBlur:n}=this.props;n==null||n(t)}}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:i}=this.props,o=t-s;if(o>=0&&o<n.length){const r=n[o],{value:a}=r;i(t,a)}else i(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,o=Math.floor(s/n),r=Math.ceil(i/n);(this.topRow!==o||this.bottomRow!==r)&&(this.topRow=o,this.bottomRow=r,t(o,r))}getElement(t){return this.list.current==null?null:this.list.current.querySelectorAll(".value-list-item")[t]}scrollIntoView(t){const n=this.getElement(t);n==null||n.scrollIntoView({block:"center"})}render(){const{className:t,disabled:n,isInvalid:s,items:i,itemCount:o,offset:r,rowHeight:a,"data-testid":l}=this.props,d=this.getCachedItems(i,a,r,n);return h("div",{className:v("select-value-list-scroll-pane h-100 w-100",{"is-invalid":s},t),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:h("div",{className:"select-value-list",style:{height:o*a},children:h("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*a,top:r*a,left:0},children:d})})})}}Si.defaultProps={disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0};const At=$.module("Shortcut");var ne=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(ne||{}),J=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(J||{});const Ti=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),q=class extends Pt{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:i,tooltip:o}){super(),this.id=e,this.name=i,this.tooltip=o,this.isEditable=s;const a=q.isMacPlatform?n:t;this.defaultKeyState=q.createKeyState(a),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(J).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!q.isMacPlatform&&e.metaKey||!q.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Ti.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!q.isAllowedKey(t)&&q.isAllowedKey(String.fromCharCode(n))?s=String.fromCharCode(n):s=t,{keyValue:s,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":q.isMacPlatform?q.getMacDisplayText(e):q.getWindowsDisplayText(e)}getDisplayText(){return q.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){q.isValidKeyState(e)?(At.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new qt("onUpdate",{detail:this}))):At.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return q.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(q.NULL_KEY_STATE)}isNull(){return q.doKeyStatesMatch(this.keyState,q.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return q.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(q.getKeyStateFromEvent(e))}};let St=q;St.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};St.isMacPlatform=U.isMacPlatform();const Ot=$.module("ShortcutRegistry");class Ei extends Pt{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new St(t);return this.add(n)}add(t){var i;const n=this.shortcutMap.get(t.id);if(n)return Ot.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;Ot.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:o})=>this.dispatchEvent(new qt("onUpdate",{detail:o})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const Ne=Object.freeze(new Ei);Ne.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[ne.CTRL,J.C],macShortcut:[ne.CMD,J.C],isEditable:!1}),Ne.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[ne.CTRL,J.V],macShortcut:[ne.CMD,J.V],isEditable:!1}),Ne.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[ne.CTRL,J.S],macShortcut:[ne.CMD,J.S],isEditable:!1}),Ne.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[ne.CTRL,J.A],macShortcut:[ne.CMD,J.A],isEditable:!1}),Ne.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[ne.CTRL,J.L],macShortcut:[ne.CMD,J.L]}),Ne.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[J.ESCAPE],macShortcut:[J.ESCAPE],isEditable:!1});const fn=D.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,isLinked:o,isLinkedSource:r,isInvalid:a,onClick:l,onMouseEnter:d,onMouseLeave:p,style:m,"data-testid":b}=e;return L("button",{ref:t,type:"button",className:v("btn-socketed",{"btn-socketed-linked":o||r},{"btn-socketed-linked-source":r},{"is-invalid":a},s),onClick:l,onMouseEnter:d,onMouseLeave:p,style:m,disabled:i,"data-testid":b,children:[n,h(X,{icon:Pn,className:"linked btn-socketed-icon",transform:"down-1"}),h(X,{icon:Hn,className:"is-invalid btn-socketed-icon"})]})});fn.displayName="SocketedButton";fn.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Mi="_track_xvu02_28",Ci="_handle_xvu02_11",Ii="_ticks_xvu02_96",gn={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Mi,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:Ci,ticks:Ii,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(gn["handle-size"],10);parseInt(gn["popover-width"],10);Object.freeze({ERROR:"error"});const ve=$.module("EmbedChart.App");async function xi(e,t){ve.info(`Fetching figure ${t}...`);const n={name:t,type:c.VariableType.FIGURE};return e.getObject(n)}function Di(){const[e,t]=x.exports.useState(),[n,s]=x.exports.useState(),[i,o]=x.exports.useState(!0),r=x.exports.useMemo(()=>new URLSearchParams(window.location.search),[]);x.exports.useEffect(function(){async function d(){try{const p=r.get("name");if(!p)throw new Error("No name param provided");const m=new URL("/jsapi",`${window.location}`),b=`${m.protocol}//${m.host}`;ve.debug("Starting connection...");const y=new c.IdeConnection(b);ve.debug("Loading figure",p,"...");const w=await xi(y,p);ve.debug("Creating model...");const C=await ht.makeModel(void 0,w);t(C),ve.debug("Figure successfully loaded!")}catch(p){ve.error("Unable to load figure",p),s(`${p}`)}o(!1)}d()},[r]);const a=e!=null;return L("div",{className:"App",children:[a&&h(Gt,{model:e}),!a&&h(bi,{isLoaded:a,isLoading:i,errorMessage:n!=null?n:null}),h(Js,{})]})}Rt.render(h(Di,{}),document.getElementById("root"));
2
- //# sourceMappingURL=index.e19382e7.js.map