@deephaven/embed-grid 0.67.1-beta.0 → 0.67.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-f0a83160.js → App-0903d1ea.js} +2 -2
- package/build/assets/App-0903d1ea.js.map +1 -0
- package/build/assets/{Chart-065a0fa4.js → Chart-2f1506c1.js} +2 -2
- package/build/assets/{Chart-065a0fa4.js.map → Chart-2f1506c1.js.map} +1 -1
- package/build/assets/{IrisGrid-bc329491.js → IrisGrid-a8e74a25.js} +5 -5
- package/build/assets/IrisGrid-a8e74a25.js.map +1 -0
- package/build/assets/{IrisGridThemeProvider-68c9a06b.js → IrisGridThemeProvider-fb501222.js} +2 -2
- package/build/assets/{IrisGridThemeProvider-68c9a06b.js.map → IrisGridThemeProvider-fb501222.js.map} +1 -1
- package/build/assets/{MarkdownEditor-52464698.js → MarkdownEditor-6ffb4f23.js} +2 -2
- package/build/assets/{MarkdownEditor-52464698.js.map → MarkdownEditor-6ffb4f23.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-9742e374.js → MarkdownNotebook-52e14d92.js} +2 -2
- package/build/assets/{MarkdownNotebook-9742e374.js.map → MarkdownNotebook-52e14d92.js.map} +1 -1
- package/build/assets/index-4cb59416.js +29 -0
- package/build/assets/index-4cb59416.js.map +1 -0
- package/build/assets/{index-ea353fc2.js → index-c9408b8e.js} +2 -2
- package/build/assets/{index-ea353fc2.js.map → index-c9408b8e.js.map} +1 -1
- package/build/assets/useUser-ae22a8dc.js +3 -0
- package/build/assets/useUser-ae22a8dc.js.map +1 -0
- package/build/index.html +1 -1
- package/package.json +14 -14
- package/build/assets/App-f0a83160.js.map +0 -1
- package/build/assets/IrisGrid-bc329491.js.map +0 -1
- package/build/assets/index-4a8d2f58.js +0 -29
- package/build/assets/index-4a8d2f58.js.map +0 -1
- package/build/assets/useUser-99234a48.js +0 -3
- package/build/assets/useUser-99234a48.js.map +0 -1
package/build/assets/{IrisGridThemeProvider-68c9a06b.js → IrisGridThemeProvider-fb501222.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{P as ca,d as De,as as Br,at as ha,e as uo,c as va,ac as oe,al as Ur,au as co,$ as Pn,av as ho,o as Oe,V as vo,aj as Xe,af as le,aw as Pt,ah as go,a1 as Ht,ag as $t,a6 as ga,Y as ie,l as fo,a0 as Et,W as mo}from"./useUser-99234a48.js";import{r as R,H as te,aw as po,D as u,E as Tr,F as K,R as bo,W as V,G as ce,M as it,av as fa,V as ge,ax as wo,ay as Co,Z as ma,a0 as tn,az as So,aA as yo,aB as Oo,_ as rn,Y as $e,aC as Vr,al as Tn,L as pa,aD as Po,aE as tt,aF as To,aG as Io,aH as Ro,aI as Do,aJ as Gr,aK as Eo,aL as Mo,aM as xo,aN as In,aO as jo,aP as Rn,aQ as ko,aR as No,aS as Ao,aT as Fo,aU as Lo,aV as Ho,aj as $o,au as Bo}from"./vendor-f46f78b9.js";import{T as be,L as fe,a8 as Wo,b5 as _o,b2 as Uo,b6 as Vo,aw as Go,ay as nn,h as zo,g as Ko,f as Xo,A as qo,F as Yo,D as Zo,z as Qo,G as Jo,u as es,K as ts,p as rs,Q as ns,b7 as is,ap as ba,v as sr,as as an,b8 as on,b9 as sn,Z as as,a7 as wa,k as os,ba as ss,aA as C,V as Ca,a5 as Or,ag as ls,q as Sa,j as ee,d as ds,bb as us,aM as Dn,bc as cs,aX as ya,bd as Oa,be as hs,bf as vs,e as gs,bg as fs,bh as ms,bi as ps,bj as bs,bk as ws,bl as Cs,_ as Ss,$ as ys,bm as Os,r as Pa,B as Ps}from"./index-ea353fc2.js";import{e as ct,l as Ut,a as Ve,K as zr,b as En,R as Ts}from"./monaco-0b69f16f.js";function Mn(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Is(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Mn(a,r,i,o,s,"next",l)}function s(l){Mn(a,r,i,o,s,"throw",l)}o(void 0)})}}function Rs(n){return Kr.apply(this,arguments)}function Kr(){return Kr=Is(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return xn(n)}xn(n)}),Kr.apply(this,arguments)}function xn(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function qt(n,e,t){return e=Ds(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ds(n){var e=Es(n,"string");return typeof e=="symbol"?e:String(e)}function Es(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ms="table_",Ta="column_",xs=new Set(["in","not","i","ii","k"]),js=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),ks=/[^a-zA-Z0-9_$+@-]/g,Ns=/[^A-Za-z0-9_$]/g;class Be{}qt(Be,"legalize",(n,e,t,r,i)=>{var a=n.trim().replace(/[- ]/g,"_");return r&&(xs.has(a)||js.has(a))&&(a=e+a),a=a.replace(t,""),a||(a=e+i),Number.isNaN(Number(a.charAt(0)))||(a=e+a),a});qt(Be,"legalizeTableName",n=>Be.legalize(n,Ms,ks,!1,0));qt(Be,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=Be.legalizeColumnName(t,r);e.includes(i)&&(i=Ta+r),e.push(i)}),e});qt(Be,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Be.legalize(n,Ta,Ns,!0,e)});qt(Be,"isValidTableName",n=>Be.legalizeTableName(n)===n);qt(Be,"isValidColumnName",n=>Be.legalizeColumnName(n)===n);const ln=Be;function jn(n,e,t){return e=As(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function As(n){var e=Fs(n,"string");return typeof e=="symbol"?e:String(e)}function Fs(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ls{constructor(){jn(this,"pending",[]),jn(this,"resolved",[])}add(e,t){var r=ca.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const Hv=Ls;class dn{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!dn.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],a=i[0],o=i[1];if(a<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(o,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){a[o]=[l,r-1],a.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(o,1):l<r?a[o]=[l,r-1]:a[o]=[i+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var a=[...r],o=i[0];o<=i[1];o+=1)a.push(e[o]);return a},[])}}const bt=dn;function*$v(n,e){for(var t=n;t<=e;++t)yield t}function Ia(n,e,t){return e=Hs(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hs(n){var e=$s(n,"string");return typeof e=="symbol"?e:String(e)}function $s(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class lr{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),a=r%60,o=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(lr.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}Ia(lr,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Ia(lr,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const Bs=lr;function Ws(n,e,t){return e=_s(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _s(n){var e=Us(n,"string");return typeof e=="symbol"?e:String(e)}function Us(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vs extends Error{constructor(){super(...arguments),Ws(this,"isInvalid",!0)}}const Bv=Vs;function kn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kn(Object(t),!0).forEach(function(r){Xt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xt(n,e,t){return e=zs(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zs(n){var e=Ks(n,"string");return typeof e=="symbol"?e:String(e)}function Ks(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class un extends R.Component{constructor(e){super(e),Xt(this,"element",void 0),Xt(this,"container",void 0),Xt(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=te.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Gs({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new po(r||a,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var o=this.element.firstElementChild;o instanceof HTMLElement&&o.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:a}=this.props,{show:o}=this.state;return u.jsx(Tr,{in:o,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:K("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&bo.createPortal(this.renderContent(),this.element)})}}Xt(un,"propTypes",{children:V.node.isRequired,options:V.shape({}),className:V.string,timeout:V.number,onEntered:V.func,onExited:V.func,isShown:V.bool,closeOnBlur:V.bool,interactive:V.bool,referenceObject:V.shape({}),"data-testid":V.string});Xt(un,"defaultProps",{options:{},className:"",timeout:be.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const cn=un;function Nn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Xs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nn(Object(t),!0).forEach(function(r){qe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Nn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qe(n,e,t){return e=qs(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qs(n){var e=Ys(n,"string");return typeof e=="symbol"?e:String(e)}function Ys(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zs=fe.module("Tooltip");class ve extends R.Component{static handleHidden(){ve.shownTooltipCount-=1,ve.shownTooltipCount===0&&(ve.lastHiddenTime=Date.now())}static handleShown(){ve.shownTooltipCount+=1}constructor(e){super(e),qe(this,"container",void 0),qe(this,"popper",void 0),qe(this,"parent",void 0),qe(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=te.createRef(),this.popper=te.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:r}=t,{isShown:i}=this.state;i!==r&&(i?ve.handleShown():ve.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ve.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Zs.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var a=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(ve.shownTooltipCount>0||Date.now()-ve.lastHiddenTime<ve.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":a,onEntered:o}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=Xs({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:u.jsx(cn,{className:K(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}qe(ve,"defaultTimeout",500);qe(ve,"defaultReshowTimeout",100);qe(ve,"triggerReshowThreshold",300);qe(ve,"shownTooltipCount",0);qe(ve,"lastHiddenTime",Date.now());qe(ve,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:ve.defaultReshowTimeout,timeout:ve.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const ar=ve;function Qs(n){var e=R.useRef();return R.useEffect(function(){e.current=n}),e.current}function hn(n){var e=R.useRef(null);return R.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var Js=3500,el=fe.module("useCopyToClipboard");function tl(){var[n,e]=R.useState(!1),t=R.useRef(null),r=R.useCallback(i=>{Rs(i).then(()=>{e(!0)}).catch(a=>el.error("Unable to copy ".concat(i),`
|
|
1
|
+
import{P as ca,d as De,at as Br,au as ha,e as uo,c as va,ad as oe,am as Ur,av as co,a0 as Pn,aw as ho,o as Oe,W as vo,ak as Xe,ag as le,ax as Pt,ai as go,a2 as Ht,ah as $t,a7 as ga,Z as ie,l as fo,a1 as Et,X as mo}from"./useUser-ae22a8dc.js";import{r as R,H as te,aw as po,D as u,E as Tr,F as K,R as bo,W as V,G as ce,M as it,av as fa,V as ge,ax as wo,ay as Co,Z as ma,a0 as tn,az as So,aA as yo,aB as Oo,_ as rn,Y as $e,aC as Vr,al as Tn,L as pa,aD as Po,aE as tt,aF as To,aG as Io,aH as Ro,aI as Do,aJ as Gr,aK as Eo,aL as Mo,aM as xo,aN as In,aO as jo,aP as Rn,aQ as ko,aR as No,aS as Ao,aT as Fo,aU as Lo,aV as Ho,aj as $o,au as Bo}from"./vendor-f46f78b9.js";import{T as be,L as fe,a8 as Wo,b5 as _o,b2 as Uo,b6 as Vo,aw as Go,ay as nn,h as zo,g as Ko,f as Xo,A as qo,F as Yo,D as Zo,z as Qo,G as Jo,u as es,K as ts,p as rs,Q as ns,b7 as is,ap as ba,v as sr,as as an,b8 as on,b9 as sn,Z as as,a7 as wa,k as os,ba as ss,aA as C,V as Ca,a5 as Or,ag as ls,q as Sa,j as ee,d as ds,bb as us,aM as Dn,bc as cs,aX as ya,bd as Oa,be as hs,bf as vs,e as gs,bg as fs,bh as ms,bi as ps,bj as bs,bk as ws,bl as Cs,_ as Ss,$ as ys,bm as Os,r as Pa,B as Ps}from"./index-c9408b8e.js";import{e as ct,l as Ut,a as Ve,K as zr,b as En,R as Ts}from"./monaco-0b69f16f.js";function Mn(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Is(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Mn(a,r,i,o,s,"next",l)}function s(l){Mn(a,r,i,o,s,"throw",l)}o(void 0)})}}function Rs(n){return Kr.apply(this,arguments)}function Kr(){return Kr=Is(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return xn(n)}xn(n)}),Kr.apply(this,arguments)}function xn(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function qt(n,e,t){return e=Ds(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ds(n){var e=Es(n,"string");return typeof e=="symbol"?e:String(e)}function Es(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ms="table_",Ta="column_",xs=new Set(["in","not","i","ii","k"]),js=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),ks=/[^a-zA-Z0-9_$+@-]/g,Ns=/[^A-Za-z0-9_$]/g;class Be{}qt(Be,"legalize",(n,e,t,r,i)=>{var a=n.trim().replace(/[- ]/g,"_");return r&&(xs.has(a)||js.has(a))&&(a=e+a),a=a.replace(t,""),a||(a=e+i),Number.isNaN(Number(a.charAt(0)))||(a=e+a),a});qt(Be,"legalizeTableName",n=>Be.legalize(n,Ms,ks,!1,0));qt(Be,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=Be.legalizeColumnName(t,r);e.includes(i)&&(i=Ta+r),e.push(i)}),e});qt(Be,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Be.legalize(n,Ta,Ns,!0,e)});qt(Be,"isValidTableName",n=>Be.legalizeTableName(n)===n);qt(Be,"isValidColumnName",n=>Be.legalizeColumnName(n)===n);const ln=Be;function jn(n,e,t){return e=As(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function As(n){var e=Fs(n,"string");return typeof e=="symbol"?e:String(e)}function Fs(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ls{constructor(){jn(this,"pending",[]),jn(this,"resolved",[])}add(e,t){var r=ca.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const Hv=Ls;class dn{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!dn.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],a=i[0],o=i[1];if(a<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(o,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){a[o]=[l,r-1],a.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(o,1):l<r?a[o]=[l,r-1]:a[o]=[i+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var a=[...r],o=i[0];o<=i[1];o+=1)a.push(e[o]);return a},[])}}const bt=dn;function*$v(n,e){for(var t=n;t<=e;++t)yield t}function Ia(n,e,t){return e=Hs(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hs(n){var e=$s(n,"string");return typeof e=="symbol"?e:String(e)}function $s(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class lr{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),a=r%60,o=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(lr.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}Ia(lr,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Ia(lr,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const Bs=lr;function Ws(n,e,t){return e=_s(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _s(n){var e=Us(n,"string");return typeof e=="symbol"?e:String(e)}function Us(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vs extends Error{constructor(){super(...arguments),Ws(this,"isInvalid",!0)}}const Bv=Vs;function kn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kn(Object(t),!0).forEach(function(r){Xt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xt(n,e,t){return e=zs(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zs(n){var e=Ks(n,"string");return typeof e=="symbol"?e:String(e)}function Ks(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class un extends R.Component{constructor(e){super(e),Xt(this,"element",void 0),Xt(this,"container",void 0),Xt(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=te.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Gs({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new po(r||a,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var o=this.element.firstElementChild;o instanceof HTMLElement&&o.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:a}=this.props,{show:o}=this.state;return u.jsx(Tr,{in:o,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:K("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&bo.createPortal(this.renderContent(),this.element)})}}Xt(un,"propTypes",{children:V.node.isRequired,options:V.shape({}),className:V.string,timeout:V.number,onEntered:V.func,onExited:V.func,isShown:V.bool,closeOnBlur:V.bool,interactive:V.bool,referenceObject:V.shape({}),"data-testid":V.string});Xt(un,"defaultProps",{options:{},className:"",timeout:be.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const cn=un;function Nn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Xs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nn(Object(t),!0).forEach(function(r){qe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Nn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qe(n,e,t){return e=qs(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qs(n){var e=Ys(n,"string");return typeof e=="symbol"?e:String(e)}function Ys(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zs=fe.module("Tooltip");class ve extends R.Component{static handleHidden(){ve.shownTooltipCount-=1,ve.shownTooltipCount===0&&(ve.lastHiddenTime=Date.now())}static handleShown(){ve.shownTooltipCount+=1}constructor(e){super(e),qe(this,"container",void 0),qe(this,"popper",void 0),qe(this,"parent",void 0),qe(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=te.createRef(),this.popper=te.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:r}=t,{isShown:i}=this.state;i!==r&&(i?ve.handleShown():ve.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ve.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Zs.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var a=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(ve.shownTooltipCount>0||Date.now()-ve.lastHiddenTime<ve.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":a,onEntered:o}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=Xs({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:u.jsx(cn,{className:K(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}qe(ve,"defaultTimeout",500);qe(ve,"defaultReshowTimeout",100);qe(ve,"triggerReshowThreshold",300);qe(ve,"shownTooltipCount",0);qe(ve,"lastHiddenTime",Date.now());qe(ve,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:ve.defaultReshowTimeout,timeout:ve.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const ar=ve;function Qs(n){var e=R.useRef();return R.useEffect(function(){e.current=n}),e.current}function hn(n){var e=R.useRef(null);return R.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var Js=3500,el=fe.module("useCopyToClipboard");function tl(){var[n,e]=R.useState(!1),t=R.useRef(null),r=R.useCallback(i=>{Rs(i).then(()=>{e(!0)}).catch(a=>el.error("Unable to copy ".concat(i),`
|
|
2
2
|
`,a))},[]);return R.useEffect(()=>(t.current&&clearTimeout(t.current),n&&(t.current=setTimeout(()=>{e(!1)},Js)),()=>{t.current&&clearTimeout(t.current)}),[n]),[n,r]}var rl=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function An(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Fn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?An(Object(t),!0).forEach(function(r){nl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):An(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nl(n,e,t){return e=il(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function il(n){var e=al(n,"string");return typeof e=="symbol"?e:String(e)}function al(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ol(n,e){if(n==null)return{};var t=sl(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function sl(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var ll=["primary","secondary","tertiary","success","danger","inline","ghost"],dl=["group-end"];function ul(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return K("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function cl(n){switch(n){case"group-end":return K("pl-2","pr-3")}}var xr=te.forwardRef((n,e)=>{var{kind:t,variant:r,type:i,tooltip:a,icon:o,disabled:s=!1,active:l,onClick:d,onContextMenu:c,onMouseDown:h,onMouseUp:v,onMouseEnter:g,onMouseLeave:f,onKeyDown:m,className:p,style:b,children:S,tabIndex:y,"data-testid":P,"aria-label":I}=n,E=ol(n,rl),A;r&&(A=cl(r));var k;o&&(k=te.isValidElement(o)?o:u.jsx(ce,{icon:o}));var M=k!=null&&S==null,D=ul(t,M),x;a!==void 0&&(x=typeof a=="string"?u.jsx(ar,{children:a}):a);var H=I;I===void 0&&M&&a!=null&&typeof a=="string"&&(H=a);var T=u.jsxs("button",Fn(Fn({"data-testid":P,ref:e,type:i,className:K("btn",D,A,{active:l},p),onClick:d,onContextMenu:c,onMouseUp:v,onMouseDown:h,onMouseEnter:g,onMouseLeave:f,onKeyDown:m,style:b,disabled:s,tabIndex:y,"aria-label":H},E),{},{children:[o&&k,S,a!=null&&!s&&x]}));return s&&a!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[T,x]}):T});xr.displayName="Button";xr.propTypes={kind:V.oneOf(ll).isRequired,variant:V.oneOf(dl),type:V.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:r}=n;return e===void 0&&t!=null&&r==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!te.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:V.bool,active:V.bool,onClick(n){var{onClick:e,type:t}=n;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:V.func,onMouseUp:V.func,onMouseDown:V.func,onMouseEnter:V.func,onMouseLeave:V.func,onKeyDown:V.func,tabIndex:V.number,children:V.node,className:V.string,style:V.object,"data-testid":V.string};xr.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const Q=xr;var Ln=fe.module("GlobalContextAction");class hl extends R.Component{constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),Ln.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!De.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Ln.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const vl=hl;class gl extends R.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var a=e[i],{shortcut:o}=a;if(a.title!=null||a.menuElement||o){var s=u.jsx(vl,{action:a,"data-testid":t},"".concat(a.title,".").concat(o==null?void 0:o.id));r.push(s)}}return r}}const fl=gl;function Ra(n,e,t){return e=ml(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ml(n){var e=pl(n,"string");return typeof e=="symbol"?e:String(e)}function pl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ur=fe.module("ContextActions");class Da extends R.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var a=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}}constructor(e){super(e),Ra(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=te.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!Br(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!Br(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var r=e.target,i=function(){var{classList:d}=r,c=t.find(h=>d.contains(h));if(c!==void 0)return ur.debug2('Contextmenu event ignored based on the target className "'.concat(c,'"')),{v:void 0};r=r.parentElement};r!=null;){var a=i();if(typeof a=="object")return a.v}if(De.isContextActionEvent(e)||(e.contextActions=[]),!!De.isContextActionEvent(e)){var{actions:o}=this.props;if(o!=null){var s=o;Array.isArray(s)&&(s=s.filter(l=>Br(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}ur.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!De.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var a;ur.debug("Context hotkey matched!",e),(a=i.action)===null||a===void 0||a.call(i,e),e.stopPropagation(),e.preventDefault(),ur.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(fl,{actions:t})})}}Ra(Da,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const bl=Da;var jr=te.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:a,inputClassName:o,isInvalid:s,labelClassName:l,name:d,onChange:c,"data-testid":h}=n,[v]=R.useState(it()),g=hn(e);R.useEffect(function(){g.current&&(g.current.indeterminate=t===null)},[g,t]);var f=R.useCallback(m=>{g.current&&(g.current.indeterminate=t===null),c&&c(m)},[g,t,c]);return u.jsxs("div",{className:K("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:g,checked:t??!1,className:K("custom-control-input",o,{"is-invalid":s}),disabled:a,id:v,name:d,onChange:f,"data-testid":h}),u.jsx("label",{className:K("custom-control-label",l),htmlFor:v,children:r})]})});jr.displayName="Checkbox";jr.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:V.node.isRequired,className:V.string,disabled:V.bool,inputClassName:V.string,isInvalid:V.bool,labelClassName:V.string,name:V.string,onChange:V.func,"data-testid":V.string};jr.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Tt=jr;function wt(n,e,t){return e=wl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wl(n){var e=Cl(n,"string");return typeof e=="symbol"?e:String(e)}function Cl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Hn=fe.module("Shortcut"),q;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(q||(q={}));var U;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(U||(U={}));var Sl=new Set([U.ENTER,U.DELETE,U.F1,U.F2,U.F3,U.F4,U.F5,U.F6,U.F7,U.F8,U.F9,U.F10,U.F11,U.F12]);class ue extends fa{static isAllowedKey(e){return Object.values(U).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!ue.isMacPlatform&&e.metaKey||!ue.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||Sl.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case q.CTRL:t.ctrlKey=!0;break;case q.ALT:case q.OPTION:t.altKey=!0;break;case q.CMD:t.metaKey=!0;break;case q.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!ue.isAllowedKey(t)&&ue.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===U.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case U.ENTER:t+="⏎";break;case U.ESCAPE:t+="⎋";break;case U.BACKSPACE:t+="⌫";break;case U.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":ue.isMacPlatform?ue.getMacDisplayText(e):ue.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:a=!0,name:o,tooltip:s}=e;super(),wt(this,"id",void 0),wt(this,"name",void 0),wt(this,"tooltip",void 0),wt(this,"isEditable",void 0),wt(this,"defaultKeyState",void 0),wt(this,"keyState",void 0),this.id=t,this.name=o,this.tooltip=s,this.isEditable=a;var l=ue.isMacPlatform,d=l?i:r;this.defaultKeyState=ue.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return ue.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){ue.isValidKeyState(e)?(Hn.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new ha("onUpdate",{detail:this}))):Hn.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return ue.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(ue.NULL_KEY_STATE)}isNull(){return ue.doKeyStatesMatch(this.keyState,ue.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return ue.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(ue.getKeyStateFromEvent(e))}}wt(ue,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});wt(ue,"isMacPlatform",De.isMacPlatform());function $n(n,e,t){return e=yl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yl(n){var e=Ol(n,"string");return typeof e=="symbol"?e:String(e)}function Ol(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Bn=fe.module("ShortcutRegistry");class Pl extends fa{constructor(){super(...arguments),$n(this,"shortcutMap",new Map),$n(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new ue(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Bn.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Bn.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",a=>{var{detail:o}=a;return this.dispatchEvent(new ha("onUpdate",{detail:o}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var Tl=Object.freeze(new Pl);const pe=Tl;var Il={COPY:pe.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[q.CTRL,U.C],macShortcut:[q.CMD,U.C],isEditable:!1}),PASTE:pe.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[q.CTRL,U.V],macShortcut:[q.CMD,U.V],isEditable:!1}),SAVE:pe.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[q.CTRL,U.S],macShortcut:[q.CMD,U.S],isEditable:!1}),SELECT_ALL:pe.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[q.CTRL,U.A],macShortcut:[q.CMD,U.A],isEditable:!1}),LINKER:pe.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[q.CTRL,U.L],macShortcut:[q.CMD,U.L]}),LINKER_CLOSE:pe.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[U.ESCAPE],macShortcut:[U.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:pe.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[q.CTRL,q.ALT,U.I],macShortcut:[q.CMD,q.SHIFT,U.I],isEditable:!0}),NEXT:pe.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[U.ENTER],macShortcut:[U.ENTER],isEditable:!1}),PREVIOUS:pe.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[q.SHIFT,U.ENTER],macShortcut:[q.SHIFT,U.ENTER],isEditable:!1})};const cr=Il;function Xr(n,e,t){return e=Rl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rl(n){var e=Dl(n,"string");return typeof e=="symbol"?e:String(e)}function Dl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ea extends R.PureComponent{constructor(e){super(e),Xr(this,"inputField",void 0),Xr(this,"searchChangeSelection",void 0),this.inputField=te.createRef(),this.searchChangeSelection=te.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:a,disabled:o,matchCount:s,id:l,onKeyDown:d,"data-testid":c,cursor:h}=this.props,v,g=[{action:()=>h==null?void 0:h.next("forward"),shortcut:cr.NEXT},{action:()=>h==null?void 0:h.next("back"),shortcut:cr.PREVIOUS}];return h&&s>1?v=u.jsxs(u.Fragment,{children:[u.jsx(Q,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{h.next("back")},icon:Wo,tooltip:"Previous match (".concat(cr.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[h.index!==void 0&&"".concat(h.index+1," of "),s]}),u.jsx(Q,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{h.next("forward")},icon:_o,tooltip:"Next match (".concat(cr.NEXT.getDisplayText(),")")})]}):v=s>0&&u.jsx("span",{className:"search-match",children:s}),u.jsxs("div",{className:K("search-group",a),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:o,placeholder:t,ref:this.inputField,id:l,"data-testid":c}),s!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),u.jsx(bl,{actions:g})]}):u.jsx("span",{className:"search-icon",children:u.jsx(ce,{icon:Uo})})]})}}Xr(Ea,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});const vn=Ea;function Wn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function El(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wn(Object(t),!0).forEach(function(r){Le(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Le(n,e,t){return e=Ml(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ml(n){var e=xl(n,"string");return typeof e=="symbol"?e:String(e)}function xl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qr;(function(n){n.UP="UP",n.DOWN="DOWN"})(qr||(qr={}));class rt extends R.Component{constructor(e){super(e),Le(this,"popper",void 0),Le(this,"cbContainer",void 0),Le(this,"toggleButton",void 0),Le(this,"menuContainer",void 0),Le(this,"input",void 0),Le(this,"searchInput",void 0),Le(this,"getCachedFilteredOptions",ge((t,r)=>t.filter(i=>i.title.toLowerCase().indexOf(r.toLowerCase())>=0||i.value.toLowerCase().indexOf(r.toLowerCase())>=0))),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=te.createRef(),this.cbContainer=te.createRef(),this.toggleButton=te.createRef(),this.menuContainer=te.createRef(),this.input=te.createRef(),this.searchInput=te.createRef()}componentDidUpdate(){var{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)===null||e===void 0||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){var{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,r,{filter:i,filteredOptions:a,keyboardOptionIndex:o}=this.state,{options:s}=this.props,l=i?a:s;switch(e.key){case"Enter":((t=l[o])===null||t===void 0?void 0:t.value)!=null&&this.updateInputValue(l[o].value),this.closeMenu(),(r=this.input.current)===null||r===void 0||r.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(rt.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(rt.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":i!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&o===l.length-1&&this.closeMenu();break}}handleMenuNavigation(e){var{filter:t,filteredOptions:r,keyboardOptionIndex:i}=this.state,{options:a}=this.props,o=t?r:a,s=o.length,l=0;switch(e){case rt.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case rt.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(i+l+s)%s})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?r||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,r=Number(e.currentTarget.value),{filter:i,filteredOptions:a}=this.state,{options:o}=this.props,s=i?a:o;this.updateInputValue(s[r].value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var t,{options:r}=this.props,i=e.target.value,a=this.getCachedFilteredOptions(r,i);this.setState({filter:i,filteredOptions:a,keyboardOptionIndex:0}),(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;if(e){var t;this.setState({menuIsOpen:!1}),(t=this.popper.current)===null||t===void 0||t.hide()}this.setState({filter:""})}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)===null||e===void 0||e.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:r}=this.state,{options:i}=this.props,a=t?r:i,o=a.findIndex(s=>s.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var e,t=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cb-option-btn.keyboard-active");t instanceof HTMLElement&&t.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){var{searchPlaceholder:e}=this.props,{filter:t,inputWidth:r}=this.state;return u.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:r},onBlur:this.handleMenuBlur,children:[u.jsx("div",{className:"cb-search-input-container",children:u.jsx(vn,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u.jsx("div",{className:"cb-options-container",children:u.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:r,filteredOptions:i}=this.state,a=r?i:e;return a.map((o,s)=>{var l="option-".concat(s,"-").concat(o.value);return u.jsx("button",{type:"button",value:s,className:K("cb-option-btn",{"keyboard-active":t===s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultValue:a,spellCheck:o,"data-testid":s}=this.props,{value:l}=this.state,{popperOptions:d}=this.props;return d=El({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},d),u.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:K("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:r,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s!==void 0?"".concat(s,"-input"):void 0}),u.jsx("div",{className:"input-group-append cb-dropdown",children:u.jsxs("button",{tabIndex:-1,type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:r,"data-testid":s!==void 0?"".concat(s,"-btn"):void 0,children:[u.jsx("span",{className:"cb-caret"}),u.jsx(cn,{ref:this.popper,options:d,className:K("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}Le(rt,"MENU_NAVIGATION_DIRECTION",qr);Le(rt,"DROP_DOWN_MENU_HEIGHT",200);Le(rt,"propTypes",{options:V.arrayOf(V.shape({title:V.string.isRequired,value:V.string.isRequired})).isRequired,popperOptions:V.shape({title:V.string.isRequired,value:V.string.isRequired}),onChange:V.func,inputPlaceholder:V.string,searchPlaceholder:V.string,disabled:V.bool,className:V.string,defaultValue:V.string,spellCheck:V.bool,onEnter:V.func,"data-testid":V.string});Le(rt,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const Wv=rt;function _v(n){var{copy:e,kind:t="ghost",tooltip:r="Copy",className:i,style:a,"data-testid":o,children:s}=n,[l,d]=tl();return u.jsx(Q,{kind:t,className:i,style:a,"data-testid":o,icon:l?Vo:Go,tooltip:l?"Copied":r,onClick:()=>{d(typeof e=="function"?e():e)},children:s})}function Ma(n,e,t){return n.substring(0,e)+t+n.substring(e+1)}function jl(n,e,t){return n.length<t?"".concat(n).concat(e.substring(n.length,t)):n}function _n(n,e){for(var{length:t}=n,r=n.length-1;r>=0&&e[r]===n[r];r-=1)t=r;return n.substring(0,t)}function Un(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function kl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Un(Object(t),!0).forEach(function(r){Nl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Nl(n,e,t){return e=Al(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Al(n){var e=Fl(n,"string");return typeof e=="symbol"?e:String(e)}function Fl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ue=fe.module("MaskedInput"),Bt={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},hr=" ",xa=te.forwardRef((n,e)=>{var{className:t,example:r,getNextSegmentValue:i=(T,O,w)=>w,getPreferredReplacementString:a=Ma,onChange:o=()=>!1,onSelect:s=()=>!1,onSubmit:l,pattern:d,placeholder:c,selection:h,value:v,onFocus:g=()=>!1,onBlur:f=()=>!1,"data-testid":m}=n,p=hn(e),b=R.useMemo(()=>Array.isArray(r)?r:[r],[r]),S=R.useMemo(()=>b[0].replace(/[a-zA-Z0-9]/g,hr),[b]);R.useEffect(function(){if(h!=null){var O;Ue.debug("setting selection...",h);var{selectionStart:w,selectionEnd:j,selectionDirection:N}=h;(O=p.current)===null||O===void 0||O.setSelectionRange(w,j,N),Ue.debug("selection set!")}},[h,p]);var y=R.useCallback(T=>{for(var O=T,w=T,j=b.length>0?b[0]:v,N=O-1;N>=0&&/[a-zA-Z0-9]/g.test(j.charAt(N));N-=1)O=N;for(var L=w;L<j.length&&/[a-zA-Z0-9]/g.test(j.charAt(L));L+=1)w=L+1;var W=O===w?Bt.NONE:Bt.BACKWARD;return{selectionStart:O,selectionEnd:w,selectionDirection:W}},[b,v]);function P(T,O){for(var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T.length,j="",N=0;N<w;N+=1)T.charAt(N)!==hr?j=j.concat(T[N]):j=j.concat(O[N]);return j=j.concat(O.substring(w)),j}function I(T){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.length,w=new RegExp("^".concat(d,"$"));if(w.test(T))return!0;for(var j=0;j<b.length;j+=1){var N=P(T,b[j],O);if(w.test(N))return!0}return!1}function E(T){var O=y(T),w=O.selectionEnd+1;return w>=v.length?O:y(w)}function A(T){var O=y(T),w=O.selectionStart-1;return w<=0?O:y(w)}function k(T,O){var w=y(T),j=v.substring(w.selectionStart,w.selectionEnd),N=i(w,O,j,v),L=v.substring(0,w.selectionStart)+N+v.substring(w.selectionEnd);I(L,w.selectionEnd)&&(o(L),s(w))}var M=R.useCallback(T=>{var{selectionStart:O=0,selectionEnd:w=0,selectionDirection:j="none"}=T.target;if(O===null||w===null||j===null){Ue.error("Selection attempted on non-text input element",T.target);return}if(Ue.debug2("handleSelect",O,w,j),!(h!=null&&O===h.selectionStart&&w===h.selectionEnd)){if(h!=null&&O===v.length&&w===v.length&&T.nativeEvent.type!=="mouseup"){s(kl({},h));return}if(O===w){var N=y(O);Ue.debug("Selection segment from ",O,w,"=>",N),s(N)}else s({selectionStart:O,selectionEnd:w,selectionDirection:j})}},[y,s,h,v]),D=R.useCallback(T=>{var O;if(p.current){Ue.debug("handleSelectCapture",T);var w=(O=p.current.selectionStart)!==null&&O!==void 0?O:0;w===v.length&&h!=null&&w!==h.selectionStart&&(T.preventDefault(),T.stopPropagation())}},[p,h,v]);function x(T){if(T.preventDefault(),T.stopPropagation(),!!p.current){var{key:O}=T,{selectionStart:w=0,selectionEnd:j=0}=p.current;if(w===null||j===null){Ue.error("Selection arrow nvaigation attempted on non-text input element",T.target);return}O==="ArrowLeft"?s(A(w)):O==="ArrowRight"?s(E(j)):O==="ArrowUp"?k(w,-1):O==="ArrowDown"&&k(w,1)}}function H(T){if(p.current){Ue.debug("handleKeyDown",T);var{key:O}=T,{selectionStart:w=0,selectionEnd:j=0}=p.current;if(w===null||j===null){Ue.error("Selection key event on non-text input element",T.target);return}if(O==="Enter"){l==null||l(T);return}if(O.startsWith("Arrow")){x(T);return}if(O==="Delete"||O==="Backspace"){if(T.preventDefault(),T.stopPropagation(),j>=_n(v,S).length){var N=v.substring(0,w===j?w-1:w),L=_n(N,S);L!==v&&(o(L),s({selectionStart:L.length,selectionEnd:L.length,selectionDirection:Bt.NONE}));return}if(w!==j){var W=v.substring(0,w)+v.substring(w,j).replace(/[a-zA-Z0-9]/g,hr)+v.substring(j);Ue.debug("Range ",w,j,"deleted, setting value",W),o(W),s({selectionStart:w,selectionEnd:w,selectionDirection:Bt.NONE})}else if(w>0)for(var _=w-1;_>=0;_-=1){var F=v.substring(0,_)+v.substring(_,w).replace(/[a-zA-Z0-9]/g,hr)+v.substring(w);if(F!==v){o(F),s({selectionStart:_,selectionEnd:_,selectionDirection:Bt.NONE});return}}return}if(!(T.altKey||T.metaKey||T.ctrlKey||O.length>1)){T.preventDefault(),T.stopPropagation();for(var $=Array.from(new Set([O,O.toUpperCase(),O.toLowerCase()])),G=0;G<$.length;G+=1)for(var B=$[G],X=/[a-zA-Z0-9]/g.test(B)?b[0].length-1:w,z=w;z<=X;z+=1){var J=jl(v,b[0],z+1),ae=a(J,z,B,w,j);if(I(ae,z+1)){var Y=y(z),Z=z+1,me={selectionStart:Z,selectionEnd:Z,selectionDirection:Bt.NONE};if(Z>=Y.selectionEnd){var he=E(z);he.selectionStart!==Y.selectionStart&&(me=he)}Ue.debug("handleKeyDown",O,"=>",ae,me),o(ae),s(me);return}}}}}return u.jsx("input",{ref:p,className:K("form-control masked-input",t),type:"text",pattern:d,placeholder:c,value:v,onChange:()=>{},onKeyDown:H,onSelect:M,onSelectCapture:D,onFocus:g,onBlur:f,"data-testid":m})});xa.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(n,e,t)=>t,getPreferredReplacementString:Ma,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const Ll=xa;function Vn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Hl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vn(Object(t),!0).forEach(function(r){nr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nr(n,e,t){return e=$l(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $l(n){var e=Bl(n,"string");return typeof e=="symbol"?e:String(e)}function Bl(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let ja=class extends R.PureComponent{constructor(e){var t;super(e),nr(this,"container",void 0),nr(this,"oldFocus",void 0),nr(this,"rAF",void 0),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=te.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=De.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:De.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var a;i=De.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var o;i=De.getNextMenuItem((o=i)!==null&&o!==void 0?o:0,1,t)}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:a}=this.state,o=0;o<i.length;o+=1){var s=i[o];o>0&&s.group!==i[o-1].group&&e.push(u.jsx("hr",{},"".concat(o,".separator")));var l=u.jsx(uo,{isKeyboardSelected:r===o,isMouseSelected:a===o,menuItem:s,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},o);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:Hl({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};nr(ja,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const Wl=ja;function Gn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gn(Object(t),!0).forEach(function(r){zt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function zt(n,e,t){return e=_l(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _l(n){var e=Ul(n,"string");return typeof e=="symbol"?e:String(e)}function Ul(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ka extends R.PureComponent{constructor(e){super(e),zt(this,"container",void 0),zt(this,"parent",void 0),zt(this,"popper",void 0),zt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=te.createRef(),this.parent=null,this.popper=te.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:r,"data-testid":i}=this.props,{menuStyle:a}=this.props,{options:o,popperOptions:s}=this.props;return s=zn({placement:"bottom"},s),o=zn({separateKeyboardMouse:!0},o),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(cn,{ref:this.popper,options:s,className:K("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Wl,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:o,menuStyle:a})})})}}zt(ka,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const Vv=ka;function Wt(n,e,t,r,i){var a=r-t+1,o=((parseInt(e,10)-n-t)%a+a)%a+t;return"".concat(o).padStart(i,"0")}function Vl(n,e,t){var{selectionStart:r}=n;return r===0?Wt(e,t,1900,2099,4):r===5?Wt(e,t,1,12,2):r===8?Wt(e,t,1,31,2):r===11?Wt(e,t,0,23,2):r===17||r===14?Wt(e,t,0,59,2):r===20||r===24||r===28?Wt(e,t,0,999,3):t}function Yr(n){var e=n.substring(0,23),t=n.substring(23,26),r=n.substring(26);return[e,t,r].filter(i=>i!=="").join("")}var Gl=fe.module("DateTimeInput"),zl="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Kl="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",Xl="".concat(zl," ").concat(Kl),Pr="2022-01-01",Na="".concat(Pr," 00:00:00.000000000"),ql="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function Kn(n){return n!=null&&n.length>=Pr.length?"".concat(n.substring(0,Pr.length)).concat(n.substring(Pr.length).replace(/\u2007/g,"0")).concat(Na.substring(n.length)):n}function Xn(n){return n.replace(/\u200B/g,"")}var Yl=[Yr(Na)],gn=te.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:o=()=>{},onSubmit:s,"data-testid":l}=n,[d,c]=R.useState(i.length>0?Yr(i):""),[h,v]=R.useState(),g=R.useCallback(m=>{Gl.debug("handleChange",m),c(m),r(Kn(Xn(m)))},[r]),f=R.useCallback(()=>{var m=Xn(d),p=Kn(m);p!==m&&c(Yr(p)),o()},[d,o]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(Ll,{ref:e,className:K(t),example:Yl,getNextSegmentValue:Vl,onChange:g,onSelect:v,onSubmit:s,pattern:Xl,placeholder:ql,selection:h,value:d,onFocus:a,onBlur:f,"data-testid":l})})});gn.displayName="DateTimeInput";gn.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const Gv=gn;function Aa(n,e,t){return e=Zl(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zl(n){var e=Ql(n,"string");return typeof e=="symbol"?e:String(e)}function Ql(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Jl=fe.module("ItemListItem");class kr extends R.Component{static handleKeyDown(){return Jl.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Aa(this,"itemRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=te.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:a,"data-testid":o}=this.props;return u.jsx("div",{className:K("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:kr.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:a})}}Aa(kr,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const ed=kr;function qn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qn(Object(t),!0).forEach(function(r){He(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function He(n,e,t){return e=td(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function td(n){var e=rd(n,"string");return typeof e=="symbol"?e:String(e)}function rd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zn=fe.module("ItemList"),Qn=5;class Ee extends R.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),He(this,"list",void 0),He(this,"listContainer",void 0),He(this,"getItemSelected",ge((i,a)=>bt.isSelected(a,i),{max:Ee.CACHE_SIZE})),He(this,"getCachedItem",ge((i,a,o,s,l,d,c,h)=>{var v=d({item:o,itemIndex:i,isFocused:s,isSelected:l,style:c});return u.jsx(ed,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:h,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:c,children:v},a)},{max:Ee.CACHE_SIZE})),He(this,"getOuterElement",ge(i=>{var a=te.forwardRef((o,s)=>u.jsx("div",Yn({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},o)));return a.displayName="ItemListOuterElement",a})),He(this,"getInnerElement",ge(()=>{var i=te.forwardRef((a,o)=>u.jsx("div",Yn({className:"item-list-inner-element",ref:o},a)));return i.displayName="ItemListInnerElement",i})),He(this,"getItemData",ge((i,a,o)=>({items:i,selectedRanges:a,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=te.createRef(),this.listContainer=te.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:a,isStuckToBottom:o,scrollOffset:s,height:l,selectedRanges:d}=this.state;if(o&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(s!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:c}=this.props;c(d)}if(a!==t.focusIndex){var{onFocusChange:h}=this.props;h(a)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:r}=this.state,i=this.listContainer.current.querySelectorAll(t),a=e-r;return i[a]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=bt.isSelected(r,e),a=i||De.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(a=>{var{selectedRanges:o}=a;return{selectedRanges:bt.selectRange(o,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Zn.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){Zn.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:a}=this.props,{mouseDownIndex:o,selectedRanges:s,mouseX:l,mouseY:d}=this.state;if(!(o==null||a)){var c=Math.abs(t.clientX-(l??0)),h=Math.abs(t.clientY-(d??0));c>Qn&&h>Qn&&this.setState({isDragging:!0}),(r||o===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,s)&&!De.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,De.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:a}=this.props,{mouseDownIndex:o,isDragging:s}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!s){var l=t.shiftKey,d=De.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&a(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:r,onSelect:i}=this.props,{focusIndex:a}=this.state,o=a;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&i(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=r-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,r-1):o=0;else return;if(a!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);var{selectedRanges:s}=this.state;if(e.shiftKey&&s.length>0){var l=s[s.length-1];this.selectRange([Math.min(o,l[0]),Math.max(o,l[1])])}else if(this.deselectAll(),o!==null)this.selectItem(o);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(o)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:a}=this.props,{height:o}=i,s=a&&this.isListAtBottom({scrollOffset:r,height:o});return{isStuckToBottom:s,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:a}=this.props,{selectedRanges:o}=this.state;if(a&&t&&o.length>0){var s=o[o.length-1];this.selectRange([Math.min(s[0],e),Math.max(e,s[1])])}else a&&o.length===1&&o[0][0]===e&&o[0][1]===e?i&&this.deselectItem(e):a&&r?this.getItemSelected(e,o)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){bt.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:bt.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){bt.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:bt.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,a=Math.floor(e/i),o=a+Math.ceil(t/i);r(a,o)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:a,renderItem:o,disableSelect:s}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<a||t>=a+i.length)return null;var c=i[t-a];return this.getCachedItem(t,t,c,t===l&&!s,this.getItemSelected(t,d),o,r,s)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:a,"data-testid":o}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return u.jsx(wo,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:c,height:h}=d;return u.jsx(Co,{className:"item-list-scroll-pane",height:h,width:c,initialScrollOffset:l?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,s,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":o,children:this.renderInnerElement})}})}}He(Ee,"CACHE_SIZE",1e3);He(Ee,"DEFAULT_ROW_HEIGHT",20);He(Ee,"DEFAULT_OVERSCAN",10);He(Ee,"defaultProps",{offset:0,items:[],rowHeight:Ee.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Ee.DEFAULT_OVERSCAN,renderItem:Ee.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function Jn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jn(Object(t),!0).forEach(function(r){xt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xt(n,e,t){return e=nd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nd(n){var e=id(n,"string");return typeof e=="symbol"?e:String(e)}function id(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nt extends R.PureComponent{static renderHandle(){return u.jsxs("div",{children:[u.jsx(ar,{children:"Drag to re-order"}),u.jsx(ce,{icon:nn})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?u.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:r="",className:i=""}=e;return u.jsxs("div",{className:K("item-list-item-content","draggable-item-list-item-content",i),children:[u.jsx("span",{className:"title",children:t}),nt.renderBadge({text:r}),nt.renderHandle()]})}static renderItem(e){var t,r,{item:i,isClone:a,selectedCount:o}=e,s=i!=null?(t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i):"",l=a!==void 0&&a?"".concat(o):"",d=a!==void 0&&a?"item-list-item-clone":"";return nt.renderTextItem({text:s,badgeText:l,className:d})}static getDraggableId(e,t){return"".concat(e,"/").concat(t)}static getDraggableIndex(e){var t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}constructor(e){super(e),xt(this,"itemList",void 0),xt(this,"getCachedDraggableItem",ge((t,r,i,a,o,s,l,d)=>u.jsx(ma,{draggableId:nt.getDraggableId(t,a),index:a,isDragDisabled:l,children:c=>u.jsx("div",mt(mt(mt({role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1},c.draggableProps),c.dragHandleProps),{},{children:r({item:i,itemIndex:a,isFocused:o,isSelected:s,style:d,isClone:!1})}))},a),{max:Ee.CACHE_SIZE})),xt(this,"getCachedRenderDraggableItem",ge((t,r,i)=>a=>{var{item:o,itemIndex:s,isFocused:l,isSelected:d,style:c}=a;return this.getCachedDraggableItem(t,i,o,s,l,d,r,c)},{max:1})),xt(this,"getCachedRenderClone",ge((t,r,i,a)=>(o,s,l)=>{var{selectedCount:d}=this.state,{draggableProps:c,dragHandleProps:h,innerRef:v}=o,{index:g}=l.source,f=r[g-i];return u.jsx("div",mt(mt(mt({className:K("draggable-item-list-dragging-item-container",t)},c),h),{},{ref:v,children:u.jsx("div",{className:K("draggable-item-list-dragging-item",{"two-dragged":d===2},{"multiple-dragged":d>2}),children:a({item:f,itemIndex:g,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:d})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=te.createRef(),this.state={selectedCount:0}}selectItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:bt.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:r,droppableId:i,isDoubleClickSelect:a,isDragDisabled:o,isDropDisabled:s,isMultiSelect:l,isStickyBottom:d,itemCount:c,items:h,offset:v,onFocusChange:g,onSelect:f,onViewportChange:m,renderItem:p,rowHeight:b,selectedRanges:S,style:y,"data-testid":P}=this.props;return u.jsx(tn,{isDropDisabled:s,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(r,h,v,p),"data-testid":P,children:(I,E)=>u.jsx("div",mt(mt({role:"menu",className:K("draggable-item-list",e,{"is-drop-disabled":s,"is-drag-disabled":o,"is-dragging-from-this":E.draggingFromThisWith,"is-dragging-over":E.isDraggingOver,"is-dropping":E.draggingOverWith}),style:y,ref:I.innerRef},I.droppableProps),{},{children:u.jsx(Ee,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:l,isStickyBottom:d,itemCount:c,items:h,onFocusChange:g,onSelect:f,onSelectionChange:this.handleSelectionChange,onViewportChange:m,offset:v,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,p),rowHeight:b,selectedRanges:S})}))})}}xt(nt,"DEFAULT_ROW_HEIGHT",30);xt(nt,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:nt.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:nt.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const Ke=nt;class Ir{static reorder(e,t,r,i){var a=e===r?Ir.adjustDestinationIndex(i,t):i,o=Ir.removeItems(e,t);return r.splice(a,0,...o),o}static removeItems(e,t){for(var r=[],i=t.map((c,h)=>({range:c,index:h})).sort((c,h)=>h.range[0]-c.range[0]),a=0;a<i.length;a+=1){var{range:o,index:s}=i[a],[l,d]=o;r[s]=e.splice(l,d-l+1)}return So(r)}static adjustDestinationIndex(e,t){for(var r=e,i=0;i<t.length;i+=1){var[a,o]=t[i];if(a>e)break;r-=Math.min(o,e-1)-a+1}return r}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const ht=Ir;function ad(n){var{on:e,id:t,className:r,isInvalid:i,disabled:a=!1,onClick:o,"data-testid":s}=n;return u.jsx("button",{type:"button",className:K("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:o,disabled:a,"data-testid":s,children:u.jsx("div",{className:"handle"})})}function ei(n){return n.isOn!==void 0}function od(n){var{item:e,onSelect:t=()=>{},"data-testid":r}=n,{icon:i,subtitle:a,title:o}=e,s=R.useMemo(()=>ei(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return u.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":"menu-item-".concat(o),onClick:s,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s()},tabIndex:0,role:"menuitem",children:[i!==void 0&&u.jsx("div",{className:"icon",children:u.jsx(ce,{icon:i})}),u.jsx("div",{className:"title",children:o}),a!==void 0&&u.jsx("div",{className:"shortcut",children:a}),u.jsx("div",{className:"accessory","data-testid":r,children:ei(e)?u.jsx(ad,{on:e.isOn,onClick:l=>{l.stopPropagation(),s()}}):u.jsx(ce,{icon:zo})})]})}function zv(n){var{items:e,onSelect:t=()=>{},"data-testid":r}=n;return u.jsx("div",{className:"navigation-menu-view","data-testid":r,children:u.jsx("ul",{className:"navigation-menu-list",children:e.map((i,a)=>u.jsx("li",{children:u.jsx(od,{item:i,onSelect:()=>{t(a)}})},i.title))})})}function Kv(n){var{children:e,onBack:t,onClose:r,title:i,"data-testid":a}=n;return u.jsxs("div",{className:"navigation-page","data-testid":a,children:[u.jsxs("div",{className:"navigation-title-bar",children:[u.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&u.jsx(Q,{kind:"ghost",className:"btn-back m-1 btn-sm","data-testid":"btn-page-back",onClick:t,icon:Ko,children:"Back"})}),u.jsx("div",{className:"navigation-title",children:i}),u.jsx("div",{className:"navigation-right-buttons",children:r!==void 0&&u.jsx(Q,{kind:"ghost",className:"btn-close btn-sm px-2 m-1","data-testid":"btn-page-close",onClick:r,icon:Xo,tooltip:"Close"})})]}),u.jsx("div",{className:"navigation-content",children:e})]})}function Xv(n){var{children:e,"data-testid":t}=n,r=R.useMemo(()=>te.Children.toArray(e),[e]),i=Qs(r),[a,o]=R.useState(r[r.length-1]),[s,l]=R.useState(null),[d,c]=R.useState(null);R.useEffect(function(){if(!(i===void 0||r===i)){var f=r[r.length-1];r.length===i.length||i.length===0||s!==null||d!==null?s!==null&&f!==s?l(f):f!==d&&f!==a&&o(f):r.length>i.length?l(f):r.length<i.length&&(o(f),c(i[i.length-1]))}},[r,i,s,d,a]);var h=R.useCallback(()=>{o(s),l(null)},[s]),v=R.useCallback(()=>{c(null)},[]);return u.jsxs("div",{className:"navigation-stack",children:[u.jsx("div",{className:"main-view","data-testid":t,children:a}),u.jsx(Tr,{in:d!=null,timeout:be.transitionMidMs,classNames:"slide-right",onEntered:v,children:u.jsx(u.Fragment,{children:d!=null&&u.jsx("div",{className:"popping-view",children:d})})}),u.jsx(Tr,{in:s!=null,timeout:be.transitionMidMs,classNames:"slide-left",onEntered:h,children:u.jsx(u.Fragment,{children:s!=null&&u.jsx("div",{className:"pushing-view",children:s})})})]})}var sd=["children"];function ti(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ri(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ti(Object(t),!0).forEach(function(r){ld(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ti(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ld(n,e,t){return e=dd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dd(n){var e=ud(n,"string");return typeof e=="symbol"?e:String(e)}function ud(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function cd(n,e){if(n==null)return{};var t=hd(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function hd(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Fa(n){var{children:e}=n,t=cd(n,sd);return u.jsx("option",ri(ri({},t),{},{children:e}))}function fn(n){var{children:e,disabled:t=!1,name:r,onChange:i,value:a="","data-testid":o}=n,[s]=R.useState(r??it());return u.jsx(u.Fragment,{children:te.Children.map(e,l=>{var d,c;return l?te.cloneElement(l,{name:s,onChange:(d=l.props.onChange)!==null&&d!==void 0?d:i,checked:a===l.props.value,disabled:(c=l.props.disabled)!==null&&c!==void 0?c:t,"data-testid":o}):null})})}var mn=te.forwardRef((n,e)=>{var{checked:t,children:r,className:i="",disabled:a=!1,inputClassName:o="",isInvalid:s=!1,labelClassName:l="",name:d,onChange:c,value:h,"data-testid":v}=n,[g]=R.useState(it());return u.jsxs("div",{className:K("custom-control custom-radio",i),children:[u.jsx("input",{type:"radio",id:g,"data-testid":v,name:d,ref:e,className:K("custom-control-input",o,{"is-invalid":s}),checked:t,disabled:a,value:h,onChange:c}),u.jsx("label",{className:K("custom-control-label",l),htmlFor:g,children:r})]})});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};const jt=mn,vd={"dh-spectrum-palette":"_dh-spectrum-palette_llwuf_1"},gd={"dh-spectrum-alias":"_dh-spectrum-alias_1906d_1"};function ni(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ni(Object(t),!0).forEach(function(r){fd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ni(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function fd(n,e,t){return e=md(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function md(n){var e=pd(n,"string");return typeof e=="symbol"?e:String(e)}function pd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ai=ii(ii({},vd),gd);function oi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oi(Object(t),!0).forEach(function(r){bd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bd(n,e,t){return e=wd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wd(n){var e=Cd(n,"string");return typeof e=="symbol"?e:String(e)}function Cd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var{global:Sd,light:yd,dark:Od,medium:Pd,large:Td}=yo,Id={global:Sd,light:vr(vr({},yd),ai),dark:vr(vr({},Od),ai),medium:Pd,large:Td};function Rd(n){var{children:e,isPortal:t=!1,theme:r=Id,colorScheme:i}=n,[a]=R.useState(t?it():null);return u.jsx(Oo,{UNSAFE_className:"spectrum-theme-provider",theme:r,colorScheme:i,"data-unique-id":a,children:e})}var Dd=fe.module("ThemeProvider"),La=R.createContext(null);function qv(n){var{themes:e,defaultPreloadValues:t=rs,children:r}=n,i=R.useMemo(()=>qo(),[]),[a,o]=R.useState(null),[s,l]=R.useState(()=>{var h,v;return(h=(v=Yo())===null||v===void 0?void 0:v.themeKey)!==null&&h!==void 0?h:Zo}),d=R.useMemo(()=>e==null?null:Qo(s,{base:i,custom:e??[]}),[i,s,e]),c=R.useMemo(()=>[...i,...e??[]],[i,e]);return R.useEffect(function(){if(!(d==null||e==null)){Jo(t);var v=es(t);Dd.debug2("updateThemePreloadData:",{active:d.map(g=>g.themeKey),custom:e.map(g=>g.themeKey),preloadStyleContent:v,selectedThemeKey:s}),ts({themeKey:s,preloadStyleContent:v})}},[d,s,e,t]),R.useEffect(()=>{o({activeThemes:d,selectedThemeKey:s,themes:c,setSelectedThemeKey:l})},[d,s,c]),u.jsxs(u.Fragment,{children:[d==null?null:u.jsx(u.Fragment,{children:d.map(h=>u.jsx("style",{"data-theme-key":h.themeKey,children:h.styleContent},h.themeKey))}),a==null?null:u.jsx(La.Provider,{value:a,children:u.jsx(Rd,{children:r})})]})}function Ed(){return va(La,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}var Md=["children","className","onChange","data-testid"];function si(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function li(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?si(Object(t),!0).forEach(function(r){xd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):si(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xd(n,e,t){return e=jd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jd(n){var e=kd(n,"string");return typeof e=="symbol"?e:String(e)}function kd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Nd(n,e){if(n==null)return{};var t=Ad(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Ad(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var Ha=te.forwardRef((n,e)=>{var{children:t,className:r,onChange:i,"data-testid":a}=n,o=Nd(n,Md),s=hn(e),l=R.useCallback(d=>{i(d.target.value)},[i]);return u.jsx("select",li(li({ref:s,className:K("custom-select",r),onChange:l,"data-testid":a},o),{},{children:t}))});Ha.displayName="Select";const or=Ha;function Vt(n,e,t){return e=Fd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fd(n){var e=Ld(n,"string");return typeof e=="symbol"?e:String(e)}function Ld(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $a extends R.PureComponent{constructor(e){super(e),Vt(this,"list",void 0),Vt(this,"topRow",void 0),Vt(this,"bottomRow",void 0),Vt(this,"getCachedItem",ge((t,r,i,a,o,s,l)=>{var d={height:o},c=a??i;return u.jsx("li",{className:"value-list-item",style:d,tabIndex:-1,children:u.jsx(Tt,{checked:s,disabled:l,onChange:()=>this.handleSelect(t),children:c})},r)},{max:1e3})),Vt(this,"getCachedItems",ge((t,r,i,a)=>{for(var o=[],s=0;s<t.length;s+=1){var l=t[s],{value:d,displayValue:c,isSelected:h}=l,v=i+s,g=v,f=this.getCachedItem(v,g,d,c,r,h,a);o.push(f)}return o},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=te.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){var{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){var{items:t,offset:r,onSelect:i}=this.props,a=e-r;if(a>=0&&a<t.length){var o=t[a],{value:s}=o;i(e,s)}else i(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,r=this.list.current.scrollTop,i=r+this.list.current.clientHeight,a=Math.floor(r/t),o=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==o)&&(this.topRow=a,this.bottomRow=o,e(a,o))}}getElement(e){if(this.list.current==null)return null;var t=this.list.current.querySelectorAll(".value-list-item");return t[e]}scrollIntoView(e){var t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){var{className:e,disabled:t,isInvalid:r,items:i,itemCount:a,offset:o,rowHeight:s,"data-testid":l}=this.props,d=this.getCachedItems(i,s,o,t);return u.jsx("div",{className:K("select-value-list-scroll-pane h-100 w-100",{"is-invalid":r},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:u.jsx("div",{className:"select-value-list",style:{height:a*s},children:u.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*s,top:o*s,left:0},children:d})})})}}Vt($a,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const Yv=$a;function Hd(){return va(ns,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Zv(n){switch(n){case oe.eq:return"is exactly";case oe.eqIgnoreCase:return"is exactly (ignore case)";case oe.notEq:return"is not exactly";case oe.notEqIgnoreCase:return"is not exactly (ignore case)";case oe.contains:return"contains";case oe.notContains:return"does not contain";case oe.startsWith:return"starts with";case oe.endsWith:return"ends with";default:throw new Error("Unrecognized text filter type ".concat(n))}}function Qv(n){switch(n){case oe.eq:return"is equal to";case oe.notEq:return"is not equal to";case oe.greaterThan:return"greater than";case oe.greaterThanOrEqualTo:return"greater than or equal to";case oe.lessThan:return"less than";case oe.lessThanOrEqualTo:return"less than or equal to";default:throw new Error("Unrecognized number filter type ".concat(n))}}function Jv(n){switch(n){case oe.eq:return"date is";case oe.notEq:return"date is not";case oe.notEqIgnoreCase:case oe.greaterThan:return"date is after";case oe.greaterThanOrEqualTo:return"date is after or equal";case oe.lessThan:return"date is before";case oe.lessThanOrEqualTo:return"date is before or equal";default:throw new Error("Unrecognized date filter type ".concat(n))}}function eg(n){switch(n){case oe.isTrue:return"Is True";case oe.isFalse:return"Is False";case oe.isNull:return"Is Null";default:throw new Error("Unrecognized boolean filter type ".concat(n))}}function $d(n){return typeof n=="object"&&n!=null&&"equals"in n&&typeof n.equals=="function"}function Bd(n){return"".concat(n)}function tg(n){var{column:e,table:t,filter:r=Ur,onChange:i,selectedValue:a,disabled:o,className:s,formatValue:l=Bd,maxSize:d=1e3}=n,c=Hd(),[h,v]=R.useState([]);R.useEffect(()=>{if(t==null){v([]);return}var p=e??t.columns[0];t.applyFilter(r);var b=t.setViewport(0,d,[p]);return b.addEventListener(c.Table.EVENT_UPDATED,S=>{var{detail:y}=S,P=y.rows.map(I=>I.get(p));v(P)}),()=>{b.close()}},[e,c,r,d,t]);var g=R.useMemo(()=>a===void 0?[void 0,...h]:h,[a,h]),f=R.useMemo(()=>g.findIndex(p=>p===a||$d(p)&&p.equals(a)),[a,g]),m=R.useCallback(p=>{i(g[p])},[i,g]);return u.jsx(or,{className:s,value:f,onChange:m,disabled:o,children:g.map((p,b)=>u.jsx(Fa,{value:b,children:l(p)},"".concat(b)))})}function di(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ui(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?di(Object(t),!0).forEach(function(r){Wd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):di(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wd(n,e,t){return e=_d(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _d(n){var e=Ud(n,"string");return typeof e=="symbol"?e:String(e)}function Ud(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ci=fe.module("Aggregations");function rg(n){var{isRollup:e,settings:t,onChange:r,onEdit:i}=n,{aggregations:a,showOnTop:o}=t,s=R.useMemo(()=>co.filter(D=>!a.some(x=>x.operation===D)),[a]),[l,d]=R.useState(s[0]),[c,h]=R.useState([]),v=R.useCallback(D=>{r(ui(ui({},t),D))},[r,t]),g=R.useCallback(D=>{v({aggregations:D})},[v]),f=R.useCallback(D=>{v({showOnTop:D})},[v]),m=R.useCallback(()=>{ci.debug("handleDragStart"),ht.startDragging()},[]),p=R.useCallback(D=>{var{destination:x,source:H}=D;if(ci.debug("handleDragEnd",x,H),ht.stopDragging(),x!==null){var T=x.index;H.index<x.index&&(T+=1);var O=[...a],w=ht.reorder(O,c,O,T),j=ht.adjustDestinationIndex(T,c),N=[[j,j+w.length-1]];g(O),h(N)}},[g,a,c,h]),b=R.useCallback(D=>{d(D)},[d]),S=R.useCallback(()=>{g([...a,{operation:l,selected:[],invert:!0}])},[a,l,g]),y=R.useCallback(D=>{g(a.filter((x,H)=>H!==D))},[a,g]),P=R.useCallback(D=>{h(D)},[h]),I=R.useCallback(D=>{var x=a[D];Pn.isRollupOperation(x.operation)||i(x)},[a,i]),E=R.useCallback(D=>{f(D.target.value==="true")},[f]);R.useEffect(function(){s.length>0&&!s.includes(l)&&d(s[0])},[s,l]);var A=R.useCallback(D=>{var{item:x,itemIndex:H,isClone:T=!1,selectedCount:O}=D,w=x.operation,j=T?"".concat(O):void 0,N=T?"item-list-item-clone":void 0,L=Pn.isRollupOperation(x.operation),W=!T&&!L;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:K("item-list-item-content","draggable-item-list-item-content",N),children:[u.jsxs("span",{className:"title",children:[w,!e&&L&&u.jsxs("span",{className:"small text-warning",children:[u.jsx(ce,{icon:is})," Requires rollup"]})]}),Ke.renderBadge({text:j}),Ke.renderHandle()]}),!T&&u.jsxs(u.Fragment,{children:[u.jsx(Q,{kind:"ghost",className:"btn-edit",icon:ba,tooltip:"Edit Columns",onClick:()=>i(x),disabled:!W}),u.jsx(Q,{kind:"ghost",className:"btn-delete",icon:sr,tooltip:"Delete Aggregation",onClick:()=>y(H)})]})]})},[y,i,e]),k=s.length>0,M=a.length>0;return u.jsxs("div",{className:"aggregations",children:[k&&u.jsxs("div",{className:"form-inline",children:[u.jsx(or,{onChange:b,value:l,children:s.map(D=>u.jsx(Fa,{value:D,children:D},D))}),u.jsxs("button",{type:"button",className:"btn btn-link btn-add",onClick:S,children:[u.jsx(ce,{icon:an}),"Add Aggregation"]})]}),k&&M&&u.jsx("hr",{}),M&&u.jsxs(u.Fragment,{children:[!e&&u.jsxs("div",{className:"form-inline",children:[u.jsx("label",{children:"Placement: "}),u.jsxs(fn,{onChange:E,value:"".concat(o),children:[u.jsx(jt,{value:"true",children:"Top"}),u.jsx(jt,{value:"false",children:"Bottom"})]})]}),u.jsx(rn,{onDragStart:m,onDragEnd:p,children:u.jsx(Ke,{className:"selected-aggregations",itemCount:a.length,items:a,renderItem:A,offset:0,onSelectionChange:P,onSelect:I,selectedRanges:c,isMultiSelect:!0})})]})]})}function hi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function pt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hi(Object(t),!0).forEach(function(r){Vd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Vd(n,e,t){return e=Gd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gd(n){var e=zd(n,"string");return typeof e=="symbol"?e:String(e)}function zd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ge;(function(n){n[n.NONE=0]="NONE",n[n.ASCENDING=1]="ASCENDING",n[n.DESCENDING=2]="DESCENDING"})(Ge||(Ge={}));var Kd=30;function ng(n){var{aggregation:e,columns:t,onChange:r}=n,[i,a]=R.useState(-1),[o,s]=R.useState(-1),[l,d]=R.useState(Ge.NONE),{invert:c,selected:h}=e,v=R.useRef(null),g=R.useCallback(E=>h.includes(E)?!c:c,[c,h]),f=R.useMemo(()=>{var E=ho(t,e.operation);return l!==Ge.NONE&&(E=Oe.sortColumns(E,l===Ge.ASCENDING)),E},[t,e.operation,l]),m=R.useMemo(()=>i>=0?f.slice(i,o+1).map(E=>({value:E.name,displayValue:E.name,isSelected:g(E.name)})):[],[f,g,o,i]),p=R.useCallback(E=>{var{name:A}=f[E],k=h.indexOf(A),M=[...h],D=c;k>=0?M.splice(k,1):(M.push(A),M.length===f.length&&(M=[],D=!c)),r(pt(pt({},e),{},{selected:M,invert:D}))},[e,c,f,h,r]),b=R.useCallback(()=>{d(Ge.NONE),r(pt(pt({},e),{},{selected:[],invert:!0}))},[e,r]),S=R.useCallback((E,A)=>{a(E),s(A)},[a,s]),y=R.useCallback(()=>{h.length===0?r(pt(pt({},e),{},{invert:!c})):r(pt(pt({},e),{},{selected:[],invert:!0}))},[e,c,r,h]),P=h.length===0?c:null,I=h.length!==0||!c||l!==Ge.NONE;return u.jsxs("div",{role:"menu",className:"aggregation-edit",children:[u.jsx("div",{className:"top-menu",children:u.jsxs("div",{className:"form-inline",children:[u.jsx(Tt,{checked:P,onChange:y,children:"Toggle All"}),u.jsx("div",{className:"spacer"}),u.jsx(Tr,{in:I,timeout:be.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(Q,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),u.jsx(Q,{kind:"ghost",className:K({active:l===Ge.ASCENDING}),icon:on,tooltip:"Sort ascending",onClick:()=>d(Ge.ASCENDING)}),u.jsx(Q,{kind:"ghost",className:K({active:l===Ge.DESCENDING}),icon:sn,tooltip:"Sort descending",onClick:()=>d(Ge.DESCENDING)})]})}),u.jsx("div",{className:"aggregation-edit-item-list",children:u.jsx(Ee,{itemCount:f.length,items:m,offset:i,renderItem:E=>{var{item:A}=E;return u.jsx(Tt,{checked:g(A.value),children:A.displayValue})},onSelect:p,onViewportChange:S,rowHeight:Kd,focusSelector:"input",ref:v})})]})}function vi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vi(Object(t),!0).forEach(function(r){Xd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xd(n,e,t){return e=qd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qd(n){var e=Yd(n,"string");return typeof e=="symbol"?e:String(e)}function Yd(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Zd(n){return u.jsx("svg",gi(gi({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:u.jsxs("g",{fill:"none",fillRule:"evenodd",children:[u.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u.jsx("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})}))}function fi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fi(Object(t),!0).forEach(function(r){Qd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):fi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qd(n,e,t){return e=Jd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jd(n){var e=eu(n,"string");return typeof e=="symbol"?e:String(e)}function eu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function tu(n){return u.jsx("svg",mi(mi({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:u.jsxs("g",{fill:"none",fillRule:"evenodd",children:[u.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u.jsx("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})}))}function pi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function bi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pi(Object(t),!0).forEach(function(r){ru(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ru(n,e,t){return e=nu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nu(n){var e=iu(n,"string");return typeof e=="symbol"?e:String(e)}function iu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function au(n){return u.jsx("svg",bi(bi({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:u.jsxs("g",{fill:"none",fillRule:"evenodd",children:[u.jsx("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),u.jsx("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),u.jsx("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})}))}function wi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ci(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wi(Object(t),!0).forEach(function(r){ou(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ou(n,e,t){return e=su(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function su(n){var e=lu(n,"string");return typeof e=="symbol"?e:String(e)}function lu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function du(n){return u.jsx("svg",Ci(Ci({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:u.jsxs("g",{fill:"none",fillRule:"evenodd",children:[u.jsx("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),u.jsx("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})}))}function Si(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Si(Object(t),!0).forEach(function(r){uu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Si(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function uu(n,e,t){return e=cu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cu(n){var e=hu(n,"string");return typeof e=="symbol"?e:String(e)}function hu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function vu(n){return u.jsx("svg",yi(yi({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:u.jsxs("g",{fill:"none",fillRule:"evenodd",children:[u.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u.jsx("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),u.jsx("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),u.jsx("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})}))}function Oi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Pi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oi(Object(t),!0).forEach(function(r){gu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Oi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gu(n,e,t){return e=fu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fu(n){var e=mu(n,"string");return typeof e=="symbol"?e:String(e)}function mu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ig(n){return u.jsxs("svg",Pi(Pi({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[u.jsx("rect",{width:"48",height:"48",fill:"none"}),u.jsx("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),u.jsx("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),u.jsx("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),u.jsx("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]}))}function Ti(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ti(Object(t),!0).forEach(function(r){pu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ti(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pu(n,e,t){return e=bu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bu(n){var e=wu(n,"string");return typeof e=="symbol"?e:String(e)}function wu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ag(n){return u.jsxs("svg",Ii(Ii({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[u.jsx("rect",{width:"48",height:"48",fill:"none"}),u.jsx("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),u.jsx("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),u.jsx("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]}))}var Ri=fe.module("ChartBuilder");class ze extends R.PureComponent{static getMaxSeriesCount(e,t){switch(t){case e.plot.SeriesPlotStyle.PIE:return 1;case e.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static makeSeriesItem(e){return{id:it.generate(),value:e}}static makeDefaultSeriesItems(e,t,r){var i=ze.getMaxSeriesCount(e,t);if(i===0||r==null||r.length===0)return[];var a=r.length>1?r[1].name:r[0].name;return[ze.makeSeriesItem(a)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),vo(this);var{model:t}=e,{columns:r,dh:i}=t,a=this.getTypes()[0],o=ze.getDefaultXAxis(a,r),s=ze.makeDefaultSeriesItems(i,a,r);this.state={type:a,seriesItems:s,xAxis:o,isLinked:!0}}getTypes(){var{model:e}=this.props,{dh:t}=e;return[t.plot.SeriesPlotStyle.LINE,t.plot.SeriesPlotStyle.BAR,t.plot.SeriesPlotStyle.SCATTER,t.plot.SeriesPlotStyle.PIE]}getTypeName(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.LINE:return"Line";case r.plot.SeriesPlotStyle.BAR:return"Bar";case r.plot.SeriesPlotStyle.SCATTER:return"Scatter";case r.plot.SeriesPlotStyle.PIE:return"Pie";case r.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}getTypeIcon(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.LINE:return u.jsx(au,{});case r.plot.SeriesPlotStyle.BAR:return u.jsx(Zd,{});case r.plot.SeriesPlotStyle.SCATTER:return u.jsx(vu,{});case r.plot.SeriesPlotStyle.PIE:return u.jsx(du,{});case r.plot.SeriesPlotStyle.HISTOGRAM:return u.jsx(tu,{});default:return null}}getXAxisLabel(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.PIE:return"Labels";case r.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}getSeriesLabel(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}handleAddSeries(){this.setState(e=>{var{seriesItems:t}=e,r=[...t],{model:i}=this.props,{columns:a}=i;return r.push({id:it.generate(),value:a[0].name}),{seriesItems:r}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){var{model:e}=this.props,{columns:t,dh:r}=e,i=this.getTypes()[0],a=ze.getDefaultXAxis(i,t),o=ze.makeDefaultSeriesItems(r,i,t),s=!0;this.setState({type:i,seriesItems:o,xAxis:a,isLinked:s},this.sendChange)}handleSeriesChange(e,t){var r=e;this.setState(i=>{var{seriesItems:a}=i;return a=[...a],a[t].value=r,{seriesItems:a}},this.sendChange)}handleSeriesDeleteClick(e){this.setState(t=>{var{seriesItems:r}=t,i=[...r];return i.splice(e,1),{seriesItems:i}},this.sendChange)}handleSubmit(e){e.preventDefault();var{onSubmit:t}=this.props,{type:r,seriesItems:i,xAxis:a,isLinked:o}=this.state,s=i.map(l=>l.value);t({type:r,series:s,xAxis:a,isLinked:o})}handleTypeClick(e){var t=this.getTypes()[e];Ri.debug2("handleTypeSelect",t),this.setState(r=>{var{model:i}=this.props,{dh:a}=i,o=ze.getMaxSeriesCount(a,t),{seriesItems:s}=r;if(s=s.slice(0,o),s.length===0&&o>0){var{columns:l}=i;s=ze.makeDefaultSeriesItems(a,t,l)}return{type:t,seriesItems:s}},this.sendChange)}handleXAxisChange(e){var t=e;Ri.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){var{onChange:e}=this.props,{isLinked:t,type:r,seriesItems:i,xAxis:a}=this.state,o=i.map(s=>s.value);e({type:r,series:o,xAxis:a,isLinked:t})}render(){var{model:e}=this.props,{columns:t,dh:r}=e,{seriesItems:i,type:a,xAxis:o,isLinked:s}=this.state,l=ze.getMaxSeriesCount(r,a),d=this.getXAxisLabel(a),c=this.getSeriesLabel(a),h=i.length>0,v=i.length<l;return u.jsx("div",{className:"chart-builder",children:u.jsxs("form",{onSubmit:this.handleSubmit,children:[u.jsxs("div",{className:"form-row",children:[u.jsx("label",{children:"Select Chart Type"}),u.jsx("div",{className:"form-row",children:this.getTypes().map((g,f)=>{var m=g;return u.jsx("div",{className:"col col-chart-type",children:u.jsxs("button",{type:"button",className:K("btn","btn-icon","btn-chart-type",{active:g===a}),onClick:()=>this.handleTypeClick(f),children:[this.getTypeIcon(g),this.getTypeName(g)]})},m)})})]}),u.jsx("hr",{}),u.jsxs("div",{className:"form-row form-inline",children:[u.jsx("label",{className:"col-2 label-left",children:d}),u.jsx(or,{className:"form-control select-x-axis col",value:o,onChange:this.handleXAxisChange,children:t.map(g=>u.jsx("option",{value:g.name,children:g.name},g.name))})]}),h&&u.jsx("hr",{}),i.map((g,f)=>u.jsxs("div",{className:"form-row form-inline form-series-item","data-testid":"form-series-item-".concat(f),children:[u.jsx("label",{className:"col-2 label-left",children:f===0?c:""}),u.jsx(or,{className:"form-control select-series col",value:g.value,onChange:m=>this.handleSeriesChange(m,f),"data-testid":"select-series-item-".concat(f),children:t.map(m=>u.jsx("option",{value:m.name,children:m.name},m.name))}),i.length>1&&u.jsx(Q,{kind:"ghost",className:"btn-delete-series ml-2 px-2","data-testid":"delete-series-".concat(f),onClick:()=>{this.handleSeriesDeleteClick(f)},icon:sr,tooltip:"Delete"})]},g.id)),v&&u.jsxs("div",{className:"form-row",children:[u.jsx("div",{className:"col-2"}),u.jsx(Q,{kind:"ghost",className:"btn-add-series mt-1",onClick:this.handleAddSeries,icon:an,children:"Add Series"})]}),u.jsxs("div",{className:"form-row chart-builder-link",children:[u.jsx("label",{className:"col-2 label-right",children:u.jsxs("div",{className:"fa-md fa-layers",children:[u.jsx(ce,{mask:as,icon:wa,transform:"right-5 down-5"}),u.jsx(ce,{icon:s?os:ss,transform:"grow-2 right-8 down-6"})]})}),u.jsxs(fn,{onChange:this.handleLinkStateChange,value:"".concat(s),children:[u.jsx(jt,{value:"true",children:"Sync State"}),u.jsx(jt,{value:"false",children:"Freeze State"})]})]}),u.jsxs("div",{className:"form-row",children:[u.jsx("div",{className:"col-2 label-right"}),u.jsx("div",{className:"col chart-builder-link-info",children:s?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),u.jsxs("div",{className:K("form-row","justify-content-end","my-3"),children:[u.jsx(Q,{kind:"secondary",className:"btn-reset",onClick:this.handleReset,children:"Reset"}),u.jsx(Q,{kind:"primary",type:"submit",className:"btn-submit",children:"Create"})]})]})})}}const og=ze;function Di(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Cu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Di(Object(t),!0).forEach(function(r){Rr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Di(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rr(n,e,t){return e=Su(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Su(n){var e=yu(n,"string");return typeof e=="symbol"?e:String(e)}function yu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ba extends R.Component{constructor(e){super(e),Rr(this,"editorContainer",void 0),Rr(this,"editor",void 0),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var e,{value:t,editorSettings:r}=this.props,i=Cu({copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0},r);if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=ct.create(this.editorContainer,i),this.editor.layout(),(e=this.editor.getModel())===null||e===void 0||e.updateOptions({tabSize:0}),this.editor.onKeyDown(this.handleKeyDown),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var e;(e=this.editor)===null||e===void 0||e.dispose(),this.editor=void 0}handleContentChanged(){var e,t,{onContentChanged:r}=this.props,i=(e=this.editor)===null||e===void 0||(t=e.getModel())===null||t===void 0?void 0:t.getValue();i!==void 0&&this.setState({isEditorEmpty:i.length===0}),r(i)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var e,t,r,i=(e=(t=this.editor)===null||t===void 0||(r=t.getModel())===null||r===void 0?void 0:r.getValue())!==null&&e!==void 0?e:"";this.setState({isEditorEmpty:i.length===0,isEditorFocused:!1})}handleContainerClick(){var e,{isEditorFocused:t}=this.state;t||(e=this.editor)===null||e===void 0||e.focus()}handleKeyDown(e){var{onTab:t,editorIndex:r}=this.props;e.code==="Tab"&&(e.stopPropagation(),e.preventDefault(),t(r,e.shiftKey))}render(){var{className:e,invalid:t,placeholder:r="",value:i}=this.props,{isEditorFocused:a,isEditorEmpty:o}=this.state;return u.jsxs("div",{className:K("input-editor-wrapper",{focused:a,invalid:t},e),role:"presentation",onClick:this.handleContainerClick,children:[u.jsx("div",{className:"editor-container",ref:s=>{this.editorContainer=s},"data-testid":"custom-column-formula"}),o&&!i&&r.length>0&&u.jsx("div",{className:"editor-placeholder text-muted",children:r})]})}}Rr(Ba,"defaultProps",{value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1});function Ei(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ei(Object(t),!0).forEach(function(r){Ou(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ei(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ou(n,e,t){return e=Pu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pu(n){var e=Tu(n,"string");return typeof e=="symbol"?e:String(e)}function Tu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mi=Object.freeze({NAME:"name",FORMULA:"formula"}),Iu=()=>{};function Ru(n){var{eventKey:e,name:t,inputIndex:r,formula:i,onChange:a,onDeleteColumn:o,onTabInEditor:s,invalid:l,isDuplicate:d}=n,c=t===""||ln.isValidColumnName(t),h=R.useCallback(v=>{v!==void 0&&(v.replace(/(\r\n|\n|\r)/gm,""),a(e,Mi.FORMULA,v))},[a,e]);return u.jsx(ma,{draggableId:e,index:r,disableInteractiveElementBlocking:!0,children:(v,g)=>u.jsxs("div",gr(gr({className:K("draggable-container",{dragging:g.isDragging}),ref:v.innerRef},v.draggableProps),{},{children:[u.jsxs("div",{className:"custom-column-input-container",children:[u.jsxs("div",{className:"pb-3",children:[u.jsxs("div",{className:"d-flex flex-row custom-column-name",children:[u.jsx("input",{className:K("form-control custom-column-input",{"is-invalid":l||!c||d}),placeholder:"Column Name",value:t,onChange:f=>{a(e,Mi.NAME,f.target.value)}}),u.jsx(Q,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{o(e)},icon:sr,tooltip:"Delete custom column"}),u.jsx(Q,gr(gr({kind:"ghost",className:"btn-drag-handle",onClick:Iu},v.dragHandleProps),{},{icon:nn,tooltip:"Drag column to re-order"}))]}),(!c||d)&&u.jsx("p",{className:"validate-label-error text-danger mb-0 mt-2 pl-1",children:c?"Duplicate name":"Invalid name"})]}),u.jsx(Ba,{editorSettings:{language:"deephavenDb"},editorIndex:r,placeholder:"Column Formula",value:i,onContentChanged:h,onTab:s,invalid:l})]}),u.jsx("hr",{})]}))})}function Te(n,e,t){return e=Du(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Du(n){var e=Eu(n,"string");return typeof e=="symbol"?e:String(e)}function Eu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function fr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yt.CACHE_SIZE,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Math.floor(e/2);if(n.size>e)for(var r=n.keys();n.size>t;)n.delete(r.next().value)}function xi(n,e,t,r,i){for(var a=new Map,o=0,s=0;s<n&&s<t;s+=1)a.set(s,o),o+=C(i,s);o=r;for(var l=0;l<e&&t-l-1>=0;l+=1)o-=C(i,t-l-1),a.set(t-l-1,o);return a}class Yt{constructor(){var{userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:r=new Map,calculatedRowHeights:i=new Map,fontWidths:a=new Map,modelRows:o=new Map,modelColumns:s=new Map,movedRows:l=[],movedColumns:d=[],initialRowHeights:c=new Map,initialColumnWidths:h=new Map}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Te(this,"initialRowHeights",void 0),Te(this,"initialColumnWidths",void 0),Te(this,"userColumnWidths",void 0),Te(this,"userRowHeights",void 0),Te(this,"calculatedColumnWidths",void 0),Te(this,"calculatedRowHeights",void 0),Te(this,"fontWidths",void 0),Te(this,"modelRows",void 0),Te(this,"modelColumns",void 0),Te(this,"movedRows",void 0),Te(this,"movedColumns",void 0),this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=i,this.calculatedColumnWidths=r,this.fontWidths=a,this.modelRows=o,this.modelColumns=s,this.movedRows=l,this.movedColumns=d,this.initialRowHeights=c,this.initialColumnWidths=h}getMetrics(e){var{left:t,top:r,leftOffset:i,topOffset:a,width:o,height:s,theme:l,model:d,movedRows:c,movedColumns:h,draggingColumn:v}=e,{rowHeight:g,rowHeaderWidth:f,rowFooterWidth:m,columnWidth:p,columnHeaderHeight:b,minScrollHandleSize:S,scrollBarSize:y}=l;c!==this.movedRows&&(this.movedRows=c,this.modelRows.clear()),h!==this.movedColumns&&(this.movedColumns=h,this.modelColumns.clear());var{columnCount:P,rowCount:I,floatingTopRowCount:E,floatingBottomRowCount:A,floatingLeftColumnCount:k,floatingRightColumnCount:M,columnHeaderMaxDepth:D}=d,x=this.getFirstRow(e),H=this.getFirstColumn(e),T=this.getGridX(e),O=this.getGridY(e),w=Xe(d)&&d.hasExpandableRows?this.calculateTreePaddingX(e):0,j=0,N=this.getVisibleRowHeights(e),L=this.getVisibleColumnWidths(e,H,w),W=Array.from(N.keys()),_=Array.from(L.keys()),F=new Map([...N,...this.getFloatingRowHeights(e)]),$=new Map([...L,...this.getFloatingColumnWidths(e)]),G=this.getVisibleColumnXs($,_,i),B=this.getVisibleRowYs(F,W,a),X=W.length>0?W[W.length-1]:r,z=_.length>0?_[_.length-1]:t,J=this.getBottomViewport(e,W,B,F),ae=this.getRightViewport(e,_,G,$),Y=this.getFloatingTopHeight(e,F),Z=this.getFloatingBottomHeight(e,F),me=this.getFloatingLeftWidth(e,$),he=this.getFloatingRightWidth(e,$),We=Array.from($.values()),Me=Array.from(F.values()),Pe=We.reduce((Dt,$r)=>Dt+$r,0)-i,we=Me.reduce((Dt,$r)=>Dt+$r,0)-a,xe=i+Pe+m,je=a+we,ke=o-T,Ne=s-O,vt=this.getLastLeft(e,null,ke-m),at=this.getLastLeft(e,null,ke-m-y),Zt=this.getLastTop(e,null,Ne-Z),Qt=this.getLastTop(e,null,Ne-Z-y),Ye=at,Ce=Qt;vt===0&&Zt===0&&(Ye=0,Ce=0);var ot=Ye>0,Ze=ot?y:0,_e=Ce>0,Qe=_e?y:0,Ft=T,st=D*b,Je=o-Ft-Qe,Ae=s-st-Ze,Lt=P===1?Je/xe:(P-Ye)/P,It=I===1?Ae/je:(I-Ce)/I,Rt=ot?$e(Je*Lt,S,Je-1):0,et=_e?$e(Ae*It,S,Ae-1):0,gt=C($,t,0),Jt=C(F,r,0),dr=gt>0?i/gt:0,Nr=Jt>0?a/Jt:0,Ar=P===1?i/(xe-ke):(t+dr)/Ye,Fr=I===1?a/(je-Ne):(r+Nr)/Ce,Lr=ot?Ar*(Je-Rt):0,de=_e?Fr*(Ae-et):0,bn=[...Array(E).keys(),...[...Array(A).keys()].map(Dt=>I-Dt-1)],Hr=new Map([...B,...this.getFloatingRowYs(e,F,Math.floor(s-O-Ze))]),wn=[...Array(k).keys(),...[...Array(M).keys()].map(Dt=>P-Dt-1)],er=new Map([...G,...this.getFloatingColumnXs(e,$,Math.floor(o-T-Qe))]),Cn=[];if(v)for(var ft=v.range[0];ft<=v.range[1];ft+=1)Cn.push(ft),$.has(ft)||$.set(ft,this.getVisibleColumnWidth(ft,e)),er.has(ft)||er.set(ft,0);var Sn=W.concat(bn),yn=_.concat(wn).concat(Cn),On=this.getModelRows(Sn,e),Qa=this.getModelColumns(yn,e),Ja=this.getVisibleRowTreeBoxes(F,On,e),eo=this.getTopVisible(e,Hr,F,W),to=this.getLeftVisible(e,er,$,_),ro=Ce>0?this.getBottomVisible(e,Hr,F,W,O):X,no=Ye>0?this.getRightVisible(e,er,$,_,T):z,{fontWidths:io,userColumnWidths:ao,userRowHeights:oo,calculatedRowHeights:so,calculatedColumnWidths:lo}=this;return{rowHeight:g,rowHeaderWidth:f,rowFooterWidth:m,rowCount:I,columnWidth:p,columnCount:P,columnHeaderHeight:b,floatingTopRowCount:E,floatingBottomRowCount:A,floatingLeftColumnCount:k,floatingRightColumnCount:M,gridX:T,gridY:O,firstRow:x,firstColumn:H,treePaddingX:w,treePaddingY:j,left:t,top:r,bottom:X,right:z,topOffset:a,leftOffset:i,topVisible:eo,leftVisible:to,bottomVisible:ro,rightVisible:no,bottomViewport:J,rightViewport:ae,width:o,height:s,maxX:Pe,maxY:we,lastLeft:Ye,lastTop:Ce,barHeight:Ae,barTop:st,barWidth:Je,barLeft:Ft,handleHeight:et,handleWidth:Rt,hasHorizontalBar:ot,hasVerticalBar:_e,verticalBarWidth:Qe,horizontalBarHeight:Ze,scrollX:Lr,scrollY:de,scrollableContentWidth:xe,scrollableContentHeight:je,scrollableViewportWidth:ke,scrollableViewportHeight:Ne,visibleRows:W,visibleColumns:_,visibleRowHeights:N,visibleColumnWidths:L,floatingRows:bn,floatingColumns:wn,allRows:Sn,allColumns:yn,allRowHeights:F,allColumnWidths:$,floatingTopHeight:Y,floatingBottomHeight:Z,floatingLeftWidth:me,floatingRightWidth:he,visibleRowYs:B,visibleColumnXs:G,allRowYs:Hr,allColumnXs:er,visibleRowTreeBoxes:Ja,modelRows:On,modelColumns:Qa,movedRows:c,movedColumns:h,fontWidths:io,userColumnWidths:ao,userRowHeights:oo,calculatedRowHeights:so,calculatedColumnWidths:lo,columnHeaderMaxDepth:D}}getGridX(e){var{theme:t}=e,{rowHeaderWidth:r}=t;return r}getGridY(e){var{theme:t,model:r}=e,{columnHeaderHeight:i}=t,{columnHeaderMaxDepth:a}=r;return a*i}getVisibleHeight(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{height:r,theme:i}=e,{scrollBarSize:a}=i,o=this.getGridY(e),s=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return r-s-l-o-a}getVisibleWidth(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{width:r,theme:i}=e,{scrollBarSize:a,rowFooterWidth:o}=i,s=this.getGridX(e),l=this.getFloatingRightWidth(e,t),d=this.getFloatingLeftWidth(e,t);return r-d-l-s-a-o}getFirstIndex(e,t,r){for(var i=e.size+1,a=0;a<i;a+=1){var o=t(a,r);if(e.get(o)!==0)return a}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t,r){var{model:i}=e,{columnCount:a,floatingRightColumnCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleColumnWidth(s,e);if(l+=d,l>=r)return $e(s+1,0,t??a-1);s-=1}return 0}getLastTop(e,t,r){var{model:i}=e,{rowCount:a,floatingBottomRowCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleRowHeight(s,e);if(l+=d,l>=r)return $e(s+1,0,a-1);s-=1}return 0}getTopForTopVisible(e,t){for(var r=this.getFloatingTopHeight(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleRowHeight(i,e);return i}getTopForBottomVisible(e,t){var{height:r}=e,i=this.getGridY(e),a=this.getFloatingBottomHeight(e),o=r-i-a;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){for(var r=this.getFloatingLeftWidth(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleColumnWidth(i,e);return i}getLeftForRightVisible(e,t){var{width:r}=e,i=this.getGridX(e),a=this.getFloatingRightWidth(e),o=r-i-a;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){for(var{model:t}=e,{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a}=t,o=new Map,s=0;s<r&&s<a;s+=1)o.set(s,this.getVisibleRowHeight(s,e));for(var l=0;l<i&&a-l-1>=0;l+=1){var d=a-l-1;o.set(d,this.getVisibleRowHeight(d,e))}return o}getVisibleRowHeights(e){for(var{top:t,topOffset:r,height:i,model:a}=e,o=0,s=t,l=new Map,{rowCount:d}=a;o<i+r&&s<d;){var c=this.getVisibleRowHeight(s,e);l.set(s,c),o+=c,s+=1}return l}getFloatingColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i,l=new Map,d=0;d<o&&d<a;d+=1)l.set(d,this.getVisibleColumnWidth(d,e,t,r));for(var c=0;c<s&&a-c-1>=0;c+=1){var h=a-c-1;l.set(h,this.getVisibleColumnWidth(h,e,t,r))}return l}getVisibleColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{left:i,leftOffset:a,width:o,model:s}=e,l=0,d=i,c=new Map,{columnCount:h}=s;l<o+a&&d<h;){var v=this.getVisibleColumnWidth(d,e,t,r);c.set(d,v),l+=v,d+=1}return c}getFloatingColumnXs(e,t,r){var{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i;return xi(o,s,a,r,t)}getVisibleColumnXs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=C(e,s);i.set(s,a),a+=l}return i}getFloatingRowYs(e,t,r){var{model:i}=e,{floatingTopRowCount:a,floatingBottomRowCount:o,rowCount:s}=i;return xi(a,o,s,r,t)}getVisibleRowYs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=C(e,s);i.set(s,a),a+=l}return i}getVisibleRowTreeBoxes(e,t,r){var i=new Map,{model:a,theme:o}=r,{treeDepthIndent:s,treeHorizontalPadding:l}=o;return Xe(a)&&a.hasExpandableRows&&e.forEach((d,c)=>{var h=C(t,c);if(a.isRowExpandable(h)){var v=a.depthForRow(h),g=v*s+l,f=(v+1)*s+l,m=0,p=d;i.set(c,{x1:g,y1:m,x2:f,y2:p})}}),i}getFloatingLeftWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingLeftColumnCount:i}=r,a=0,o=0;o<i;o+=1)a+=C(t,o);return a}getFloatingRightWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingRightColumnCount:i,columnCount:a}=r,o=0,s=0;s<i;s+=1)o+=C(t,a-s-1);return o}getFloatingTopHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingTopRowCount:i}=r,a=0,o=0;o<i;o+=1)a+=C(t,o);return a}getFloatingBottomHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingBottomRowCount:i,rowCount:a}=r,o=0,s=0;s<i;s+=1)o+=C(t,a-s-1);return o}getTopVisible(e,t,r,i){for(var a=this.getFloatingTopHeight(e,r),o=0;o<i.length;o+=1){var s=i[o],l=C(t,s);if(l>=a)return s}return 0}getLeftVisible(e,t,r,i){for(var a=this.getFloatingLeftWidth(e,r),o=0;o<i.length;o+=1){var s=i[o],l=C(t,s);if(l>=a)return s}return 0}getBottomVisible(e,t,r,i,a){for(var{height:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingBottomHeight(e,r),c=o-a-l-d,h=i.length-1;h>=0;h-=1){var v=i[h],g=C(t,v),f=C(r,v);if(g+f<=c)return v}return 0}getRightVisible(e,t,r,i,a){for(var{width:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingRightWidth(e,r),c=o-a-l-d,h=i.length-1;h>=0;h-=1){var v=i[h],g=C(t,v),f=C(r,v);if(g+f<=c)return v}return 0}getBottomViewport(e,t,r,i){var{height:a,theme:o}=e,{rowHeight:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getRightViewport(e,t,r,i){var{width:a,theme:o}=e,{columnWidth:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getLastIndexViewport(e,t,r,i,a){var o=0,s=0;return e.length>0&&(o=e[e.length-1],s=C(t,o)+C(r,o)),s<i&&(o+=Math.ceil((i-s)/a)),o}getVisibleItemSize(e,t,r){var i;return(i=t.get(e))!==null&&i!==void 0?i:r()}getVisibleRowHeight(e,t){var r=this.getModelRow(e,t),i=this.calculateRowHeight(e,r,t);return this.getVisibleItemSize(r,this.userRowHeights,()=>{var a=this.initialRowHeights.get(r);return a!==void 0?a:i})}getVisibleColumnWidth(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getFirstColumn(t),i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.calculateTreePaddingX(t),a=this.getModelColumn(e,t),o=this.calculateColumnWidth(e,a,t,r,i);return this.getVisibleItemSize(a,this.userColumnWidths,()=>{var s=this.initialColumnWidths.get(a);return s!==void 0?s:o})}getModelRows(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelRow(a,t);r.set(a,o)}return r}getModelRow(e,t){if(this.modelRows.has(e))return C(this.modelRows,e);var{movedRows:r}=t,i=le.getModelIndex(e,r);return this.modelRows.set(e,i),i}getModelColumns(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelColumn(a,t);r.set(a,o)}return r}getModelColumn(e,t){var r=this.modelColumns.has(e);if(r)return C(this.modelColumns,e);var{movedColumns:i}=t,a=le.getModelIndex(e,i);return this.modelColumns.set(e,a),a}calculateRowHeight(e,t,r){var{theme:i}=r,{autoSizeRows:a,rowHeight:o}=i;if(!a)return o;var s=this.calculatedRowHeights.get(t);return s??(this.calculatedRowHeights.set(t,Math.ceil(o)),fr(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.getFirstColumn(r),a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.calculateTreePaddingX(r),{theme:o}=r,{autoSizeColumns:s,minColumnWidth:l,maxColumnWidth:d}=o;if(!s){var{columnWidth:c}=o;return c}var h=this.calculateColumnHeaderWidth(t,r),v=this.calculateColumnDataWidth(t,r),g=this.calculatedColumnWidths.get(t),f=Math.ceil(Math.max(h,v));return f=Math.max(l,f),f=Math.min(d,f),g!=null&&g>f?f=g:(this.calculatedColumnWidths.set(t,f),fr(this.calculatedColumnWidths)),e===i&&(f+=a),f}calculateColumnHeaderWidth(e,t){var{model:r,theme:i}=t,{headerFont:a,headerHorizontalPadding:o}=i,s=r.textForColumnHeader(e,0);if(s!==void 0&&s!==""){var l=this.getWidthForFont(a,t);return s.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){var{top:r,height:i,width:a,model:o,theme:s}=t,{floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:c}=o,{font:h,cellHorizontalPadding:v,rowHeight:g,rowHeaderWidth:f,rowFooterWidth:m,scrollBarSize:p,dataBarHorizontalPadding:b}=s,S=0,y=this.getWidthForFont(h,t),P=i/g,I=Math.ceil(r+P);return le.iterateAllItems(r,I,l,d,c,E=>{var A=this.getModelRow(E,t),k=o.textForCell(e,A),M=o.renderTypeForCell(e,A),D=0;if(k){var x=v*2;D=k.length*y+x}M==="dataBar"&&(D+=b),S=Math.max(S,D)}),S=Math.max(Math.min(S,(a-f-p-m)*Yt.MAX_COLUMN_WIDTH),v*2),S}calculateTreePaddingX(e){var{top:t,height:r,model:i,theme:a}=e,{rowHeight:o,treeDepthIndent:s}=a;if(!Xe(i)||!i.hasExpandableRows)return 0;for(var l=0,d=r/o,c=Math.ceil(t+d),h=t;h<=c;h+=1){var v=this.getModelRow(h,e),g=i.depthForRow(v);l=Math.max(l,s*(g+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return C(this.fontWidths,e);var{context:r}=t;r.font=e;var i=r.measureText("8"),{width:a}=i;return this.fontWidths.set(e,a),this.fontWidths.set(r.font,a),a}setColumnWidth(e,t){var r=new Map(this.userColumnWidths);r.set(e,Math.ceil(t)),fr(r),this.userColumnWidths=r}resetColumnWidth(e){var t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){var r=new Map(this.userRowHeights);r.set(e,Math.ceil(t)),fr(r),this.userRowHeights=r}resetRowHeight(e){var t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}}Te(Yt,"CACHE_SIZE",1e4);Te(Yt,"MAX_COLUMN_WIDTH",.8);var Mu=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",black:"#000000",white:"#ffffff",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans-serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans-serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,activeCellSelectionBorderWidth:2,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowAlpha:.15,shadowColor:"#000000",textColor:"#ffffff",hyperlinkColor:"#4878ea",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,maxColumnWidth:600,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc",zeroLineColor:"#888888",positiveBarColor:"#00ff00",negativeBarColor:"#ff0000",markerBarColor:"#ffffff",dataBarHorizontalPadding:90});const xu=Mu;function ju(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6,r=Vr.hex.lab.raw(n),i=r[0]<50?17:10;return r[0]=Math.max(r[0]-i/t*e,0),"#".concat(Vr.lab.hex(r))}function ku(n,e){var[t,r,i]=Vr.hex.rgb(n);return"rgba(".concat(t,", ").concat(r,", ").concat(i,", ").concat(e,")")}var Nu=n=>{var{r:e,g:t,b:r}=n,i=.4122214708*e+.5363325363*t+.0514459929*r,a=.2119034982*e+.6806995451*t+.1073969566*r,o=.0883024619*e+.2817188376*t+.6299787005*r,s=Math.cbrt(i),l=Math.cbrt(a),d=Math.cbrt(o);return{L:.2104542553*s+.793617785*l-.0040720468*d,a:1.9779984951*s-2.428592205*l+.4505937099*d,b:.0259040371*s+.7827717662*l-.808675766*d}},Au=n=>{var{L:e,a:t,b:r}=n,i=e+.3963377774*t+.2158037573*r,a=e-.1055613458*t-.0638541728*r,o=e-.0894841775*t-1.291485548*r,s=i*i*i,l=a*a*a,d=o*o*o;return{r:$e(4.0767416621*s-3.3077115913*l+.2309699292*d,0,255),g:$e(-1.2684380046*s+2.6097574011*l-.3413193965*d,0,255),b:$e(-.0041960863*s-.7034186147*l+1.707614701*d,0,255)}},Fu=n=>{var e,t,r=(e=(t=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,o,s)=>"#".concat(a).concat(a).concat(o).concat(o).concat(s).concat(s)).substring(1).match(/.{2}/g))===null||t===void 0?void 0:t.map(i=>parseInt(i,16)))!==null&&e!==void 0?e:[0,0,0];return{r:r[0],g:r[1],b:r[2]}},Lu=n=>{var e=Math.round(n.r),t=Math.round(n.g),r=Math.round(n.b);return"#".concat([e,t,r].map(i=>{var a=i.toString(16);return a.length===1?"0".concat(a):a}).join(""))},Hu=(n,e,t)=>{var{L:r,a:i,b:a}=n,{L:o,a:s,b:l}=e,d=r+(o-r)*t,c=i+(s-i)*t,h=a+(l-a)*t;return{L:d,a:c,b:h}};const Mt={colorWithAlpha:ku,darkenForDepth:ju,linearSRGBToOklab:Nu,OklabToLinearSRGB:Au,hexToRgb:Fu,rgbToHex:Lu,lerpColor:Hu};function ji(n,e,t){return e=$u(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $u(n){var e=Bu(n,"string");return typeof e=="symbol"?e:String(e)}function Bu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Wu{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;ji(this,"order",void 0),ji(this,"cursor",null),this.order=e}onDown(e,t,r){return!1}onMove(e,t,r){return!1}onDrag(e,t,r){return!1}onLeave(e,t,r){return!1}onClick(e,t,r){return!1}onContextMenu(e,t,r){return!1}onDoubleClick(e,t,r){return!1}onUp(e,t,r){return!1}onWheel(e,t,r){return!1}}function tr(n,e,t){return e=_u(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _u(n){var e=Uu(n,"string");return typeof e=="symbol"?e:String(e)}function Uu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vu extends Wu{constructor(){super(...arguments),tr(this,"draggingIndex",void 0),tr(this,"resizingItems",[]),tr(this,"hiddenItems",[]),tr(this,"targetSizes",new Map),tr(this,"dragOffset",0)}onDown(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);if(o!=null){var s=o.index;return this.dragOffset=0,this.draggingIndex=s,this.resizingItems=[s],this.hiddenItems=this.getHiddenItems(s,r).reverse(),this.targetSizes.clear(),this.addTargetSize(r,s),this.updateCursor(r,s),this.updateSeparator(t,o),!0}return!1}onMove(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);return o!=null?(this.updateCursor(r,o.index),!0):!1}onDrag(e,t){if(this.draggingIndex==null)return!1;var r=e[this.pointProperty],{metricCalculator:i,metrics:a}=t;if(!a)throw new Error("metrics not set");for(var o=t.getTheme(),s=a[this.visibleOffsetProperty],l=a[this.marginProperty],d=a[this.calculatedSizesProperty],c=a[this.modelIndexesProperty],h=a[this.firstIndexProperty],v=a[this.treePaddingProperty],g=new Map,f=this.resizingItems[this.resizingItems.length-1];f!=null;){var m=C(s,f),p=r-l-m-this.dragOffset,b=C(c,f),S=this.targetSizes.get(b),y=this.resizingItems.length>1,P=this.hiddenItems.indexOf(f),I=C(d,b);f===h&&(I+=v);var E=p;if(Math.abs(p-I)<=o.headerResizeSnapThreshold?E=I:S!==void 0&&p>S&&(y&&P!==0||P>0)?E=S:p<=o.headerResizeHiddenSnapThreshold&&(E=0),g.set(b,E),p<-o.headerResizeSnapThreshold&&E===0)if(P>=0&&y){var A;this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(A=this.targetSizes.get(C(c,f)))!==null&&A!==void 0?A:0}else f=this.getNextShownItem(f,a),f!==null&&(this.resizingItems.push(f),this.addTargetSize(a,f));else S!==void 0&&p>S+o.headerResizeSnapThreshold&&E===S?P>0?(this.dragOffset+=E,f=this.hiddenItems[P-1],this.resizingItems.push(f),this.addTargetSize(a,f)):y?(this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1]):f=null:f=null}return g.forEach((k,M)=>{var D,x=(D=i[this.initialSizesProperty].get(M))!==null&&D!==void 0?D:d.get(M);k===x?this.resetSize(i,M):this.setSize(i,M,k)}),this.updateCursor(a,this.draggingIndex),!0}onUp(e,t){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(t,null)),!1}onDoubleClick(e,t){var{metrics:r,metricCalculator:i}=t,{model:a}=t.props,o=t.getTheme();if(!r)throw new Error("metrics not set");var s=this.getSeparator(e,r,a,o);if(s!=null){var l=r[this.modelIndexesProperty],d=C(l,s.index),c=C(r[this.calculatedSizesProperty],d),h=i[this.initialSizesProperty].get(d);return c===h?this.resetSize(i,d):this.setSize(i,d,c),t.forceUpdate(),!0}return!1}updateCursor(e,t){var r=e[this.visibleSizesProperty],i=C(r,t);i===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(e,t){var r=e[this.modelIndexesProperty],i=e[this.userSizesProperty],a=e[this.calculatedSizesProperty],o=t===0?e[this.treePaddingProperty]:0,s=C(r,t),l=i.get(s);(l==null||l===0)&&(l=C(a,s)+o),this.targetSizes.set(s,l)}removeTargetSize(e,t){var r=e[this.modelIndexesProperty],i=C(r,t);this.targetSizes.delete(i)}}const Gu=Vu;function Se(n,e,t){return e=zu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zu(n){var e=Ku(n,"string");return typeof e=="symbol"?e:String(e)}function Ku(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pn extends Gu{constructor(){super(...arguments),Se(this,"hiddenCursor","e-resize"),Se(this,"defaultCursor","col-resize"),Se(this,"pointProperty","x"),Se(this,"userSizesProperty","userColumnWidths"),Se(this,"visibleOffsetProperty","visibleColumnXs"),Se(this,"visibleSizesProperty","visibleColumnWidths"),Se(this,"marginProperty","rowHeaderWidth"),Se(this,"calculatedSizesProperty","calculatedColumnWidths"),Se(this,"initialSizesProperty","initialColumnWidths"),Se(this,"modelIndexesProperty","modelColumns"),Se(this,"firstIndexProperty","firstColumn"),Se(this,"treePaddingProperty","treePaddingX"),Se(this,"getHiddenItems",le.getHiddenColumns),Se(this,"getNextShownItem",le.getNextShownColumn),Se(this,"getSeparator",pn.getColumnSeparator)}static getColumnSeparator(e,t,r,i){if(!i.allowColumnResize)return null;var{x:a,y:o,columnHeaderDepth:s}=e,{modelColumns:l}=t,d=le.getColumnSeparatorIndex(a,o,t,i);if(d==null||s==null||s>0)return null;var c=l.get(d);return c!=null?{index:d,depth:0}:null}setSize(e,t,r){e.setColumnWidth(t,r)}resetSize(e,t){e.resetColumnWidth(t)}updateSeparator(e,t){e.setState({draggingColumnSeparator:t,isDragging:t!==null})}}const Xu=pn;var Nt=10;function qu(n,e,t){return e=Yu(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yu(n){var e=Zu(n,"string");return typeof e=="symbol"?e:String(e)}function Zu(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qu{constructor(){qu(this,"getCachedTruncatedString",Pt((e,t,r,i,a)=>kt.truncateToWidth(e,t,r,i,a),{max:1e4}))}drawCellRowTreeMarker(e,t,r){var{metrics:i,model:a,mouseX:o,mouseY:s,theme:l}=t,{firstColumn:d,gridX:c,gridY:h,allColumnXs:v,allColumnWidths:g,allRowYs:f,allRowHeights:m,visibleRowTreeBoxes:p}=i,{treeMarkerColor:b,treeMarkerHoverColor:S}=l,y=C(v,d),P=C(g,d),I=C(f,r),E=C(m,r);if(!(!Xe(a)||!a.isRowExpandable(r))){var A=C(p,r),k=o!=null&&s!=null&&o>=c+y&&o<=c+y+P&&s>=h+I&&s<=h+I+E?S:b;this.drawTreeMarker(e,t,y,I,A,k,a.isRowExpanded(r))}}drawTreeMarker(e,t,r,i,a,o,s){var{x1:l,y1:d,x2:c,y2:h}=a,v=s?"⊟":"⊞",g=r+(l+c)*.5+.5,f=i+(d+h)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(v,g,f)}}const Wa=Qu;function ki(n){return(n==null?void 0:n.dataBarOptionsForCell)!==void 0}function Ni(n,e,t){return e=Ju(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ju(n){var e=ec(n,"string");return typeof e=="symbol"?e:String(e)}function ec(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class tc extends Wa{constructor(){super(...arguments),Ni(this,"heightOfDigits",void 0),Ni(this,"getCachedWidestValueForColumn",Pt((e,t,r,i,a)=>{for(var o=0,s=0;s<t.length;s+=1){var l=t[s],d=C(r,l),c=i.textForCell(a,d);o=Math.max(o,e.measureText(c).width)}return o},{max:1e3}))}drawCellContent(e,t,r,i){var a,{metrics:o,model:s,theme:l}=t;if(ki(s)){var{modelColumns:d,modelRows:c,allRowHeights:h,allRowYs:v,firstColumn:g,fontWidths:f}=o,m=r===g,p=C(h,i),b=C(c,i),S=C(d,r),y=C(v,i),P=s.textAlignForCell(S,b),I=s.textForCell(S,b),{x:E,width:A}=le.getTextRenderMetrics(t,r,i),k=(a=f==null?void 0:f.get(e.font))!==null&&a!==void 0?a:Nt,M=s.truncationCharForCell(S,b),D=this.getCachedTruncatedString(e,I,A,k,M),{columnMin:x,columnMax:H,axis:T,color:O,valuePlacement:w,opacity:j,markers:N,direction:L,value:W}=s.dataBarOptionsForCell(S,b,l),_=Array.isArray(O);if(!(x==null||H==null)){var{maxWidth:F,x:$,y:G,zeroPosition:B,leftmostPosition:X,markerXs:z,totalValueRange:J,dataBarWidth:ae}=this.getDataBarRenderMetrics(e,t,r,i);if(this.heightOfDigits===void 0){var{actualBoundingBoxAscent:Y,actualBoundingBoxDescent:Z}=e.measureText("1234567890");this.heightOfDigits=Y+Z}if(e.save(),e.textAlign=P,_){var me=W>=0?O[O.length-1]:O[0];e.fillStyle=me}else e.fillStyle=O;if(e.textBaseline="top",e.font=l.font,w!=="hide"&&e.fillText(D,E,y+(p-this.heightOfDigits)/2),_){var he=O.map(et=>Mt.linearSRGBToOklab(Mt.hexToRgb(et)));if(e.save(),e.beginPath(),e.roundRect($,G,ae,p-2,1),e.clip(),W<0){if(L==="LTR")for(var We=Math.round(Math.abs(x)/J*F),Me=We/(O.length-1),Pe=Math.round(X),we=0;we<O.length-1;we+=1){var xe=he[we],je=he[we+1];this.drawGradient(e,xe,je,Pe,y+1,Me,p),Pe+=Me}else if(L==="RTL")for(var ke=Math.round(F-Math.abs(H)/J*F),Ne=ke/(O.length-1),vt=Math.round(B),at=O.length-1;at>0;at-=1){var Zt=he[at],Qt=he[at-1];this.drawGradient(e,Zt,Qt,vt,y+1,Ne,p),vt+=Ne}}else if(L==="LTR")for(var Ye=Math.round(F-Math.abs(x)/J*F)-1,Ce=Ye/(O.length-1),ot=Math.round(B),Ze=0;Ze<O.length-1;Ze+=1){var _e=he[Ze],Qe=he[Ze+1];this.drawGradient(e,_e,Qe,ot,y+1,Ce,p-2),ot+=Ce}else if(L==="RTL")for(var Ft=Math.round(Math.abs(H)/J*F),st=Ft/(O.length-1),Je=Math.round(X),Ae=O.length-1;Ae>0;Ae-=1){var Lt=he[Ae],It=he[Ae-1];this.drawGradient(e,Lt,It,Je,y+1,st,p-2),Je+=st}e.restore()}else e.save(),e.globalAlpha=j,e.beginPath(),e.roundRect($,G,ae,p-2,1),e.fill(),e.restore();F>0&&z.forEach((et,gt)=>{e.fillStyle=N[gt].color,e.fillRect(et,G,1,p-2)});var Rt=!(T==="directional"&&(w==="beside"&&P==="right"&&L==="LTR"||w==="beside"&&P==="left"&&L==="RTL"||w!=="beside"));Rt&&(e.strokeStyle=l.zeroLineColor,e.beginPath(),e.setLineDash([2,1]),e.moveTo(B,y),e.lineTo(B,y+p),e.stroke()),e.restore(),m&&Xe(s)&&s.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}}}getDataBarRenderMetrics(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(!ki(o))throw new Error("Grid model is not a data bar grid model");var{firstColumn:l,allColumnXs:d,allColumnWidths:c,allRowYs:h,modelColumns:v,modelRows:g,visibleRows:f}=a,{cellHorizontalPadding:m,treeDepthIndent:p,treeHorizontalPadding:b}=s,S=C(v,r),y=C(g,i),P=C(d,r),I=C(h,i),E=C(c,r),A=r===l,k=0;Xe(o)&&o.hasExpandableRows&&A&&(k=p*(o.depthForRow(i)+1)+b);var M=o.textAlignForCell(S,y),{columnMin:D,columnMax:x,axis:H,valuePlacement:T,markers:O,direction:w,value:j}=o.dataBarOptionsForCell(S,y,s),N=this.getCachedWidestValueForColumn(e,f,g,o,S),L=2,W=T==="beside"&&M==="right"?2:1,_=x-D;x>=0&&D>=0||D===x?_=x:x<=0&&D<=0&&(_=Math.abs(D));var F=E-k-W-L;T==="beside"&&(F=F-m-N),F<0&&(F=0);var $=Math.max(Math.abs(D),Math.abs(x)),G=Math.abs(j)/_*F;F===0?G=0:H==="middle"?G=Math.abs(j)/$*(F/2):H==="directional"&&(G=Math.abs(j)/$*F);var B=D>=0?0:Math.abs(D)/_*F,X=j>=0?B:B-Math.abs(j)/_*F,z=O.map(Y=>{var{value:Z}=Y,me=Math.abs(Z)/_*F;return Z>=0?B+me:B-me}),J=T==="beside"&&M==="left"?m+N+L:L,ae=T==="beside"&&M==="right"?E-m-N-W:W;return w==="RTL"&&(B=D>=0?E:E-Math.abs(D)/_*F,X=j>=0?B-j/_*F:B,z=O.map(Y=>{var{value:Z}=Y;return Z>=0?B-Math.abs(Z)/_*F:B+Math.abs(Z)/_*F})),H==="middle"?(B=F/2,w==="LTR"?(X=j>=0?B:B-Math.abs(j)/$*(F/2),z=O.map(Y=>{var{value:Z}=Y;return Z>=0?B+Math.abs(Z)/$*(F/2):B-Math.abs(Z)/$*(F/2)})):w==="RTL"&&(X=j<=0?B:B-Math.abs(j)/$*(F/2),z=O.map(Y=>{var{value:Z}=Y;return Z<=0?B+Math.abs(Z)/$*(F/2):B-Math.abs(Z)/$*(F/2)}))):H==="directional"&&(w==="LTR"?(B=0,X=B,z=O.map(Y=>{var{value:Z}=Y;return B+Math.abs(Z)/$*F})):w==="RTL"&&(B=E,X=B-Math.abs(j)/$*F,z=O.map(Y=>{var{value:Z}=Y;return B-Math.abs(Z)/$*F}))),w==="LTR"?(B+=P+L+k,X+=P+L+k,z=z.map(Y=>Y+P+L+k),T==="beside"&&M==="left"&&(B+=N+m,X+=N+m,z=z.map(Y=>Y+N+m))):w==="RTL"&&(B=B+P-W,X=X+P-W,z=z.map(Y=>Y+P-W),T==="beside"&&M==="right"&&(B=B-m-N,X=X-m-N,z=z.map(Y=>Y-m-N))),J+=P+k,ae+=P,{maxWidth:F,x:X,y:I+1.5,zeroPosition:B,leftmostPosition:J,rightmostPosition:ae,totalValueRange:_,dataBarWidth:G,markerXs:z}}drawGradient(e,t,r,i,a,o,s){for(var l=t,d=i;d<=i+o;d+=.5)this.drawGradientPart(e,d,a,1,s,Mt.rgbToHex(Mt.OklabToLinearSRGB(l))),l=Mt.lerpColor(t,r,(d-i)/o)}drawGradientPart(e,t,r,i,a,o){e.fillStyle=o,e.fillRect(t,r,i,a)}}const _a=tc;function rc(n,e,t){return e=nc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nc(n){var e=ic(n,"string");return typeof e=="symbol"?e:String(e)}function ic(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ac extends Wa{constructor(){super(...arguments),rc(this,"getCachedTokenBoxesForVisibleCell",Pt((e,t,r,i,a,o)=>{for(var s=0,l=a,d=[],c=0,h=0,v=0;v<t.length;v+=1){var g=t[v],{start:f,end:m}=g,p=m>e.length?e.substring(f):g.value;h+=o.measureText(e.substring(c,f)).width;var b=o.measureText(p).width,S=h,y=S+b,P={x1:S,y1:s,x2:y,y2:l,token:g};d.push(P),c=m,h+=b}return d},{max:1e4}))}drawCellContent(e,t,r,i){var{metrics:a,model:o,theme:s}=t,{fontWidths:l,modelColumns:d,modelRows:c,allRowHeights:h,firstColumn:v}=a,g=r===v,{textColor:f}=s,m=C(h,i),p=C(c,i),b=C(d,r),S=o.textForCell(b,p),y=o.truncationCharForCell(b,p);if(S&&m>0){var P,I=o.textAlignForCell(b,p)||"left";e.textAlign=I;var E=o.colorForCell(b,p,s)||f;e.fillStyle=E,e.save();var{width:A,x:k,y:M}=le.getTextRenderMetrics(t,r,i),D=(P=l.get(e.font))!==null&&P!==void 0?P:Nt,x=this.getCachedTruncatedString(e,S,A,D,y),H=o.tokensForCell(b,p,x.length);if(x)for(var T=0,O=0,w=k,{actualBoundingBoxDescent:j}=e.measureText(x);O<x.length;){var N,L,W=H[T],_=O===(W==null?void 0:W.start)?W:null,F=(N=(L=_==null?void 0:_.end)!==null&&L!==void 0?L:W==null?void 0:W.start)!==null&&N!==void 0?N:x.length,$=x.substring(O,F),{width:G}=e.measureText($),B=$.endsWith("…")?e.measureText($.substring(0,$.length-1)).width:G;_!=null?(e.fillStyle=s.hyperlinkColor,e.fillText($,w,M),e.fillRect(w,M+j,B,1)):(e.fillStyle=E,e.fillText($,w,M)),w+=G,O=F,_!=null&&(T+=1)}e.restore()}g&&Xe(o)&&o.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}getTokenBoxesForVisibleCell(e,t,r){var i,{metrics:a,context:o,model:s,theme:l}=r;if(o==null||a==null)return Ur;var{modelRows:d,modelColumns:c}=a,h=C(d,t),v=C(c,e),g=s.textForCell(v,h),{width:f,x:m,y:p}=le.getTextRenderMetrics(r,e,t),{fontWidths:b}=a;o.save(),this.configureContext(o,r);var S=(i=b==null?void 0:b.get(o.font))!==null&&i!==void 0?i:Nt,y=s.truncationCharForCell(v,h),P=this.getCachedTruncatedString(o,g,f,S,y),{actualBoundingBoxAscent:I,actualBoundingBoxDescent:E}=o.measureText(P),A=I+E,k=s.tokensForCell(v,h,P.length);if(k.length===0)return o.restore(),Ur;var M=this.getCachedTokenBoxesForVisibleCell(P,k,l.font,"middle",A,o).map(D=>({x1:D.x1+m,y1:D.y1+(p-I),x2:D.x2+m,y2:D.y2+(p-I),token:D.token}));return o.restore(),M}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}}const Ua=ac;function Gt(n,e,t){return e=oc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oc(n){var e=sc(n,"string");return typeof e=="symbol"?e:String(e)}function sc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class kt{constructor(){Gt(this,"textCellRenderer",new Ua),Gt(this,"dataBarCellRenderer",new _a),Gt(this,"getCachedBackgroundColors",Pt((e,t)=>e.split(" ").map(r=>{for(var i=[],a=0;a<t;a+=1)i.push(Mt.darkenForDepth(r,a,t));return i}),{max:1e3})),Gt(this,"getCachedColorWithAlpha",Pt((e,t)=>Mt.colorWithAlpha(e,t),{max:1e3})),Gt(this,"getCachedColorIsDark",Pt(e=>Ca.isDark(e),{max:1e3}))}static truncate(e,t){return t<e.length?e.substr(0,t)+"…":e}static binaryTruncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:t.length,o=arguments.length>5?arguments[5]:void 0;if(a>=t.length&&e.measureText(t).width<=r)return t;if(o!==void 0){var s=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(r/s)))}for(var l=i,d=Math.min(t.length-1,a),c=t;d>=l;){var h=Math.ceil((d+l)/2),v=kt.truncate(t,h);if(e.measureText(v).width<=r){if(c=v,l===h)break;l=h}else if(h===0){c=v;break}else d=h-1}return c}static truncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Nt,a=arguments.length>4?arguments[4]:void 0;if(r<=0||t.length<=0)return"";var o=Math.min(Math.max(0,Math.floor(r/i/2)-5),t.length),s=Math.min(Math.ceil(r/i*2),t.length);return kt.binaryTruncateToWidth(e,t,r,o,s,a)}drawCanvas(e){var{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){var{theme:r,metrics:i}=t,{width:a,height:o}=i;e.fillStyle=r.backgroundColor,e.fillRect(0,0,a,o)}drawGrid(e,t){var{metrics:r,draggingRow:i,draggingColumn:a}=t,{gridX:o,gridY:s}=r;e.translate(o,s),this.drawGridBackground(e,t,i==null&&a==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-s)}drawFloatingRows(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingTopRowCount:s,floatingBottomRowCount:l,floatingRows:d,rowCount:c,visibleColumns:h,allRowYs:v,allRowHeights:g}=a;if(d.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,d,o.floatingRowBackgroundColors),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,h,d,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,h,d),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{top:0,bottom:s-1,maxY:C(v,s-1)+C(g,s-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:c-l-1,bottom:c-1,minY:C(v,c-l)+.5,maxY:C(v,c-1)+C(g,c-1)-.5});for(var f=0;f<h.length;f+=1)for(var m=h[f],p=0;p<d.length;p+=1){var b=d[p];this.drawCellContent(e,t,m,b)}}}drawFloatingColumns(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingLeftColumnCount:s,floatingRightColumnCount:l,floatingLeftWidth:d,floatingRightWidth:c,floatingColumns:h,gridX:v,maxX:g,columnCount:f,visibleRows:m,allColumnXs:p,allColumnWidths:b,width:S,height:y}=a;if(h.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,m,o.floatingRowBackgroundColors,0,d),this.drawRowStripesForRows(e,t,m,o.floatingRowBackgroundColors,S-v-c,g)),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,d,y),e.clip(),this.drawGridLinesForItems(e,t,h,m,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,h,m),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{left:0,maxX:C(p,s-1)+C(b,s-1)}),l>0&&this.drawSelectedRanges(e,t,{left:f-l,right:f-1,minX:C(p,f-l)+.5,maxX:C(p,f-1)+C(b,f-1)});for(var P=0;P<h.length;P+=1)for(var I=h[P],E=0;E<m.length;E+=1){var A=m[E];this.drawCellContent(e,t,I,A)}}}drawFloatingBorders(e,t){var{metrics:r,theme:i}=t,{floatingTopRowCount:a,floatingBottomRowCount:o,floatingLeftColumnCount:s,floatingRightColumnCount:l,rowCount:d,columnCount:c,allRowYs:h,allColumnXs:v,allRowHeights:g,allColumnWidths:f,maxX:m,maxY:p}=r,{floatingDividerOuterColor:b,floatingDividerInnerColor:S}=i;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,a>0){var y=C(h,a-1)+C(g,a-1)+.5;e.moveTo(0,y),e.lineTo(m,y)}if(o>0){var P=C(h,d-o)-.5;e.moveTo(0,P),e.lineTo(m,P)}if(s>0){var I=C(v,s-1)+C(f,s-1)+.5;e.moveTo(I,0),e.lineTo(I,p)}if(l>0){var E=C(v,c-l)-.5;e.moveTo(E,0),e.lineTo(E,p)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=S,a>0){var A=C(h,a-1)+C(g,a-1)+.5;e.moveTo(0,A),e.lineTo(m,A)}if(o>0){var k=C(h,d-o)-.5;e.moveTo(0,k),e.lineTo(m,k)}if(s>0){var M=C(v,s-1)+C(f,s-1)+.5;e.moveTo(M,0),e.lineTo(M,p)}if(l>0){var D=C(v,c-l)-.5;e.moveTo(D,0),e.lineTo(D,p)}e.stroke()}drawGridBackground(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.drawRowStripes(e,t),r&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);var{metrics:i}=t,{bottom:a,right:o,floatingBottomRowCount:s,floatingLeftColumnCount:l,floatingRightColumnCount:d,floatingTopRowCount:c,columnCount:h,rowCount:v,allRowHeights:g,allRowYs:f,allColumnXs:m,allColumnWidths:p,width:b,height:S}=i;this.drawSelectedRanges(e,t,{bottom:Math.min(a,v-s-1),right:Math.min(o,h-d-1),minX:l>0&&m.has(l+1)?C(m,l+1):-10,minY:c>0&&f.has(c+1)?C(f,c+1):-10,maxX:d>0&&m.has(h-d-1)?C(m,h-d-1)+C(p,h-d-1)-.5:b+10,maxY:s>0&&f.has(v-s-1)?C(f,v-s-1)+C(g,v-s-1)-.5:S+10})}drawRowStripes(e,t){var{metrics:r,theme:i}=t,{visibleRows:a}=r,{rowBackgroundColors:o}=i;o&&this.drawRowStripesForRows(e,t,a,o)}drawRowStripesForRows(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t.metrics.maxX,{theme:s,metrics:l,model:d}=t,{maxDepth:c,shadowBlur:h,shadowColor:v,shadowAlpha:g}=s,f=this.getCachedBackgroundColors(i,c),{allRowYs:m,allRowHeights:p}=l,b=new Map,S=[],y=[],P=($,G)=>{var B=Xe(d)?d.depthForRow($):0,X=f[$%f.length],z=X[Math.min(B,X.length-1)];if(b.has(z)||b.set(z,[]),b.get(z).push($),G!=null){var J=Xe(d)?d.depthForRow(G):0;J<B?S.push($):J>B&&y.push(G)}},I=0;I<r.length;I+=1){var E=r[I],A=I>0?r[I-1]:void 0;P(E,A)}if(b.forEach(($,G)=>{e.fillStyle=G,e.beginPath();for(var B=0;B<$.length;B+=1){var X=$[B],z=C(m,X),J=C(p,X);e.rect(a,z,o,J)}e.fill()}),S.length>0){e.save();var k=this.getCachedColorWithAlpha(v,g),M=this.getCachedColorWithAlpha(v,0),D=e.createLinearGradient(0,0,0,h);D.addColorStop(0,k),D.addColorStop(1,M),e.fillStyle=D;for(var x=0;x<S.length;x+=1){var H=S[x],T=C(m,H);e.translate(0,T),e.fillRect(a,0,o,h),e.translate(0,-T)}e.restore()}if(y.length>0){e.save();var O=this.getCachedColorWithAlpha(v,0),w=this.getCachedColorWithAlpha(v,g),j=e.createLinearGradient(0,0,0,h);j.addColorStop(0,O),j.addColorStop(1,w),e.fillStyle=j;for(var N=0;N<y.length;N+=1){var L=y[N],W=C(m,L),_=C(p,L),F=W+_-h;e.translate(0,F),e.fillRect(a,0,o,h),e.translate(0,-F)}e.restore()}}drawMouseColumnHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var s=le.getColumnAtX(r,o);if(!(s==null||a.columnHoverBackgroundColor==null)){var{allColumnWidths:l,allColumnXs:d,maxY:c}=o;if(!(i>c)){var h=C(d,s),v=C(l,s);e.fillStyle=a.columnHoverBackgroundColor,e.fillRect(h,0,v,c)}}}}drawMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var{maxX:s}=o;if(!(r>s||a.rowHoverBackgroundColor==null)){var l=le.getRowAtY(i,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}}}drawFloatingMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t,{maxX:s,floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:c,rowFooterWidth:h}=o;if(!(r==null||i==null||r>s+h||a.rowHoverBackgroundColor==null)){var v=le.getRowAtY(i,o);v!=null&&(v<l||c-d<=v)&&this.drawMouseRowHoverForRow(e,t,v)}}drawMouseRowHoverForRow(e,t,r){var{metrics:i,selectedRanges:a,theme:o}=t,{allRowHeights:s,allRowYs:l,maxX:d}=i,c=C(l,r),h=C(s,r);o.rowHoverBackgroundColor!=null&&(e.fillStyle=o.rowHoverBackgroundColor);for(var v=0;v<a.length;v+=1){var{startRow:g,endRow:f}=a[v];if(g!=null&&f!=null&&g<=r&&f>=r){o.selectedRowHoverBackgroundColor!=null&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,c,d,h)}drawGridLines(e,t){var{metrics:r,theme:i}=t,{visibleColumns:a,visibleRows:o}=r;this.drawGridLinesForItems(e,t,a,o,i.gridColumnColor,i.gridRowColor)}drawGridLinesForItems(e,t,r,i,a,o){a==null&&o==null||(e.lineWidth=1,e.beginPath(),a!=null&&(e.strokeStyle=a,this.drawGridLinesForColumns(e,t,r)),o!=null&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,i)),e.stroke())}drawGridLinesForColumns(e,t,r){for(var{metrics:i}=t,{allColumnXs:a,maxY:o}=i,s=0;s<r.length;s+=1){var l=r[s],d=C(a,l)+.5;e.moveTo(d,0),e.lineTo(d,o)}}drawGridLinesForRows(e,t,r){for(var{metrics:i}=t,{allRowYs:a,maxX:o}=i,s=o,l=0;l<r.length;l+=1){var d=r[l],c=C(a,d)+.5;e.moveTo(.5,c),e.lineTo(s-.5,c)}}drawCellBackgrounds(e,t){var{metrics:r}=t,{visibleColumns:i,visibleRows:a}=r;this.drawCellBackgroundsForItems(e,t,i,a)}drawCellBackgroundsForItems(e,t,r,i){e.save();for(var a=0;a<r.length;a+=1)for(var o=r[a],s=0;s<i.length;s+=1){var l=i[s],d=s+1<i.length?i[s+1]:void 0;this.drawCellBackground(e,t,o,l,d)}e.restore()}drawCellBackground(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{firstColumn:d,modelColumns:c,modelRows:h,allColumnXs:v,allColumnWidths:g,allRowYs:f,allRowHeights:m}=o,p=C(h,i),b=C(c,r),S=s.backgroundColorForCell(b,p,l),y=r===d,P=Xe(s)&&s.hasExpandableRows;if(S!=null){var I=C(v,r)+1,E=C(f,i)+1,A=C(g,r)-1,k=C(m,i)-1;e.fillStyle=S,e.fillRect(I,E,A,k)}y&&P&&this.drawCellRowTreeDepthLines(e,t,i,a)}drawCellContents(e,t){for(var{metrics:r}=t,{visibleColumns:i}=r,a=0;a<i.length;a+=1){var o=i[a];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,r){var{metrics:i}=t,{allColumnXs:a,allColumnWidths:o,visibleRows:s,height:l}=i,d=C(a,r),c=C(o,r);e.save(),e.beginPath(),e.rect(d,0,c,l),e.clip();for(var h=0;h<s.length;h+=1){var v=s[h];this.drawCellContent(e,t,r,v)}e.restore()}drawCellContent(e,t,r,i){var{metrics:a,model:o}=t,{modelColumns:s,modelRows:l}=a,d=C(l,i),c=C(s,r),h=o.renderTypeForCell(c,d),v=this.getCellRenderer(h);v.drawCellContent(e,t,r,i)}getCellRenderer(e){switch(e){case"dataBar":return this.dataBarCellRenderer;default:return this.textCellRenderer}}drawCellRowTreeDepthLines(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(Xe(o)){var l=o.depthForRow(r);if(l!==0){var{firstColumn:d,allColumnXs:c,allRowYs:h,allRowHeights:v}=a,{treeDepthIndent:g,treeHorizontalPadding:f,treeLineColor:m}=s,p=C(c,d),b=C(h,r),S=C(v,r),y=i!==void 0?o.depthForRow(i):0,P=l>y?l-y:0;if(e.strokeStyle=m,e.lineWidth=1,l-P>0){e.beginPath();for(var I=0;I<l-P;I+=1){var E=p+I*g+g*.5+f+.5;e.moveTo(E,b),e.lineTo(E,b+S)}e.stroke()}if(P>0){e.beginPath();for(var A=l-P;A<l;A+=1){var k=p+A*g+g*.5+f+.5;e.moveTo(k,b),e.lineTo(k,b+Math.ceil(S/2)),e.moveTo(k-.5,b+Math.ceil(S/2)+.5),e.lineTo(k+g-.5,b+Math.ceil(S/2)+.5)}e.stroke()}}}}drawHeaders(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o,draggingColumnSeparator:s,isDragging:l,model:d}=t,{columnHeaderHeight:c,floatingColumns:h,gridX:v,width:g,visibleColumns:f,allColumnWidths:m,allColumnXs:p,floatingLeftColumnCount:b,floatingLeftWidth:S,floatingRightWidth:y,modelColumns:P,columnHeaderMaxDepth:I}=o;if(!(c<=0)){var{headerHiddenSeparatorSize:E,headerHiddenSeparatorHoverColor:A,headerSeparatorColor:k,headerSeparatorHoverColor:M}=a,D=c*.5,x=c*(I-1)+c*.5-D*.5,H=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[f[0],f[f.length-1]],{minX:v+S,maxX:g-y}),H&&this.drawColumnHeadersForRange(e,t,[h[0],h[h.length-1]],{minX:v,maxX:v+S}),k){e.strokeStyle=k;var T=[...m.entries()].filter(We=>{var[Me,Pe]=We;return Pe===0}).map(We=>{var[Me]=We;return Me});e.beginPath(),e.fillStyle=k;for(var O=0;O<T.length;O+=1){var w=T[O],j=C(p,w),N=C(m,w),L=v+j+N+.5-E*.5;e.rect(L,x,E,D)}e.fill()}if(M){var{index:W,depth:_}=s??{};if(W==null&&r!=null&&i!=null){var F=Xu.getColumnSeparator(le.getGridPointFromXY(r,i,o),o,d,a);W=F==null?void 0:F.index,_=F==null?void 0:F.depth}var $;if(W==null)$=!1;else{var G=P.get(W),B=P.get(W+1);G==null||B==null?$=!1:$=d.textForColumnHeader(G,_)!==d.textForColumnHeader(B,_)}if($&&W!=null&&_!=null&&(!l||s!=null)){e.strokeStyle=M;var X=C(p,W),z=C(m,W),J=v+X+z+.5,ae=f.indexOf(W),Y=ae<f.length-1?f[ae+1]:null,Z=Y!=null?m.get(Y):null,me=z===0,he=Z!=null&&Z===0;me?(e.strokeStyle=A,e.fillStyle=A,e.fillRect(J,x,E*.5,D)):he&&(e.fillStyle=M,e.fillRect(J-E*.5,x,E*.5,D)),e.beginPath(),e.moveTo(J,(I-_-1)*c),e.lineTo(J,(I-_)*c-1),e.stroke()}}e.restore()}}drawColumnHeadersForRange(e,t,r,i){var{model:a}=t,{columnHeaderMaxDepth:o}=a;if(o!==0)for(var s=0;s<=o;s+=1)this.drawColumnHeadersAtDepth(e,t,r,i,s)}drawColumnHeadersAtDepth(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{modelColumns:d,allColumnXs:c,gridX:h,userColumnWidths:v,allColumnWidths:g,movedColumns:f}=o,{columnHeaderHeight:m,columnWidth:p}=l,{columnHeaderMaxDepth:b}=s,{minX:S,maxX:y}=i,P=y-S;if(b!==0){var I=r[0],E=r[1];if(e.save(),e.translate(0,(b-a-1)*m),a===0){this.drawColumnHeader(e,t,"",S,y);for(var A=I;A<=E;A+=1)this.drawColumnHeaderAtIndex(e,t,A,i)}if(a>0)for(var k=I;k<=E;){var{columnCount:M}=o,D=C(d,k),x=s.textForColumnHeader(D,a),H=s.colorForColumnHeader(D,a),T=C(c,k)+h,O=T+C(g,k);if(x!=null){for(var w=k-1;w>=0&&(O-T<P||T>S);){var j,N,L,W=(j=d.get(w))!==null&&j!==void 0?j:le.getModelIndex(w,f);if(W==null||s.textForColumnHeader(W,a)!==x)break;var _=(N=(L=v.get(W))!==null&&L!==void 0?L:g.get(w))!==null&&N!==void 0?N:p;T-=_,w-=1}for(var F=k+1;F<M&&(O-T<P||O<y);){var $,G,B,X=($=d.get(F))!==null&&$!==void 0?$:le.getModelIndex(F,f);if(s.textForColumnHeader(X,a)!==x)break;var z=(G=(B=v.get(X))!==null&&B!==void 0?B:g.get(F))!==null&&G!==void 0?G:p;O+=z,F+=1}k=F-1;var J=O-T>=P,ae=T;J&&(O<y?ae=O-P:T<S&&(ae=S)),this.drawColumnHeader(e,t,x,ae,Math.min(O-T,P),{backgroundColor:H??void 0},i)}k+=1}e.restore()}}drawColumnHeaderAtIndex(e,t,r,i){var a,{metrics:o,model:s}=t,{modelColumns:l,allColumnWidths:d,allColumnXs:c,gridX:h}=o,v=C(d,r),g=C(c,r)+h,f=C(l,r),m=s.textForColumnHeader(f);m!=null&&this.drawColumnHeader(e,t,m,g,v,{backgroundColor:(a=s.colorForColumnHeader(f))!==null&&a!==void 0?a:void 0},i)}drawColumnHeader(e,t,r,i,a,o,s){var l;if(!(a<=0)){var{metrics:d,theme:c}=t,{headerHorizontalPadding:h,columnHeaderHeight:v,headerBackgroundColor:g,headerColor:f,headerSeparatorColor:m,black:p,white:b}=c,{fontWidths:S,width:y}=d,P=(l=S.get(e.font))!==null&&l!==void 0?l:Nt,I=a-h*2,E=I/P,{backgroundColor:A=g,separatorColor:k=m}=o??{},{textColor:M=f}=o??{};try{var D=this.getCachedColorIsDark(A),x=this.getCachedColorIsDark(M);D&&x?M=b:!D&&!x&&(M=p)}catch{}var{minX:H=0,maxX:T=y}=s??{};e.save(),e.rect(H,0,T-H,v),e.clip(),A!=null&&(e.fillStyle=A,e.fillRect(i,0,a,v)),k!=null&&(e.strokeStyle=k,e.beginPath(),i>0&&(e.moveTo(i+.5,0),e.lineTo(i+.5,v)),e.moveTo(i+a+.5,0),e.lineTo(i+a+.5,v),e.moveTo(i,v-.5),e.lineTo(i+a,v-.5),e.stroke()),e.beginPath(),e.rect(i,0,a,v),e.clip(),e.fillStyle=M;var O=r;E<=0?O="":O.length>E&&(O="".concat(O.substring(0,E-1),"…"));var w=O.length*P,j=i+a*.5,N=v*.5;H+=h,T-=h;var L=i+h,W=$e(L,H,T),_=i+a-h,F=$e(_,H,T),$=F-W,G=j-w*.5<H,B=j+w*.5>T;G?w<$?j=H+w*.5:j=_-w*.5:B&&(w<$?j=T-w*.5:j=L+w*.5),e.textAlign="center",e.fillText(O,j,N),e.restore()}}drawRowHeaders(e,t){var{mouseX:r,mouseY:i,metrics:a,theme:o,draggingRowSeparator:s}=t,{gridY:l,rowHeaderWidth:d,height:c,visibleRows:h,allRowHeights:v,allRowYs:g}=a;if(!(d<=0)){var{headerBackgroundColor:f,headerColor:m,headerHiddenSeparatorSize:p,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:S,headerSeparatorHoverColor:y}=o,P=d*.5,I=d*.5-P*.5;if(e.save(),e.beginPath(),e.fillStyle=f,e.fillRect(0,0,d,c),S){e.strokeStyle=S,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(d,l+.5);for(var E=[],A=!1,k=0;k<h.length;k+=1){var M=h[k],D=C(g,M),x=C(v,M);if(x>0){var H=l+D+x+.5;e.moveTo(0,H),e.lineTo(d,H),A=!1}else A||(A=!0,E.push(M))}e.moveTo(d-.5,0),e.lineTo(d-.5,c),e.stroke(),e.beginPath(),e.fillStyle=S;for(var T=0;T<E.length;T+=1){var O=E[T],w=C(g,O),j=C(v,O),N=l+w+j+.5-p*.5;e.rect(I,N,P,p)}e.fill()}if(y){var{index:L=null}=s??{};if(L==null&&r!=null&&i!=null&&(L=le.getRowSeparatorIndex(r,i,a,o)),L!=null){e.strokeStyle=y;var W=C(g,L),_=C(v,L),F=l+W+_+.5,$=h.indexOf(L),G=$<h.length-1?h[$+1]:null,B=G!=null?v.get(G):null,X=_===0,z=B!=null&&B===0;X?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(I,F,P,p*.5)):z&&(e.fillStyle=y,e.fillRect(I,F-p*.5,P,p*.5)),e.beginPath(),e.moveTo(.5,F),e.lineTo(d+.5,F),e.stroke()}}e.beginPath(),e.rect(0,l,d,c),e.clip(),e.fillStyle=m,e.textAlign="right";for(var J=0;J<h.length;J+=1){var ae=h[J],Y=C(v,ae),Z=C(g,ae)+l;this.drawRowHeader(e,t,ae,Z,Y)}e.restore()}}drawRowHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,model:s,theme:l}=t,{modelRows:d,rowHeaderWidth:c}=o,h=C(d,r),v=c-l.cellHorizontalPadding,g=i+a*.5;e.fillText(s.textForRowHeader(h),v,g)}}drawRowFooters(e,t){var{mouseX:r,mouseY:i,metrics:a,model:o,theme:s,draggingRowSeparator:l}=t,{gridY:d,gridX:c,maxX:h,modelRows:v,rowFooterWidth:g,height:f,verticalBarWidth:m,visibleRows:p,allRowHeights:b,allRowYs:S,width:y}=a;if(!(g<=0)){var{cellHorizontalPadding:P,headerBackgroundColor:I,headerColor:E,headerHiddenSeparatorSize:A,headerHiddenSeparatorHoverColor:k,headerSeparatorColor:M,headerSeparatorHoverColor:D}=s,x=g*.5,H=g*.5-x*.5,T=Math.min(c+h,y-g-m);if(e.save(),e.beginPath(),e.fillStyle=I,e.fillRect(T,d,g,f),M){e.strokeStyle=M,e.beginPath(),e.moveTo(T,d+.5),e.lineTo(g,d+.5);for(var O=[],w=!1,j=0;j<p.length;j+=1){var N=p[j],L=C(S,N),W=C(b,N);if(W>0){var _=d+L+W+.5;e.moveTo(T+.5,_),e.lineTo(T+g-.5,_),w=!1}else w||(w=!0,O.push(N))}e.moveTo(T+.5,d),e.lineTo(T+.5,f),e.stroke(),e.beginPath(),e.fillStyle=M;for(var F=0;F<O.length;F+=1){var $=O[F],G=C(S,$),B=C(b,$),X=d+G+B+.5-A*.5;e.rect(T+H,X,x,A)}e.fill()}if(D){var{index:z=null}=l??{};if(z==null&&r!=null&&i!=null&&(z=le.getRowSeparatorIndex(r,i,a,s)),z!=null){e.strokeStyle=D;var J=C(S,z),ae=C(b,z),Y=d+J+ae+.5,Z=p.indexOf(z),me=Z<p.length-1?p[Z+1]:null,he=me!=null?b.get(me):null,We=ae===0,Me=he!=null&&he===0;We?(e.strokeStyle=k,e.fillStyle=k,e.fillRect(H,Y,x,A*.5)):Me&&(e.fillStyle=D,e.fillRect(H,Y-A*.5,x,A*.5)),e.beginPath(),e.moveTo(T+.5,Y),e.lineTo(T+g+.5,Y),e.stroke()}}e.beginPath(),e.rect(T,d,g,f),e.clip(),e.fillStyle=E,e.textAlign="left";for(var Pe=T+P,we=0;we<p.length;we+=1){var xe=p[we],je=C(b,xe);if(je>0){var ke=C(S,xe)+d,Ne=C(v,xe),vt=ke+je*.5;e.fillText(o.textForRowFooter(Ne),Pe,vt)}}e.restore()}}drawSelectedRanges(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{cursorColumn:i,cursorRow:a,draggingRow:o,draggingColumn:s,editingCell:l,metrics:d,model:c,selectedRanges:h,theme:v}=t,{allColumnWidths:g,allColumnXs:f,allRowHeights:m,allRowYs:p,width:b,height:S}=d,{left:y=d.left,top:P=d.top,right:I=d.right,bottom:E=d.bottom,minY:A=-10,maxY:k=S+10,minX:M=-10,maxX:D=b+10}=r;if(h.length!==0){var x=go(c)&&c.isEditable&&l==null&&o==null&&s==null&&i!=null&&a!=null&&f.has(i)&&p.has(a);if(x){var H=C(f,i),T=C(p,a),O=C(g,i),w=C(m,a);e.save(),e.beginPath(),e.rect(0,0,b,S),e.rect(H,T,O,w),e.clip("evenodd")}e.beginPath();for(var j=0;j<h.length;j+=1){var N=h[j],L=N.startColumn!==null?N.startColumn:y,W=N.startRow!==null?N.startRow:P,_=N.endColumn!==null?N.endColumn:I,F=N.endRow!==null?N.endRow:E;if(F>=P&&E>=W&&_>=y&&I>=L){var $=L>=y&&f.has(L)?Math.round(C(f,L))+.5:M,G=W>=P&&p.has(W)?Math.max(Math.round(C(p,W))+.5,.5):A,B=_<=I&&f.has(_)?Math.round(C(f,_)+C(g,_))-.5:D,X=F<=E&&p.has(F)?Math.round(C(p,F)+C(m,F))-.5:k;e.rect($,G,B-$,X-G)}}e.fillStyle=v.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=v.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=v.selectionOutlineColor,e.lineWidth=1,e.stroke(),x&&i!=null&&a!=null&&(e.restore(),this.drawActiveCell(e,t,i,a))}}drawActiveCell(e,t,r,i){var{metrics:a,theme:o}=t,{scrollX:s,scrollY:l,allColumnWidths:d,allColumnXs:c,allRowHeights:h,allRowYs:v}=a,{activeCellSelectionBorderWidth:g}=o,f=C(c,r),m=C(v,i),p=C(d,r),b=C(h,i),S=f-g*.5,y=m-g*.5,P=p+g,I=b+g;S<=0&&s<=0&&(P-=g-S,S=g*.5),y<=0&&l<=0&&(I-=g-y,y=g*.5);var{lineWidth:E}=e;e.beginPath(),e.lineWidth=g,e.strokeStyle=o.selectionOutlineColor,this.drawRoundedRect(e,S,y,P,I),e.stroke(),e.lineWidth=E}drawRoundedRect(e,t,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:kt.DEFAULT_EDGE_RADIUS;e.beginPath(),e.moveTo(t+o,r),e.lineTo(t+i-o,r),e.quadraticCurveTo(t+i,r,t+i,r+o),e.lineTo(t+i,r+a-o),e.quadraticCurveTo(t+i,r+a,t+i-o,r+a),e.lineTo(t+o,r+a),e.quadraticCurveTo(t,r+a,t,r+a-o),e.lineTo(t,r+o),e.quadraticCurveTo(t,r,t+o,r),e.closePath()}drawDraggingColumn(e,t){var r,{draggingColumn:i,metrics:a,mouseX:o,theme:s,model:l}=t;if(!(i==null||o==null)){var{range:d,depth:c}=i,{gridX:h,gridY:v,allColumnXs:g,allColumnWidths:f,height:m,width:p,columnHeaderMaxDepth:b,columnHeaderHeight:S,movedColumns:y,modelColumns:P,floatingLeftWidth:I}=a,E=(r=P.get(d[0]))!==null&&r!==void 0?r:le.getModelIndex(d[0],y),A=l.getColumnHeaderGroup(E,c);if(!(c>0&&!A)){var[k,M]=d,D=C(g,k),x=C(g,M)+C(f,M),H=x-D,T=i.left,{backgroundColor:O,font:w,headerFont:j,reorderOffset:N,shadowBlur:L,shadowColor:W}=s,_=(b-c-1)*S;e.save(),e.translate(h,0),e.save(),e.beginPath(),e.rect(I,0,p,m),e.clip(),e.fillStyle=O,e.fillRect(D,_,H,m),e.restore(),e.translate(0,N),e.save(),e.shadowColor=W,e.shadowBlur=L,e.fillStyle=O,e.fillRect(i.left,_+N,i.width,m),e.restore(),e.beginPath(),e.rect(i.left,_,i.width+1,m),e.clip(),e.translate(T-D,0),e.font=j;for(var F=[],$=i.range[0];$<=i.range[1];$+=1)F.push($);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[F[0],F[F.length-1]],{minX:D,maxX:p}),e.translate(0,v),e.font=w,this.drawGridBackground(e,t);for(var G=k;G<=M;G+=1)this.drawColumnCellContents(e,t,G);e.restore()}}}drawDraggingRow(e,t){var{draggingRow:r,draggingRowOffset:i,metrics:a,mouseY:o,theme:s}=t;if(!(r==null||o==null)){var{gridX:l,gridY:d,allRowYs:c,allRowHeights:h,width:v}=a,g=C(c,r),f=C(h,r)+1,{backgroundColor:m,font:p,headerFont:b,reorderOffset:S,shadowBlur:y,shadowColor:P}=s;e.save(),e.translate(0,d),e.fillStyle=m,e.fillRect(0,g,v,f),e.translate(l+S,o-g-d-(i??0)),e.save(),e.shadowColor=P,e.shadowBlur=y,e.fillStyle=m,e.fillRect(-l,g,v,f),e.restore(),e.beginPath(),e.rect(-l,g,v,f),e.clip(),e.font=p,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-d),e.font=b,this.drawRowHeaders(e,t),e.restore()}}drawScrollBars(e,t){var{isDraggingHorizontalScrollBar:r,isDraggingVerticalScrollBar:i,isDragging:a,metrics:o,mouseX:s,mouseY:l,theme:d}=t;if(!(d.scrollBarSize<=0)){var{width:c,height:h,handleHeight:v,handleWidth:g,scrollX:f,scrollY:m,hasHorizontalBar:p,hasVerticalBar:b,barWidth:S,barHeight:y,barLeft:P,barTop:I}=o,{scrollBarBackgroundColor:E,scrollBarHoverBackgroundColor:A,scrollBarCasingColor:k,scrollBarCornerColor:M,scrollBarColor:D,scrollBarHoverColor:x,scrollBarActiveColor:H,scrollBarSize:T,scrollBarHoverSize:O,scrollBarCasingWidth:w,scrollBarSelectionTick:j,scrollBarSelectionTickColor:N,scrollBarActiveSelectionTickColor:L,autoSelectRow:W,autoSelectColumn:_}=d,F=s!=null&&l!=null&&s<=c&&l<=h,$=i||b&&!r&&!a&&s!=null&&l!=null&&s>=c-O&&l>=I&&F,G=r||p&&!i&&!a&&!$&&s!=null&&l!=null&&l>=h-O&&s>=P&&F,B=G?O:T,X=$?O:T;if(e.translate(P,I),p&&b&&(e.fillStyle=k,e.fillRect(c-P-T,h-I-T,T,T),e.fillStyle=M,e.fillRect(c-P-T+w,h-I-T+w,T-w,T-w)),p){var z=f,J=h-I-B;if(e.fillStyle=k,e.fillRect(0,J,S,B-w),e.fillStyle=G?A:E,e.fillRect(0,J+w,S,B-w),r?e.fillStyle=H:G?e.fillStyle=x:e.fillStyle=D,e.fillRect(z,J+w,g,B-w),!W&&j&&N!=null&&L!=null){e.fillStyle=N;for(var{selectedRanges:ae,cursorColumn:Y}=t,{lastLeft:Z,columnCount:me}=o,he=[...ae].filter(de=>de.startColumn!=null&&de.endColumn!=null),We=he.map(de=>[de.startColumn,de.endColumn]).sort(le.compareRanges),Me=le.mergeSortedRanges(We),Pe=de=>de<=Z?de/Z*(S-g):S-g+(de-Z)/(me-Z)*g,we=0;we<Me.length;we+=1){var xe=Me[we],je=xe[0],ke=xe[1];if(je!=null&&ke!=null&&(je!==Y||ke!==Y)){var Ne=Pe(je),vt=Math.max(1,Math.round(Pe(ke+1)-Ne)),at=B-w;e.fillRect(Ne,J+w+Math.round(at/3),vt,Math.round(at/3))}}if(Y!=null){var Zt=Pe(Y),Qt=2,Ye=B-w;e.fillStyle=L,e.fillRect(Zt,J+w,Qt,Ye)}}}if(b){var Ce=c-P-X,ot=m;if(e.fillStyle=k,e.fillRect(Ce,0,X-w,y),e.fillStyle=$?A:E,e.fillRect(Ce+w,0,X-w,y),i?e.fillStyle=H:$?e.fillStyle=x:e.fillStyle=D,e.fillRect(Ce+w,ot,X-w,v),!_&&j&&N!=null&&L!=null){var{selectedRanges:Ze,cursorRow:_e}=t,{lastTop:Qe,rowCount:Ft}=o,st=de=>de<=Qe?de/Qe*(y-v):y-v+(de-Qe)/(Ft-Qe)*v;e.fillStyle=N;for(var Je=[...Ze].filter(de=>de.startRow!=null&&de.endRow!=null),Ae=Je.map(de=>[de.startRow,de.endRow]).sort(le.compareRanges),Lt=le.mergeSortedRanges(Ae),It=0;It<Lt.length;It+=1){var Rt=Lt[It],et=Rt[0],gt=Rt[1];if(et!=null&>!=null&&(et!==_e||gt!==_e)){var Jt=st(et),dr=X-w,Nr=Math.max(1,Math.round(st(gt+1)-Jt));e.fillRect(Ce+w+Math.round(dr/3),Jt,Math.round(dr/3),Nr)}}if(_e!=null){var Ar=Math.round(st(_e)),Fr=X-w,Lr=2;e.fillStyle=L,e.fillRect(Ce+w,Ar,Fr,Lr)}}}e.translate(-P,-I)}}}Gt(kt,"DEFAULT_EDGE_RADIUS",2);function Ai(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ai(Object(t),!0).forEach(function(r){Kt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ai(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Kt(n,e,t){return e=lc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lc(n){var e=dc(n,"string");return typeof e=="symbol"?e:String(e)}function dc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class St extends R.Component{static makeCustomColumnInputEventKey(){return it.generate()}static createCustomColumnInput(){return{eventKey:it.generate(),name:"",formula:""}}constructor(e){super(e),Kt(this,"container",void 0),Kt(this,"successButtonTimer",void 0),Kt(this,"getInput",Tn((t,r)=>t.find(i=>i.eventKey===r))),Kt(this,"getInputIndex",Tn((t,r)=>t.findIndex(i=>i.eventKey===r))),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleSaveClick=this.handleSaveClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleCustomColumnUpdated=this.handleCustomColumnUpdated.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.resetRequestFailed=this.resetRequestFailed.bind(this),this.handleEditorTabNavigation=this.handleEditorTabNavigation.bind(this),this.state={inputs:[],isCustomColumnApplying:!1,errorMessage:null,hasRequestFailed:!1,isSuccessShowing:!1},this.container=null,this.successButtonTimer=null}componentDidMount(){var{customColumns:e}=this.props;this.parseCustomColumns(e),this.startListening()}componentWillUnmount(){this.stopListening(),this.successButtonTimer&&clearTimeout(this.successButtonTimer)}resetErrorMessage(){this.setState({errorMessage:null})}startListening(){var{model:e}=this.props;e.addEventListener(Ht.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.addEventListener(Ht.EVENT.UPDATED,this.handleCustomColumnUpdated),e.addEventListener(Ht.EVENT.REQUEST_FAILED,this.handleRequestFailed)}stopListening(){var{model:e}=this.props;e.removeEventListener(Ht.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.removeEventListener(Ht.EVENT.UPDATED,this.handleCustomColumnUpdated),e.removeEventListener(Ht.EVENT.REQUEST_FAILED,this.handleRequestFailed)}parseCustomColumns(e){if(e.length>0){var t=e.map(r=>{var i=r.split(/=(.+)/,2);return{eventKey:St.makeCustomColumnInputEventKey(),name:i[0],formula:i[1]}});this.setState({inputs:t})}else this.setState({inputs:[St.createCustomColumnInput()]})}handleAddColumnClick(){var{inputs:e}=this.state,t=[...e];t.push(St.createCustomColumnInput()),this.setState({inputs:t})}handleDeleteColumn(e){var{inputs:t}=this.state,r=this.getInputIndex(t,e),i=[...t];i.splice(r,1),i.length===0&&i.push(St.createCustomColumnInput()),this.setState({inputs:i})}handleInputChange(e,t,r){var{inputs:i}=this.state,a=this.getInputIndex(i,e),o=this.getInput(i,e),s=Wr({},o);s[t]=r;var l=[...i];l.splice(a,1,s),this.setState({inputs:l})}handleCustomColumnUpdated(){var{isCustomColumnApplying:e}=this.state;e&&this.setState({isCustomColumnApplying:!1,isSuccessShowing:!0},()=>{this.successButtonTimer=setTimeout(()=>this.setState({isSuccessShowing:!1}),St.SUCCESS_SHOW_DURATION)})}handleRequestFailed(e){var t=e,{isCustomColumnApplying:r}=this.state;r&&this.setState({isCustomColumnApplying:!1,errorMessage:u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:[u.jsx(ce,{icon:Or})," Failed to apply custom columns."]}),u.jsxs("div",{className:"error-box",children:[t.detail.errorMessage,u.jsx("br",{}),"Table configuration:"," ",JSON.stringify(t.detail.configuration)]})]}),hasRequestFailed:!0})}handleDragEnd(e){if(ht.stopDragging(),!!e.destination){var{inputs:t}=this.state,r=e.source.index,i=e.destination.index,a=[...t],o=t[r];a.splice(r,1),a.splice(i,0,o),this.setState({inputs:a})}}handleEditorTabNavigation(e,t){var{inputs:r}=this.state;if(t){var i;((i=this.container)===null||i===void 0?void 0:i.querySelectorAll(".btn-drag-handle")[e]).focus();return}if(e===r.length-1){var a,o;(a=this.container)===null||a===void 0||(o=a.querySelector(".btn-add-column"))===null||o===void 0||o.focus()}else{var s,l=e+1;((s=this.container)===null||s===void 0?void 0:s.querySelectorAll(".custom-column-input")[l]).focus()}}handleSaveClick(){var{onSave:e,customColumns:t}=this.props,{inputs:r,isCustomColumnApplying:i}=this.state;if(!i){var a=[];r.forEach(o=>{var{name:s,formula:l}=o;s&&l&&a.push("".concat(s,"=").concat(l))}),this.resetErrorMessage(),this.setState({isCustomColumnApplying:a.length>0||t.length>0}),e(a)}}resetRequestFailed(){this.setState(e=>{var{hasRequestFailed:t}=e;return t?{hasRequestFailed:!1}:null})}renderInputs(){var{inputs:e,hasRequestFailed:t}=this.state,r=new Map;return e.forEach(i=>{var a,{name:o}=i;return r.set(o,((a=r.get(o))!==null&&a!==void 0?a:0)+1)}),e.map((i,a)=>{var o,{eventKey:s,name:l,formula:d}=i,c=((o=r.get(l))!==null&&o!==void 0?o:0)>1;return u.jsx(Ru,{inputIndex:a,eventKey:s,name:l,formula:d,onChange:this.handleInputChange,onDeleteColumn:this.handleDeleteColumn,onTabInEditor:this.handleEditorTabNavigation,invalid:t,isDuplicate:c},s)})}renderSaveButton(){var{inputs:e,isCustomColumnApplying:t,isSuccessShowing:r}=this.state,i=e.length>1?"Save Columns":"Save Column",a=e.every(l=>{var{name:d}=l;return d===""||ln.isValidColumnName(d)}),o=e.filter(l=>{var{name:d}=l;return d!==""}).map(l=>{var{name:d}=l;return d}),s=new Set(o).size===o.length;return u.jsxs(Q,{kind:r?"success":"primary",className:K("btn-apply",{"btn-spinner":t}),disabled:r||t||!a||!s,onClick:this.handleSaveClick,icon:r?ls:void 0,children:[t&&u.jsxs("span",{children:[u.jsx(Sa,{className:"mr-2 loading-spinner-vertical-align"}),u.jsx("span",{className:"btn-normal-content",children:"Applying"})]}),!r&&!t&&i,r&&"Success"]})}render(){var{onCancel:e}=this.props,{errorMessage:t}=this.state;return u.jsxs("div",{role:"presentation",className:"custom-column-builder-container",ref:r=>{this.container=r},onClick:this.resetRequestFailed,onFocus:this.resetRequestFailed,children:[u.jsx("hr",{}),u.jsx(rn,{onDragStart:ht.startDragging,onDragEnd:this.handleDragEnd,children:u.jsx(tn,{droppableId:"droppable-custom-columns",children:(r,i)=>u.jsxs("div",Wr(Wr({ref:r.innerRef},r.droppableProps),{},{className:K("droppable-container",{dragging:i.draggingFromThisWith}),children:[this.renderInputs(),r.placeholder]}))})}),u.jsx("div",{className:"pt-1 px-3",children:u.jsx(Q,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,icon:an,children:"Add Another Column"})}),u.jsxs("div",{className:"custom-column-builder-footer",children:[t&&u.jsx("div",{className:"error-message",children:t}),u.jsxs("div",{className:"d-flex justify-content-end",children:[u.jsx(Q,{kind:"secondary",className:"mr-2",onClick:e,children:"Cancel"}),this.renderSaveButton()]})]})]})}}Kt(St,"SUCCESS_SHOW_DURATION",750);const sg=St;var Zr;(function(n){n.ADVANCED_SETTINGS="ADVANCED_SETTINGS",n.AGGREGATIONS="AGGREGATIONS",n.AGGREGATION_EDIT="AGGREGATIONS_EDIT",n.CHART_BUILDER="CHART_BUILDER",n.CUSTOM_COLUMN_BUILDER="CUSTOM_COLUMN_BUILDER",n.QUICK_FILTERS="QUICK_FILTERS",n.ROLLUP_ROWS="ROLLUP_ROWS",n.SEARCH_BAR="SEARCH_BAR",n.SELECT_DISTINCT="SELECT_DISTINCT",n.TABLE_EXPORTER="TABLE_EXPORTER",n.VISIBILITY_ORDERING_BUILDER="VISIBILITY_ORDERING_BUILDER",n.CONDITIONAL_FORMATTING="CONDITIONAL_FORMATTING",n.CONDITIONAL_FORMATTING_EDIT="CONDITIONAL_FORMATTING_EDIT",n.GOTO="GOTO"})(Zr||(Zr={}));const lg=Zr;function Fi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Li(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fi(Object(t),!0).forEach(function(r){yt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yt(n,e,t){return e=uc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uc(n){var e=cc(n,"string");return typeof e=="symbol"?e:String(e)}function cc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rr=fe.module("RollupRows"),hc=150,mr="grouped-rollup-rows",pr="ungrouped-rollup-rows";class ye extends R.Component{static renderColumn(e){var{item:t,isClone:r,selectedCount:i}=e,a=t==null?void 0:t.name,o=r!==void 0&&r?"".concat(i):void 0,s=r!==void 0&&r?"item-list-item-clone":"";return Ke.renderTextItem({text:a,badgeText:o,className:s})}static addGroupings(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length;if(t==null||t.length===0)return e;var i=r,a=e.filter((o,s)=>t.includes(o)?(s<i&&(i-=1),!1):!0);return a.splice(i,0,...t),a}static isGroupable(e){return!Oe.isDecimalType(e.type)}constructor(e){super(e),yt(this,"ungroupedList",void 0),yt(this,"groupedList",void 0),yt(this,"search",pa(o=>{for(var s=this.getSortedUngroupedColumns(),l=[],d=null,c=0;c<s.length;c+=1){var h=s[c];h.name.toLowerCase().includes(o.toLowerCase())&&(d==null&&(d=c),l.push([c,c]))}ee(d),this.setState({ungroupedSelectedRanges:l}),l.length>0&&this.ungroupedList.current&&this.ungroupedList.current.scrollToItem(d)},hc)),yt(this,"getCachedUngroupedColumns",ge((o,s)=>o.filter(l=>ye.isGroupable(l)&&s.find(d=>d===l.name)==null))),yt(this,"getCachedSortedColumns",ge((o,s)=>s==null?[...o]:Oe.sortColumns(o,s===ye.SORT.ASCENDING))),this.handleDeleteClicked=this.handleDeleteClicked.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUngroupedSelect=this.handleUngroupedSelect.bind(this),this.handleUngroupedSelectionChange=this.handleUngroupedSelectionChange.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupedSelectionChange=this.handleGroupedSelectionChange.bind(this),this.handleShowConstituentsChange=this.handleShowConstituentsChange.bind(this),this.handleShowNonAggregatedColumnsChange=this.handleShowNonAggregatedColumnsChange.bind(this),this.handleSortAscending=this.handleSortAscending.bind(this),this.handleSortDescending=this.handleSortDescending.bind(this),this.renderGroupedItem=this.renderGroupedItem.bind(this),this.ungroupedList=te.createRef(),this.groupedList=te.createRef();var{config:t}=e,{columns:r=[],showConstituents:i=!0,showNonAggregatedColumns:a=!0}=t??{};this.state={ungroupedSelectedRanges:[],columns:r,groupedSelectedRanges:[],searchFilter:"",showConstituents:i,showNonAggregatedColumns:a,dragSource:null,sort:null}}componentDidUpdate(e,t){var{config:r}=this.props,{columns:i,showConstituents:a,showNonAggregatedColumns:o}=this.state;r!==e.config?this.updateFromConfig():(i!==t.columns||a!==t.showConstituents||o!==t.showNonAggregatedColumns)&&(r==null||i!==r.columns||a!==r.showConstituents||o!==r.showNonAggregatedColumns)&&this.sendChange()}componentWillUnmount(){this.search.cancel()}handleSearchChange(e){var t=e.target.value;if(this.setState({searchFilter:t}),!t){this.search.cancel(),this.resetSelection();return}this.search(t)}handleSortAscending(){this.setState(e=>{var{sort:t}=e;return{sort:t===ye.SORT.ASCENDING?null:ye.SORT.ASCENDING}})}handleSortDescending(){this.setState(e=>{var{sort:t}=e;return{sort:t===ye.SORT.DESCENDING?null:ye.SORT.DESCENDING}})}resetSelection(){this.setState({ungroupedSelectedRanges:[],groupedSelectedRanges:[]})}handleDragStart(e){rr.debug("handleDragStart",e),document.documentElement.classList.add("drag-pointer-events-none"),this.setState({dragSource:e.source})}handleDragEnd(e){rr.debug("handleDragEnd",e),document.documentElement.classList.remove("drag-pointer-events-none"),this.setState({dragSource:null});var{destination:t,source:r}=e;if(!(t==null||r==null)){if(t.droppableId===pr){this.setState(o=>{var{groupedSelectedRanges:s,columns:l}=o,d=[...l];return ht.reorder(d,s,[],0),{columns:d,ungroupedSelectedRanges:[],groupedSelectedRanges:[]}});return}var i=r.droppableId===mr,a=t.index;i&&r.index<t.index&&(a+=1),this.setState(o=>{var{columns:s,ungroupedSelectedRanges:l,groupedSelectedRanges:d}=o,c=[...s],h=i?c:this.getSortedUngroupedColumns().map(p=>p.name),v=i?d:l,g=ht.reorder(h,v,c,a),f=i?ht.adjustDestinationIndex(a,d):a,m=[[f,f+g.length-1]];return{columns:c,ungroupedSelectedRanges:[],groupedSelectedRanges:m}}),this.resetSelection()}}handleUngroupedSelect(e){rr.debug("handleUngroupedSelect"),this.setState(t=>{var{columns:r}=t;return{columns:ye.addGroupings(r,[this.getSortedUngroupedColumns()[e].name]),ungroupedSelectedRanges:[],groupedSelectedRanges:[]}})}handleUngroupedSelectionChange(e){rr.debug2("handleUngroupedSelectionChange",e),this.setState(t=>{var{ungroupedSelectedRanges:r}=t;return e===r?null:{ungroupedSelectedRanges:e,groupedSelectedRanges:[]}})}handleGroupedSelectionChange(e){rr.debug2("handleGroupedSelectedRanges",e),this.setState(t=>{var{groupedSelectedRanges:r}=t;return e===r?null:{groupedSelectedRanges:e,ungroupedSelectedRanges:[]}})}handleDeleteClicked(e){this.setState(t=>{var{columns:r}=t,i=r.slice();return i.splice(e,1),{columns:i}})}handleShowConstituentsChange(){this.setState(e=>{var{showConstituents:t}=e;return{showConstituents:!t}})}handleShowNonAggregatedColumnsChange(){this.setState(e=>{var{showNonAggregatedColumns:t}=e;return{showNonAggregatedColumns:!t}})}updateFromConfig(){var{config:e}=this.props,{columns:t=[],showConstituents:r=!0,showNonAggregatedColumns:i=!0}=e??{};this.setState({columns:t,showConstituents:r,showNonAggregatedColumns:i})}sendChange(){var{onChange:e}=this.props,{columns:t,showConstituents:r,showNonAggregatedColumns:i}=this.state;e({columns:t,showConstituents:r,showNonAggregatedColumns:i})}getUngroupedColumns(){var{model:e}=this.props,{columns:t}=this.state,{originalColumns:r}=e;return this.getCachedUngroupedColumns(r,t)}getSortedUngroupedColumns(){var{sort:e}=this.state,t=this.getUngroupedColumns();return this.getCachedSortedColumns(t,e)}renderGroupedItem(e){var{item:t,itemIndex:r,isClone:i,selectedCount:a}=e,o=i!==void 0&&i?"":" ".repeat(r),s="".concat(o).concat(t),l=i!==void 0&&i?"".concat(a):void 0,d=i!==void 0&&i?"item-list-item-clone":"";return u.jsxs(u.Fragment,{children:[Ke.renderTextItem({text:s,badgeText:l,className:d}),(i===void 0||!i)&&u.jsx(Q,{kind:"ghost",className:"btn btn-link btn-link-icon btn-delete-grouping float-right",onClick:()=>this.handleDeleteClicked(r),children:u.jsx(ce,{icon:sr})})]})}render(){var{columns:e,dragSource:t,searchFilter:r,groupedSelectedRanges:i,ungroupedSelectedRanges:a,showConstituents:o,showNonAggregatedColumns:s,sort:l}=this.state,d=this.getSortedUngroupedColumns(),c=e.length*Ke.DEFAULT_ROW_HEIGHT;(t==null?void 0:t.droppableId)===pr&&(c+=Ke.DEFAULT_ROW_HEIGHT);var h=d.length*Ke.DEFAULT_ROW_HEIGHT+10,v=Math.min(3*Ke.DEFAULT_ROW_HEIGHT,h);return u.jsx("div",{role:"menu",className:K("rollup-rows",{"is-dragging":t!=null}),tabIndex:0,children:u.jsxs(rn,{onDragEnd:this.handleDragEnd,onDragStart:this.handleDragStart,children:[u.jsxs("div",{className:"rollup-rows-group-by",children:[u.jsx("div",{className:"section-title",children:"Group By"}),e.length===0&&u.jsx(tn,{droppableId:"placeholder",children:(g,f)=>u.jsx("div",Li(Li({className:K("placeholder","text-muted",{"is-dragging-from-this":f.draggingFromThisWith,"is-dragging-over":f.isDraggingOver,"is-dropping":f.draggingOverWith}),ref:g.innerRef},g.droppableProps),{},{children:"To create a rollup, drag columns from the list below and drop them into this area."}))}),e.length>0&&u.jsx(Ke,{draggingItemClassName:"rollup-rows-dragging-grouped-item",draggablePrefix:mr,droppableId:mr,itemCount:e.length,items:e,offset:0,onSelectionChange:this.handleGroupedSelectionChange,ref:this.groupedList,renderItem:this.renderGroupedItem,selectedRanges:i,style:{height:c},isMultiSelect:!0})]}),u.jsxs("div",{className:"rollup-rows-available-columns",children:[u.jsx("div",{className:"section-title",children:"Available Grouping Columns"}),u.jsxs("div",{className:"top-menu",children:[u.jsx(vn,{className:"w-100",value:r,matchCount:r?a.length:void 0,placeholder:"Find column...",onChange:this.handleSearchChange}),u.jsxs(Q,{kind:"ghost",className:K("btn-link btn-link-icon",{active:l===ye.SORT.ASCENDING}),onClick:this.handleSortAscending,children:[u.jsx(ce,{icon:on}),u.jsx(ar,{children:"Sort ascending"})]}),u.jsxs(Q,{kind:"ghost",className:K("btn-link btn-link-icon",{active:l===ye.SORT.DESCENDING}),onClick:this.handleSortDescending,children:[u.jsx(ce,{icon:sn}),u.jsx(ar,{children:"Sort descending"})]})]}),u.jsx(Ke,{className:"rollup-available-grouping-columns",draggablePrefix:pr,droppableId:pr,itemCount:d.length,items:d,renderItem:ye.renderColumn,offset:0,onSelect:this.handleUngroupedSelect,onSelectionChange:this.handleUngroupedSelectionChange,ref:this.ungroupedList,selectedRanges:a,style:{maxHeight:h,minHeight:v},isDropDisabled:(t==null?void 0:t.droppableId)!==mr,isMultiSelect:!0}),u.jsxs("div",{className:"bottom-menu",children:[u.jsx("div",{className:"label",children:"Show:"}),u.jsx(Tt,{checked:o,onChange:this.handleShowConstituentsChange,children:"Constituents"}),u.jsx(Tt,{checked:s,onChange:this.handleShowNonAggregatedColumnsChange,children:"Non-Aggregated Columns"})]})]})]})})}}yt(ye,"SORT",Object.freeze({ASCENDING:"ASC",DESCENDING:"DESC"}));yt(ye,"defaultProps",{config:null,onChange:()=>{}});const dg=ye;function Hi(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function vc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Hi(a,r,i,o,s,"next",l)}function s(l){Hi(a,r,i,o,s,"throw",l)}o(void 0)})}}function $i(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Bi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$i(Object(t),!0).forEach(function(r){At(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$i(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function At(n,e,t){return e=gc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gc(n){var e=fc(n,"string");return typeof e=="symbol"?e:String(e)}function fc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var mc=fe.module("TableCsvExporter");class re extends R.Component{static getDateString(e){return e.i18n.DateTimeFormat.format(re.FILENAME_DATE_FORMAT,new Date)}constructor(e){super(e),this.handleDownloadClick=this.handleDownloadClick.bind(this),this.handleDownloadRowOptionChanged=this.handleDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowOptionChanged=this.handleCustomizedDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowsChanged=this.handleCustomizedDownloadRowsChanged.bind(this),this.handleIncludeColumnHeadersChanged=this.handleIncludeColumnHeadersChanged.bind(this),this.handleIncludeHiddenColumnsChanged=this.handleIncludeHiddenColumnsChanged.bind(this),this.handleUseUnformattedValuesChanged=this.handleUseUnformattedValuesChanged.bind(this);var{model:t,name:r}=e;this.state={fileName:"".concat(r,"-").concat(re.getDateString(t.dh),".csv"),downloadRowOption:re.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,customizedDownloadRowOption:re.CUSTOMIZED_ROWS_OPTIONS.FIRST,customizedDownloadRows:re.DEFAULT_DOWNLOAD_ROWS,includeColumnHeaders:!0,includeHiddenColumns:!1,useUnformattedValues:!1,errorMessage:null,id:it.generate()}}getSnapshotRanges(){var{model:e,selectedRanges:t}=this.props,{downloadRowOption:r,customizedDownloadRowOption:i,customizedDownloadRows:a}=this.state,{rowCount:o,columnCount:s}=e,l=[];switch(r){case re.DOWNLOAD_ROW_OPTIONS.ALL_ROWS:l.push(new $t(0,0,s-1,o-1));break;case re.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS:l=t.map(d=>Bi(Bi({},d),{},{startColumn:0,endColumn:s-1})).sort((d,c)=>d.startRow!=null&&c.startRow!=null?d.startRow-c.startRow:0);break;case re.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS:switch(i){case re.CUSTOMIZED_ROWS_OPTIONS.FIRST:l.push(new $t(0,0,s-1,Math.min(a-1,o-1)));break;case re.CUSTOMIZED_ROWS_OPTIONS.LAST:l.push(new $t(0,Math.max(0,o-a),s-1,o-1));break}break}return l}getModelRanges(e){var{userColumnWidths:t,movedColumns:r}=this.props,{includeHiddenColumns:i}=this.state,a=ga.getHiddenColumns(t),o=ie.getModelRanges(e,r);if(!i&&a.length>0){var s=a.map($t.makeColumn);o=$t.subtractRangesFromRanges(o,s)}return o}resetDownloadState(){this.setState({errorMessage:null})}handleDownloadClick(){var e=this;return vc(function*(){var{model:t,isDownloading:r,onDownloadStart:i,onDownload:a,onCancel:o}=e.props,{fileName:s,includeColumnHeaders:l,useUnformattedValues:d}=e.state;if(r){o();return}e.resetDownloadState();var c=e.getSnapshotRanges(),h=e.getModelRanges(c);if(e.validateOptionInput()){i();try{var v=yield t.export(),g=v.setViewport(0,0);yield g.getViewportData(),a(s,v,g,c,h,l,d)}catch(f){mc.error("CSV download failed",f),e.setState({errorMessage:u.jsxs("p",{children:[u.jsx(ce,{icon:Or})," ","".concat(f)]})}),o()}}})()}handleDownloadRowOptionChanged(e){this.setState({downloadRowOption:e.target.value})}handleCustomizedDownloadRowOptionChanged(e){this.setState({customizedDownloadRowOption:e})}handleCustomizedDownloadRowsChanged(e){this.setState({customizedDownloadRows:parseInt(e.target.value,10)})}handleIncludeColumnHeadersChanged(){this.setState(e=>{var{includeColumnHeaders:t}=e;return{includeColumnHeaders:!t}})}handleIncludeHiddenColumnsChanged(){this.setState(e=>{var{includeHiddenColumns:t}=e;return{includeHiddenColumns:!t}})}handleUseUnformattedValuesChanged(){this.setState(e=>{var{useUnformattedValues:t}=e;return{useUnformattedValues:!t}})}validateOptionInput(){var{selectedRanges:e}=this.props,{downloadRowOption:t,customizedDownloadRows:r}=this.state;return t===re.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS&&e.length===0?(this.setState({errorMessage:u.jsxs("p",{children:[u.jsx(ce,{icon:Or})," No rows selected. Please select some rows in the table."]})}),!1):t===re.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS&&r<=0?(this.setState({errorMessage:u.jsxs("p",{children:[u.jsx(ce,{icon:Or})," Number of rows to output must be greater than 0"]})}),!1):!0}render(){var{model:e,isDownloading:t,tableDownloadProgress:r,tableDownloadEstimatedTime:i,selectedRanges:a,tableDownloadStatus:o}=this.props,{fileName:s,downloadRowOption:l,customizedDownloadRowOption:d,customizedDownloadRows:c,includeColumnHeaders:h,includeHiddenColumns:v,useUnformattedValues:g,errorMessage:f,id:m}=this.state,{rowCount:p}=e;return u.jsxs("div",{className:"table-csv-exporter",children:[u.jsx("div",{className:"section-title",children:"Download Rows"}),u.jsx("div",{className:"form-group",children:u.jsxs(fn,{onChange:this.handleDownloadRowOptionChanged,value:l,disabled:t,children:[u.jsxs(jt,{value:re.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,"data-testid":"radio-csv-exporter-download-all",children:["All Rows",u.jsx("span",{className:"text-muted ml-2",children:"(".concat(p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)")})]}),u.jsxs(jt,{value:re.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS,"data-testid":"radio-csv-exporter-only-selected",children:["Only Selected Rows",u.jsx("span",{className:"text-muted ml-2",children:a.length>0?"(".concat($t.rowCount(a).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)"):null})]}),u.jsx(jt,{value:re.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS,"data-testid":"radio-csv-exporter-customized-rows",children:u.jsxs("div",{className:"radio-input-row",role:"presentation",onClick:()=>{this.setState({downloadRowOption:re.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS})},children:[u.jsxs(or,{value:d,"data-testid":"select-csv-exporter-customized-rows",className:"custom-select",disabled:t,onChange:this.handleCustomizedDownloadRowOptionChanged,children:[u.jsx("option",{value:"FIRST",children:"First"}),u.jsx("option",{value:"LAST",children:"Last"})]}),u.jsx("input",{type:"number",className:"form-control",id:"customizedRows-".concat(m),"data-testid":"input-csv-exporter-customized-rows",name:"customizedRows-".concat(m),placeholder:"100",value:c,disabled:t,onChange:this.handleCustomizedDownloadRowsChanged}),u.jsx("div",{children:"Rows"})]})})]})}),u.jsxs("div",{className:"form-group",children:[u.jsx("label",{htmlFor:"customizedRows-".concat(m),children:"File Name"}),u.jsx("input",{type:"text",className:"form-control",id:"filename-".concat(m),"data-testid":"input-csv-exporter-file-name",name:"filename-".concat(m),value:s,onChange:b=>{this.setState({fileName:b.target.value})},disabled:t})]}),u.jsxs("div",{className:"checkbox-options",children:[u.jsx(Tt,{checked:h,onChange:this.handleIncludeColumnHeadersChanged,children:"Include column headers"}),u.jsx(Tt,{checked:v,onChange:this.handleIncludeHiddenColumnsChanged,children:"Include hidden columns"}),u.jsx(Tt,{checked:g,onChange:this.handleUseUnformattedValuesChanged,children:"Use unformatted values"})]}),u.jsxs("div",{className:"section-footer flex-column",children:[f!=null&&u.jsx("div",{className:"error-message",children:f}),o&&u.jsxs("div",{className:"download-status",children:[(o===re.DOWNLOAD_STATUS.DOWNLOADING||o===re.DOWNLOAD_STATUS.INITIATING)&&u.jsxs(u.Fragment,{children:[o===re.DOWNLOAD_STATUS.INITIATING&&u.jsx("div",{className:"text-muted",children:"Starting Download..."}),o===re.DOWNLOAD_STATUS.DOWNLOADING&&u.jsxs("div",{className:"text-muted d-flex justify-content-between",children:[u.jsx("span",{children:i||i===0?"Estimated time: ".concat(Bs.formatElapsedTime(i)):null}),u.jsx("span",{children:"".concat(r,"%")})]})]}),o===re.DOWNLOAD_STATUS.FINISHED&&u.jsx("div",{className:"text-muted text-right",children:"Download Completed"}),o===re.DOWNLOAD_STATUS.CANCELED&&u.jsx("div",{className:"text-muted",children:"Download Canceled"}),(o===re.DOWNLOAD_STATUS.DOWNLOADING||o===re.DOWNLOAD_STATUS.INITIATING)&&u.jsx("div",{className:"progress",children:u.jsx("div",{className:"progress-bar progress-bar-striped progress-bar-animated",style:{width:"".concat(r,"%")}})}),o===re.DOWNLOAD_STATUS.FINISHED&&u.jsx("div",{className:"progress",children:u.jsx("div",{className:"progress-bar bg-success",style:{width:"".concat(r,"%")}})})]}),u.jsxs(Q,{kind:"primary","data-testid":"btn-csv-exporter-download",className:K("btn-downloading",{"btn-spinner btn-cancelable":t}),onClick:this.handleDownloadClick,children:[t&&u.jsxs("span",{children:[u.jsx(Sa,{className:"mr-2 loading-spinner-vertical-align"}),u.jsx("span",{className:"btn-normal-content",children:"Downloading"}),u.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!t&&"Download"]})]})]})}}At(re,"FILENAME_DATE_FORMAT","yyyy-MM-dd-HHmmss");At(re,"DOWNLOAD_STATUS",{INITIATING:"INITIATING",DOWNLOADING:"DOWNLOADING",FINISHED:"FINISHED",CANCELED:"CANCELED"});At(re,"DOWNLOAD_ROW_OPTIONS",{ALL_ROWS:"ALL_ROWS",SELECTED_ROWS:"SELECTED_ROWS",CUSTOMIZED_ROWS:"CUSTOMIZED_ROWS"});At(re,"CUSTOMIZED_ROWS_OPTIONS",{FIRST:"FIRST",LAST:"LAST"});At(re,"DEFAULT_DOWNLOAD_ROWS",100);At(re,"defaultProps",{onDownloadStart:()=>{},isDownloading:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:null,selectedRanges:[]});const ug=re;function ne(n,e,t){return e=pc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=bc(n,"string");return typeof e=="symbol"?e:String(e)}function bc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var lt=fe.module("TableSaver"),wc="yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";function Cc(n){return n.added!==void 0}function Sc(n){if(!Cc(n))throw new Error("event is not UpdateEventData")}class Re extends R.PureComponent{static csvEscapeString(e){return'"'.concat(e.replace(/"/g,'""'),'"')}constructor(e){super(e),ne(this,"sw",void 0),ne(this,"port",void 0),ne(this,"fileWriter",void 0),ne(this,"table",void 0),ne(this,"tableSubscription",void 0),ne(this,"columns",void 0),ne(this,"fileName",void 0),ne(this,"includeColumnHeaders",void 0),ne(this,"useUnformattedValues",void 0),ne(this,"chunkRows",void 0),ne(this,"gridRanges",void 0),ne(this,"gridRangeCounter",void 0),ne(this,"rangedSnapshotsTotal",void 0),ne(this,"rangedSnapshotCounter",void 0),ne(this,"snapshotsTotal",void 0),ne(this,"snapshotCounter",void 0),ne(this,"snapshotsBuffer",void 0),ne(this,"currentSnapshotIndex",void 0),ne(this,"snapshotPending",void 0),ne(this,"cancelableSnapshots",void 0),ne(this,"streamTimeout",void 0),ne(this,"snapshotHandlerTimeout",void 0),ne(this,"downloadStartTime",void 0),ne(this,"iframe",void 0),ne(this,"useBlobFallback",void 0),ne(this,"getCachedCustomColumnFormatFlag",Pt(fo.isCustomColumnFormatDefined,{max:1e4})),this.handlePortMessage=this.handlePortMessage.bind(this),this.handleSnapshotResolved=this.handleSnapshotResolved.bind(this),this.handleDownloadTimeout=this.handleDownloadTimeout.bind(this),this.state={},this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.useBlobFallback=!1}componentDidMount(){var{getDownloadWorker:e}=this.props;e().then(t=>{lt.info("found active service worker"),this.sw=t,this.sw.postMessage("ping")}).catch(t=>{lt.warn("Download csv is not optimized.",t),this.useBlobFallback=!0})}componentWillUnmount(){this.removeIframe(),this.streamTimeout&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout&&clearTimeout(this.snapshotHandlerTimeout)}createWriterStream(e){var t=this.useBlobFallback,r=[],i=null;t&&(i=TextEncoder.prototype.encode.bind(new TextEncoder));var{fileName:a}=this,o={};return t?(o.write=s=>{ee(i),s.header!==void 0&&r.push(i(s.header)),s.rows!==void 0&&r.push(i(s.rows))},o.close=()=>{ee(a);var s=new Blob(r,{type:"application/octet-stream; charset=utf-8"}),l=document.createElement("a");l.href=URL.createObjectURL(s),l.download=a,l.click()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}):(o.write=s=>{e.postMessage(s)},o.close=()=>{e.postMessage({end:!0}),e.close()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}),new WritableStream(o)}startDownload(e,t,r,i,a,o,s){var{isDownloading:l}=this.props;if(!l){this.downloadStartTime=Date.now(),lt.info("start downloading ".concat(e)),this.table=t,this.columns=ga.columnsFromRanges(a,t.columns),this.tableSubscription=r,this.gridRanges=i,this.includeColumnHeaders=o,this.useUnformattedValues=s;var d=encodeURIComponent(e.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A"),c=new MessageChannel;if(this.port=c.port1,this.fileName=e,this.fileWriter=this.createWriterStream(this.port).getWriter(),this.useBlobFallback){this.writeCsvTable(o);return}this.sw&&this.sw.postMessage({encodedFileName:d},[c.port2]),this.port.onmessage=this.handlePortMessage}}finishDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.close();var{onDownloadCompleted:e}=this.props;e(),this.resetTableSaver(),this.downloadStartTime!==void 0&<.info("download finished, total elapsed time ".concat((Date.now()-this.downloadStartTime)/1e3," seconds"))}cancelDownload(){var e,t,r;(e=this.table)===null||e===void 0||e.close(),(t=this.tableSubscription)===null||t===void 0||t.close(),(r=this.fileWriter)===null||r===void 0||r.abort(),this.cancelableSnapshots.forEach(a=>{a&&(a.catch(()=>null),a.cancel())});var{onDownloadCanceled:i}=this.props;i(),this.resetTableSaver()}resetTableSaver(){this.table=void 0,this.tableSubscription=void 0,this.columns=void 0,this.chunkRows=void 0,this.removeIframe(),this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout!=null&&clearTimeout(this.snapshotHandlerTimeout),this.streamTimeout=void 0,this.snapshotHandlerTimeout=void 0}handleDownloadTimeout(){lt.info("download canceled"),this.cancelDownload()}writeTableHeader(){var e,t="";if(this.columns)for(var r=0;r<this.columns.length;r+=1)t+=this.columns[r].name,t+=r===this.columns.length-1?`
|
|
3
3
|
`:",";(e=this.fileWriter)===null||e===void 0||e.write({header:t}).then(()=>null)}startWriteTableBody(){this.columns&&this.gridRanges!=null&&(this.chunkRows=Math.floor(Re.DOWNLOAD_CELL_CHUNK/this.columns.length),this.rangedSnapshotsTotal=this.gridRanges.map(e=>(ee(e.endRow),ee(e.startRow),ee(this.chunkRows),Math.ceil((e.endRow-e.startRow+1)/this.chunkRows))),this.snapshotsTotal=this.rangedSnapshotsTotal.reduce((e,t)=>e+t),lt.info("start writing table, total snapshots: ",this.snapshotsTotal),this.makeSnapshot(Math.min(Re.SNAPSHOT_BUFFER_SIZE,this.snapshotsTotal)))}writeCsvTable(e){e&&this.writeTableHeader(),this.startWriteTableBody()}writeSnapshot(e,t,r){if(this.currentSnapshotIndex===e&&this.fileWriter){for(;this.snapshotsBuffer.has(this.currentSnapshotIndex);){var i=this.snapshotsBuffer.get(this.currentSnapshotIndex);ee(i),this.fileWriter.write({rows:this.convertSnapshotIntoCsv(i)}),this.snapshotsBuffer.delete(this.currentSnapshotIndex),this.currentSnapshotIndex+=1,this.updateDownloadProgress(e)}if(this.snapshotsTotal&&this.currentSnapshotIndex>=this.snapshotsTotal){this.finishDownload();return}}this.snapshotCounter&&this.snapshotsTotal&&this.snapshotCounter<this.snapshotsTotal&&(lt.debug2(`
|
|
4
4
|
current range index: `.concat(this.gridRangeCounter,`,
|
|
@@ -9,4 +9,4 @@ import{P as ca,d as De,as as Br,at as ha,e as uo,c as va,ac as oe,al as Ur,au as
|
|
|
9
9
|
making `).concat(Math.min(Re.SNAPSHOT_BUFFER_SIZE-this.snapshotsBuffer.size-this.snapshotPending,this.snapshotsTotal-this.snapshotCounter),` more snapshots
|
|
10
10
|
`)),this.makeSnapshot(Math.min(Re.SNAPSHOT_BUFFER_SIZE-this.snapshotsBuffer.size-this.snapshotPending,this.snapshotsTotal-this.snapshotCounter)))}updateDownloadProgress(e){if(e!=null&&this.snapshotsTotal!=null&&this.downloadStartTime!=null){var{onDownloadProgressUpdate:t}=this.props,r=Math.floor(e*100/this.snapshotsTotal),i=e>1?Math.floor((Date.now()-this.downloadStartTime)*(this.snapshotsTotal-e)/e/1e3):null;t(r,i)}}convertSnapshotIntoCsv(e){for(var t="",r=e.added.iterator(),{dh:i,formatter:a}=this.props,o=[];r.hasNext();)o.push(r.next().value);ee(this.columns);for(var{useUnformattedValues:s}=this,l=0;l<o.length;l+=1)for(var d=o[l],c=0;c<this.columns.length;c+=1){var{type:h,name:v}=this.columns[c],g=null;if(s){var f,m=(f=e.getData(d,this.columns[c]))!==null&&f!==void 0?f:"";m!==""&&Oe.isDateType(h)&&(m=i.i18n.DateTimeFormat.format(wc,m,i.i18n.TimeZone.getTimeZone(a.timeZone))),g=m.toString()}else{var p=this.getCachedCustomColumnFormatFlag(a,v,h),b=null;if(!p){var S=e.getFormat(d,this.columns[c]);b=(S==null?void 0:S.formatString)!=null?S:null}b?g=a.getFormattedString(e.getData(d,this.columns[c]),h,v,b):g=a.getFormattedString(e.getData(d,this.columns[c]),h,v)}t+=Re.csvEscapeString(g),t+=c===this.columns.length-1?`
|
|
11
11
|
`:","}return t}makeSnapshot(e){var t=this;if(!(e<=0)){var{dh:r}=this.props;ee(this.gridRangeCounter);var i=0,a=this.gridRanges[this.gridRangeCounter];ee(this.tableSubscription),ee(this.columns);for(var o=function(){ee(a),ee(a.startRow),ee(a.endRow),ee(t.rangedSnapshotCounter),ee(t.chunkRows);var l=a.startRow+t.rangedSnapshotCounter*t.chunkRows,d=Math.min(l+t.chunkRows-1,a.endRow),c=t.snapshotCounter;t.cancelableSnapshots.push(ca.makeCancelable(t.tableSubscription.snapshot(r.RangeSet.ofRange(l,d),t.columns).then(h=>(Sc(h),t.handleSnapshotResolved(h,c,l,d),c)).catch(h=>{lt.error(h)}),h=>{lt.info("snapshot ".concat(h," has been canceled"))})),t.rangedSnapshotCounter+=1,t.snapshotCounter+=1,t.snapshotPending+=1,t.rangedSnapshotCounter>=t.rangedSnapshotsTotal[t.gridRangeCounter]&&(t.gridRangeCounter+=1,t.rangedSnapshotCounter=0,a=t.gridRanges[t.gridRangeCounter]),i+=1};i<e;)o()}}handlePortMessage(e){var{data:t}=e,{download:r,readableStreamPulling:i}=t;if(!this.useBlobFallback){if(r!=null){var{includeColumnHeaders:a}=this;this.makeIframe("".concat(r)),this.writeCsvTable(a)}i!=null&&(this.useBlobFallback||(this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.streamTimeout=setTimeout(this.handleDownloadTimeout,Re.STREAM_TIMEOUT)))}}handleSnapshotResolved(e,t,r,i){this.snapshotHandlerTimeout=setTimeout(()=>{this.snapshotsBuffer.set(t,e),this.snapshotPending-=1,this.writeSnapshot(t,r,i),this.cancelableSnapshots[t]=null},Re.SNAPSHOT_HANDLER_TIMEOUT)}makeIframe(e){var t=document.createElement("iframe");t.hidden=!0,t.src=e,t.name="iframe",document.body.appendChild(t),this.iframe=t}removeIframe(){var e;(e=this.iframe)===null||e===void 0||e.remove(),this.iframe=void 0}render(){return null}}ne(Re,"DOWNLOAD_CELL_CHUNK",6e3);ne(Re,"SNAPSHOT_BUFFER_SIZE",5);ne(Re,"STREAM_TIMEOUT",8e3);ne(Re,"SNAPSHOT_HANDLER_TIMEOUT",5);ne(Re,"defaultProps",{isDownloading:!1,onDownloadCompleted:()=>{},onDownloadCanceled:()=>{},onDownloadProgressUpdate:()=>{}});function yc(n){var e,{group:t,onDelete:r,onColorChange:i,onNameChange:a,validateName:o}=n,{isNew:s}=t,l=R.useRef(t),d=R.useRef(null),c=R.useRef(null),[h,v]=R.useState(!1),[g,f]=R.useState(s?"":t.name),[m,p]=R.useState(s),[b,S]=R.useState(!1),y=g!==t.name?o(g):"",P=s&&!b||y==="",I=R.useCallback(()=>{v(!1)},[]);R.useEffect(function(){m&&d.current&&(d.current.focus(),d.current.select())},[m]),R.useEffect(function(){return()=>{l.current.isNew&&r(l.current)}},[r]),R.useEffect(function(){if(h){var D,x;(D=c.current)===null||D===void 0||D.click(),(x=c.current)===null||x===void 0||x.focus(),window.addEventListener("click",I,!0)}return()=>window.removeEventListener("click",I,!0)},[h,I]);var E=()=>{P&&(a(t,g),p(!1))},A=()=>{if(s){r(t);return}f(t.name),p(!1)},k=M=>{S(!0),M.key==="Enter"&&(M.stopPropagation(),E()),M.key===" "&&M.stopPropagation(),M.key==="Escape"&&A()};return m?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"editing-container",children:[u.jsx("input",{ref:d,className:K("form-control",{"is-invalid":!P}),value:g,placeholder:"Group Name",onChange:M=>f(M.target.value),onKeyDown:k,onBlur:()=>S(!0)}),u.jsx(Q,{kind:"ghost",icon:ds,tooltip:"Confirm",onClick:E}),u.jsx(Q,{kind:"ghost",icon:us,tooltip:"Cancel",onClick:A})]}),!P&&u.jsx("p",{className:"mb-0 validate-label-error text-danger",children:y})]}):u.jsxs("div",{className:"group-name-wrapper",children:[u.jsx("span",{className:"column-name",children:g}),u.jsx(Q,{className:"p-1 mx-1",kind:"ghost",icon:ba,tooltip:"Edit",onClick:()=>{p(!0)}}),u.jsxs("span",{className:"right-buttons",children:[u.jsx(Q,{kind:"ghost",icon:sr,tooltip:"Delete group",onClick:()=>r(t)}),u.jsx(Q,{kind:"ghost",className:"color-swatch mr-1",icon:t.color!==void 0?u.jsxs("span",{className:"fa-layers",children:[u.jsx(ce,{className:"color-swatch",icon:Dn,color:be.white,transform:"down-1"}),u.jsx(ce,{className:"color-swatch",icon:Dn,color:t.color,transform:"shrink-2 down-1"})]}):cs,tooltip:"Set color",onClick:()=>v(M=>!M)}),h&&u.jsxs(u.Fragment,{children:[u.jsx("input",{"aria-label":"Color input",ref:c,type:"color",list:"presetColors",value:(e=t.color)!==null&&e!==void 0?e:be["content-bg"],style:{visibility:"hidden",width:0,height:0,padding:0,border:0},onChange:M=>{t.color=M.target.value,i(t,M.target.value)}}),u.jsxs("datalist",{id:"presetColors",children:[u.jsx("option",{children:be["content-bg"]}),u.jsx("option",{children:be.primary}),u.jsx("option",{children:be.foreground}),u.jsx("option",{children:be.green}),u.jsx("option",{children:be.yellow}),u.jsx("option",{children:be.orange}),u.jsx("option",{children:be.red}),u.jsx("option",{children:be.purple}),u.jsx("option",{children:be.blue}),u.jsx("option",{children:be["gray-400"]})]})]})]})]})}function Wi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function _i(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wi(Object(t),!0).forEach(function(r){Oc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Oc(n,e,t){return e=Pc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pc(n){var e=Tc(n,"string");return typeof e=="symbol"?e:String(e)}function Tc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ic(){}var Rc=R.forwardRef(function(e,t){var{value:r,clone:i,childCount:a,item:o,onVisibilityChange:s,onClick:l,onGroupDelete:d,onGroupColorChange:c,onGroupNameChange:h,validateGroupName:v,handleProps:g}=e,{group:f,modelIndex:m,isVisible:p}=o.data,b=R.useRef(null),S=R.useCallback(P=>{if(P.buttons===1){var I;s([m].flat(),!p),(I=b.current)===null||I===void 0||I.focus()}},[s,m,p]),y=R.useCallback(P=>{l(r,P)},[l,r]);return u.jsxs("div",_i(_i({ref:t,className:K("tree-item",{isSelected:o.selected,"two-dragged":a===2,"multiple-dragged":a>2}),onClick:y},g),{},{children:[u.jsx(Q,{ref:b,kind:"ghost",className:"px-1",onClick:Ic,onMouseDown:S,onMouseEnter:S,icon:p?ya:Oa,tooltip:"Toggle visibility"}),u.jsx("span",{className:K("column-name",f&&"column-group"),children:f&&!i?u.jsx(yc,{group:f,onDelete:d,onColorChange:c,onNameChange:h,validateName:v}):r}),u.jsxs("div",{children:[i&&a>1&&u.jsx("span",{className:"item-count",children:a}),u.jsx(ar,{children:"Drag to re-order"}),u.jsx(ce,{icon:nn})]})]}))});const Dc=Rc;function Ec(n){return n.parentId!==void 0}function Ui(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ui(Object(t),!0).forEach(function(r){Mc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ui(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Mc(n,e,t){return e=xc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xc(n){var e=jc(n,"string");return typeof e=="symbol"?e:String(e)}function jc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function kc(n,e){return Math.round(n/e)}function Va(n,e,t,r,i,a){var o=n.findIndex(d=>d.name===r);if(o===-1){var s=t.get(r);if(s==null)throw new Error("Column or header group not found: ".concat(r));var l=s.childIndexes.flat();return{id:r,selected:a.has(r),children:s.children.map(d=>Va(n,e,t,d,i,a)).sort((d,c)=>{var h=Array.isArray(d.data.visibleIndex)?d.data.visibleIndex[0]:d.data.visibleIndex,v=Array.isArray(c.data.visibleIndex)?c.data.visibleIndex[0]:c.data.visibleIndex;return h-v}),data:{modelIndex:l,visibleIndex:s.getVisibleRange(e),group:s,isVisible:l.some(d=>!i.has(d))}}}return{id:r,children:[],selected:a.has(r),data:{modelIndex:o,visibleIndex:ie.getVisibleIndex(o,e),isVisible:!i.has(o)}}}function Nc(n,e,t,r,i){for(var a=[],o=new Set(i),s=new Map(t.map(h=>[h.name,h])),l=new Set(r),d=0,c=function(){for(var v=ie.getModelIndex(d,e),g=n[v].name,f=t.find(p=>{var{children:b}=p;return b.includes(g)});f!==void 0&&f.parent!==void 0;)f=s.get(f.parent);var m=Va(n,e,s,f?f.name:g,l,o);a.push(m),Array.isArray(m.data.visibleIndex)?d+=m.data.visibleIndex[1]-m.data.visibleIndex[0]+1:d+=1};d<n.length;)c();return a}function Dr(n,e,t,r,i){var a=n.findIndex(b=>{var{id:S}=b;return S===t}),o=n.findIndex(b=>{var{id:S}=b;return S===e}),s=n[o],l=Po(n,o,a),d=l[a-1],c=l[a+1],h=kc(r,i),v=s.depth+h,g=Ac({previousItem:d,nextItem:c}),f=Fc({nextItem:c}),m=v;return v>=g?m=g:v<f&&(m=f),{depth:m,maxDepth:g,minDepth:f,parentId:p()};function p(){var b;if(m===0||!d)return null;if(m===d.depth)return d.parentId;if(m>d.depth)return d.id;var S=(b=l.slice(0,a).reverse().find(y=>y.depth===m))===null||b===void 0?void 0:b.parentId;return S??null}}function Ac(n){var e,t,{previousItem:r,nextItem:i}=n;return Math.max((e=r==null?void 0:r.depth)!==null&&e!==void 0?e:0,(t=i==null?void 0:i.depth)!==null&&t!==void 0?t:0)}function Fc(n){var{nextItem:e}=n;return e?e.depth:0}function Ga(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return n.reduce((r,i,a)=>[...r,Vi(Vi({},i),{},{parentId:e,depth:t,index:a}),...Ga(i.children,i.id,t+1)],[])}function Ie(n){return n.every(Ec)?[...n]:Ga(n)}function za(n,e){for(var t=0;t<n.length;t+=1){var r=n[t],{id:i,children:a}=r;if(i===e)return r;if(a.length){var o=za(a,e);if(o)return o}}}function Ka(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return n.reduce((t,r)=>{var{children:i}=r;return i.length?Ka(i,t+1):t+1},e)}function Lc(n,e){var t=za(n,e);return t?Ka(t.children):0}function Gi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function br(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(t),!0).forEach(function(r){Hc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Hc(n,e,t){return e=$c(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $c(n){var e=Bc(n,"string");return typeof e=="symbol"?e:String(e)}function Bc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wc=[tt.Down,tt.Right,tt.Up,tt.Left],_c=[tt.Left,tt.Right];function Uc(n,e,t){return(r,i)=>{var{currentCoordinates:a,context:{active:o,over:s,collisionRect:l,droppableRects:d,droppableContainers:c}}=i;if(Wc.includes(r.code)){if(!o||!l)return;r.preventDefault();var{current:{items:h,offset:v}}=n;if(_c.includes(r.code)&&(s==null?void 0:s.id)!=null){var{depth:g,maxDepth:f,minDepth:m}=Dr(h,o.id,s.id,v,t);switch(r.code){case tt.Left:if(g>m)return br(br({},a),{},{x:a.x-t});break;case tt.Right:if(g<f)return br(br({},a),{},{x:a.x+t});break}return}var p=[];c.forEach(w=>{if(!(w!=null&&w.disabled||w.id===(s==null?void 0:s.id))){var j=d.get(w.id);if(j)switch(r.code){case tt.Down:l.top<j.top&&p.push(w);break;case tt.Up:l.top>j.top&&p.push(w);break}}});var b=To({active:o,collisionRect:l,pointerCoordinates:null,droppableRects:d,droppableContainers:p}),S=Io(b,"id");if(S===(s==null?void 0:s.id)&&b.length>1&&(S=b[1].id),S!=null&&(s==null?void 0:s.id)!=null){var y=d.get(o.id),P=d.get(S),I=c.get(S);if(y&&P&&I){var E=h.findIndex(w=>{var{id:j}=w;return j===S}),A=h[E],k=h.findIndex(w=>{var{id:j}=w;return j===o.id}),M=h[k];if(A!=null&&M!=null){var{depth:D}=Dr(h,o.id,S,(A.depth-M.depth)*t,t),x=E>k,H=x?1:-1,T=e?(l.height-y.height)/2:0,O={x:P.left+D*t,y:P.top+H*T};return O}}}}}}function Vc(n,e,t){return e=Gc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gc(n){var e=zc(n,"string");return typeof e=="symbol"?e:String(e)}function zc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xa extends Ro{}Vc(Xa,"activators",[{eventName:"onPointerDown",handler:n=>{var{nativeEvent:e}=n;return!(!e.isPrimary||e.button!==0||Xc(e.target))}}]);var Kc=["button","input","textarea","select","option"];function Xc(n){return!!((n==null?void 0:n.tagName)!=null&&Kc.includes(n.tagName.toLowerCase()))}function qa(n){var{clone:e=!1,depth:t,disableInteraction:r=!1,ghost:i=!1,handleProps:a,value:o,dragRef:s=null,wrapperRef:l=null,renderItem:d,item:c,childCount:h}=n,v=R.useMemo(()=>Array(t).fill(0).map((f,m)=>u.jsx("span",{className:"depth-line"},"depth-line-".concat(m))),[t]),g=R.useMemo(()=>({ref:s,clone:e,value:o,item:c,childCount:h,handleProps:a}),[s,e,o,c,h,a]);return u.jsxs("li",{className:K("item-wrapper",{clone:e,ghost:i,disableInteraction:r}),ref:l,children:[!e&&v,d(g)]},o)}qa.displayName="TreeItem";var qc=["id","depth"];function zi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zi(Object(t),!0).forEach(function(r){Yc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Yc(n,e,t){return e=Zc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zc(n){var e=Qc(n,"string");return typeof e=="symbol"?e:String(e)}function Qc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Jc(n,e){if(n==null)return{};var t=eh(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function eh(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var th=n=>{var{isSorting:e,wasDragging:t}=n;return!(e||t)};function Ki(n){var{id:e,depth:t}=n,r=Jc(n,qc),{attributes:i,isDragging:a,isSorting:o,listeners:s,setDraggableNodeRef:l,setDroppableNodeRef:d,transform:c,transition:h}=Do({id:e,animateLayoutChanges:th}),v=Gr.Translate.toString(c),g=R.useMemo(()=>({transform:v,transition:h}),[v,h]),f=R.useMemo(()=>wr(wr(wr({},i),s),{},{style:g}),[i,s,g]);return u.jsx(qa,wr({dragRef:l,wrapperRef:d,depth:t,ghost:a,disableInteraction:o,handleProps:f},r))}function Xi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Er(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xi(Object(t),!0).forEach(function(r){rh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rh(n,e,t){return e=nh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nh(n){var e=ih(n,"string");return typeof e=="symbol"?e:String(e)}function ih(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ah={keyframes(n){var{transform:e}=n;return[{opacity:1,transform:Gr.Transform.toString(e.initial)},{opacity:0,transform:Gr.Transform.toString(Er(Er({},e.final),{},{x:e.final.x+5,y:e.final.y+5}))}]},easing:"ease-out",sideEffects(n){var{active:e}=n;e.node.animate([{opacity:0},{opacity:1}],{duration:In.duration,easing:In.easing})}},Cr=null;function oh(n){var e;return Cr==null&&n.activeNodeRect&&n.activatorEvent instanceof PointerEvent&&(Cr=Math.floor((n.activatorEvent.clientY-n.activeNodeRect.top)/n.activeNodeRect.height)*n.activeNodeRect.height),n.activeNodeRect||(Cr=null),Er(Er({},n.transform),{},{y:n.transform.y+((e=Cr)!==null&&e!==void 0?e:0)})}function sh(n){var{items:e,renderItem:t,indentationWidth:r=30,indicator:i=!1,activeId:a,overId:o,offsetLeft:s}=n,l=Eo(),d=R.useRef(l);R.useEffect(function(){d.current=l},[l]),R.useEffect(function(){d.current.measureDroppableContainers(e.map(f=>{var{id:m}=f;return m}))},[e]);var c=a!=null&&o!=null?Dr(e,a,o,s,r):null,h=R.useRef({items:e,offset:s}),v=a!=null?e.find(g=>{var{id:f}=g;return f===a}):null;return R.useEffect(()=>{h.current={items:e,offset:s}},[e,s]),u.jsxs(u.Fragment,{children:[u.jsx("div",{className:K("tree-container",a!=null&&"marching-ants"),children:e.map(g=>{var{id:f,depth:m}=g;return u.jsx(Ki,{id:f,value:f,depth:f===a&&c?c.depth:m,item:g,renderItem:t},f)})}),Mo.createPortal(u.jsx(xo,{dropAnimation:ah,modifiers:[oh],className:"visibility-ordering-list",children:a!=null&&v?u.jsx(Ki,{id:a,depth:v.depth,clone:!0,childCount:Lc(e,a)+1,value:a.toString(),renderItem:t,item:v}):null}),document.body)]})}function qi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Sr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qi(Object(t),!0).forEach(function(r){lh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lh(n,e,t){return e=dh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dh(n){var e=uh(n,"string");return typeof e=="symbol"?e:String(e)}function uh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ch={droppable:{strategy:Lo.Always}},hh={activationConstraint:{distance:5}};function vh(n){var{items:e,indicator:t=!1,indentationWidth:r=30,onDragStart:i,onDragEnd:a,renderItem:o}=n,[s,l]=R.useState(null),[d,c]=R.useState(null),[h,v]=R.useState(0),g=R.useMemo(()=>{var M=Ie(e);return s!=null?M.filter(D=>{var{id:x,selected:H}=D;return x===s||!H}):M},[s,e]),f=s!=null&&d!=null?Dr(g,s,d,h,r):null,m=R.useRef({items:g,offset:h}),p=R.useMemo(()=>({coordinateGetter:Uc(m,t,r)}),[r,t]),b=jo(Rn(Xa,hh),Rn(Ho,p)),S=R.useMemo(()=>g.map(M=>{var{id:D}=M;return D}),[g]);R.useEffect(()=>{m.current={items:g,offset:h}},[g,h]);var y=R.useCallback(M=>{var{active:{id:D}}=M;l(D),c(D),i==null||i(D),document.body.style.setProperty("cursor","grabbing")},[i]),P=R.useCallback(M=>{var{delta:D}=M;v(D.x)},[]),I=R.useCallback(M=>{var D,{over:x}=M;c((D=x==null?void 0:x.id)!==null&&D!==void 0?D:null)},[]),E=R.useCallback(()=>{c(null),l(null),v(0),document.body.style.setProperty("cursor","")},[]),A=R.useCallback(M=>{var{active:D,over:x}=M;if(E(),f&&x){var{depth:H,parentId:T}=f,O=JSON.parse(JSON.stringify(Ie(e))),w=O.findIndex(L=>{var{id:W}=L;return W===x.id}),j=O.findIndex(L=>{var{id:W}=L;return W===D.id}),N=O[j];O[j]=Sr(Sr({},N),{},{depth:H,parentId:T}),a==null||a(N,Sr(Sr({},O[w]),{},{parentId:f.parentId}))}},[e,a,f,E]),k=R.useCallback(()=>{E()},[E]);return u.jsx(ko,{sensors:b,collisionDetection:No,measuring:ch,onDragStart:y,onDragMove:P,onDragOver:I,onDragEnd:A,onDragCancel:k,children:u.jsx(Ao,{items:S,strategy:Fo,children:u.jsx(sh,{items:g,renderItem:o,indicator:t,indentationWidth:r,activeId:s,overId:d,offsetLeft:h})})})}function Yi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Zi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yi(Object(t),!0).forEach(function(r){gh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Yi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gh(n,e,t){return e=fh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fh(n){var e=mh(n,"string");return typeof e=="symbol"?e:String(e)}function mh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ph(n,e,t,r,i,a,o,s){var l=i.map((P,I)=>Zi(Zi({},P),{},{index:I})),d=[],c=r,h=a[0].data.visibleIndex,v=l.findIndex(P=>{var{id:I}=P;return I===n.id}),g=l.findIndex(P=>{var{id:I}=P;return I===e.id}),f=Array.isArray(h)?h[1]+1:h+1;c=Ct(a[0],e.parentId,c);for(var m=1;m<a.length;m+=1){var{data:{visibleIndex:p}}=a[m];d=ie.moveItemOrRange(p,f,d,!0),f+=Array.isArray(p)?p[1]-p[0]+1:1,c=Ct(a[m],e.parentId,c)}var b=[Array.isArray(h)?h[0]:h,f-1],S=Array.isArray(e.data.visibleIndex)?e.data.visibleIndex[0]:e.data.visibleIndex,y=ie.getVisibleIndex(S,d);return v>g&&y>S&&(y-=1),e.children.length>0&&(Array.isArray(h)?h[0]:h)<y&&(y-=1),b[0]<y&&(y-=b[1]-b[0]),d=ie.moveItemOrRange(b,$e(y,o,s),d),{groups:c,movedColumns:t.concat(d)}}function Ct(n,e,t){if(n.parentId===e)return[...t];var r=t.map(p=>new Et(p)),i=new Map(r.map(p=>[p.name,p])),a=r.find(p=>p.name===n.parentId),o=r.find(p=>p.name===e),s=r.find(p=>p.name===n.id);if(a!=null&&(a.children=a.children.filter(p=>p!==n.id),a.children.length===0)){var l,d=new Set([a.name]),{parent:c=""}=a,h=i.get(c);for((l=h)===null||l===void 0||l.removeChildren([a.name]);h&&h.children.length===0;){var v,g;d.add(h.name);var f=(v=(g=h)===null||g===void 0?void 0:g.parent)!==null&&v!==void 0?v:"",m=i.get(f);m==null||m.removeChildren([h.name]),h=m}r=r.filter(p=>{var{name:b}=p;return!d.has(b)})}return o!=null&&o.addChildren([n.id]),s==null||s.setParent(e??void 0),r}function Qi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function _t(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qi(Object(t),!0).forEach(function(r){Fe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fe(n,e,t){return e=bh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bh(n){var e=wh(n,"string");return typeof e=="symbol"?e:String(e)}function wh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ch=150;class se extends R.PureComponent{static shouldRenderColumn(e){return e.isProxy!==!0}constructor(e){super(e),Fe(this,"list",void 0),Fe(this,"debouncedSearchColumns",pa(this.searchColumns,Ch)),Fe(this,"handleGroupColorChange",$o((t,r)=>{var{columnHeaderGroups:i,onColumnHeaderGroupChanged:a}=this.props,o=[...i],s=new Et(_t(_t({},t),{},{color:r}));o.splice(o.findIndex(l=>{var{name:d}=l;return d===t.name}),1,s),a(o)},250)),Fe(this,"renderItem",ge(t=>{var{value:r,clone:i,item:a,ref:o,handleProps:s}=t,{onColumnVisibilityChanged:l}=this.props,{selectedColumns:d}=this.state,c=r;if(i){var h=this.getSelectedParentItems().map(v=>{var{id:g}=v;return g});c=h.join(", ")}return u.jsx(Dc,{ref:o,value:c,clone:i,item:a,childCount:d.size,onVisibilityChange:l,onClick:this.handleItemClick,onGroupDelete:this.handleGroupDelete,onGroupColorChange:this.handleGroupColorChange,onGroupNameChange:this.handleGroupNameChange,validateGroupName:this.validateGroupName,handleProps:s})})),Fe(this,"getMemoizedFirstMovableIndex",ge((t,r,i)=>{for(var a=0;a<r.length;a+=1){var o=ie.getModelIndex(a,i);if(t.isColumnMovable(o))return a}return null})),Fe(this,"getMemoizedLastMovableIndex",ge((t,r,i)=>{for(var a=r.length-1;a>=0;a-=1){var o=ie.getModelIndex(a,i);if(t.isColumnMovable(o))return a}return null})),Fe(this,"memoizedGetTreeItems",ge((t,r,i,a,o)=>Nc(t,r,i,a,[...o.values()]))),Fe(this,"makeVisibilityOrderingList",ge((t,r)=>{var{movedColumns:i}=this.props,a=[],o=this.getFirstMovableIndex(),s=this.getLastMovableIndex(),l=r.findIndex(P=>{var{data:I}=P;return Array.isArray(I.visibleIndex)?I.visibleIndex[0]===o:I.visibleIndex===o}),d=r.findIndex(P=>{var{data:I}=P;return Array.isArray(I.visibleIndex)?I.visibleIndex[1]===s:I.visibleIndex===s}),c=r.slice(l,d+1);if(o==null||s===null){for(var h=0;h<t.length;h+=1){var v=ie.getModelIndex(h,i),g=t[v];se.shouldRenderColumn(g)&&a.push(this.renderImmovableItem(g.name))}return a}for(var f=0;f<o;f+=1){var m=ie.getModelIndex(f,i),p=t[m];se.shouldRenderColumn(p)&&a.push(this.renderImmovableItem(p.name))}o!==null&&o>0&&a.push(u.jsx("hr",{},"top-horizontal-divider")),a.push(u.jsx(vh,{items:c,renderItem:this.renderItem,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd},"movable-items")),s!=null&&s<t.length-1&&a.push(u.jsx("hr",{},"bottom-horizontal-divider"));for(var b=s+1;b<t.length;b+=1){var S=ie.getModelIndex(b,i),y=t[S];se.shouldRenderColumn(y)&&a.push(this.renderImmovableItem(y.name))}return a})),Fe(this,"renderImmovableItem",ge(t=>u.jsx("div",{className:"visibility-ordering-list-item immovable",children:u.jsx("div",{className:"column-item",children:u.jsx("span",{className:"column-name",children:t})})},t))),this.handleSearchInputChange=this.handleSearchInputChange.bind(this),this.searchColumns=this.searchColumns.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupDelete=this.handleGroupDelete.bind(this),this.handleGroupNameChange=this.handleGroupNameChange.bind(this),this.handleGroupCreate=this.handleGroupCreate.bind(this),this.validateGroupName=this.validateGroupName.bind(this),this.addColumnToSelected=this.addColumnToSelected.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.state={selectedColumns:new Set,queriedColumnIndex:void 0,queriedColumnRange:void 0,prevQueriedColumns:void 0,lastSelectedColumn:"",searchFilter:""},this.list=null}componentDidUpdate(e){var{movedColumns:t}=this.props;if(t!==e.movedColumns){var{searchFilter:r}=this.state;this.searchColumns(r,!1)}}componentWillUnmount(){this.debouncedSearchColumns.cancel()}resetVisibilityOrdering(){var{model:e,onReset:t,onMovedColumnsChanged:r,onColumnHeaderGroupChanged:i}=this.props;this.setState({selectedColumns:new Set,queriedColumnIndex:void 0,queriedColumnRange:void 0,prevQueriedColumns:void 0,lastSelectedColumn:"",searchFilter:""}),t(),i(e.initialColumnHeaderGroups),r(e.initialMovedColumns)}resetSelection(){this.setState({selectedColumns:new Set,lastSelectedColumn:""})}handleSearchInputChange(e){var t=e.target.value;if(this.setState({searchFilter:t}),!t){this.debouncedSearchColumns.cancel(),this.resetSelection();return}this.debouncedSearchColumns(t)}searchColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=Ie(this.getTreeItems()),i=r.filter(c=>{var h,v,{id:g,data:f}=c;return!((h=(v=f.group)===null||v===void 0?void 0:v.isNew)!==null&&h!==void 0&&h)&&g.toLowerCase().includes(e.toLowerCase())}),a=i.reduce((c,h)=>{var{id:v}=h,g=r.findIndex(f=>f.id===v);return _t(_t({},c),{},{[g]:v})},{});if(!t){this.setState({prevQueriedColumns:a});return}var o=i.map(c=>{var{id:h}=c;return h});if(this.addColumnToSelected(o,!1),o.length>0){var s,l=r.findIndex(c=>{var{id:h}=c;return h.toLowerCase().includes(e.toLowerCase())}),d=(s=this.list)===null||s===void 0?void 0:s.querySelectorAll(".item-wrapper")[l];d==null||d.scrollIntoView({block:"center"})}this.setState({prevQueriedColumns:a,queriedColumnIndex:void 0})}changeSelectedColumn(e){var t,{queriedColumnIndex:r,queriedColumnRange:i,prevQueriedColumns:a}=this.state,o=r;if(a!==void 0){var s=Object.keys(a).length;e==="forward"?i!==void 0?o=i.nextIndex:o===void 0||o>=s-1?o=0:o+=1:e==="back"&&(i!==void 0?o=i.prevIndex:o===void 0||o<=0?o=s-1:o-=1),this.addColumnToSelected([Object.values(a)[o]],!1);var l=parseInt(Object.keys(a)[o],10),d=(t=this.list)===null||t===void 0?void 0:t.querySelectorAll(".item-wrapper")[l];d==null||d.scrollIntoView({block:"center"}),this.setState({queriedColumnIndex:o,queriedColumnRange:void 0})}}adjustQueriedIndex(e){var{prevQueriedColumns:t}=this.state;if(t!==void 0){if(e in Object.values(t)){var r=Object.values(t).indexOf(e);this.setState({queriedColumnIndex:r,queriedColumnRange:void 0});return}for(var i=Ie(this.getTreeItems()),a=i.findIndex(h=>h.id===e),o=Object.keys(t).map(h=>parseInt(h,10)),s=o.length-1,l=0,d=0;d<o.length;d+=1){var c=o[d];if(c<a)s=d;else if(c>a){l=d;break}}this.setState({queriedColumnRange:{prevIndex:s,nextIndex:l}})}}moveSelectedColumns(e){var{columnHeaderGroups:t}=this.props,{selectedColumns:r}=this.state,i=Ie(this.getTreeItems()),a=this.getFirstMovableIndex(),o=this.getLastMovableIndex();ee(a),ee(o);var s=this.getSelectedParentItems(),l=e===se.MOVE_OPTIONS.UP||e===se.MOVE_OPTIONS.TOP;l||s.reverse();for(var d=[],c=t,h=function(){var{id:f,parentId:m,depth:p,data:{visibleIndex:b}}=s[v];switch(e){case se.MOVE_OPTIONS.TOP:{d=ie.moveItemOrRange(b,a,d,!0);var S=Array.isArray(b)?b[1]-b[0]+1:1;a+=S,c=Ct(s[v],null,c);break}case se.MOVE_OPTIONS.BOTTOM:{d=ie.moveItemOrRange(b,o,d,!0);var y=Array.isArray(b)?b[1]-b[0]+1:1;o-=y,c=Ct(s[v],null,c);break}case se.MOVE_OPTIONS.UP:{var P=i.findIndex(N=>N.id===f),I=i.map((N,L)=>L<P&&!r.has(N.id)).lastIndexOf(!0),E=i[I];if(E!=null&&E.parentId!==m)if(Math.abs(E.depth-p)>1){var A=i.map((N,L)=>L<I&&N.depth===p).lastIndexOf(!0),k=i[A];c=Ct(s[v],k.id,c)}else c=Ct(s[v],E.parentId,c);else{var M=$e(Array.isArray(b)?b[0]-1:b-1,a,o);d=ie.moveItemOrRange(b,M,d,!1);var D=Array.isArray(b)?b[1]-b[0]+1:1;a+=D}break}case se.MOVE_OPTIONS.DOWN:{var x=i.findIndex(N=>N.id===f),H=i.find((N,L)=>L>x&&!r.has(N.id));if((H==null?void 0:H.parentId)!==m){var T,O=i.find(N=>N.id===m);c=Ct(s[v],(T=O==null?void 0:O.parentId)!==null&&T!==void 0?T:null,c);break}else if((H==null?void 0:H.children.length)>0){c=Ct(s[v],H.id,c);break}var w=$e(Array.isArray(b)?b[0]+1:b+1,a,o);d=ie.moveItemOrRange(b,w,d,!1);var j=Array.isArray(b)?b[1]-b[0]+1:1;o-=j;break}}},v=0;v<s.length;v+=1)h();return{newMoves:d,groups:c}}handleMoveColumns(e){var{onMovedColumnsChanged:t,movedColumns:r,onColumnHeaderGroupChanged:i}=this.props,{newMoves:a,groups:o}=this.moveSelectedColumns(e),s;e===se.MOVE_OPTIONS.TOP&&(s=()=>{var l,d;(l=this.list)===null||l===void 0||(d=l.parentElement)===null||d===void 0||d.scroll({top:0})}),e===se.MOVE_OPTIONS.BOTTOM&&(s=()=>{var l,d;(l=this.list)===null||l===void 0||(d=l.parentElement)===null||d===void 0||d.scroll({top:this.list.parentElement.scrollHeight})}),i(o),a.length>0&&t(r.concat(a),s)}getSortMoves(e,t,r){var i=[...e],a=t===se.SORTING_OPTIONS.ASC;i.sort((v,g)=>{var f=v.id.toUpperCase(),m=g.id.toUpperCase();return mo.sort(f,m,a)});for(var o=[...r],s=Math.min(...i.flatMap(v=>{var{modelIndex:g}=v.data;return Array.isArray(g)?ie.getVisibleIndexes(g,o):ie.getVisibleIndex(g,o)})),l=0;l<i.length;l+=1){var d=i[l],{modelIndex:c}=d.data,h=Array.isArray(c)?ie.getVisibleIndexes(c,o):ie.getVisibleIndex(c,o);o=Array.isArray(h)?ie.moveRange([Math.min(...h),Math.max(...h)],s,o,!0):ie.moveItem(h,s,o),Array.isArray(h)&&(o=this.getSortMoves(d.children,t,o)),s+=Array.isArray(c)?c.length:1}return o}handleSortColumns(e){for(var t,r,{model:i,onMovedColumnsChanged:a}=this.props,o=this.getTreeItems(),s=(t=this.getFirstMovableIndex())!==null&&t!==void 0?t:0,l=(r=this.getLastMovableIndex())!==null&&r!==void 0?r:o.length-1,d=o.slice(s,l+1),c=[...i.initialMovedColumns],h=0;h<i.frozenColumns.length;h+=1){var v,g=i.frozenColumns[h],f=ie.getVisibleIndex((v=i.getColumnIndexByName(g))!==null&&v!==void 0?v:0,c);f!==h&&c.push({from:f,to:h})}var m=this.getSortMoves(d,e,c);a(m)}handleItemClick(e,t){if(t.stopPropagation(),!(t.target instanceof HTMLElement&&(t.target.tagName==="BUTTON"||t.target.tagName==="INPUT"))){t.currentTarget.focus();var{selectedColumns:r,lastSelectedColumn:i}=this.state,a=ie.isModifierKeyDown(t),o=t.shiftKey,s=r.has(e),l=[e];if(s&&a){this.removeColumnFromSelected(e);return}var d=Ie(this.getTreeItems());if(s&&!o&&i===e){var c=d.find(f=>{var{id:m}=f;return m===e});ee(c);var h=Ie(c.children).length;if(h+1===r.size){this.resetSelection();return}}if(o){var v=d.findIndex(f=>f.id===e),g=d.findIndex(f=>f.id===i);l.push(...d.slice(Math.min(g,v),Math.max(g,v)+1).map(f=>f.id))}this.addColumnToSelected(l,a||o),this.adjustQueriedIndex(e),this.setState({lastSelectedColumn:e})}}addColumnToSelected(e,t){var{selectedColumns:r}=this.state,i=new Set(t?[...r.values()].concat(e):e),a=Ie(this.getTreeItems());a.forEach(o=>{var{id:s,children:l}=o;i.has(s)&&l.forEach(d=>i.add(d.id))}),this.setState({selectedColumns:i})}removeColumnFromSelected(e){var{selectedColumns:t}=this.state,r=Ie(this.getTreeItems()),i=r.find(s=>{var{id:l}=s;return l===e});ee(i);var a=r.find(s=>{var{id:l}=s;return l===i.parentId});Ie(i==null?void 0:i.children).forEach(s=>t.delete(s.id));for(var o=function(){t.delete(a.id);var l=a.parentId;a=r.find(d=>{var{id:c}=d;return c===l})};a!=null;)o();t.delete(e),this.setState({selectedColumns:new Set(t)})}handleDragStart(e){var{selectedColumns:t}=this.state;t.has(e)||this.addColumnToSelected([e],!1)}handleDragEnd(e,t){var{movedColumns:r,onMovedColumnsChanged:i,columnHeaderGroups:a,onColumnHeaderGroupChanged:o}=this.props,s=this.getSelectedParentItems(),l=Ie(this.getTreeItems()).map((g,f)=>_t(_t({},g),{},{index:f})),d=this.getFirstMovableIndex(),c=this.getLastMovableIndex();ee(d),ee(c);var{groups:h,movedColumns:v}=ph(e,t,r,a,l,s,d,c);o(h),i(v)}handleGroupNameChange(e,t){var{columnHeaderGroups:r,onColumnHeaderGroupChanged:i}=this.props,a=[...r],o=e.name,s=a.findIndex(v=>{var{name:g}=v;return g===o}),l=a[s];ee(l);var d=new Et(l);d.name=t,a.splice(s,1,d);var c=a.findIndex(v=>{var{name:g}=v;return g===d.parent});if(c>=0){var h=new Et(a[c]);h.removeChildren([o]),h.addChildren([t]),a.splice(c,1,h)}i(a)}handleGroupDelete(e){var{columnHeaderGroups:t,onColumnHeaderGroupChanged:r}=this.props,i=t.filter(s=>s.name!==e.name),a=i.findIndex(s=>s.name===e.parent);if(a>=0){var o=new Et(i[a]);o.addChildren(e.children),o.removeChildren([e.name]),i.splice(a,1,o)}r(i)}handleGroupCreate(){var{movedColumns:e,onMovedColumnsChanged:t,onColumnHeaderGroupChanged:r}=this.props,{newMoves:i,groups:a}=this.moveSelectedColumns(se.MOVE_OPTIONS.TOP),o=a.filter(h=>!h.isNew),s=this.getSelectedParentItems(),l=s.map(h=>h.data.modelIndex).flat().filter(h=>h>=0),d="".concat(Et.NEW_GROUP_PREFIX,"-").concat(Date.now()),c=new Et({name:d,children:s.map(h=>{var{id:v}=h;return v}),depth:0,childIndexes:[...new Set(l)]});t(e.concat(i),()=>{var h,v;(h=this.list)===null||h===void 0||(v=h.parentElement)===null||v===void 0||v.scroll({top:0})}),r(o.concat([c])),this.resetSelection()}validateGroupName(e){var{model:t,columnHeaderGroups:r}=this.props,{columns:i}=t;return ln.isValidColumnName(e)?i.some(a=>{var{name:o}=a;return o===e})||r.some(a=>{var{name:o}=a;return o===e})?"Duplicate name":"":"Invalid name"}getFirstMovableIndex(){var{model:e,movedColumns:t}=this.props;return this.getMemoizedFirstMovableIndex(e,e.columns,t)}getLastMovableIndex(){var{model:e,movedColumns:t}=this.props;return this.getMemoizedLastMovableIndex(e,e.columns,t)}getTreeItems(){var{model:e,movedColumns:t,hiddenColumns:r,columnHeaderGroups:i}=this.props,{selectedColumns:a}=this.state;return this.memoizedGetTreeItems(e.columns,t,i,r,a)}getSelectedParentItems(){var{selectedColumns:e}=this.state,t=Ie(this.getTreeItems());return t.filter(r=>{var{id:i,parentId:a}=r;return e.has(i)&&!e.has(a??"")})}render(){var{model:e,hiddenColumns:t,onColumnVisibilityChanged:r}=this.props,{selectedColumns:i,searchFilter:a,prevQueriedColumns:o,queriedColumnIndex:s}=this.state,l=i.size>0,d=this.getTreeItems(),c=new Map(Ie(d).map(y=>[y.id,y.data.modelIndex])),h=new Set(t),v=[...new Set(l?[...i.values()].map(y=>c.get(y)).filter(y=>y!=null).flat():d.map(y=>y.data.modelIndex).flat())],g=v.some(y=>!h.has(y)),f=g?"Hide All":"Show All",m=g?"Hide Selected":"Show Selected",p=this.makeVisibilityOrderingList(e.columns,d),b={index:s,next:y=>this.changeSelectedColumn(y)},S=Object.keys(o??{}).length;return u.jsxs("div",{role:"menu",className:"visibility-ordering-builder",tabIndex:0,children:[u.jsxs("div",{className:"top-menu",children:[u.jsx(Q,{kind:"ghost",className:"toggle-visibility-btn",onClick:()=>{r(v,!g)},icon:g?ya:Oa,tooltip:"Toggle column visibility",children:l?m:f}),u.jsx(vn,{className:"visibility-search",value:a,matchCount:a?S:void 0,onChange:this.handleSearchInputChange,cursor:b})]}),u.jsxs("div",{className:"top-menu",children:[u.jsx(Q,{kind:"ghost",icon:hs,tooltip:"Reset to default",onClick:()=>{this.resetVisibilityOrdering()},children:"Reset"}),u.jsx("span",{className:"vertical-divider"}),u.jsx(Q,{kind:"ghost",icon:on,tooltip:"Sort ascending",onClick:()=>{this.handleSortColumns(se.SORTING_OPTIONS.ASC)}}),u.jsx(Q,{kind:"ghost",icon:sn,tooltip:"Sort descending",onClick:()=>{this.handleSortColumns(se.SORTING_OPTIONS.DSC)}}),u.jsx("span",{className:"vertical-divider"}),u.jsxs(Q,{kind:"ghost",tooltip:"Create group from selection",disabled:!l,onClick:this.handleGroupCreate,children:[u.jsxs("span",{className:"fa-layers",style:{marginRight:"0.75rem"},children:[u.jsx(ce,{mask:vs,icon:wa,transform:"right-7 down-5 shrink-6"}),u.jsx(ce,{icon:gs,transform:"right-8 down-6 shrink-8"})]}),"Group"]}),u.jsx("span",{className:"vertical-divider"}),u.jsx(Q,{kind:"ghost",icon:fs,tooltip:"Move selection up",onClick:()=>{this.handleMoveColumns(se.MOVE_OPTIONS.UP)},disabled:!l}),u.jsx(Q,{kind:"ghost",icon:ms,tooltip:"Move selection down",onClick:()=>{this.handleMoveColumns(se.MOVE_OPTIONS.DOWN)},disabled:!l}),u.jsx(Q,{kind:"ghost",icon:ps,tooltip:"Move selection to top",onClick:()=>{this.handleMoveColumns(se.MOVE_OPTIONS.TOP)},disabled:!l}),u.jsx(Q,{kind:"ghost",icon:bs,tooltip:"Move selection to bottom",onClick:()=>{this.handleMoveColumns(se.MOVE_OPTIONS.BOTTOM)},disabled:!l})]}),u.jsx("div",{role:"menu",className:K("visibility-ordering-list"),children:u.jsx("div",{className:"column-list",ref:y=>{this.list=y},children:p})})]})}}Fe(se,"SORTING_OPTIONS",{DSC:"DSC",ASC:"ASC"});Fe(se,"MOVE_OPTIONS",{TOP:"TOP",BOTTOM:"BOTTOM",UP:"UP",DOWN:"DOWN"});const cg=se;function Ji(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Sh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Ji(a,r,i,o,s,"next",l)}function s(l){Ji(a,r,i,o,s,"throw",l)}o(void 0)})}}function yh(n,e,t){return e=Oh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oh(n){var e=Ph(n,"string");return typeof e=="symbol"?e:String(e)}function Ph(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yr=fe.module("DownloadServiceWorkerUtils");class Ot{static register(e){Ot.serviceWorkerRegistration&&Ot.unregisterSW(),"serviceWorker"in navigator?navigator.serviceWorker.register(e).then(t=>{t.update(),Ot.serviceWorkerRegistration=t,yr.info("Registering service worker on ",e,t)}).catch(t=>{yr.error("Failed to register service worker",t)}):yr.info("Service worker is not supported.")}static getServiceWorker(){return Sh(function*(){if("serviceWorker"in navigator){var e=Ot.serviceWorkerRegistration;if(e&&e.active)return yr.info("Download service worker is active."),e.active;throw new Error("Can not find download service worker.")}throw new Error("Download service worker is not available.")})()}static unregisterSW(){var e;(e=Ot.serviceWorkerRegistration)===null||e===void 0||e.unregister()}}yh(Ot,"serviceWorkerRegistration",null);const hg=Ot;var Th={TOGGLE_QUICK_FILTER:pe.createAndAdd({id:"TABLE.TOGGLE_QUICK_FILTER",name:"Toggle Quick Filter",shortcut:[q.CTRL,U.F],macShortcut:[q.CMD,U.F]}),CLEAR_ALL_FILTERS:pe.createAndAdd({id:"TABLE.CLEAR_ALL_FILTERS",name:"Clear All Table Filters",shortcut:[q.CTRL,U.E],macShortcut:[q.CMD,U.E]}),CLEAR_FILTERS:pe.createAndAdd({id:"TABLE.CLEAR_FILTERS",name:"Clear Active Table Filters",shortcut:[q.CTRL,q.SHIFT,U.E],macShortcut:[q.CMD,q.SHIFT,U.E]}),REVERSE:pe.createAndAdd({id:"TABLE.REVERSE",name:"Reverse",shortcut:[q.CTRL,U.I],macShortcut:[q.CMD,U.I]}),TOGGLE_SEARCH:pe.createAndAdd({id:"TABLE.TOGGLE_SEARCH",name:"Toggle Search",shortcut:[q.CTRL,q.SHIFT,U.F],macShortcut:[q.CMD,q.SHIFT,U.F]}),GOTO_ROW:pe.createAndAdd({id:"TABLE.GOTO_ROW",name:"Go to Row",shortcut:[q.CTRL,U.G],macShortcut:[q.CMD,U.G]})},Ih={COMMIT:pe.createAndAdd({id:"INPUT_TABLE.COMMIT",name:"Commit",shortcut:[q.CTRL,U.S],macShortcut:[q.CMD,U.S]}),DISCARD:pe.createAndAdd({id:"INPUT_TABLE.DISCARD",name:"Discard",shortcut:[q.CTRL,q.ALT,U.S],macShortcut:[q.CMD,q.OPTION,U.S]})},Rh={TABLE:Th,INPUT_TABLE:Ih};const vg=Rh;class gg extends Yt{getGridY(e){var t=super.getGridY(e),{isFilterBarShown:r,theme:i,advancedFilters:a,quickFilters:o,sorts:s,reverseType:l}=e;return r?t+=i.filterBarHeight:(o!=null&&o.size>0||a!=null&&a.size>0)&&(t+=i.filterBarCollapsedHeight),l!==Oe.REVERSE_TYPE.NONE&&s!=null&&s.length>0&&(t+=i.reverseHeaderBarHeight),t}getUserColumnWidths(){return this.userColumnWidths}}var Qr=16,Dh=new Map([["sortUp",ws],["sortDown",Cs],["caretDown",Ss],["caretRight",ys],["cellOverflow",Os]]),Eh=Pt(n=>{var e=Dh.get(n);if(e===void 0)throw new Error("Icon is undefined");var t=Array.isArray(e.icon[4])?e.icon[4][0]:e.icon[4],r=new Path2D(t),i=new Path2D,a={a:Qr/e.icon[0],d:Qr/e.icon[1]};return i.addPath(r,a),i},{max:1e3});function ir(n){return Eh(n)}class Mh{static drawTreeMarker(e,t,r,i,a,o,s){e.save();var{x1:l,y1:d}=a,c=ir(s?"caretDown":"caretRight"),h=r+l-2,v=i+d+2.5;e.fillStyle=o,e.textAlign="center",e.translate(h,v),e.fill(c),e.restore()}}const Ya=Mh;class xh extends Ua{drawCellContent(e,t,r,i){var a,{metrics:o,model:s}=t,{modelColumns:l,modelRows:d}=o,c=C(d,i),h=l.get(r);if(h!==void 0){var v=s.valueForCell(h,c);if(Oe.isTextType((a=s.columns[h])===null||a===void 0?void 0:a.type)&&(v===null||v==="")){var g=e.font;e.font="italic ".concat(g),super.drawCellContent(e,t,r,i),e.font=g;return}super.drawCellContent(e,t,r,i)}}getTextRenderMetrics(e,t,r){var i=ie.getTextRenderMetrics(e,t,r),{mouseX:a,mouseY:o,metrics:s,theme:l}=e;if(a==null||o==null)return i;var{column:d,row:c}=ie.getGridPointFromXY(a,o,s);if(t===d&&r===c){var{left:h}=this.getCellOverflowButtonPosition(a,o,s,l);this.shouldRenderOverflowButton(e)&&h!=null&&(i.width=h-s.gridX-i.x)}return i}getCellOverflowButtonPosition(e,t,r,i){var a={left:null,top:null,width:null,height:null};if(e==null||t==null||r==null)return a;var{rowHeight:o,columnWidth:s,left:l,top:d}=ie.getCellInfoFromXY(e,t,r);if(l==null||s==null||d==null)return a;var{width:c,verticalBarWidth:h}=r,{cellHorizontalPadding:v}=i,g=Qr+2*v,f=o,m=Math.min(r.gridX+l+s,c-h),p=m-g,b=r.gridY+d;return{left:p,top:b,width:g,height:f}}shouldRenderOverflowButton(e){var t,r,{context:i,mouseX:a,mouseY:o,metrics:s,model:l,theme:d}=e;if(a==null||o==null)return!1;var{row:c,column:h,modelRow:v,modelColumn:g}=ie.getCellInfoFromXY(a,o,s);if(c==null||h==null||v==null||g==null||!Oe.isStringType(l.columns[g].type))return!1;var f=(t=l.textForCell(g,v))!==null&&t!==void 0?t:"",{width:m}=ie.getTextRenderMetrics(e,h,c),p=(r=s.fontWidths.get(d.font))!==null&&r!==void 0?r:Nt;i.save(),i.font=d.font;var b=this.getCachedTruncatedString(i,f,m,p,l.truncationCharForCell(g,v));return i.restore(),f!==""&&b!==f}drawTreeMarker(e,t,r,i,a,o,s){Ya.drawTreeMarker(e,t,r,i,a,o,s)}}const jh=xh;class kh extends _a{drawTreeMarker(e,t,r,i,a,o,s){Ya.drawTreeMarker(e,t,r,i,a,o,s)}}const Nh=kh;function ea(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ta(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(t),!0).forEach(function(r){Jr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Jr(n,e,t){return e=Ah(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ah(n){var e=Fh(n,"string");return typeof e=="symbol"?e:String(e)}function Fh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _r=Object.freeze({SORT_UP:"sortUp",SORT_DOWN:"sortDown",CARET_DOWN:"caretDown",CARET_RIGHT:"caretRight",CELL_OVERFLOW:"cellOverflow"}),ra=10;class en extends kt{constructor(){super(...arguments),Jr(this,"textCellRenderer",new jh),Jr(this,"dataBarCellRenderer",new Nh)}static isFilterValid(e,t){var r=e==null||e.filter!=null,i=t==null||t.filter!=null;return r&&i}getSortIcon(e){return e?e.direction===Oe.sortDirection.ascending?ir(_r.SORT_UP):e.direction===Oe.sortDirection.descending?ir(_r.SORT_DOWN):null:null}drawCanvas(e){super.drawCanvas(e),this.drawScrim(e)}drawGrid(e,t){super.drawGrid(e,t),this.drawCellOverflowButton(t)}drawGridLines(e,t){super.drawGridLines(e,t),this.drawGroupedColumnLine(e,t),this.drawPendingRowLine(e,t)}drawCellContent(e,t,r,i){var{metrics:a,model:o}=t,{modelColumns:s,modelRows:l}=a,d=s.get(r),c=C(l,i);if(d!==void 0){var h=o.renderTypeForCell(d,c),v=this.getCellRenderer(h);v.drawCellContent(e,t,r,i)}}getCellOverflowButtonPosition(e){var{mouseX:t,mouseY:r,metrics:i,theme:a}=e;return this.textCellRenderer.getCellOverflowButtonPosition(t,r,i,a)}shouldRenderOverflowButton(e){return this.textCellRenderer.shouldRenderOverflowButton(e)}drawCellOverflowButton(e){var{context:t,mouseX:r,mouseY:i,theme:a}=e;if(!(r==null||i==null)&&this.shouldRenderOverflowButton(e)){var{left:o,top:s,width:l,height:d}=this.getCellOverflowButtonPosition(e),{cellHorizontalPadding:c,overflowButtonColor:h,overflowButtonHoverColor:v}=a;t.save(),v!=null&&o!=null&&l!=null&&s!=null&&d!=null&&r>=o&&r<=o+l&&i>=s&&i<=s+d?t.fillStyle=v:h!=null&&(t.fillStyle=h);var g=ir(_r.CELL_OVERFLOW);o!=null&&s!=null&&t.translate(o+c,s+2),t.fill(g),t.restore()}}drawGroupedColumnLine(e,t){var{metrics:r,model:i,theme:a}=t,{groupedColumns:o}=i,{maxY:s,allColumnWidths:l,allColumnXs:d}=r;if(!(o.length===0||a.groupedColumnDividerColor==null)){var c=o.length-1,h=d.get(c),v=l.get(c);if(!(h==null||v==null)){var g=h+v+.5;e.strokeStyle=a.groupedColumnDividerColor,e.lineWidth=1,e.beginPath(),e.moveTo(g,0),e.lineTo(g,s),e.stroke()}}}drawPendingRowLine(e,t){var{metrics:r,model:i,theme:a}=t,{allRowYs:o,maxX:s}=r,{pendingRowCount:l}=i;if(!(l<=0)){var d=i.rowCount-i.pendingRowCount-i.floatingBottomRowCount,c=o.get(d);c!=null&&(c-=.5,e.save(),e.setLineDash([4,2]),e.strokeStyle=a.pendingTextColor,e.lineWidth=1,e.beginPath(),e.moveTo(0,c),e.lineTo(s,c),e.stroke(),e.restore())}}drawMouseColumnHover(e,t){var{theme:r,metrics:i,hoverSelectColumn:a}=t;if(!(a==null||r.linkerColumnHoverBackgroundColor==null)){var{allColumnWidths:o,allColumnXs:s,maxY:l}=i,d=C(s,a),c=C(o,a);e.fillStyle=r.linkerColumnHoverBackgroundColor,e.fillRect(d,0,c,l)}}drawMouseRowHover(e,t){var{isSelectingColumn:r}=t;r||super.drawMouseRowHover(e,t)}drawScrim(e){var{context:t,loadingScrimProgress:r,metrics:i,theme:a}=e;if(r!=null){var{width:o,height:s,gridY:l}=i,{scrimBlurSize:d,scrimColor:c}=a;t.save(),t.globalCompositeOperation="color",t.filter="blur(".concat(d,"px)"),c!=null&&(t.fillStyle=c),t.beginPath(),t.rect(0,l,o,s-l),t.clip(),t.fillRect(-d,-d+l,d*2+o,(d*2+(s-l))*r),t.globalCompositeOperation="source-over",t.filter="blur(".concat(d,"px) opacity(15%)"),t.fillRect(-d,-d+l,d*2+o,(d*2+(s-l))*r),t.restore()}}drawColumnHeaders(e,t){super.drawColumnHeaders(e,t);var{theme:r,metrics:i,model:a,reverseType:o}=t,{columnHeaderHeight:s}=i;if(this.drawFilterHeaders(e,t),!(s<=0)){var{sort:l}=a;if(l.length===1){var d=o!==Oe.REVERSE_TYPE.NONE,c;d?c=r.headerReverseBarColor:c=r.headerSortBarColor,this.drawHeaderBar(e,t,c,d?r.reverseHeaderBarHeight:r.sortHeaderBarHeight)}else l.length>1&&(o!==Oe.REVERSE_TYPE.NONE&&this.drawHeaderBar(e,t,r.headerReverseBarColor,r.reverseHeaderBarHeight,!1),this.drawHeaderBar(e,t,r.headerSortBarColor,r.sortHeaderBarHeight))}}drawHeaderBar(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,{theme:o,metrics:s,model:l}=t,{columnHeaderHeight:d,width:c}=s,h=0;a||(h=i),e.fillStyle=o.headerBarCasingColor,e.fillRect(0,l.columnHeaderMaxDepth*d-i-2+h,c,i+2),e.fillStyle=r,e.fillRect(0,l.columnHeaderMaxDepth*d-i-1+h,c,i)}drawColumnHeadersAtDepth(e,t,r,i,a){var{metrics:o,model:s,isMenuShown:l}=t,{columnHeaderMaxDepth:d}=s,{width:c}=o,h=ta(ta({},i),{},{maxX:a===d-1&&i.maxX===c?c-(l?0:30):i.maxX});super.drawColumnHeadersAtDepth(e,t,r,h,a)}drawColumnHeaderAtIndex(e,t,r,i){var a,o;super.drawColumnHeaderAtIndex(e,t,r,i);var{metrics:s,model:l,theme:d}=t,{modelColumns:c,allColumnWidths:h,allColumnXs:v,gridX:g,columnHeaderHeight:f,fontWidths:m}=s,{headerHorizontalPadding:p}=d,b=C(h,r,0),S=C(v,r)+g,y=c.get(r);if(y!=null){var P=(a=l.columns[y])===null||a===void 0?void 0:a.name;if(P!=null){var I=Oe.getSortForColumn(l.sort,P);if(I){var E=this.getSortIcon(I);if(E){var A=l.textForColumnHeader(y);if(A!==void 0){var k=(o=m.get(e.font))!==null&&o!==void 0?o:Nt;ee(k);var M=A.length*k,D=g+S+M+p,{maxX:x}=i;x-=p;var H=g+S+b-p-1,T=D>x?D+1:Math.min(x,H),O=I.direction===Oe.sortDirection.ascending?-6:-12,w=f*.5+O;e.save(),e.beginPath(),e.rect(S,0,b,f),e.clip(),e.fillStyle=d.headerSortBarColor,e.translate(T,w),e.fill(E),e.restore()}}}}}}drawFilterHeaders(e,t){var{isFilterBarShown:r,quickFilters:i,advancedFilters:a}=t;r?this.drawExpandedFilterHeaders(e,t):(i!=null&&i.size>0||a!=null&&a.size>0)&&this.drawCollapsedFilterHeaders(e,t)}drawExpandedFilterHeaders(e,t){var{metrics:r,model:i,theme:a,quickFilters:o,advancedFilters:s}=t,{filterBarHeight:l}=a;if(!(l<=0)){var{gridX:d,gridY:c,maxX:h,modelColumns:v,visibleColumns:g,allColumnWidths:f,allColumnXs:m}=r,p=c-l;e.save(),e.font=a.font,e.textAlign="left",o!=null&&o.size>0||s!=null&&s.size>0?e.fillStyle=a.filterBarExpandedActiveBackgroundColor:e.fillStyle=a.filterBarExpandedBackgroundColor,e.fillRect(d,p,h,l-1),e.fillStyle=a.headerBarCasingColor,e.fillRect(d,p+l-1,h,1);var b=p;e.strokeStyle=a.filterBarSeparatorColor,e.beginPath();for(var S=0;S<g.length;S+=1){var y=g[S],P=C(v,y),I=C(m,y),E=C(f,y);if(i.isFilterable(P)&&E>0){var A=d+(I??0);e.rect(A+.5,b+.5,E,l-2)}}e.stroke();for(var k=0;k<g.length;k+=1){var M=g[k],D=C(f,M),x=C(m,M),H=x+d;this.drawExpandedFilterHeader(e,t,M,H,D)}e.restore()}}drawExpandedFilterHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,theme:s,quickFilters:l,advancedFilters:d}=t,{modelColumns:c,gridY:h}=o,{filterBarHeight:v,filterBarExpandedActiveCellBackgroundColor:g,filterBarErrorColor:f,filterBarHorizontalPadding:m,headerColor:p}=s,b=h-v,S=c.get(r);if(S!==void 0){var y=l.get(S),P=d.get(S);if(!(y==null&&P==null)){var I=null;if(y!=null){var{text:E}=y;if(I=E,I||(I=Oe.getFilterText(y.filter)),I!=null){var{fontWidths:A}=o,k=A.get(e.font);(k==null||k===0)&&(k=e.measureText("8").width,k||(k=10));var M=(a-m*2)/k;M<=0?I="":I.length>M&&(I="".concat(I.substring(0,M-1),"…"))}}e.save();var D=en.isFilterValid(P,y);if(D&&g!=null)e.fillStyle=g,e.fillRect(i+1,b+1,a-1,v-3);else if(f!=null){e.fillStyle=f,e.lineWidth=2,e.strokeStyle=f;var x=i+2,H=b+2,T=a-3,O=v-5;e.strokeRect(x,H,T,O)}if(I!=null&&I!==""){var w=i+m,j=b+v*.5+1;e.fillStyle=p,e.fillText(I,w,j)}e.restore()}}}}drawCollapsedFilterHeaders(e,t){var{metrics:r,theme:i}=t,{headerSeparatorColor:a,filterBarCollapsedHeight:o}=i;if(!(o<=0)){var{gridX:s,gridY:l,maxX:d,visibleColumns:c,allColumnWidths:h,allColumnXs:v}=r,g=l-o;e.save(),e.fillStyle=a,e.fillRect(s,g,d,o);for(var f=0;f<c.length;f+=1){var m=c[f],p=h.get(m),b=v.get(m);if(b!=null&&p!=null){var S=b+s;this.drawCollapsedFilterHeader(e,t,m,S,p)}}e.restore()}}drawCollapsedFilterHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,theme:s,quickFilters:l,advancedFilters:d}=t,{modelColumns:c,gridY:h}=o,v=c.get(r);if(v!==void 0){var g=l.get(v),f=d.get(v),{filterBarCollapsedHeight:m,filterBarActiveColor:p,filterBarActiveBackgroundColor:b,filterBarErrorColor:S}=s;e.save();var y=en.isFilterValid(f,g);b!=null&&g==null&&f==null?e.fillStyle=b:p!=null&&y?e.fillStyle=p:S!=null&&(e.fillStyle=S);var P=i+1,I=h-m,E=a-1,A=m-1;e.fillRect(P,I,E,A),e.restore()}}}drawRowFooters(e,t){var{metrics:r,model:i,mouseX:a,mouseY:o,theme:s}=t,{gridY:l,gridX:d,maxX:c,modelRows:h,floatingTopHeight:v,floatingBottomHeight:g,floatingRows:f,rowFooterWidth:m,height:p,horizontalBarHeight:b,verticalBarWidth:S,allRowHeights:y,allRowYs:P,width:I}=r;if(!(m<=0||f.length===0)){var{cellHorizontalPadding:E,floatingGridRowColor:A,floatingRowBackgroundColors:k,headerColor:M,rowHoverBackgroundColor:D}=s;e.translate(d,l),e.beginPath();var x=Math.min(c,I-m-S-d);e.fillStyle=k,v>0&&e.rect(x,0,m,v),g>0&&e.rect(x,p-l-b-g,m,g),e.fill();var H=a!=null&&o!=null&&a>=d&&a<=c+m?ie.getRowAtY(o,r):null;if(D!=null&&H!==null&&f.includes(H)){e.fillStyle=D;var T=P.get(H),O=y.get(H);ee(T),ee(O),e.fillRect(x,T,m,O)}if(e.beginPath(),A!=null&&(e.strokeStyle=A),v>0&&(e.moveTo(x+.5,.5),e.lineTo(x+.5,v-.5)),g>0){var w=p-l-b-g;e.moveTo(x-.5,w+.5),e.lineTo(x-.5,w+g-.5)}e.stroke(),e.fillStyle=M,e.textAlign="left";for(var j=x+E,N=0;N<f.length;N+=1){var L=f[N],W=y.get(L),_=P.get(L),F=h.get(L);if(_!=null&&W!=null&&F!=null){var $=_+W*.5;e.fillText(i.textForRowFooter(F),j,$)}}e.translate(-d,-l)}}getExpandButtonPosition(e,t){var{mouseX:r,mouseY:i,metrics:a,theme:o}=e,s={left:null,top:null,width:null,height:null};if(r==null||i==null||t==null||!a)return s;var{rowHeight:l,left:d,top:c}=ie.getCellInfoFromXY(r,i,a);ee(d),ee(l),ee(c);var{cellHorizontalPadding:h}=o,v=ra+2*h,g=Math.max(d+ra*t,a.gridX),f=a.gridY+c;return{left:g,top:f,width:v,height:l}}}const Lh="12px Fira Sans, sans-serif",Hh="var(--dh-color-white)",$h="var(--dh-color-black)",na={"grid-bg":"var(--dh-color-grid-bg)",font:Lh,white:Hh,black:$h,"header-bg":"var(--dh-color-grid-header-bg)","header-color":"var(--dh-color-grid-header-text)","header-height":"30px","header-separator-color":"var(--dh-color-grid-header-separator)","header-separator-hover-color":"var(--dh-color-grid-header-separator-hover)","header-hidden-separator-hover-color":"var(--dh-color-grid-header-separator-hidden-hover)","header-sort-bar-color":"var(--dh-color-grid-header-sort-bar)","header-reverse-bar-color":"var(--dh-color-grid-header-reverse-bar)","header-bar-casing-color":"var(--dh-color-grid-header-bar-casing)","header-font":"600 12px Fira Sans, sans-serif","row-height":"19px","row-background-colors":"var(--dh-color-grid-row-0-bg) var(--dh-color-grid-row-1-bg)","active-cell-selection-border-width":"2px","selection-color":"var(--dh-color-grid-selection)","selection-outline-color":"var(--dh-color-grid-selection-outline)","selection-outline-casing-color":"var(--dh-color-grid-selection-outline-casing)","row-hover-bg":"var(--dh-color-grid-row-hover-bg)","row-shadow-alpha":"var(--dh-color-grid-row-shadow-alpha)","selected-row-hover-bg":"var(--dh-color-grid-row-hover-bg-selected)","scroll-bar-active-selection-tick-color":"var(--dh-color-grid-scroll-bar-active-selection-tick)","scroll-bar-bg":"var(--dh-color-grid-scroll-bar-bg)","scroll-bar-hover-bg":"var(--dh-color-grid-scroll-bar-hover-bg)","scroll-bar-casing-color":"var(--dh-color-grid-scroll-bar-casing)","scroll-bar-corner-color":"var(--dh-color-grid-scroll-bar-corner)","scroll-bar-color":"var(--dh-color-grid-scroll-bar)","scroll-bar-hover-color":"var(--dh-color-grid-scroll-bar-hover)","scroll-bar-active-color":"var(--dh-color-grid-scroll-bar-active)","text-color":"var(--dh-color-grid-text)","hyperlink-color":"var(--dh-color-grid-text-hyperlink)","positive-number-color":"var(--dh-color-grid-number-positive)","negative-number-color":"var(--dh-color-grid-number-negative)","zero-number-color":"var(--dh-color-grid-number-zero)","date-color":"var(--dh-color-grid-date)","pending-text-color":"var(--dh-color-grid-text-pending)","error-text-color":"var(--dh-color-grid-text-error)","null-string-color":"var(--dh-color-grid-string-null)","filter-bar-active-bg":"var(--dh-color-grid-filter-bar-active-bg)","filter-bar-active-color":"var(--dh-color-grid-filter-bar-active)","filter-bar-expanded-bg":"var(--dh-color-grid-filter-bar-expanded-bg)","filter-bar-expanded-active-bg":"var(--dh-color-grid-filter-bar-expanded-active-bg)","filter-bar-expanded-active-cell-bg":"var(--dh-color-grid-filter-bar-expanded-active-cell-bg)","filter-bar-separator-color":"var(--dh-color-grid-filter-bar-separator)","filter-bar-error-color":"var(--dh-color-grid-filter-bar-error)","filter-icon-color":"var(--dh-color-grid-filter-icon)","scrim-color":"var(--dh-color-grid-scrim)","context-menu-sort-icon-color":"var(--dh-color-grid-context-menu-sort-icon)","context-menu-reverse-icon-color":"var(--dh-color-grid-context-menu-reverse-icon)","linker-column-hover-bg":"var(--dh-color-grid-column-linker-hover-bg)","tree-line-color":"var(--dh-color-grid-tree-line)","tree-marker-color":"var(--dh-color-grid-tree-marker)","tree-marker-hover-color":"var(--dh-color-grid-tree-marker-hover)","grouped-column-divider-color":"var(--dh-color-grid-column-grouped-divider)","floating-grid-row-color":"var(--dh-color-grid-floating-row)","floating-row-background-colors":"var(--dh-color-grid-floating-row-bg)","floating-divider-inner-color":"var(--dh-color-grid-floating-divider-inner)","floating-divider-outer-color":"var(--dh-color-grid-floating-divider-outer)","overflow-button-color":"var(--dh-color-grid-overflow-button)","overflow-button-hover-color":"var(--dh-color-grid-overflow-button-hover)","zero-line-color":"var(--dh-color-grid-data-bar-zero-line)","positive-bar-color":"var(--dh-color-grid-data-bar-positive)","negative-bar-color":"var(--dh-color-grid-data-bar-negative)","marker-bar-color":"var(--dh-color-grid-data-bar-marker)"};function ia(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function aa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ia(Object(t),!0).forEach(function(r){Bh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ia(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Bh(n,e,t){return e=Wh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wh(n){var e=_h(n,"string");return typeof e=="symbol"?e:String(e)}function _h(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var oa=fe.module("IrisGridTheme");function Uh(){var n,e=Pa(na);return e["row-background-colors"]=Ps((n=e["row-background-colors"])!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return Ca.normalizeCssColor(e["row-background-colors"].substring(r,i+1))}).join(" "),oa.debug2("Iris grid theme:",na),oa.debug2("Iris grid theme derived:",e),Object.freeze(aa(aa({},xu),{},{backgroundColor:e["grid-bg"],white:e.white,black:e.black,font:e.font,headerBackgroundColor:e["header-bg"],headerColor:e["header-color"],headerSeparatorColor:e["header-separator-color"],headerSeparatorHoverColor:e["header-separator-hover-color"],headerHiddenSeparatorHoverColor:e["header-hidden-separator-hover-color"],headerSortBarColor:e["header-sort-bar-color"],headerReverseBarColor:e["header-reverse-bar-color"],headerBarCasingColor:e["header-bar-casing-color"],headerFont:e["header-font"],rowBackgroundColors:e["row-background-colors"],rowHoverBackgroundColor:e["row-hover-bg"],selectionColor:e["selection-color"],selectionOutlineColor:e["selection-outline-color"],selectionOutlineCasingColor:e["selection-outline-casing-color"],selectedRowHoverBackgroundColor:e["selected-row-hover-bg"],scrollBarBackgroundColor:e["scroll-bar-bg"],scrollBarHoverBackgroundColor:e["scroll-bar-hover-bg"],scrollBarCasingColor:e["scroll-bar-casing-color"],scrollBarCornerColor:e["scroll-bar-corner-color"],scrollBarColor:e["scroll-bar-color"],scrollBarHoverColor:e["scroll-bar-hover-color"],scrollBarActiveColor:e["scroll-bar-active-color"],scrollBarSelectionTickColor:e["selected-row-hover-bg"],scrollBarActiveSelectionTickColor:e["scroll-bar-active-selection-tick-color"],textColor:e["text-color"],hyperlinkColor:e["hyperlink-color"],positiveNumberColor:e["positive-number-color"],negativeNumberColor:e["negative-number-color"],zeroNumberColor:e["zero-number-color"],dateColor:e["date-color"],pendingTextColor:e["pending-text-color"],errorTextColor:e["error-text-color"],nullStringColor:e["null-string-color"],filterBarActiveBackgroundColor:e["filter-bar-active-bg"],filterBarExpandedBackgroundColor:e["filter-bar-expanded-bg"],filterBarExpandedActiveBackgroundColor:e["filter-bar-expanded-active-bg"],filterBarExpandedActiveCellBackgroundColor:e["filter-bar-expanded-active-cell-bg"],filterBarSeparatorColor:e["filter-bar-separator-color"],filterBarActiveColor:e["filter-bar-active-color"],filterBarErrorColor:e["filter-bar-error-color"],filterIconColor:e["filter-icon-color"],scrimColor:e["scrim-color"],contextMenuSortIconColor:e["context-menu-sort-icon-color"],contextMenuReverseIconColor:e["context-menu-reverse-icon-color"],allowRowResize:!1,autoSelectRow:!0,gridColumnColor:null,gridRowColor:null,groupedColumnDividerColor:e["grouped-column-divider-color"],columnHoverBackgroundColor:null,headerHorizontalPadding:12,scrollBarSize:13,scrollBarHoverSize:16,minScrollHandleSize:24,rowHeight:parseInt(e["row-height"],10)||19,columnWidth:100,rowHeaderWidth:0,rowFooterWidth:60,columnHeaderHeight:parseInt(e["header-height"],10)||30,filterBarHeight:30,filterBarCollapsedHeight:5,sortHeaderBarHeight:2,reverseHeaderBarHeight:4,filterBarHorizontalPadding:4,activeCellSelectionBorderWidth:parseInt(e["active-cell-selection-border-width"],10)||2,shadowAlpha:parseFloat(e["row-shadow-alpha"])||.15,scrimBlurSize:25,minScrimTransitionTime:150,maxScrimTransitionTime:350,scrollSnapToRow:!0,linkerColumnHoverBackgroundColor:e["linker-column-hover-bg"],treeLineColor:e["tree-line-color"],treeMarkerColor:e["tree-marker-color"],treeMarkerHoverColor:e["tree-marker-hover-color"],floatingGridColumnColor:null,floatingGridRowColor:e["floating-grid-row-color"],floatingRowBackgroundColors:e["floating-row-background-colors"],floatingDividerInnerColor:e["floating-divider-inner-color"],floatingDividerOuterColor:e["floating-divider-outer-color"],overflowButtonColor:e["overflow-button-color"],overflowButtonHoverColor:e["overflow-button-hover-color"],zeroLineColor:e["zero-line-color"],positiveBarColor:e["positive-bar-color"],negativeBarColor:e["negative-bar-color"],markerBarColor:e["marker-bar-color"]}))}const Vh="var(--dh-color-editor-bg)",Gh="var(--dh-color-editor-fg)",zh="var(--dh-color-editor-string)",Kh="var(--dh-color-editor-delimiter)",Xh="var(--dh-color-editor-predefined)",qh="var(--dh-color-editor-keyword)",Yh="var(--dh-color-editor-storage)",Zh="var(--dh-color-editor-number)",Qh="var(--dh-color-editor-operator)",Jh="var(--dh-color-editor-identifier)",ev="var(--dh-color-editor-comment)",sa={"error-foreground":"var(--dh-color-editor-error-fg)",background:Vh,foreground:Gh,"line-height":"19px",string:zh,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:Kh,predefined:Xh,keyword:qh,storage:Yh,number:Zh,operator:Qh,identifier:Jh,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:ev,"editor-bracket-foreground1":"var(--dh-color-editor-bracket-fg1)","editor-bracket-foreground2":"var(--dh-color-editor-bracket-fg2)","editor-bracket-foreground3":"var(--dh-color-editor-bracket-fg3)","editor-bracket-foreground4":"var(--dh-color-editor-bracket-fg4)","editor-bracket-foreground5":"var(--dh-color-editor-bracket-fg5)","editor-bracket-foreground6":"var(--dh-color-editor-bracket-fg6)","editor-unexpected-bracket-foreground":"var(--dh-color-editor-unexpected-bracket-fg)","input-option-active-border":"var(--dh-color-editor-input-option-active-border)","focus-border":"var(--dh-color-editor-focus-border)","input-background":"var(--dh-color-editor-input-bg)","input-foreground":"var(--dh-color-editor-input-fg)","input-border":"var(--dh-color-editor-input-border)","editor-line-number-foreground":"var(--dh-color-editor-line-number-fg)","editor-line-number-active-foreground":"var(--dh-color-editor-line-number-active-fg)","editor-selection-background":"var(--dh-color-editor-selection-bg)","editor-inactive-selection-background":"var(--dh-color-editor-inactive-selection-bg)","editor-selection-highlight-background":"var(--dh-color-editor-selection-highlight-bg)","editor-line-highlight-background":"var(--dh-color-editor-line-highlight-bg)","editor-word-highlight-background":"var(--dh-color-editor-word-highlight-bg)","context-menu-background":"var(--dh-color-editor-context-menu-bg)","context-menu-foreground":"var(--dh-color-editor-context-menu-fg)","menu-selection-background":"var(--dh-color-editor-menu-selection-bg)","menu-selection-foreground":"var(--dh-color-editor-menu-selection-fg)","log-date":"var(--dh-color-editor-log-date)","log-error":"var(--dh-color-editor-log-error)","log-info":"var(--dh-color-editor-log-info)","log-stdout":"var(--dh-color-editor-log-stdout)","log-warn":"var(--dh-color-editor-log-warn)","log-debug":"var(--dh-color-editor-log-debug)","log-trace":"var(--dh-color-editor-log-trace)","editor-find-match-background":"var(--dh-color-editor-find-match-bg)","editor-find-match-highlight-background":"var(--dh-color-editor-find-match-highlight-bg)","editor-widget-background":"var(--dh-color-editor-find-bg)","input-option-active-background":"var(--dh-color-editor-find-option-active-bg)","input-option-active-foreground":"var(--dh-color-editor-find-option-active-fg)","editor-suggest-widget-background":"var(--dh-color-editor-suggest-bg)","editor-suggest-widget-border":"var(--dh-color-editor-suggest-border)","editor-suggest-widget-foreground":"var(--dh-color-editor-suggest-fg)","editor-suggest-widget-selected-background":"var(--dh-color-editor-suggest-selected-bg)","editor-suggest-widget-selected-foreground":"var(--dh-color-editor-suggest-selected-fg)","editor-suggest-widget-highlightForeground":"var(--dh-color-editor-suggest-highlight-fg)","editor-suggest-widget-focus-highlight-foreground":"var(--dh-color-editor-suggest-focus-highlight-fg)","list-hover-background":"var(--dh-color-editor-suggest-hover-bg)","text-link-foreground":"var(--dh-color-editor-link-foreground)","text-link-active-foreground":"var(--dh-color-editor-link-active-fg)","editor-link-active-foreground":"var(--dh-color-editor-link-active-fg)"};var tv="python",rv={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},nv={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","exec","in","raise","continue","finally","is","return","for","try",":","=","isinstance","__debug__"],storage:["class","def","async","lambda"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@storage":"storage","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]]}},iv={id:tv,conf:rv,language:nv};const av=iv;var ov="groovy",sv={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},lv={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","println","class","exec","in","raise","continue","finally","is","return","def","for","lambda","try",":","=","isinstance","__debug__"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],doccomment:[[/[^/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[/*]/,"comment.doc"]]}},dv={id:ov,conf:sv,language:lv};const uv=dv;var cv="scala",hv={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:/^\s*\/\/\s*(?:(?:#?region\b)|(?:<editor-fold\b))/,end:/^\s*\/\/\s*(?:(?:#?endregion\b)|(?:<\/editor-fold>))/}}},vv={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=><!~?:&|+\-*/^\\%@#]+/,digits:/\d+(_+\d+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,escapes:/\\(?:[btnfr\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,fstring_conv:/[bBhHsScCdoxXeEfgGaAt]|[Tn](?:[HIklMSLNpzZsQ]|[BbhAaCYyjmde]|[RTrDFC])/,tokenizer:{root:[[/\braw"""/,{token:"string.quote",bracket:"@open",next:"@rawstringt"}],[/\braw"/,{token:"string.quote",bracket:"@open",next:"@rawstring"}],[/\bs"""/,{token:"string.quote",bracket:"@open",next:"@sstringt"}],[/\bs"/,{token:"string.quote",bracket:"@open",next:"@sstring"}],[/\bf""""/,{token:"string.quote",bracket:"@open",next:"@fstringt"}],[/\bf"/,{token:"string.quote",bracket:"@open",next:"@fstring"}],[/"""/,{token:"string.quote",bracket:"@open",next:"@stringt"}],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/0[xX](@hexdigits)[Ll]?/,"number.hex","@allowMethod"],[/(@digits)[fFdD]/,"number.float","@allowMethod"],[/(@digits)[lL]?/,"number","@allowMethod"],[/\b_\*/,"key"],[/\b(_)\b/,"keyword","@allowMethod"],[/\bimport\b/,"keyword","@import"],[/\b(case)([ \t]+)(class)\b/,["keyword.modifier","white","keyword"]],[/\bcase\b/,"keyword","@case"],[/\bva[lr]\b/,"keyword","@vardef"],[/\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/,["keyword","white","identifier"]],[/@name(?=[ \t]*:(?!:))/,"variable"],[/(\.)(@name|@symbols)/,[{token:"operator"},{token:"@rematch",next:"@allowMethod"}]],[/([{(])(\s*)(@name(?=\s*=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,[{token:"string"},{token:"string.escape"},{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}},gv={id:cv,conf:hv,language:vv};const fv=gv;var mv="deephavenDb",pv={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},bv={tokenPostfix:".js",keywords:["boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with"],builtins:["define","require","window","document","undefined"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[~!@#%\^&*-+=|\\:`<>.?\/]+/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,exponent:/[eE][\-+]?[0-9]+/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/([a-zA-Z_\$][\w\$]*)(\s*)(:?)/,{cases:{"$1@keywords":["keyword","white","delimiter"],$3:["key.identifier","white","delimiter"],"$1@builtins":["predefined.identifier","white","delimiter"],"@default":["identifier","white","delimiter"]}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/)/,{token:"regexp.slash",bracket:"@open",next:"@regexp"}],[/[{}()\[\]]/,"@brackets"],[/[;,.]/,"delimiter"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d+\.\d*(@exponent)?/,"number.float"],[/\.\d+(@exponent)?/,"number.float"],[/\d+@exponent/,"number.float"],[/0[xX][\da-fA-F]+/,"number.hex"],[/0[0-7]+/,"number.octal"],[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment.invalid"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["@brackets.regexp.escape.control","regexp.escape.control","@brackets.regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[{token:"@brackets.regexp.escape.control"},{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["@brackets.regexp.escape.control","regexp.escape.control"]],[/[()]/,"@brackets.regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],["/",{token:"regexp.slash",bracket:"@close"},"@pop"]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]]}},wv={id:mv,conf:pv,language:bv};const Cv=wv;var Sv="log",yv={},Ov={tokenizer:{root:[[/ FATAL[\s\S]*/,{token:"error",next:"@error"}],[/ ERROR[\s\S]*/,{token:"error",next:"@error"}],[/ STDERR[\s\S]*/,{token:"error",next:"@error"}],[/ STDOUT.*/,{token:"stdout",next:"@stdout"}],[/ INFO[\s\S]*/,{token:"info",next:"@info"}],[/ WARN.*/,{token:"warn",next:"@warn"}],[/ TRACE[\s\S]*/,{token:"trace",next:"@trace"}],[/ DEBUG[.\s\S]*/,{token:"debug",next:"@debug"}],[/^\d{2}:\d{2}:\d{2}.\d{3}/,"date"]],error:[{include:"@body"}],info:[{include:"@body"}],warn:[{include:"@body"}],stdout:[{include:"@body"}],trace:[{include:"@body"}],debug:[{include:"@body"}],body:[[/^\d{2}:\d{2}:\d{2}.\d{3}/,{token:"date",next:"@pop"}],[/[\s\S]*/,{token:"$S0"}]]}},Pv={id:Sv,conf:yv,language:Ov};const Tv=Pv;function la(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function da(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(r){Iv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Iv(n,e,t){return e=Rv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rv(n){var e=Dv(n,"string");return typeof e=="symbol"?e:String(e)}function Dv(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var dt=fe.module("MonacoUtils");class ut{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt.debug("Initializing Monaco..."),e!==void 0&&ut.registerGetWorker(e);var{initTheme:t,registerLanguages:r}=ut;t(),r([Cv,av,uv,Tv,fv]),ut.removeConflictingKeybindings(),dt.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:r}=ut,i=Pa(sa);dt.debug2("Monaco theme:",sa),dt.debug2("Monaco theme derived:",i);var a=[{token:"",foreground:r(i.foreground)},{token:"string",foreground:r(i.string)},{token:"string.delim",foreground:r(i["string-delim"])},{token:"keyword",foreground:r(i.keyword)},{token:"identifier.js",foreground:r(i["identifier-js"])},{token:"delimiter",foreground:r(i.delimiter)},{token:"comment",foreground:r(i.comment)},{token:"number",foreground:r(i.number)},{token:"storage",foreground:r(i.storage)},{token:"identifier",foreground:r(i.identifier)},{token:"namespace.identifier",foreground:r(i["namespace-identifier"])},{token:"operator",foreground:r(i.operator)},{token:"predefined",foreground:r(i.predefined)},{token:"error.log",foreground:(e=(t=i["log-error"])===null||t===void 0?void 0:t.substring(1))!==null&&e!==void 0?e:""},{token:"warn.log",foreground:r(i["log-warn"])},{token:"info.log",foreground:r(i["log-info"])},{token:"stdout.log",foreground:r(i["log-stdout"])},{token:"trace.log",foreground:r(i["log-trace"])},{token:"debug.log",foreground:r(i["log-debug"])},{token:"date.log",foreground:r(i["log-date"])}],o={foreground:i.foreground,errorForeground:i["error-foreground"],"inputOption.activeBorder":i["input-option-active-border"],"editor.background":i.background,"editor.foreground":i.foreground,"editor.lineHighlightBackground":i["editor-line-highlight-background"],"editorLineNumber.foreground":i["editor-line-number-foreground"],"editorLineNumber.activeForeground":i["editor-line-number-active-foreground"],"editor.selectionBackground":i["editor-selection-background"],"editor.inactiveSelectionBackground":i["editor-inactive-selection-background"],"editor.selectionHighlightBackground":i["editor-selection-highlight-background"],"editor.wordHighlightBackground":i["editor-word-highlight-background"],"editor.findMatchBackground":i["editor-find-match-background"],"editor.findMatchHighlightBackground":i["editor-find-match-highlight-background"],"editorSuggestWidget.background":i["editor-suggest-widget-background"],"editorSuggestWidget.border":i["editor-suggest-widget-border"],"editorSuggestWidget.foreground":i["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":i["editor-suggest-widget-selected-background"],"list.activeSelectionBackground":i["editor-suggest-widget-selected-background"],"editorSuggestWidget.selectedForeground":i["editor-suggest-widget-selected-foreground"],"list.activeSelectionForeground":i["editor-suggest-widget-selected-foreground"],"editorSuggestWidget.highlightForeground":i["editor-suggest-widget-highlightForeground"],"editorSuggestWidget.focusHighlightForeground":i["editor-suggest-widget-focus-highlight-foreground"],"list.hoverBackground":i["list-hover-background"],"dropdown.background":i["context-menu-background"],"dropdown.foreground":i["context-menu-foreground"],"menu.selectionBackground":i["menu-selection-background"],"menu.selectionForeground":i["menu-selection-foreground"],"keybindingLabel.foreground":i["menu-selection-foreground"],"list.focusBackground":i["menu-selection-background"],"editorWidget.background":i["editor-widget-background"],"inputOption.activeBackground":i["input-option-active-background"],"inputOption.activeForeground":i["input-option-active-foreground"],focusBorder:i["focus-border"],"input.background":i["input-background"],"input.foreground":i["input-foreground"],"input.border":i["input-border"],"textLink.foreground":i["text-link-foreground"],"textLink.activeForeground":i["text-link-active-foreground"],"editorLink.activeForeground":i["editor-link-active-foreground"],"editorBracketHighlight.foreground1":i["editor-bracket-foreground1"],"editorBracketHighlight.foreground2":i["editor-bracket-foreground2"],"editorBracketHighlight.foreground3":i["editor-bracket-foreground3"],"editorBracketHighlight.foreground4":i["editor-bracket-foreground4"],"editorBracketHighlight.foreground5":i["editor-bracket-foreground5"],"editorBracketHighlight.foreground6":i["editor-bracket-foreground6"],"editorBracketHighlight.unexpectedBracket.foreground":i["editor-unexpected-bracket-foreground"]};ct.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:a,colors:o});try{ct.setTheme("dh-dark")}catch(s){dt.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",s),ct.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=da(da({},window.MonacoEnvironment),{},{getWorker:e})}static removeHashtag(e){var t;return(t=e==null?void 0:e.substring(1))!==null&&t!==void 0?t:""}static registerLanguages(e){var t=e.map(r=>{var{id:i}=r;return i});Ut.getLanguages().filter(r=>{var{id:i}=r;return t.includes(i)}).forEach(r=>{var i=r;dt.debug2("Overriding default language loader:",i.id)}),e.forEach(r=>{ut.registerLanguage(r)})}static registerLanguage(e){dt.debug2("Registering language: ",e.id),Ut.register(e),Ut.onLanguage(e.id,()=>{Ut.setLanguageConfiguration(e.id,e.conf),Ut.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ct.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(r)}static openDocument(e,t){var r=e.getModel();ee(r);var i={textDocument:{uri:"".concat(r.uri),languageId:r.getLanguageId(),version:r.getVersionId(),text:r.getValue()}};dt.debug2("didOpenDocumentParams: ",i),t.openDocument(i);var a=e.onDidChangeModelContent(o=>{for(var{changes:s,versionId:l}=o,d=[],c=0;c<s.length;c+=1){var h=s[c],{range:v,rangeLength:g,text:f}=h,m={range:{start:{line:v.startLineNumber-1,character:v.startColumn-1},end:{line:v.endLineNumber-1,character:v.endColumn-1}},rangeLength:g,text:f};d.push(m)}if(d.length>0){var p={textDocument:{version:l,uri:"".concat(r.uri)},contentChanges:d};dt.debug2("didChangeDocumentParams",p),t.changeDocument(p)}});return a}static closeDocument(e,t){var r=e.getModel();ee(r);var i={textDocument:{uri:"".concat(r.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var r=/“|”/g,i=/\u200b/g,a=/\u00A0/g,o=e.getModel();ee(o);var s=o.getValueInRange(t.range);(r.test(s)||i.test(s)||a.test(s))&&o.applyEdits([{range:t.range,text:s.replace(r,'"').replace(i,"").replace(a," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){ct.addKeybindingRule({keybinding:Ve.CtrlCmd|zr.KeyD,command:null}),ut.isMacPlatform()||ct.addKeybindingRule({keybinding:Ve.CtrlCmd|zr.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(it()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:r}=t;if(r===null)return 0;var i=ut.isMacPlatform();return i?(t.metaKey?Ve.CtrlCmd:0)|(t.shiftKey?Ve.Shift:0)|(t.altKey?Ve.Alt:0)|(t.ctrlKey?Ve.WinCtrl:0)|En.fromString(r):(t.ctrlKey?Ve.CtrlCmd:0)|(t.shiftKey?Ve.Shift:0)|(t.altKey?Ve.Alt:0)|(t.metaKey?Ve.WinCtrl:0)|En.fromString(r)}static provideLinks(e){for(var t=[],r=function(o){var s=e.getLineContent(o),l=Bo(s),d=l.filter(c=>c.type==="url"?/^https?:\/\//.test(c.value):!0);d.forEach(c=>{t.push({url:c.href,range:new Ts(o,c.start+1,o,c.end+1)})})},i=1;i<=e.getLineCount();i+=1)r(i);return{links:t}}}const Ev=ut;function ua(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Mv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ua(Object(t),!0).forEach(function(r){Mr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ua(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Mr(n,e,t){return e=xv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xv(n){var e=jv(n,"string");return typeof e=="symbol"?e:String(e)}function jv(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Za extends R.Component{constructor(e){super(e),Mr(this,"container",void 0),Mr(this,"editor",void 0),this.handleResize=this.handleResize.bind(this),this.container=null,this.state={}}componentDidMount(){this.initEditor(),window.addEventListener("resize",this.handleResize)}componentWillUnmount(){window.removeEventListener("resize",this.handleResize),this.destroyEditor()}setLanguage(e){if(this.editor){var t=this.editor.getModel();ee(t),ct.setModelLanguage(t,e)}}handleResize(){this.updateDimensions()}toggleFind(){this.editor&&(this.editor.focus(),this.editor.trigger("toggleFind","actions.find",void 0))}updateDimensions(){var e;(e=this.editor)===null||e===void 0||e.layout()}initEditor(){var{onEditorInitialized:e}=this.props,{settings:t}=this.props;t=Mv({copyWithSyntaxHighlighting:!1,fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"python",lineNumbersMinChars:3,minimap:{enabled:!1},scrollBeyondLastLine:!1,tabCompletion:"on",value:"",wordWrap:"off",links:!0},t),ee(this.container),this.editor=ct.create(this.container,t),this.editor.addAction({id:"find",label:"Find",keybindings:[Ve.CtrlCmd|zr.KeyF],precondition:void 0,keybindingContext:void 0,contextMenuGroupId:"navigation",contextMenuOrder:1,run:()=>{this.toggleFind()}}),this.editor.layout(),Ut.registerLinkProvider("plaintext",{provideLinks:Ev.provideLinks}),e(this.editor)}destroyEditor(){var{onEditorWillDestroy:e}=this.props;ee(this.editor),e(this.editor),this.editor.dispose(),this.editor=void 0}render(){var{className:e}=this.props;return u.jsx("div",{className:K("editor-container",e),ref:t=>{this.container=t}})}}Mr(Za,"defaultProps",{className:"fill-parent-absolute",onEditorInitialized:()=>{},onEditorWillDestroy:()=>{},settings:{}});const fg=Za;var kv=R.createContext(null);function mg(n){var{children:e}=n,{activeThemes:t}=Ed(),r=R.useMemo(Uh,[t]);return u.jsx(kv.Provider,{value:r,children:e})}export{rg as $,La as A,Q as B,Tt as C,Ma as D,qv as E,jl as F,cr as G,Id as H,Ee as I,_n as J,U as K,Hd as L,Ll as M,tg as N,Fa as O,cn as P,Ev as Q,bt as R,vn as S,ar as T,ad as U,sa as V,ln as W,Hv as X,fg as Y,Rs as Z,ng as _,hn as a,Zd as a0,og as a1,sg as a2,hg as a3,ig as a4,ag as a5,tu as a6,Ba as a7,gg as a8,en as a9,kv as aa,mg as ab,au as ac,lg as ad,du as ae,dg as af,vg as ag,vu as ah,ug as ai,Re as aj,cg as ak,Uh as al,Bv as am,Qv as an,Zv as ao,Jv as ap,Wu as aq,Gu as ar,kt as as,Yt as at,Xu as au,xu as av,eg as aw,Qs as b,Bs as c,Vv as d,Vl as e,bl as f,$v as g,ht as h,Ed as i,Wv as j,_v as k,Gv as l,Ke as m,ed as n,q as o,zv as p,od as q,Kv as r,fn as s,jt as t,tl as u,or as v,Yv as w,ue as x,pe as y,Xv as z};
|
|
12
|
-
//# sourceMappingURL=IrisGridThemeProvider-
|
|
12
|
+
//# sourceMappingURL=IrisGridThemeProvider-fb501222.js.map
|