1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.C2VVwcz1.js","./index.RuhrnD1v.js","../css/index.CwxM5zkf.css","./withFullScreenWrapper.cN232UBk.js","./FormClearHelper.DFo50Lfo.js","./moment.C7qA8nIE.js","./pandasStylerUtils.G7GPfspw.js","./numbro.B9_PXfzp.js","./_baseIndexOf.BTknn6Gb.js","./index.8HslT92O.js","./main.RoKzF5Lw.js","./throttle.C8Wqvyhj.js","./toConsumableArray.Q_9Ve-eG.js","./formatNumber.BdmueDpm.js","./sprintfjs.DSsuEWyc.js","./formatMoment.C6Hwn6X5.js","./checkbox.DjX9W7TF.js","./createDownloadLinkElement.hhAt_ffB.js","./FileDownload.esm.DmrqPFKC.js","./_arrayIncludes.B19Iyn2B.js","./number-overlay-editor.DPA2PLb4.js","./es6.dvmAQaa3.js"])))=>i.map(i=>d[i]); 2import{ay as Ya,di as ch,w as dh,bO as pc,dj as fh,dk as hh,dl as gh,dm as ph,dn as mh,dp as vh,dq as ja,dr as mc,b0 as bh,b1 as wh,r as f,E as Ll,_ as Ve,aa as qa,as as bo,by as yh,ds as Ch,aG as zt,dt as Sh,N as Mr,du as Ps,aU as Fl,G as ra,I as xh,e as Ee,bz as vc,n as ct,dv as kh,j as Ie,dw as Mh,f as Ln,dx as ir,dc as cr,dy as Fe,dz as _e,d4 as _o,d0 as Rh,aq as bc,dA as wc,a4 as Ih,d1 as Eh,d2 as Th,d3 as Dh,d5 as Oh,bn as yc,O as en,bq as Ph,al as Lh,dB as Fh,dC as _h,p as Cc,b5 as Ci,dD as Ah,aV as Hh,dE as zh,dF as Sc,co as Vh,cm as $h,dG as xc,dH as Nh,dI as Bh,cl as kc,cp as Wh,dJ as Uh,ck as Gh,dK as Xh,bo as Yh,bp as jh,cr as qh,dL as Kh,Q as Zh,dM as Jh,cs as Qh,dN as eg,R as tg,o as Gr,dO as Yt,V as _l,d6 as ng,dP as rg,dQ as ig,bs as Ka,ah as og,F as Mc,aB as ya,dR as Rc,ai as Ca,h as mn,$ as Gn,aP as Sa,aN as ag,aO as Ic,aE as Ec,dS as lg,k as sg,W as Ls,dT as ug,m as cg,z as dg,Y as fg,bu as wi,dU as hg,s as Fs}from"./index.RuhrnD1v.js";import{w as gg,E as pg}from"./withFullScreenWrapper.cN232UBk.js";import{u as mg}from"./FormClearHelper.DFo50Lfo.js";import{h as Nr}from"./moment.C7qA8nIE.js";import{r as vg,m as _s,f as bl,c as bg,a as wg}from"./pandasStylerUtils.G7GPfspw.js";import{n as yg}from"./numbro.B9_PXfzp.js";import{l as Za}from"./index.8HslT92O.js";import{R as Cg}from"./main.RoKzF5Lw.js";import{d as Tc,t as Sg}from"./throttle.C8Wqvyhj.js";import{_ as Ei,C as xg}from"./toConsumableArray.Q_9Ve-eG.js";import{f as ia}from"./formatNumber.BdmueDpm.js";import{f as As}from"./formatMoment.C6Hwn6X5.js";import{L as kg,a as Mg,S as Rg}from"./checkbox.DjX9W7TF.js";import{c as Ig}from"./createDownloadLinkElement.hhAt_ffB.js";import{D as Eg,F as Tg}from"./FileDownload.esm.DmrqPFKC.js";import{a as Dg}from"./_arrayIncludes.B19Iyn2B.js";function Og(){}function Pg(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function zn(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Ya(n),n=n===n?n:0),t!==void 0&&(t=Ya(t),t=t===t?t:0),Pg(Ya(e),t,n)}var Lg=Object.prototype,Fg=Lg.hasOwnProperty;function _g(e,t){return e!=null&&Fg.call(e,t)}function Ag(e,t){return e!=null&&ch(e,t,_g)}var Hg="[object Map]",zg="[object Set]",Vg=Object.prototype,$g=Vg.hasOwnProperty;function Ng(e){if(e==null)return!0;if(dh(e)&&(pc(e)||typeof e=="string"||typeof e.splice=="function"||fh(e)||hh(e)||gh(e)))return!e.length;var t=ph(e);if(t==Hg||t==zg)return!e.size;if(mh(e))return!vh(e).length;for(var n in e)if($g.call(e,n))return!1;return!0}var Bg=1/0,Wg=ja&&1/mc(new ja([,-0]))[1]==Bg?function(e){return new ja(e)}:Og,Ug=200;function Gg(e,t,n){var r=-1,i=Dg,o=e.length,l=!0,a=[],s=a;if(o>=Ug){var u=Wg(e);if(u)return mc(u);l=!1,i=wh,s=new bh}else s=a;e:for(;++r<o;){var c=e[r],d=c;if(c=c!==0?c:0,l&&d===d){for(var g=s.length;g--;)if(s[g]===d)continue e;a.push(c)}else i(s,d,n)||(s!==a&&s.push(d),a.push(c))}return a}function Xg(e){return e&&e.length?Gg(e):[]}var Dc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Dc.displayName="Add";var Oc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Oc.displayName="Search";
2var Pc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Pc.displayName="Visibility";function Lc(e="This should not happen"){throw new Error(e)}function On(e,t="Assertion failed"){if(!e)return Lc(t)}function uo(e,t){return Lc(t??"Hell froze over")}function Yg(e,t){try{return e()}catch{return t}}const Hs=Object.prototype.hasOwnProperty;function Di(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Di(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Hs.call(e,n)&&++r&&!Hs.call(t,n)||!(n in t)||!Di(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const oa=null,Al=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var zs;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(zs||(zs={}));var aa;(function(e){e.Triangle="triangle",e.Dots="dots"})(aa||(aa={}));function Ao(e){return"width"in e&&typeof e.width=="number"}async function Vs(e){return typeof e=="object"?e:await e()}function Si(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Mi(e){return e.kind===Vn.Marker||e.kind===Vn.NewRow}function xi(e){if(!Si(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:uo(e,"A cell was passed with an invalid kind")}}function jg(e){return Ag(e,"editor")}function Hl(e){return!(e.readonly??!1)}var Vn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Vn||(Vn={}));const la={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function Ja(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let $s;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(Ja(t));static empty=()=>$s??($s=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=Ja(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Ja([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,l]of n.entries()){const[a,s]=l;if(a<=i&&r<=s){const u=[];a<r&&u.push([a,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new Qe(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;
2if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var qg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,s]=a.split("_");n[s]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Ns=qg,Kg=e=>e.toUpperCase()===e,Zg=e=>t=>e.indexOf(t)===-1,Fc=(e,t)=>{const n={};return Object.keys(e).filter(Zg(t)).forEach(r=>{n[r]=e[r]}),n};function Jg(e,t,n){const r=Fc(t,n);if(!e){const i=typeof qa=="function"?{default:qa}:qa;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Qg=(e,t)=>{};function ep(e){let t="";return n=>{const r=(o,l)=>{const{as:a=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Kg(a[0])):n.propsAsIs,c=Jg(u,o,["as","class"]);c.ref=l,c.className=n.atomic?Ns(n.class,c.className||s):Ns(c.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const m in d){const y=d[m],v=y[0],b=y[1]||"",x=typeof v=="function"?v(o):v;Qg(x,n.name),g[`--${m}`]=`${x}${b}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):(o=>{const l=Fc(o,["innerRef"]);return r(l,o.innerRef)});return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var dn=ep;const tp=dn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Qa={},Gi={},Ho={},zo={},Bs;function np(){return Bs||(Bs=1,(function(e){(function(t,n){n(e,bo(),yh())})(zo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=l(n),o=l(r);function l(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var T=arguments[x];for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(b[k]=T[k])}return b};function s(b,x){var T={};for(var k in b)x.indexOf(k)>=0||Object.prototype.hasOwnProperty.call(b,k)&&(T[k]=b[k]);return T}function u(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}var c=(function(){function b(x,T){for(var k=0;k<T.length;k++){var R=T[k];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(x,R.key,R)}}return function(x,T,k){return T&&b(x.prototype,T),k&&b(x,k),x}})();function d(b,x){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:b}function g(b,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);b.prototype=Object.create(x&&x.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(b,x):b.__proto__=x)}var h=!1;function p(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function y(b){if("touches"in b){var x=b.touches[0],T=x.pageX,k=x.pageY;return{x:T,y:k}}var R=b.screenX,P=b.screenY;return{x:R,y:P}}var v=(function(b){g(x,b);function x(){var T;u(this,x);for(var k=arguments.length,R=Array(k),P=0;P<k;P++)R[P]=arguments[P];var I=d(this,(T=x.__proto__||Object.getPrototypeOf(x)).call.apply(T,[this].concat(R)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}
2return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(k){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(k))}},{key:"_onMouseMove",value:function(k){this.mouseDown&&this._handleSwipeMove(k)}},{key:"_onMouseUp",value:function(k){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(k)}},{key:"_handleSwipeStart",value:function(k){var R=y(k),P=R.x,I=R.y;this.moveStart={x:P,y:I},this.props.onSwipeStart(k)}},{key:"_handleSwipeMove",value:function(k){if(this.moveStart){var R=y(k),P=R.x,I=R.y,C=P-this.moveStart.x,F=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:C,y:F},k);D&&k.cancelable&&k.preventDefault(),this.movePosition={deltaX:C,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(k){this.props.onSwipeEnd(k);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,k):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,k),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,k):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,k)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(k){this.swiper=k,this.props.innerRef(k)}},{key:"render",value:function(){var k=this.props;k.tagName;var R=k.className,P=k.style,I=k.children;k.allowMouseEvents,k.onSwipeUp,k.onSwipeDown,k.onSwipeLeft,k.onSwipeRight,k.onSwipeStart,k.onSwipeMove,k.onSwipeEnd,k.innerRef,k.tolerance;var C=s(k,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},C),I)}}]),x})(n.Component);v.displayName="ReactSwipe",v.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},v.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=v})})(zo)),zo}var Ws;function _c(){return Ws||(Ws=1,(function(e){(function(t,n){n(e,np())})(Ho,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})})(Ho)),Ho}var Xi={},Us;function Ac(){if(Us)return Xi;Us=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=t(Ch());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,l){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":l==="horizontal","axis-vertical":l!=="horizontal"})},SLIDER:function(o,l){return(0,e.default)({thumbs:!o,slider:o,animated:!l})},ITEM:function(o,l,a){return(0,e.default)({thumb:!o,slide:o,selected:l,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xi.default=r,Xi}var Yi={},ji={},Gs;function rp(){if(Gs)return ji;Gs=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return ji.outerWidth=e,ji}var qi={},Xs;function zl(){if(Xs)return qi;Xs=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,l=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",s="("+l.join(",")+")";return a+s};return qi.default=e,qi}var Ki={},Ys;function Hc(){if(Ys)return Ki;Ys=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=function(){return window}
2;return Ki.default=e,Ki}var js;function zc(){if(js)return Yi;js=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=s(bo()),t=l(Ac()),n=rp(),r=l(zl()),i=l(_c()),o=l(Hc());function l(I){return I&&I.__esModule?I:{default:I}}function a(){if(typeof WeakMap!="function")return null;var I=new WeakMap;return a=function(){return I},I}function s(I){if(I&&I.__esModule)return I;if(I===null||u(I)!=="object"&&typeof I!="function")return{default:I};var C=a();if(C&&C.has(I))return C.get(I);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in I)if(Object.prototype.hasOwnProperty.call(I,S)){var E=D?Object.getOwnPropertyDescriptor(I,S):null;E&&(E.get||E.set)?Object.defineProperty(F,S,E):F[S]=I[S]}return F.default=I,C&&C.set(I,F),F}function u(I){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(I)}function c(){return c=Object.assign||function(I){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(I[D]=F[D])}return I},c.apply(this,arguments)}function d(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function g(I,C){for(var F=0;F<C.length;F++){var D=C[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,C,F){return C&&g(I.prototype,C),I}function p(I,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(C&&C.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),C&&m(I,C)}function m(I,C){return m=Object.setPrototypeOf||function(D,S){return D.__proto__=S,D},m(I,C)}function y(I){var C=x();return function(){var D=T(I),S;if(C){var E=T(this).constructor;S=Reflect.construct(D,arguments,E)}else S=D.apply(this,arguments);return v(this,S)}}function v(I,C){return C&&(u(C)==="object"||typeof C=="function")?C:b(I)}function b(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function T(I){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},T(I)}function k(I,C,F){return C in I?Object.defineProperty(I,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):I[C]=F,I}var R=function(C){return C.hasOwnProperty("key")},P=(function(I){p(F,I);var C=y(F);function F(D){var S;return d(this,F),S=C.call(this,D),k(b(S),"itemsWrapperRef",void 0),k(b(S),"itemsListRef",void 0),k(b(S),"thumbsRef",void 0),k(b(S),"setItemsWrapperRef",function(E){S.itemsWrapperRef=E}),k(b(S),"setItemsListRef",function(E){S.itemsListRef=E}),k(b(S),"setThumbsRef",function(E,O){S.thumbsRef||(S.thumbsRef=[]),S.thumbsRef[O]=E}),k(b(S),"updateSizes",function(){if(!(!S.props.children||!S.itemsWrapperRef||!S.thumbsRef)){var E=e.Children.count(S.props.children),O=S.itemsWrapperRef.clientWidth,M=S.props.thumbWidth?S.props.thumbWidth:(0,n.outerWidth)(S.thumbsRef[0]),V=Math.floor(O/M),W=V<E,j=W?E-V:0;S.setState(function(oe,Q){return{itemSize:M,visibleItems:V,firstItem:W?S.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:W}})}}),k(b(S),"handleClickItem",function(E,O,M){if(!R(M)||M.key==="Enter"){var V=S.props.onSelectItem;typeof V=="function"&&V(E,O)}}),k(b(S),"onSwipeStart",function(){S.setState({swiping:!0})}),k(b(S),"onSwipeEnd",function(){S.setState({swiping:!1})}),k(b(S),"onSwipeMove",function(E){var O=E.x;if(!S.state.itemSize||!S.itemsWrapperRef||!S.state.visibleItems)return!1;var M=0,V=e.Children.count(S.props.children),W=-(S.state.firstItem*100)/S.state.visibleItems,j=Math.max(V-S.state.visibleItems,0),oe=-j*100/S.state.visibleItems;W===M&&O>0&&(O=0),W===oe&&O<0&&(O=0);var Q=S.itemsWrapperRef.clientWidth,re=W+100/(Q/O);return S.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(se){S.itemsListRef.style[se]=(0,r.default)(re,"%",S.props.axis)}),!0}),k(b(S),"slideRight",function(E){S.moveTo(S.state.firstItem-(typeof E=="number"?E:1))}),k(b(S),"slideLeft",function(E){S.moveTo(S.state.firstItem+(typeof E=="number"?E:1))}),k(b(S),"moveTo",function(E){E=E<0?0:E,E=E>=S.state.lastPosition?S.state.lastPosition:E,S.setState({firstItem:E})}),S.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},S}
2return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(S){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==S.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(S){var E=S;return S>=this.state.lastPosition&&(E=this.state.lastPosition),S<this.state.firstItem+this.state.visibleItems&&(E=this.state.firstItem),S<this.state.firstItem&&(E=S),E}},{key:"renderItems",value:function(){var S=this;return this.props.children.map(function(E,O){var M=t.default.ITEM(!1,O===S.state.selectedItem),V={key:O,ref:function(j){return S.setThumbsRef(j,O)},className:M,onClick:S.handleClickItem.bind(S,O,S.props.children[O]),onKeyDown:S.handleClickItem.bind(S,O,S.props.children[O]),"aria-label":"".concat(S.props.labels.item," ").concat(O+1),style:{width:S.props.thumbWidth}};return e.default.createElement("li",c({},V,{role:"button",tabIndex:0}),E)})}},{key:"render",value:function(){var S=this;if(!this.props.children)return null;var E=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,M=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,V={},W=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(W,"px",this.props.axis),oe=this.props.transitionTime+"ms";return V={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return S.slideRight()},"aria-label":this.props.labels.leftArrow}),E?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:V,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(re){return S.setItemsListRef(re)},style:V},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!M),onClick:function(){return S.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F})(e.Component);return Yi.default=P,k(P,"displayName","Thumbs"),k(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Yi}var Zi={},qs;function ip(){if(qs)return Zi;qs=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.default=void 0;var e=function(){return document};return Zi.default=e,Zi}var Dn={},Ks;function Vc(){if(Ks)return Dn;Ks=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.setPosition=Dn.getPosition=Dn.isKeyboardEvent=Dn.defaultStatusFormatter=Dn.noop=void 0;var e=bo(),t=n(zl());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Dn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Dn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Dn.isKeyboardEvent=o;var l=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Dn.getPosition=l;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Dn.setPosition=a,Dn}var Un={},Zs;
2function op(){if(Zs)return Un;Zs=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.fadeAnimationHandler=Un.slideStopSwipingHandler=Un.slideSwipeAnimationHandler=Un.slideAnimationHandler=void 0;var e=bo(),t=r(zl()),n=Vc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,p)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){l(d,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(h,p))})}return d}function l(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var p={},m=h.selectedItem,y=m,v=e.Children.count(g.children)-1,b=g.infiniteLoop&&(m<0||m>v);if(b)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(v+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(v+2)*100,g.axis):y>v&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var x=(0,n.getPosition)(m,g),T=(0,t.default)(x,"%",g.axis),k=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:T,msTransform:T,OTransform:T,transform:T},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:k,MozTransitionDuration:k,OTransitionDuration:k,transitionDuration:k,msTransitionDuration:k})),p};Un.slideAnimationHandler=a;var s=function(g,h,p,m){var y={},v=h.axis==="horizontal",b=e.Children.count(h.children),x=0,T=(0,n.getPosition)(p.selectedItem,h),k=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),R=v?g.x:g.y,P=R;T===x&&R>0&&(P=0),T===k&&R<0&&(P=0);var I=T+100/(p.itemSize/P),C=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&C&&(p.selectedItem===0&&I>-100?I-=b*100:p.selectedItem===b-1&&I<-b*100&&(I+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||C||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(I,h.axis)),C&&!p.cancelClick&&m({cancelClick:!0}),y};Un.slideSwipeAnimationHandler=s;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Un.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Un.fadeAnimationHandler=c,Un}var Js;function ap(){if(Js)return Gi;Js=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=c(bo()),t=s(_c()),n=s(Ac()),r=s(zc()),i=s(ip()),o=s(Hc()),l=Vc(),a=op();function s(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var S=u();if(S&&S.has(D))return S.get(D);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in D)if(Object.prototype.hasOwnProperty.call(D,M)){var V=O?Object.getOwnPropertyDescriptor(D,M):null;V&&(V.get||V.set)?Object.defineProperty(E,M,V):E[M]=D[M]}return E.default=D,S&&S.set(D,E),E}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(E){return typeof E}:d=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(D)}function g(){return g=Object.assign||function(D){for(var S=1;S<arguments.length;S++){var E=arguments[S];for(var O in E)Object.prototype.hasOwnProperty.call(E,O)&&(D[O]=E[O])}return D},g.apply(this,arguments)}function h(D,S){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);S&&(O=O.filter(function(M){return Object.getOwnPropertyDescriptor(D,M).enumerable})),E.push.apply(E,O)}return E}function p(D){for(var S=1;S<arguments.length;S++){var E=arguments[S]!=null?arguments[S]:{};
vendor: 11,463 bytes, line 2
2S%2?h(Object(E),!0).forEach(function(O){C(D,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(E,O))})}return D}function m(D,S){if(!(D instanceof S))throw new TypeError("Cannot call a class as a function")}function y(D,S){for(var E=0;E<S.length;E++){var O=S[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function v(D,S,E){return S&&y(D.prototype,S),D}function b(D,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(S&&S.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),S&&x(D,S)}function x(D,S){return x=Object.setPrototypeOf||function(O,M){return O.__proto__=M,O},x(D,S)}function T(D){var S=P();return function(){var O=I(D),M;if(S){var V=I(this).constructor;M=Reflect.construct(O,arguments,V)}else M=O.apply(this,arguments);return k(this,M)}}function k(D,S){return S&&(d(S)==="object"||typeof S=="function")?S:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(D){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},I(D)}function C(D,S,E){return S in D?Object.defineProperty(D,S,{value:E,enumerable:!0,configurable:!0,writable:!0}):D[S]=E,D}var F=(function(D){b(E,D);var S=T(E);function E(O){var M;m(this,E),M=S.call(this,O),C(R(M),"thumbsRef",void 0),C(R(M),"carouselWrapperRef",void 0),C(R(M),"listRef",void 0),C(R(M),"itemsRef",void 0),C(R(M),"timer",void 0),C(R(M),"animationHandler",void 0),C(R(M),"setThumbsRef",function(W){M.thumbsRef=W}),C(R(M),"setCarouselWrapperRef",function(W){M.carouselWrapperRef=W}),C(R(M),"setListRef",function(W){M.listRef=W}),C(R(M),"setItemsRef",function(W,j){M.itemsRef||(M.itemsRef=[]),M.itemsRef[j]=W}),C(R(M),"autoPlay",function(){e.Children.count(M.props.children)<=1||(M.clearAutoPlay(),M.props.autoPlay&&(M.timer=setTimeout(function(){M.increment()},M.props.interval)))}),C(R(M),"clearAutoPlay",function(){M.timer&&clearTimeout(M.timer)}),C(R(M),"resetAutoPlay",function(){M.clearAutoPlay(),M.autoPlay()}),C(R(M),"stopOnHover",function(){M.setState({isMouseEntered:!0},M.clearAutoPlay)}),C(R(M),"startOnLeave",function(){M.setState({isMouseEntered:!1},M.autoPlay)}),C(R(M),"isFocusWithinTheCarousel",function(){return M.carouselWrapperRef?!!((0,i.default)().activeElement===M.carouselWrapperRef||M.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),C(R(M),"navigateWithKeyboard",function(W){if(M.isFocusWithinTheCarousel()){var j=M.props.axis,oe=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},re=oe?Q.ArrowRight:Q.ArrowDown,se=oe?Q.ArrowLeft:Q.ArrowUp;re===W.keyCode?M.increment():se===W.keyCode&&M.decrement()}}),C(R(M),"updateSizes",function(){if(!(!M.state.initialized||!M.itemsRef||M.itemsRef.length===0)){var W=M.props.axis==="horizontal",j=M.itemsRef[0];if(j){var oe=W?j.clientWidth:j.clientHeight;M.setState({itemSize:oe}),M.thumbsRef&&M.thumbsRef.updateSizes()}}}),C(R(M),"setMountState",function(){M.setState({hasMount:!0}),M.updateSizes()}),C(R(M),"handleClickItem",function(W,j){if(e.Children.count(M.props.children)!==0){if(M.state.cancelClick){M.setState({cancelClick:!1});return}M.props.onClickItem(W,j),W!==M.state.selectedItem&&M.setState({selectedItem:W})}}),C(R(M),"handleOnChange",function(W,j){e.Children.count(M.props.children)<=1||M.props.onChange(W,j)}),C(R(M),"handleClickThumb",function(W,j){M.props.onClickThumb(W,j),M.moveTo(W)}),C(R(M),"onSwipeStart",function(W){M.setState({swiping:!0}),M.props.onSwipeStart(W)}),C(R(M),"onSwipeEnd",function(W){M.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),M.props.onSwipeEnd(W),M.clearAutoPlay(),M.state.autoPlay&&M.autoPlay()}),C(R(M),"onSwipeMove",function(W,j){M.props.onSwipeMove(j);var oe=M.props.swipeAnimationHandler(W,M.props,M.state,M.setState.bind(R(M)));return M.setState(p({},oe)),!!Object.keys(oe).length}),C(R(M),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem-(typeof W=="number"?W:1))}),C(R(M),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem+(typeof W=="number"?W:1))}),C(R(M),"moveTo",function(W){if(typeof W=="number"){var j=e.Children.count(M.props.children)-1;W<0&&(W=M.props.infiniteLoop?j:0),W>j&&(W=M.props.infiniteLoop?0:j),M.selectItem({selectedItem:W}),M.state.autoPlay&&M.state.isMouseEntered===!1&&M.resetAutoPlay()}}),C(R(M),"onClickNext",function(){M.increment(1)}),C(R(M),"onClickPrev",function(){M.decrement(1)}),C(R(M),"onSwipeForward",function(){M.increment(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),C(R(M),"onSwipeBackwards",function(){M.decrement(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),C(R(M),"changeItem",function(W){return function(j){(!(0,l.isKeyboardEvent)(j)||j.key==="Enter")&&M.moveTo(W)}}),C(R(M),"selectItem",function(W){M.setState(p({previousItem:M.state.selectedItem},W),function(){M.setState(M.animationHandler(M.props,M.state))}),M.handleOnChange(W.selectedItem,e.Children.toArray(M.props.children)[W.selectedItem])}),C(R(M),"getInitialImage",function(){var W=M.props.selectedItem,j=M.itemsRef&&M.itemsRef[W],oe=j&&j.getElementsByTagName("img")||[];return oe[0]}),C(R(M),"getVariableItemHeight",function(W){var j=M.itemsRef&&M.itemsRef[W];if(M.state.hasMount&&j&&j.children.length){var oe=j.children[0].getElementsByTagName("img")||[];if(oe.length>0){var Q=oe[0];if(!Q.complete){var re=function de(){M.forceUpdate(),Q.removeEventListener("load",de)};Q.addEventListener("load",re)}}var se=oe[0]||j.children[0],ae=se.clientHeight;return ae>0?ae:null}return null});var V={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return M.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,M.state=p(p({},V),M.animationHandler(O,V)),M}return v(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(M,V){!M.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!M.autoFocus&&this.props.autoFocus&&this.forceFocus(),V.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(M.selectedItem!==this.props.selectedItem||M.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),M.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var M=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var V=M.getInitialImage();V&&!V.complete?V.addEventListener("load",M.setMountState):M.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.addEventListener("mouseenter",this.stopOnHover),M.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.removeEventListener("mouseenter",this.stopOnHover),M.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var M=this.getInitialImage();M&&M.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var M;(M=this.carouselWrapperRef)===null||M===void 0||M.focus()}},{key:"renderItems",value:function(M){var V=this;return this.props.children?e.Children.map(this.props.children,function(W,j){var oe=j===V.state.selectedItem,Q=j===V.state.previousItem,re=oe&&V.state.selectedStyle||Q&&V.state.prevStyle||V.state.slideStyle||{};V.props.centerMode&&V.props.axis==="horizontal"&&(re=p(p({},re),{},{minWidth:V.props.centerSlidePercentage+"%"})),V.state.swiping&&V.state.swipeMovementStarted&&(re=p(p({},re),{},{pointerEvents:"none"}));var se={ref:function(de){return V.setItemsRef(de,j)},key:"itemKey"+j+(M?"clone":""),className:n.default.ITEM(!0,j===V.state.selectedItem,j===V.state.previousItem),onClick:V.handleClickItem.bind(V,j,W),style:re};return e.default.createElement("li",se,V.props.renderItem(W,{isSelected:j===V.state.selectedItem,isPrevious:j===V.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var M=this,V=this.props,W=V.showIndicators,j=V.labels,oe=V.renderIndicator,Q=V.children;return W?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(re,se){return oe&&oe(M.changeItem(se),se===M.state.selectedItem,se,j.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var M=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var V=this.props.swipeable&&e.Children.count(this.props.children)>1,W=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,re=this.renderItems(!0),se=re.shift(),ae=re.pop(),de={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};
2if(W){if(de.onSwipeLeft=this.onSwipeForward,de.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ue=this.getVariableItemHeight(this.state.selectedItem);fe.height=ue||"auto"}}else de.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,de.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,de.style=p(p({},de.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},V?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},de,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&se):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return M.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&se)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E})(e.default.Component);return Gi.default=F,C(F,"displayName","Carousel"),C(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(S,E,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!E),onClick:S})},renderArrowNext:function(S,E,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!E),onClick:S})},renderIndicator:function(S,E,O,M){return e.default.createElement("li",{className:n.default.DOT(E),onClick:S,onKeyDown:S,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(M," ").concat(O+1)})},renderItem:function(S){return S},renderThumbs:function(S){var E=e.Children.map(S,function(O){var M=O;if(O.type!=="img"&&(M=e.Children.toArray(O.props.children).find(function(V){return V.type==="img"})),!!M)return M});return E.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):E},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Gi}var Qs={},eu;function lp(){return eu||(eu=1),Qs}var tu;function sp(){return tu||(tu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(ap()),n=lp(),r=i(zc());function i(o){return o&&o.__esModule?o:{default:o}}})(Qa)),Qa}var up=sp();function kn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{o.current?.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:i}),()=>{l.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Sr(e,t){return e===void 0?void 0:t}const cp=Math.PI;function nu(e){return e*cp/180}const $c=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Nc=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},Bc=(e,t,n)=>Math.min(e,t-n*2),Wc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Vl=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322
26.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},dp=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function fp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const l=f.useRef(Tc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&l.current(()=>e())},t),r}const hp="Ö-ß¿ï¬-﷽ﹰ-ﻼ",gp="A-Za-zÃ-ÃÃ-öø-ʸÌ-Öà -á¿¿ââ°-ï¬ï¸-﹯﻽-ï¿¿",pp=new RegExp("^[^"+gp+"]*["+hp+"]");function $l(e){return pp.test(e)?"rtl":"not-rtl"}let Vo;function wl(){if(typeof document>"u")return 0;if(Vo!==void 0)return Vo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Vo=n-r,Vo}const $r=Symbol();function mp(e){const t=f.useRef([$r,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const s=t.current[0];s!==$r&&(a=typeof a=="function"?a(s):a,a===s)||(s!==$r&&i({}),r(u=>typeof a=="function"?a(s===$r?u:s):a),t.current[0]=$r)},[]),l=f.useCallback(()=>{t.current[0]=$r,i({})},[]);return[t.current[0]===$r?n:t.current[0],o,l]}function Uc(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function vp(e){const t=f.useRef(e);return Di(e,t.current)||(t.current=e),t.current}const bp=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const l=o.length>1;return f.createElement(tp,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(up.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},o.map(a=>{const s=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Vl,null)))};function Gc(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Xr=Gc();function wp(e){Xr=e}const Xc=/[&<>"']/,yp=new RegExp(Xc.source,"g"),Yc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Cp=new RegExp(Yc.source,"g"),Sp={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=e=>Sp[e];function vn(e,t){if(t){if(Xc.test(e))return e.replace(yp,ru)}else if(Yc.test(e))return e.replace(Cp,ru);return e}const xp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function jc(e){return e.replace(xp,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const kp=/(^|[^\[])\^/g;function Ft(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(kp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const Mp=/[^\w:]/g,Rp=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(jc(n)).replace(Mp,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Rp.test(n)&&(n=Dp(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const $o={},Ip=/^[^:]+:\/*[^/]*$/,Ep=/^([^:]+:)[\s\S]*$/,Tp=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Dp(e,t){$o[" "+e]||(Ip.test(e)?$o[" "+e]=e+"/":$o[" "+e]=Zo(e,"/",!0)),e=$o[" "+e];const n=e.indexOf(":")===-1;
2return t.substring(0,2)==="//"?n?t:e.replace(Ep,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Tp,"$1")+t:e+t}const sa={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,l,a)=>{let s=!1,u=l;for(;--u>=0&&a[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Zo(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Op(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Pp(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function lu(e,t,n,r){const i=t.href,o=t.title?vn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:vn(l)}}function Lp(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(` 3`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(` 4`)}class Nl{constructor(t){this.options=t||Xr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Zo(r,` 5`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Lp(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=Zo(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,l,a,s,u,c,d,g,h,p,m=n[1].trim();const y=m.length>1,v={type:"list",raw:"",ordered:y,start:y?+m.slice(0,-1):"",loose:!1,items:[]};m=y?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=y?m:"[*+-]");const b=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(` 6`,1)[0].replace(/^\t+/,T=>" ".repeat(3*T.length)),d=t.split(` 7`,1)[0],this.options.pedantic?(l=2,h=c.trimLeft()):(l=n[2].search(/[^ ]/),l=l>4?1:l,h=c.slice(l),l+=n[1].length),s=!1,!c&&/^ *$/.test(d)&&(r+=d+` 8`,t=t.substring(d.length+1),p=!0),!p){const T=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),k=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),P=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;t&&(g=t.split(` 9`,1)[0],d=g,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(d)||P.test(d)||T.test(d)||k.test(t)));){if(d.search(/[^ ]/)>=l||!d.trim())h+=` 10`+d.slice(l);else{if(s||c.search(/[^ ]/)>=4||R.test(c)||P.test(c)||k.test(c))break;h+=` 11`+d}!s&&!d.trim()&&(s=!0),r+=g+` 12`,t=t.substring(g.length+1),c=d.slice(l)}}v.loose||(u?v.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(o=i[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:h}),v.raw+=r}
12v.items[v.items.length-1].raw=r.trimRight(),v.items[v.items.length-1].text=h.trimRight(),v.raw=v.raw.trimRight();const x=v.items.length;for(a=0;a<x;a++)if(this.lexer.state.top=!1,v.items[a].tokens=this.lexer.blockTokens(v.items[a].text,[]),!v.loose){const T=v.items[a].tokens.filter(R=>R.type==="space"),k=T.length>0&&T.some(R=>/\n.*\n/.test(R.raw));v.loose=k}if(v.loose)for(a=0;a<x;a++)v.items[a].loose=!0;return v}}html(t){const n=this.rules.block.html.exec(t);if(n){const r={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(n[0]):vn(n[0]);r.type="paragraph",r.text=i,r.tokens=this.lexer.inline(i)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:ou(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` 13`):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,l,a,s;for(o=0;o<i;o++)/^ *-+: *$/.test(r.align[o])?r.align[o]="right":/^ *:-+: *$/.test(r.align[o])?r.align[o]="center":/^ *:-+ *$/.test(r.align[o])?r.align[o]="left":r.align[o]=null;for(i=r.rows.length,o=0;o<i;o++)r.rows[o]=ou(r.rows[o],r.header.length).map(u=>({text:u}));for(i=r.header.length,l=0;l<i;l++)r.header[l].tokens=this.lexer.inline(r.header[l].text);for(i=r.rows.length,l=0;l<i;l++)for(s=r.rows[l],a=0;a<s.length;a++)s[a].tokens=this.lexer.inline(s[a].text);return r}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===` 14`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:vn(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):vn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const l=Zo(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{const l=Op(n[2],"()");if(l>-1){const s=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,s).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],o=l[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),lu(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return lu(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){const l=i[0].length-1;let a,s,u=l,c=0;const d=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+l);(i=d.exec(n))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(s=a.length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&l%3&&!((l+s)%3)){c+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+c);const g=t.slice(0,l+i.index+(i[0].length-a.length)+s);
14if(Math.min(l,s)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=vn(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=vn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=vn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=vn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let l;do l=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(l!==r[0]);i=vn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):vn(r[0]):r[0]:i=vn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}}const $e={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:sa,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};$e._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;$e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;$e.def=Ft($e.def).replace("label",$e._label).replace("title",$e._title).getRegex();$e.bullet=/(?:[*+-]|\d{1,9}[.)])/;$e.listItemStart=Ft(/^( *)(bull) */).replace("bull",$e.bullet).getRegex();$e.list=Ft($e.list).replace(/bull/g,$e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$e.def.source+")").getRegex();$e._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";$e._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;$e.html=Ft($e.html,"i").replace("comment",$e._comment).replace("tag",$e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();$e.paragraph=Ft($e._paragraph).replace("hr",$e.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$e._tag).getRegex();$e.blockquote=Ft($e.blockquote).replace("paragraph",$e.paragraph).getRegex();$e.normal={...$e};
vendor: 14,356 bytes, lines 14-45
14$e.gfm={...$e.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};$e.gfm.table=Ft($e.gfm.table).replace("hr",$e.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$e._tag).getRegex();$e.gfm.paragraph=Ft($e._paragraph).replace("hr",$e.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",$e.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$e._tag).getRegex();$e.pedantic={...$e.normal,html:Ft(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$e._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ft($e.normal._paragraph).replace("hr",$e.hr).replace("heading",` *#{1,6} *[^ 15]`).replace("lheading",$e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sa,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";be.punctuation=Ft(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex();be.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;be.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;be._comment=Ft($e._comment).replace("(?:-->|$)","-->").getRegex();be.emStrong.lDelim=Ft(be.emStrong.lDelim).replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimAst=Ft(be.emStrong.rDelimAst,"g").replace(/punct/g,be._punctuation).getRegex();be.emStrong.rDelimUnd=Ft(be.emStrong.rDelimUnd,"g").replace(/punct/g,be._punctuation).getRegex();be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;be._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;be.autolink=Ft(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex();be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;be.tag=Ft(be.tag).replace("comment",be._comment).replace("attribute",be._attribute).getRegex();be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;be._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;be.link=Ft(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex();be.reflink=Ft(be.reflink).replace("label",be._label).replace("ref",$e._label).getRegex();be.nolink=Ft(be.nolink).replace("ref",$e._label).getRegex();be.reflinkSearch=Ft(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex();be.normal={...be};be.pedantic={...be.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ft(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:Ft(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()};be.gfm={...be.normal,escape:Ft(be.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};be.gfm.url=Ft(be.gfm.url,"i").replace("email",be.gfm._extended_email).getRegex();be.breaks={...be.gfm,br:Ft(be.br).replace("{2,}","*").getRegex(),text:Ft(be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function Fp(e){return e.replace(/---/g,"â").replace(/--/g,"â").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1â").replace(/'/g,"â").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1â").replace(/"/g,"â").replace(/\.{3}/g,"â¦")}function su(e){let t="",n,r;const i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class Rr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Xr,this.options.tokenizer=this.options.tokenizer||new Nl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:$e.normal,inline:be.normal};this.options.pedantic?(n.block=$e.pedantic,n.inline=be.pedantic):this.options.gfm&&(n.block=$e.gfm,this.options.breaks?n.inline=be.breaks:n.inline=be.gfm),this.tokenizer.rules=n}static get rules(){return{block:$e,inline:be}}static lex(t,n){return new Rr(n).lex(t)}static lexInline(t,n){return new Rr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` 16`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,s,u)=>s+" ".repeat(u.length));let r,i,o,l;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=` 17`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` 18`+r.raw,i.text+=` 19`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` 20`+r.raw,i.text+=` 21`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const s=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},s),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],l&&i.type==="paragraph"?(i.raw+=` 22`+r.raw,i.text+=` 23`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),l=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=` 24`+r.raw,i.text+=` 25`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,i,o,l=t,a,s,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,a.index+a[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(s||(u=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,l,u)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t,su)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,su))){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let g;this.options.extensions.startInline.forEach(function(h){g=h.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,Fp)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),s=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class Bl{constructor(t){this.options=t||Xr}code(t,n,r){const i=(n||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,i);o!=null&&o!==t&&(r=!0,t=o)}return t=t.replace(/\n$/,"")+` 26`,i?'<pre><code class="'+this.options.langPrefix+vn(i)+'">'+(r?t:vn(t,!0))+`</code></pre> 27`:"<pre><code>"+(r?t:vn(t,!0))+`</code></pre> 28`}blockquote(t){return`<blockquote> 29${t}</blockquote> 30`}html(t){return t}heading(t,n,r,i){if(this.options.headerIds){const o=this.options.headerPrefix+i.slug(r);return`<h${n} id="${o}">${t}</h${n}> 31`}return`<h${n}>${t}</h${n}> 32`}hr(){return this.options.xhtml?`<hr/> 33`:`<hr> 34`}list(t,n,r){const i=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+i+o+`> 35`+t+"</"+i+`> 36`}listitem(t){return`<li>${t}</li> 37`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p> 38`}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table> 39<thead> 40`+t+`</thead> 41`+n+`</table> 42`}tablerow(t){return`<tr> 43${t}</tr> 44`}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}> 45`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class qc{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class Kc{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}
vendor: 4,488 bytes, lines 45-47
45getNextSafeSlug(t,n){let r=t,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Ir{constructor(t){this.options=t||Xr,this.options.renderer=this.options.renderer||new Bl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qc,this.slugger=new Kc}static parse(t,n){return new Ir(n).parse(t)}static parseInline(t,n){return new Ir(n).parseInline(t)}parse(t,n=!0){let r="",i,o,l,a,s,u,c,d,g,h,p,m,y,v,b,x,T,k,R;const P=t.length;for(i=0;i<P;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(R=this.options.extensions.renderers[h.type].call({parser:this},h),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=R||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,jc(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",a=h.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",a=h.rows.length,o=0;o<a;o++){for(u=h.rows[o],c="",s=u.length,l=0;l<s;l++)c+=this.renderer.tablecell(this.parseInline(u[l].tokens),{header:!1,align:h.align[l]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(p=h.ordered,m=h.start,y=h.loose,a=h.items.length,g="",o=0;o<a;o++)b=h.items[o],x=b.checked,T=b.task,v="",b.task&&(k=this.renderer.checkbox(x),y?b.tokens.length>0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=k+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=k+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(b.tokens,y),g+=this.renderer.listitem(v,T,x);r+=this.renderer.list(g,p,m);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<P&&t[i+1].type==="text";)h=t[++i],g+=` 46`+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const I='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(I);return}else throw new Error(I)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",i,o,l;const a=t.length;for(i=0;i<a;i++){if(o=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(l=this.options.extensions.renderers[o.type].call({parser:this},o),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=l||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(s);return}else throw new Error(s)}}}return r}}class yl{constructor(t){this.options=t||Xr}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}function _p(e,t,n){return r=>{if(r.message+=` 47Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+vn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function Zc(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...Ue.defaults,...o};const l=_p(r.silent,r.async,i);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));
47if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Pp(r),r.hooks&&(r.hooks.options=r),i){const a=r.highlight;let s;try{r.hooks&&(n=r.hooks.preprocess(n)),s=e(n,r)}catch(d){return l(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&Ue.walkTokens(s,r.walkTokens),g=t(s,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=a,d?l(d):i(null,g)};if(!a||a.length<3||(delete r.highlight,!s.length))return u();let c=0;Ue.walkTokens(s,function(d){d.type==="code"&&(c++,setTimeout(()=>{a(d.text,d.lang,function(g,h){if(g)return u(g);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(Ue.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(l);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&Ue.walkTokens(a,r.walkTokens);let s=t(a,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(a){return l(a)}}}function Ue(e,t,n){return Zc(Rr.lex,Ir.parse)(e,t,n)}Ue.options=Ue.setOptions=function(e){return Ue.defaults={...Ue.defaults,...e},wp(Ue.defaults),Ue};Ue.getDefaults=Gc;Ue.defaults=Xr;Ue.use=function(...e){const t=Ue.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=Ue.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...l){let a=i.renderer.apply(this,l);return a===!1&&(a=o.apply(this,l)),a}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=Ue.defaults.renderer||new Bl;for(const o in n.renderer){const l=i[o];i[o]=(...a)=>{let s=n.renderer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.renderer=i}if(n.tokenizer){const i=Ue.defaults.tokenizer||new Nl;for(const o in n.tokenizer){const l=i[o];i[o]=(...a)=>{let s=n.tokenizer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.tokenizer=i}if(n.hooks){const i=Ue.defaults.hooks||new yl;for(const o in n.hooks){const l=i[o];yl.passThroughHooks.has(o)?i[o]=a=>
47{if(Ue.defaults.async)return Promise.resolve(n.hooks[o].call(i,a)).then(u=>l.call(i,u));const s=n.hooks[o].call(i,a);return l.call(i,s)}:i[o]=(...a)=>{let s=n.hooks[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.hooks=i}if(n.walkTokens){const i=Ue.defaults.walkTokens;r.walkTokens=function(o){let l=[];return l.push(n.walkTokens.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}Ue.setOptions(r)})};Ue.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Ue,r)),r.type){case"table":{for(const i of r.header)n=n.concat(Ue.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(Ue.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Ue.walkTokens(r.items,t));break}default:Ue.defaults.extensions&&Ue.defaults.extensions.childTokens&&Ue.defaults.extensions.childTokens[r.type]?Ue.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(Ue.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(Ue.walkTokens(r.tokens,t)))}return n};Ue.parseInline=Zc(Rr.lexInline,Ir.parseInline);Ue.Parser=Ir;Ue.parser=Ir.parse;Ue.Renderer=Bl;Ue.TextRenderer=qc;Ue.Lexer=Rr;Ue.lexer=Rr.lex;Ue.Tokenizer=Nl;Ue.Slugger=Kc;Ue.Hooks=yl;Ue.parse=Ue;Ue.options;Ue.setOptions;Ue.use;Ue.walkTokens;Ue.parseInline;Ir.parse;Rr.lex;const Ap=dn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Hp extends zt.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:i}=n,o=Ue(r),l=document.createRange();l.selectNodeContents(t),l.deleteContents();let a=i?.(o);if(a===void 0){const u=document.createElement("template");u.innerHTML=o,a=u.content}t.append(a);const s=t.getElementsByTagName("a");for(const u of s)u.target="_blank",u.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),zt.createElement(Ap,{ref:this.containerRefHook})}}const zp=dn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Vp=dn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),$p=dn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let uu=0;const Yr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:l,...a}=e,{onChange:s,className:u}=a,c=f.useRef(null),d=n??"";On(s!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(uu=(uu+1)%1e7));f.useEffect(()=>{const p=c.current;if(p===null||p.disabled)return;const m=d.toString().length;p.focus(),p.setSelectionRange(i?0:m,m)},[]),f.useLayoutEffect(()=>{if(l!==void 0){const p=typeof l=="number"?[l,null]:l;c.current?.setSelectionRange(p[0],p[1])}},[l]);const h=f.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&o===!0||r?.(p)},[o,r]);return f.createElement($p,{className:"gdg-growing-entry"},f.createElement(Vp,{className:u},d+` 48`),f.createElement(zp,{...a,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},el={};let yr=null;function Np(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function co(e){const t=e.toLowerCase().trim();if(el[t]!==void 0)return el[t];yr=yr||Np(),yr.style.color="#000",yr.style.color=t;const n=getComputedStyle(yr).color;yr.style.color="#fff",yr.style.color=t;const r=getComputedStyle(yr).color;if(r!==n)return[0,0,0,1];let i=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(o=>Number.isNaN(o)?0:o),el[t]=i,i}function Ur(e,t){const[n,r,i]=co(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const cu=new Map;function du(e,t){const n=`${e}-${t}`,r=cu.get(n);if(r!==void 0)return r;const i=Pn(e,t);return cu.set(n,i),i}function Pn(e,t){if(t===void 0)return e;const[n,r,i,o]=co(e);if(o===1)return e;const[l,a,s,u]=co(t),c=o+u*(1-o),d=(o*n+u*l*(1-o))/c,g=(o*r+u*a*(1-o))/c,h=(o*i+u*s*(1-o))/c;return`rgba(${d}, ${g}, ${h}, ${c})`}function Cl(e){if(e==="transparent")return 0;function t(o){const l=o/255;return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}const[n,r,i]=co(e);return .2126*t(n)+.7152*t(r)+.0722*t(i)}var ki=new Map,Ri=new Map,Sl=new Map;function Bp(){ki.clear(),Sl.clear(),Ri.clear()}function Wp(e,t,n,r,i){var o,l,a;let s=0,u={};for(let d of e)s+=(o=n.get(d))!=null?o:i,u[d]=((l=u[d])!=null?l:0)+1;let c=t-s;for(let d of Object.keys(u)){let g=u[d],h=(a=n.get(d))!=null?a:i,p=h*g/s,m=c*p*r/g,y=h+m;n.set(d,y)}}function Up(e,t){var n;let r=new Map,i=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),i+=c}let o=i/r.size,l=3,a=(t/o+l)/(l+1),s=r.keys();for(let u of s)r.set(u,((n=r.get(u))!=null?n:o)*a);return r}function oo(e,t,n,r){var i,o;let l=Ri.get(n);if(r&&l!==void 0&&l.count>2e4){let u=Sl.get(n);if(u===void 0&&(u=Up(e,l.size),Sl.set(n,u)),l.count>5e5){let d=0;for(let g of t)d+=(i=u.get(g))!=null?i:l.size;return d*1.01}let c=e.measureText(t);return Wp(t,c.width,u,Math.max(.05,1-l.count/2e5),l.size),Ri.set(n,{count:l.count+t.length,size:l.size}),c.width}let a=e.measureText(t),s=a.width/t.length;if(((o=l?.count)!=null?o:0)>2e4)return a.width;if(l===void 0)Ri.set(n,{count:t.length,size:s});else{let u=s-l.size,c=t.length/(l.count+t.length),d=l.size+u*c;Ri.set(n,{count:l.count+t.length,size:d})}return a.width}function Gp(e,t,n,r,i,o,l,a){if(t.length<=1)return t.length;if(i<n)return-1;let s=Math.floor(n/i*o),u=oo(e,t.slice(0,Math.max(0,s)),r,l);if(u!==n)if(u<n){for(;u<n;)s++,u=oo(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;u>n;){let c=t.lastIndexOf(" ",s-1);c>0?s=c:s--,u=oo(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let c=0;c=t.lastIndexOf(" ",s),c>0&&(s=c)}return s}function Xp(e,t,n,r,i,o){let l=`${t}_${n}_${r}px`,a=ki.get(l);if(a!==void 0)return a;
48if(r<=0)return[];let s=[],u=t.split(` 49`),c=Ri.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let p=oo(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d);if(p<=r)s.push(h);else{for(;p>r;){let y=Gp(e,h,r,n,p,m,g),v=h.slice(0,Math.max(0,y));h=h.slice(v.length),s.push(v),p=oo(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d)}p>0&&s.push(h)}}return s=s.map((h,p)=>p===0?h.trimEnd():h.trim()),ki.set(l,s),ki.size>500&&ki.delete(ki.keys().next().value),s}function Yp(e,t){return zt.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function jp(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(ao(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function fo(e,t){return(e??"")===(t??"")}function qp(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function Jc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function ao(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function Qc(e){return[e.x+e.width-1,e.y+e.height-1]}function fu(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,l=n.y+n.height-1,[a,s]=e;if(s<o||s>l)return!1;if(t.span===void 0)return a>=r&&a<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function Kp(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&fu(e,t,o)&&i++;for(const l of n.current.rangeStack)fu(e,t,l)&&i++;return i}function ed(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,l)=>({...o,sticky:e[l].sticky})),n=r}return n}function Oi(e,t){let n=0;const r=ed(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function jr(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function xl(e,t,n,r,i){const o=ed(e,r),l=[];for(const u of o)if(u.sticky)l.push(u);else break;if(l.length>0)for(const u of l)n-=u.width;let a=t,s=i??0;for(;s<=n&&a<o.length;)s+=o[a].width,a++;for(let u=t;u<a;u++){const c=o[u];c.sticky||l.push(c)}return l}function Zp(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function Jp(e,t,n,r,i,o,l,a,s,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let p=0;p<u;p++){const m=o-1-p,y=typeof l=="number"?l:l(m);if(d-=y,e>=d)return m}const g=o-u,h=e-(s??0);if(typeof l=="number"){const p=Math.floor((h-c)/l)+a;return p>=g?void 0:p}else{let p=c;for(let m=a;m<g;m++){const y=l(m);if(h<=p+y)return m;p+=y}return}}let Jo=0,lo={};const Qp=typeof window>"u";async function em(){Qp||document?.fonts?.ready===void 0||(await document.fonts.ready,Jo=0,lo={},Bp())}em();function td(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Er(e,t,n,r="middle"){const i=td(e,t,r,n);let o=lo[i];return o===void 0&&(o=t.measureText(e),lo[i]=o,Jo++),Jo>1e4&&(lo={},Jo=0),o}function nd(e,t){const n=td(e,void 0,"middle",t);return lo[n]}function qn(e,t){return typeof t!="string"&&(t=t.baseFontFull),tm(e,t)}function hu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const gu=[];function tm(e,t){for(const o of gu)if(o.key===t)return o.val;const n=hu(e,"alphabetic"),i=-(hu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return gu.push({key:t,val:i}),i}function nm(e,t,n,r,i,o){const{ctx:l,rect:a,theme:s}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;l.globalAlpha=d,l.fillStyle=s.bgSearchResult,l.fillRect(a.x+1,a.y+1,a.width-(i?2:1),a.height-(o?2:1)),l.globalAlpha=1,r!==void 0&&(r.fillStyle=s.bgSearchResult)}return u<c}function wo(e,t,n){const{ctx:r,theme:i}=e,o=t??{},l=n??i.textDark;return l!==o.fillStyle&&(r.fillStyle=l,o.fillStyle=l),o}function Wl(e,t,n,r,i){const{rect:o,ctx:l,theme:a}=e;l.fillStyle=a.textDark,rr({ctx:l,rect:o,theme:a},t,n,r,i)}function rd(e,t,n,r,i,o,l,a,s){s==="right"?e.fillText(t,n+i-(a.cellHorizontalPadding+.5),r+o/2+l):s==="center"?e.fillText(t,n+i/2,r+o/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+o/2+l)}function Ul(e,t){const n=Er("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function rm(e,t){e.includes(` 50`)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function im(e,t,n,r,i,o,l,a,s,u){const c=a.baseFontFull,d=Xp(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=Ul(e,c),h=a.lineHeight*g,p=g+h*(d.length-1),m=p+a.cellVerticalPadding>o;m&&(e.save(),e.rect(n,r,i,o),e.clip());const y=r+o/2-p/2;let v=Math.max(r+a.cellVerticalPadding,y);for(const b of d)if(rd(e,b,n,v,i,g,l,a,s),v+=h,v>r+o)break;
50m&&e.restore()}function rr(e,t,n,r,i){const{ctx:o,rect:l,theme:a}=e,{x:s,y:u,width:c,height:d}=l;r=r??!1,r||(t=rm(t,c));const g=qn(o,a),h=$l(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let p=!1;n==="right"?(o.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,p=!0),r?im(o,t,s,u,c,d,g,a,n,i):rd(o,t,s,u,c,d,g,a,n),p&&(o.textAlign="start"),h&&(o.direction="inherit")}}function jn(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function om(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function am(e,t,n){const r=function(a,s){const u=s.x-a.x,c=s.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:s.y-a.y,len:d,n
50x:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let l=t[o-1];for(let a=0;a<o;a++){let s=t[a%o];const u=t[(a+1)%o],c=r(s,l),d=r(s,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,y=!1;h<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,y=!0):p>0&&(m=-1,y=!0),i=s.radius!==void 0?s.radius:n;const v=p/2;let b=Math.abs(Math.cos(v)*i/Math.sin(v)),x;b>Math.min(c.len/2,d.len/2)?(b=Math.min(c.len/2,d.len/2),x=Math.abs(b*Math.sin(v)/Math.cos(v))):x=i;let T=s.x+d.nx*b,k=s.y+d.ny*b;T+=-d.ny*x*m,k+=d.nx*x*m,e.arc(T,k,x,c.ang+Math.PI/2*m,d.ang-Math.PI/2*m,y),l=s,s=u}e.closePath()}function kl(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p){const m={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return m;const y=o-i;if(e>=d){const v=l>e?-1:1,b=Oi(h);m.x+=b+s;for(let x=l;x!==e;x+=v)m.x+=h[v===1?x:x-1].width*v}else for(let v=0;v<e;v++)m.x+=h[v].width;if(m.width=h[e].width+1,t===-1)m.y=i,m.height=y;else if(t===-2){m.y=0,m.height=i;let v=e;const b=h[e].group,x=h[e].sticky;for(;v>0&&fo(h[v-1].group,b)&&h[v-1].sticky===x;){const k=h[v-1];m.x-=k.width,m.width+=k.width,v--}let T=e;for(;T+1<h.length&&fo(h[T+1].group,b)&&h[T+1].sticky===x;){const k=h[T+1];m.width+=k.width,T++}if(!x){const k=Oi(h),R=m.x-k;R<0&&(m.x-=R,m.width+=R),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=c-g){let v=c-t;for(m.y=r;v>0;){const b=t+v-1;m.height=typeof p=="number"?p:p(b),m.y-=m.height,v--}m.height+=1}else{const v=a>t?-1:1;if(typeof p=="number"){const b=t-a;m.y+=b*p}else for(let b=a;b!==t;b+=v)m.y+=p(b)*v;m.height=(typeof p=="number"?p:p(t))+1}return m}const Gl=1<<21;function Yn(e,t){return(t+2)*Gl+e}function id(e){return e%Gl}function Xl(e){return Math.floor(e/Gl)-2}function Yl(e){const t=id(e),n=Xl(e);return[t,n]}class od{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=id(t),r=Xl(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,l=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&l};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Di(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class lm extends od{cache=new Map;setValue=(t,n)=>{this.cache.set(Yn(t[0],t[1]),n)};getValue=t=>this.cache.get(Yn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class so{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Yn(n[0],n[1])))}add(t){this.cells.add(Yn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Yn(t[0],t[1]))}remove(t){this.cells.delete(Yn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Xl(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Yn(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield Yl(t)}}function sm(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}
50}const ad={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function ld(){return ad}const sd=zt.createContext(ad);function ud(){return zt.useContext(sd)}function dr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=Pn(r[i],n[i]):n[i]=r[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Ml=150;function um(e,t,n,r){return r(t)?.measure?.(e,t,n)??Ml}function cd(e,t,n,r,i,o,l,a,s){let u=0;const c=i===void 0?[]:i.map(h=>{const p=um(e,h[r],t,s);return u=Math.max(u,p),p});if(c.length>5&&a){u=0;let h=0;for(const m of c)h+=m;
50const p=h/c.length;for(let m=0;m<c.length;m++)c[m]>=p*2?c[m]=0:u=Math.max(u,c[m])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(l),Math.ceil(u)));return{...n,width:g}}function cm(e,t,n,r,i,o,l,a,s){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(l);u.current=t,c.current=n,d.current=l;const[g,h]=f.useMemo(()=>{if(typeof window>"u")return[null,null];const b=document.createElement("canvas");return b.style.display="none",b.style.opacity="0",b.style.position="fixed",[b,b.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const p=f.useRef({}),m=f.useRef(),[y,v]=f.useState();return f.useLayoutEffect(()=>{const b=c.current;if(b===void 0||e.every(Ao))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),T=0;x<u.current&&x>1&&(x--,T=1);const k={x:0,y:0,width:e.length,height:Math.min(u.current,x)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const I=b(k,s.signal),C=T>0?b(R,s.signal):void 0;let F;typeof I=="object"?F=I:F=await Vs(I),C!==void 0&&(typeof C=="object"?F=[...F,...C]:F=[...F,...await Vs(C)]),m.current=e,v(F)})()},[s.signal,e]),f.useMemo(()=>{let x=e.every(Ao)?e:h===null?e.map(P=>Ao(P)?P:{...P,width:Ml}):(h.font=d.current.baseFontFull,e.map((P,I)=>{if(Ao(P))return P;if(p.current[P.id]!==void 0)return{...P,width:p.current[P.id]};if(y===void 0||m.current!==e||P.id===void 0)return{...P,width:Ml};const C=cd(h,l,P,I,y,i,o,!0,a);return p.current[P.id]=C.width,C})),T=0,k=0;const R=[];for(const[P,I]of x.entries())T+=I.width,I.grow!==void 0&&I.grow>0&&(k+=I.grow,R.push(P));if(T<r&&R.length>0){const P=[...x],I=r-T;let C=I;for(let F=0;F<R.length;F++){const D=R[F],S=(x[D].grow??0)/k,E=F===R.length-1?C:Math.min(C,Math.floor(I*S));P[D]={...x[D],growOffset:E,width:x[D].width+E},C-=E}x=P}return{sizedColumns:x,nonGrowWidth:T}},[r,e,h,y,l,i,o,a])}const Vt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',dm=e=>{const t=e.fgColor,n=e.bgColor;return` 51 ${Vt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},fm=e=>{const t=e.fgColor,n=e.bgColor;return` 52 ${Vt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},hm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 53 <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/> 54 <path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03
54-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/> 55 </svg>`},gm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 56 <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/> 57 <path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/> 58</svg>`},pm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 59 <path 60 d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z" 61 fill="${n}" 62 /> 63 <path 64 fill-rule="evenodd" 65 clip-rule="evenodd" 66 d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z" 67 fill="${t}" 68 /> 69</svg>`},dd=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 70<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/> 71<path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/> 72<path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/> 73</svg> 74 `},mm=e=>{const t=e.bgColor;return`${Vt} 75 <path stroke="${t}" stroke-width="2" d="M12 3v14"/> 76 <path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/> 77 <path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/> 78 </svg> 79`},vm=dd,bm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 80 <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/> 81 <path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/> 82</svg>`},wm=e=>{const t=e.fgColor,n=e.bgColor;return` 83 ${Vt} 84 <path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/> 85 <path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/> 86 <path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/> 87 <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/> 88 <path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/> 89 <path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/> 90 <path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/> 91 </svg>`},ym=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 92 <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/> 93 <path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/> 94 <path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/> 95</svg>`},Cm=e=>{const t=e.fgColor,n=e.bgColor;return` 96 ${Vt} 97 <path fill="${t}" d="M3 3h14v14H3z"/> 98 <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/> 99 </svg>`},Sm=e=>{const t=e.fgColor,n=e.bgColor;return` 100 ${Vt} 101 <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/> 102 <path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/> 103 </svg>`},xm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 104 <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/> 105 <path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.
105682z" fill="${t}"/> 106</svg>`},km=e=>{const t=e.fgColor,n=e.bgColor;return` 107 ${Vt} 108 <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/> 109 <path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/> 110 <path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/> 111 </svg>`},Mm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 112 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 113 <path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/> 114 <path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/> 115</svg>`},Rm=e=>{const t=e.fgColor,n=e.bgColor;return` 116 ${Vt} 117 <rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/> 118 <rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/> 119 <path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/> 120 </svg>`},Im=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 121 <path fill="${t}" d="M4 3h12v14H4z"/> 122 <path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/> 123</svg>`},Em=e=>{const t=e.fgColor,n=e.bgColor;return` 124 ${Vt} 125 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 126 <path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/> 127 </svg>`},Tm=e=>{const t=e.fgColor,n=e.bgColor;return` 128 ${Vt} 129 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 130 <path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/> 131 </svg>`},Dm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 132 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 133 <path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/> 134</svg>`},Om=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 135 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 136 <path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/> 137 <path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/> 138 <path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/> 139 <path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/> 140</svg>`},Pm=e=>{const t=e.fgColor,n=e.bgColor;return` 141 ${Vt} 142 <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/> 143 <path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/> 144 </svg>`},Lm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 145 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 146 <path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/> 147</svg>`},Fm=e=>{const t=e.fgColor,n=e.bgColor;return` 148 ${Vt} 149 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 150 <path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/> 151 </svg>`},_m=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 152 <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/> 153 <path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/> 154 <path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/> 155</svg>`},Am=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt} 156 <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/> 157 <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/> 158</svg>`},Hm=e=>{const t=e.fgColor;return` 159 <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg"> 160 <path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/> 161 </svg>`},zm=e=>{const t=e.fgColor;return` 162 <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg"> 163 <path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/> 164 </svg> 165`},Vm={headerRowID:dm,headerNumber:hm,headerCode:fm,headerString:gm,headerBoolean:pm,headerAudioUri:vm,headerVideoUri:bm,headerEmoji:wm,headerImage:ym,headerUri:dd,headerPhone:Cm,headerMarkdown:Sm,headerDate:xm,headerTime:km,headerEmail:Mm,headerReference:Rm,headerIfThenElse:Im,headerSingleValue:Em,headerLookup:Tm,headerTextTemplate:Dm,headerMath:Om,headerRollup:Pm,headerJoinStrings:Lm,headerSplitString:Fm,headerGeoDistance:_m,headerArray:Am,rowOwnerOverlay:Hm,protectedColumnOverlay:zm,renameIcon:mm};function $m(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Nm{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,l,a,s=1){const[u,c]=$m(n,a),d=l*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const p=this.headerIcons[t];if(p===void 0)return;h=document.createElement("canvas");const m=h.getContext("2d");if(m===null)return;const y=new Image;y.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const v=y.decode();if(v===void 0)return;this.inFlight++,v.then(()=>{m.drawImage(y,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(h,0,0,d,d,i,o,l,l),s<1&&(r.globalAlpha=1)}}function fd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function xa(e,t,n,r,i,o,l,a,s){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&s(u,c,h,!1,l&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const p=i(c);u-=p,s(u,c,p,!0,l&&c===r-1)}}}function Tr(e,t,n,r,i,o){let l=0,a=0;const s=i+r;for(const u of e){const c=u.sticky?a:l+n;if(o(u,c,s,u.sticky?0:a,t)===!0)break;l+=u.width,a+=u.sticky?u.width:0}}function hd(e,t,n,r,i){let o=0,l=0;for(let a=0;a<e.length;a++){const s=e[a];let u=a+1,c=s.width;for(s.sticky&&(l+=c);u<e.length&&fo(e[u].group,s.group)&&e[u].sticky===e[a].sticky;){const m=e[u];c+=m.width,u++,a++,m.sticky&&(l+=m.width)}const d=s.sticky?0:n,g=o+d,h=s.sticky?0:Math.max(0,l-g),p=Math.min(c-h,t-(g+h));i([s.sourceIndex,e[u-1].sourceIndex],s.group??"",g+h,0,p,r),o+=c}}function gd(e,t,n,r,i,o,l){const[a,s]=e;let u,c;const d=l.find(g=>!g.sticky)?.sourceIndex??0;if(s>d){const g=Math.max(a,d);let h=t,p=r;for(let m=o.sourceIndex-1;m>=g;m--)h-=l[m].width,p+=l[m].width;for(let m=o.sourceIndex+1;m<=s;m++)p+=l[m].width;
165c={x:h,y:n,width:p,height:i}}if(d>a){const g=Math.min(s,d-1);let h=t,p=r;for(let m=o.sourceIndex-1;m>=a;m--)h-=l[m].width,p+=l[m].width;for(let m=o.sourceIndex+1;m<=g;m++)p+=l[m].width;u={x:h,y:n,width:p,height:i}}return[u,c]}function Bm(e,t,n,r){if(r==="any")return pd(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),Jc([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,l=n-e.y+1,a=e.y+e.height-n,s=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:l,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return s===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:s===l?{x:e.x,y:n,width:e.width,height:e.y-n}:s===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function ho(e,t,n,r,i,o,l,a){return e<=i+l&&i<=e+n&&t<=o+a&&o<=t+r}function Wr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function pd(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Wm(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Um(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,o=-4,l=t+4,a=n+4,s=i-e.x,u=e.x+e.width-l,c=o-e.y,d=e.y+e.height-a,g=s>0?e.x+Math.floor(s/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,p=c>0?e.y+Math.floor(c/r)*r:e.y,m=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:p,width:h-g,height:m-p}}function Gm(e,t,n,r,i){const[o,l,a,s]=t,[u,c,d,g]=i,{x:h,y:p,width:m,height:y}=e,v=[];if(m<=0||y<=0)return v;const b=h+m,x=p+y,T=h<o,k=p<l,R=h+m>a,P=p+y>s,I=h>=o&&h<a||b>o&&b<=a||h<o&&b>a,C=p>=l&&p<s||x>l&&x<=s||p<l&&x>s;if(I&&C){const D=Math.max(h,o),S=Math.max(p,l),E=Math.min(b,a),O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(T&&k){const D=h,S=p,E=Math.min(b,o),O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:0,width:u+1,height:c+1}})}if(k&&I){const D=Math.max(h,o),S=p,E=Math.min(b,a),O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(k&&R){const D=Math.max(h,a),S=p,E=b,O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(T&&C){const D=h,S=Math.max(p,l),E=Math.min(b,o),O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(R&&C){const D=Math.max(h,a),S=Math.max(p,l),E=b,O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(T&&P){const D=h,S=Math.max(p,s),E=Math.min(b,o),O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(P&&I){const D=Math.max(h,o),S=Math.max(p,s),E=Math.min(b,a),O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(R&&P){const D=Math.max(h,a),S=Math.max(p,s),E=b,O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return v}const Xm={kind:Z.Loading,allowOverlay:!1};function pu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b,x,T,k,R,P,I,C,F,D,S,E,O,M,V,W,j){let oe=x?.size??Number.MAX_SAFE_INTEGER;const Q=performance.now();let re=E.baseFontFull;e.font=re;const se={ctx:e},ae=[0,0],de=y>0?jr(s,y,u):0;let fe,ue;const H=fd(b);return Tr(t,a,o,l,i,(L,Y,te,le,Se)=>{const pe=Math.max(0,le-Y),et=Y+pe,ke=i+1,Dt=L.width-pe,dt=r-i-1;if(b.length>0){let Ae=!1;for(let Oe=0;Oe<b.length;Oe++){const at=b[Oe];if(ho(et,ke,Dt,dt,at.x,at.y,at.width,at.height)){Ae=!0;break}}if(!Ae)return}const Ne=()=>{e.save(),e.beginPath(),e.rect(et,ke,Dt,dt),e.clip()},ne=T.columns.hasIndex(L.sourceIndex),ve=d(L.group??"").overrideTheme,me=L.themeOverride===void 0&&ve===void 0?E:dr(E,ve,L.themeOverride),he=me.baseFontFull;he!==re&&(re=he,e.font=he),Ne();let Ce;return xa(Se,te,r,s,u,y,v,H,(Ae,Oe,at,Pe,we)=>{if(Oe<0||(ae[0]=L.sourceIndex,ae[1]=Oe,x!==void 0&&!x.has(ae)))return;if(b.length>0){let De=!1;for(let mt=0;mt<b.length;mt++){const xt=b[mt];if(ho(Y,Ae,L.width,at,xt.x,xt.y,xt.width,xt.height)){De=!0;break}}if(!De)return}const He=T.rows.hasIndex(Oe),Re=h.hasIndex(Oe),Be=Oe<s?c(ae):Xm;let ft=Y,ht=L.width,Ye=!1,pt=!1;if(Be.span!==void 0){const[De,mt]=Be.span,xt=`${Oe},${De},${mt},${L.sticky}`;if(ue===void 0&&(ue=new Set),ue.has(xt)){oe--;return}else{const bn=gd(Be.span,Y,Ae,L.width,at,L,n),tn=L.sticky?bn[0]:bn[1];if(!L.sticky&&bn[0]!==void 0&&(pt=!0),tn!==void 0){ft=tn.x,ht=tn.width,ue.add(xt),e.restore(
165),Ce=void 0,e.save(),e.beginPath();const nn=Math.max(0,le-tn.x);e.rect(tn.x+nn,Ae,tn.width-nn,at),fe===void 0&&(fe=[]),fe.push({x:tn.x+nn,y:Ae,width:tn.width-nn,height:at}),e.clip(),Ye=!0}}}const Nt=g?.(Oe),St=we&&L.trailingRowOptions?.themeOverride!==void 0?L.trailingRowOptions?.themeOverride:void 0,Tt=Be.themeOverride===void 0&&Nt===void 0&&St===void 0?me:dr(me,Nt,St,Be.themeOverride);e.beginPath();const Bt=qp(ae,Be,T);let qt=Kp(ae,Be,T,m);const an=Be.span!==void 0&&T.columns.some(De=>Be.span!==void 0&&De>=Be.span[0]&&De<=Be.span[1]);Bt&&!p&&m?qt=0:Bt&&m&&(qt=Math.max(qt,1)),an&&qt++,Bt||(He&&qt++,ne&&!we&&qt++);const It=Be.kind===Z.Protected?Tt.bgCellMedium:Tt.bgCell;let gt;if((Pe||It!==E.bgCell)&&(gt=Pn(It,gt)),qt>0||Re){Re&&(gt=Pn(Tt.bgHeader,gt));for(let De=0;De<qt;De++)gt=Pn(Tt.accentLight,gt)}else if(k!==void 0){for(const De of k)if(De[0]===L.sourceIndex&&De[1]===Oe){gt=Pn(Tt.bgSearchResult,gt);break}}if(R!==void 0)for(let De=0;De<R.length;De++){const mt=R[De],xt=mt.range;mt.style!=="solid-outline"&&xt.x<=L.sourceIndex&&L.sourceIndex<xt.x+xt.width&&xt.y<=Oe&&Oe<xt.y+xt.height&&(gt=Pn(mt.color,gt))}let Wt=!1;if(x!==void 0){const De=Ae+1,xt=(Pe?De+at-1:Math.min(De+at-1,r-de))-De;(xt!==at-1||ft+1<=le)&&(Wt=!0,e.save(),e.beginPath(),e.rect(ft+1,De,ht-1,xt),e.clip()),gt=gt===void 0?Tt.bgCell:Pn(gt,Tt.bgCell)}const wt=L.sourceIndex===n.length-1,ln=Oe===s-1;gt!==void 0&&(e.fillStyle=gt,Ce!==void 0&&(Ce.fillStyle=gt),x!==void 0?e.fillRect(ft+1,Ae+1,ht-(wt?2:1),at-(ln?2:1)):e.fillRect(ft,Ae,ht,at)),Be.style==="faded"&&(e.globalAlpha=.6);let Mn;for(let De=0;De<C.length;De++){const mt=C[De];if(mt.item[0]===L.sourceIndex&&mt.item[1]===Oe){Mn=mt;break}}if(ht>j&&!pt){const De=Tt.baseFontFull;De!==re&&(e.font=De,re=De),Ce=md(e,Be,L.sourceIndex,Oe,wt,ln,ft,Ae,ht,at,qt>0,Tt,gt??Tt.bgCell,P,I,Mn?.hoverAmount??0,F,S,Q,D,Ce,O,M,V,W)}return Wt&&e.restore(),Be.style==="faded"&&(e.globalAlpha=1),oe--,Ye&&(e.restore(),Ce?.deprep?.(se),Ce=void 0,Ne(),re=he,e.font=he),oe<=0}),e.restore(),oe<=0}),fe}const Ji=[0,0],Qi={x:0,y:0,width:0,height:0},tl=[void 0,()=>{}];let Rl=!1;function Ym(){Rl=!0}function md(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b,x,T,k,R,P,I){let C,F;y!==void 0&&y[0][0]===n&&y[0][1]===r&&(C=y[1][0],F=y[1][1]);let D;Ji[0]=n,Ji[1]=r,Qi.x=l,Qi.y=a,Qi.width=s,Qi.height=u,tl[0]=R.getValue(Ji),tl[1]=M=>R.setValue(Ji,M),Rl=!1;const S={ctx:e,theme:d,col:n,row:r,cell:t,rect:Qi,highlighted:c,cellFillColor:g,hoverAmount:m,frameTime:b,hoverX:C,drawState:tl,hoverY:F,imageLoader:h,spriteManager:p,hyperWrapping:v,overrideCursor:C!==void 0?I:void 0,requestAnimationFrame:Ym},E=nm(S,t.lastUpdated,b,T,i,o),O=P(t);if(O!==void 0){T?.renderer!==O&&(T?.deprep?.(S),T=void 0);const M=O.drawPrep?.(S,T);x!==void 0&&!Mi(S.cell)?x(S,()=>O.draw(S,t)):O.draw(S,t),D=M===void 0?void 0:{deprep:M?.deprep,fillStyle:M?.fillStyle,font:M?.font,renderer:O}}return(E||Rl)&&k?.(Ji),D}function jl(e,t,n,r,i,o,l,a,s=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+l/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=Bc(c??t.checkboxMaxSize,l,t.cellVerticalPadding),y=m/2;const v=Nc(d,r,o,t.cellHorizontalPadding,m),b=$c(v,h,m),x=Wc(r+s,i+u,b);switch(n){case!0:{e.beginPath(),jn(e,v-m/2,h-m/2,m,m,p),g==="circle"&&(y*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-y+m/4.23,h-y+m/1.97),e.lineTo(v-y+m/2.42,h-y+m/1.44),e.lineTo(v-y+m/1.29,h-y+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case oa:case!1:{e.beginPath(),jn(e,v-m/2+.5,h-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case Al:{e.beginPath(),jn(e,v-m/2,h-m/2,m,m,p),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(y*=.8,m*=.8),e.beginPath(),e.moveTo(v-m/3,h),e.lineTo(v+m/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:uo()}}function jm(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b){const x=l+a;if(x<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,x);const T=r?.[0]?.[0],k=r?.[0]?.[1],R=r?.[1]?.[0],P=r?.[1]?.[1],I=d.headerFontFull;e.font=I,Tr(t,0,o,0,x,(C,F,D,S)=>{if(y!==void 0&&!y.has([C.sourceIndex,-1]))return;const E=Math.max(0,S-F);e.save(),e.beginPath(),e.rect(F+E,a,C.width-E,l),e.clip();const O=m(C.group??"").overrideTheme,M=C.themeOverride===void 0&&O===void 0?d:dr(d,O,C.themeOverride);M.bgHeader!==d.bgHeader&&(e.fillStyle=M.bgHeader,e.fill()),M!==d&&(e.font=M.headerFontFull);const V=c.columns.hasIndex(C.sourceIndex),W=s!==void 0||u||C.headerRowMarkerDisabled===!0,j=!W&&k===-1&&T===C.sourceIndex,oe=W?0:h.find(de=>de.item[0]===C.sourceIndex&&de.item[1]===-1)?.hoverAmount??0,Q=c?.current!==void 0&&c.current.cell[0]===C.sourceIndex,re=V?M.accentColor:Q?M.bgHeaderHasFocus:M.bgHeader,se=n?a:0,ae=C.sourceIndex===0?0:1;V?(e.fillStyle=re,e.fillRect(F+ae,se,C.width-ae,l)):(Q||oe>0)&&(e.beginPath(),e.rect(F+ae,se,C.width-ae,l),Q&&(e.fillStyle=M.bgHeaderHasFocus,e.fill()),oe>0&&(e.globalAlpha=oe,e.fillStyle=M.bgHeaderHovered,e.fill(),e.globalAlpha=1)),wd(e,F,se,C.width,l,C,V,M,j,j?R:void 0,j?P:void 0,Q,oe,g,v,b),e.restore(
165)}),n&&qm(e,t,i,o,a,r,d,g,h,p,m,y)}function qm(e,t,n,r,i,o,l,a,s,u,c,d){const[h,p]=o?.[0]??[];let m=0;hd(t,n,r,i,(y,v,b,x,T,k)=>{if(d!==void 0&&!d.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(b,x,T,k),e.clip();const R=c(v),P=R?.overrideTheme===void 0?l:dr(l,R.overrideTheme),I=p===-2&&h!==void 0&&h>=y[0]&&h<=y[1],C=I?P.bgGroupHeaderHovered??P.bgHeaderHovered:P.bgGroupHeader??P.bgHeader;if(C!==l.bgHeader&&(e.fillStyle=C,e.fill()),e.fillStyle=P.textGroupHeader??P.textHeader,R!==void 0){let F=b;if(R.icon!==void 0&&(a.drawSprite(R.icon,"normal",e,F+8,(i-20)/2,20,P),F+=26),e.fillText(R.name,F+8,i/2+qn(e,l.headerFontFull)),R.actions!==void 0&&I){const D=vd({x:b,y:x,width:T,height:k},R.actions);e.beginPath();const S=D[0].x-10,E=b+T-S;e.rect(S,0,E,i);const O=e.createLinearGradient(S,0,S+E,0),M=Ur(C,0);O.addColorStop(0,M),O.addColorStop(10/E,C),O.addColorStop(1,C),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[V,W]=o?.[1]??[-1,-1];for(let j=0;j<R.actions.length;j++){const oe=R.actions[j],Q=D[j],re=Wr(Q,V+b,W);re&&(e.globalAlpha=1),a.drawSprite(oe.icon,"normal",e,Q.x+Q.width/2-10,Q.y+Q.height/2-10,20,P),re&&(e.globalAlpha=.6)}e.globalAlpha=1}}b!==0&&u(y[0])&&(e.beginPath(),e.moveTo(b+.5,0),e.lineTo(b+.5,i),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=b+T}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()}const No=30;function Km(e,t,n,r,i){return{x:e+n-No,y:Math.max(t,t+r/2-No/2),width:No,height:Math.min(No,r)}}function vd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,l=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:l,height:o}),r+=26;return n}function eo(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function bd(e,t,n,r,i,o,l,a){const s=l.cellHorizontalPadding,u=l.headerIconSize,c=Km(n,r,i,o);let d=n+s;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const p={x:d,y:r,width:i-d,height:o};let m;if(t.indicatorIcon!==void 0){const v=e===void 0?nd(t.title,l.headerFontFull)?.width??0:Er(t.title,e,l.headerFontFull).width;p.width=v,d+=v+s,m={x:d,y:r+(o-u)/2,width:u,height:u}}const y=n+i/2;return{menuBounds:eo(c,y,a),iconBounds:eo(g,y,a),iconOverlayBounds:eo(h,y,a),textBounds:eo(p,y,a),indicatorIconBounds:eo(m,y,a)}}function mu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const b=o.rowMarkerChecked;b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const x=o.headerRowMarkerTheme!==void 0?dr(a,o.headerRowMarkerTheme):a;jl(e,x,b,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const y=l?a.textHeaderSelected:a.textHeader,v=o.hasMenu===!0&&(s||h&&l)&&m.menuBounds!==void 0;if(o.icon!==void 0&&m.iconBounds!==void 0){let b=l?"selected":"normal";o.style==="highlight"&&(b=l?"selected":"special"),g.drawSprite(o.icon,b,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),o.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,l?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(v&&r>35){const x=p?35:r-35,T=p?35*.7:r-35*.7,k=x/r,R=T/r,P=e.createLinearGradient(t,0,t+r,0),I=Ur(y,0);P.addColorStop(p?1:0,y),P.addColorStop(k,y),P.addColorStop(R,I),P.addColorStop(p?0:1,I),e.fillStyle=P}else e.fillStyle=y;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(o.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+i/2+qn(e,a.headerFontFull)),p&&(e.textAlign="left"),o.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!v||!ho(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let b=l?"selected":"normal";o.style==="highlight"&&(b=l?"selected":"special"),g.drawSprite(o.indicatorIcon,b,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(v&&m.menuBounds!==void 0){const b=m.menuBounds,x=u!==void 0&&c!==void 0&&Wr(b,u+t,c+n);if(x||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===aa.Triangle){e.beginPath();const T=b.x+b.width/2-5.5,k=b.y+b.height/2-3;am(e,[{x:T,y:k},{x:T+11,y:k},{x:T+5.5,y:k+6}],1),e.fillStyle=y,e.fill()}else if(o.menuIcon===aa.Dots){e.beginPath();const T=b.x+b.width/2,k=b.y+b.height/2;om(e,T,k),e.fillStyle=y,e.fill()}else{const T=b.x+(b.width-a.headerIconSize)/2,k=b.y+(b.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,T,k,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function wd(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){const y=$l(o.title)==="rtl",v=bd(e,o,t,n,r,i,a,y);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:l,hoverAmount:g,isHovered:s,hasSelectedCell:d,spriteManager:h,menuBounds:v?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>mu(e,t,n,r,i,o,l,a,s,u,c,g,h,m,y,v)):mu(e,t,n,r,i,o,l,a,s,u,c,g,h,m,y,v)}function Zm(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const x=fd(y);Tr(t,s,l,a,o,(T,k,R,P,I)=>{if(T!==t[t.length-1])return;k+=T.width;const C=Math.max(k,P);C>r||(e.save(),e.beginPath(),e.rect(C,o+1,1e4,i-o-1),e.clip(),xa(I,R,i,u,c,p,m,x,
165(F,D,S,E)=>{if(!E&&y.length>0&&!y.some(j=>ho(k,F,1e4,S,j.x,j.y,j.width,j.height)))return;const O=g.hasIndex(D),M=h.hasIndex(D);e.beginPath();const V=d?.(D),W=V===void 0?b:dr(b,V);W.bgCell!==b.bgCell&&(e.fillStyle=W.bgCell,e.fillRect(k,F,1e4,S)),M&&(e.fillStyle=W.bgHeader,e.fillRect(k,F,1e4,S)),O&&(e.fillStyle=W.accentLight,e.fillRect(k,F,1e4,S))}),e.restore())})}function Jm(e,t,n,r,i,o,l,a,s){let u=!1;for(const p of t)if(!p.sticky){u=l(p.sourceIndex);break}const c=s.horizontalBorderColor??s.borderColor,d=s.borderColor,g=u?Oi(t):0;let h;if(g!==0&&(h=du(d,s.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const p=d===c&&h!==void 0?h:du(c,s.bgCell),m=jr(o,i,a);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const yd=(e,t,n)=>{let r=0,i=t,o=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),l=Math.max(l,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:l}};function Qm(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p){const m=p.bgCell,{minX:y,maxX:v,minY:b,maxY:x}=yd(a,o,l),T=[],k=l-jr(h,g,u);let R=s,P=n,I=0;for(;R+i<k;){const S=R+i,E=u(P);if(S>=b&&S<=x-1){const M=c?.(P)?.bgCell;M!==void 0&&M!==m&&P>=h-g&&T.push({x:y,y:S,w:v-y,h:E,color:M})}R+=E,P<h-g&&(I=R),P++}let C=0;const F=Math.min(k,x)-I;if(F>0)for(let S=0;S<t.length;S++){const E=t[S];if(E.width===0)continue;const O=E.sticky?C:C+r,M=E.themeOverride?.bgCell;M!==void 0&&M!==m&&O>=y&&O<=v&&d(S+1)&&T.push({x:O,y:I,w:E.width,h:F,color:M}),C+=E.width}if(T.length===0)return;let D;e.beginPath();for(let S=T.length-1;S>=0;S--){const E=T[S];D===void 0?D=E.color:E.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=E.color),e.rect(E.x,E.y,E.w,E.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function vu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,l);for(const S of s)e.rect(S.x+1,S.y+1,S.width-1,S.height-1);e.clip("evenodd")}const b=y.horizontalBorderColor??y.borderColor,x=y.borderColor,{minX:T,maxX:k,minY:R,maxY:P}=yd(a,o,l),I=[];e.beginPath();let C=.5;for(let S=0;S<t.length;S++){const E=t[S];if(E.width===0)continue;C+=E.width;const O=E.sticky?C:C+r;O>=T&&O<=k&&h(S+1)&&I.push({x1:O,y1:Math.max(u,R),x2:O,y2:Math.min(l,P),color:x})}let F=l+.5;for(let S=m-p;S<m;S++){const E=d(S);F-=E,I.push({x1:T,y1:F,x2:k,y2:F,color:b})}if(v!==!0){let S=c+.5,E=n;const O=F;for(;S+i<O;){const M=S+i;if(M>=R&&M<=P-1){const V=g?.(E);I.push({x1:T,y1:M,x2:k,y2:M,color:V?.horizontalBorderColor??V?.borderColor??b})}S+=d(E),E++}}const D=Sh(I,S=>S.color);for(const S of Object.keys(D)){e.strokeStyle=S;for(const E of D[S])e.moveTo(E.x1,E.y1),e.lineTo(E.x2,E.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function e0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y,v,b){const x=[];e.imageSmoothingEnabled=!1;const T=Math.min(i.cellYOffset,l),k=Math.max(i.cellYOffset,l);let R=0;if(typeof v=="number")R+=(k-T)*v;else for(let O=T;O<k;O++)R+=v(O);l>i.cellYOffset&&(R=-R),R+=s-i.translateY;const P=Math.min(i.cellXOffset,o),I=Math.max(i.cellXOffset,o);let C=0;for(let O=P;O<I;O++)C+=m[O].width;o>i.cellXOffset&&(C=-C),C+=a-i.translateX;const F=Oi(y);if(C!==0&&R!==0)return{regions:[]};const D=u>0?jr(g,u,v):0,S=c-F-Math.abs(C),E=d-h-D-Math.abs(R)-1;if(S>150&&E>150){const O={sx:0,sy:0,sw:c*p,sh:d*p,dx:0,dy:0,dw:c*p,dh:d*p};if(R>0?(O.sy=(h+1)*p,O.sh=E*p,O.dy=(R+h+1)*p,O.dh=E*p,x.push({x:0,y:h,width:c,height:R+1})):R<0&&(O.sy=(-R+h+1)*p,O.sh=E*p,O.dy=(h+1)*p,O.dh=E*p,x.push({x:0,y:d+R-D,width:c,height:-R+D})),C>0?(O.sx=F*p,O.sw=S*p,O.dx=(C+F)*p,O.dw=S*p,x.push({x:F-1,y:0,width:C+2,height:d})):C<0&&(O.sx=(F-C)*p,O.sw=S*p,O.dx=F*p,O.dw=S*p,x.push({x:c+C,y:0,width:-C,height:d})),e.setTransform(1,0,0,1,0,0),b){if(F>0&&C!==0&&R===0&&(r===void 0||n?.[1]!==!1)){const M=F*p,V=d*p;e.drawImage(t,0,0,M,V,0,0,M,V)}if(D>0&&C===0&&R!==0&&(r===void 0||n?.[0]!==!1)){const M=(d-D)*p,V=c*p,W=D*p;e.drawImage(t,0,M,V,W,0,M,V,W)}}e.drawImage(t,O.sx,O.sy,O.sw,O.sh,O.dx,O.dy,O.dw,O.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:x}}function t0(e,t,n,r,i,o,l,a,s,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Tr(s,n,r,i,a,(d,g,h,p)=>{if(d.sourceIndex===u){const m=Math.max(g,p)+1;return c.push({x:m,y:0,width:o-m,height:l}),!0}}),c}function n0(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(Di(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:l,...a}=i,{width:s,...u}=o;if(!Di(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function bu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){const y=p?.filter(P=>P.style!=="no-outline");if(y===void 0||y.length===0)return;const v=Oi(a),b=jr(h,g,d),x=[s,0,a.length,h-g],T=[v,0,t,n-b],k=y.map(P=>{const I=P.range,C=P.style??"dashed";return Gm(I,x,t,n,T).map(F=>{const D=F.rect,S=kl(D.x,D.y,t,n,c,u+c,r,i,o,l,h,s,g,a,d),E=D.width===1&&D.height===1?S:kl(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,l,h,s,g,a,d);return D.x+D.width>=a.length&&(E.width-=1),D.y+D.height>
165=h&&(E.height-=1),{color:P.color,style:C,clip:F.clip,rect:Um({x:S.x,y:S.y,width:E.x+E.width-S.x,height:E.y+E.height-S.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let P=!1;for(const I of k)for(const C of I)if(C?.rect!==void 0&&ho(0,0,t,n,C.rect.x,C.rect.y,C.rect.width,C.rect.height)){const F=P,D=!Wm(C.clip,C.rect);e.beginPath(),D&&(e.save(),e.rect(C.clip.x,C.clip.y,C.clip.width,C.clip.height),e.clip()),C.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(C.style==="solid"||C.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=C.style==="solid-outline"?Pn(Pn(C.color,m.borderColor),m.bgCell):Ur(C.color,1),e.closePath(),e.strokeRect(C.rect.x+.5,C.rect.y+.5,C.rect.width-1,C.rect.height-1),D&&(e.restore(),P=F)}P&&e.setLineDash([])};return R(),R}function wu(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function nl(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,y){if(c.current===void 0)return;const v=m!==!1&&m!==void 0;if(!v)return;const b=typeof m=="object"?{...la,...m}:la,x=c.current.range,T=c.current.cell,k=[x.x+x.width-1,x.y+x.height-1];if(T[1]>=y&&k[1]>=y||!l.some(V=>V.sourceIndex===T[0]||V.sourceIndex===k[0]))return;const[P,I]=c.current.cell,C=g(c.current.cell),F=C.span??[P,P],D=I>=y-h,S=h>0&&!D?jr(y,h,d)-1:0,E=k[1];let O;if(Tr(l,r,i,o,u,(V,W,j,oe,Q)=>{if(V.sticky&&P>V.sourceIndex)return;const re=V.sourceIndex<F[0],se=V.sourceIndex>F[1],ae=V.sourceIndex===k[0];if(!(!ae&&(re||se)))return xa(Q,j,n,y,d,h,p,void 0,(de,fe,ue)=>{if(fe!==I&&fe!==E)return;let H=W,L=V.width;if(C.span!==void 0){const te=gd(C.span,W,de,V.width,ue,V,a),le=V.sticky?te[0]:te[1];le!==void 0&&(H=le.x,L=le.width)}return fe===E&&ae&&v&&(O=()=>{oe>H&&!V.sticky&&(e.beginPath(),e.rect(oe,0,t-oe,n),e.clip());const te=b.size,le=te/2,Se=H+L+b.offsetX-le+.5,pe=de+ue+b.offsetY-le+.5;e.beginPath(),b.shape==="circle"?e.arc(Se+le,pe+le,le,0,Math.PI*2):e.rect(Se,pe,te,te),e.fillStyle=V.themeOverride?.accentColor??s.accentColor,e.fill(),b.outline>0&&(e.lineWidth=b.outline,e.strokeStyle=s.bgCell,b.shape==="circle"?(e.beginPath(),e.arc(Se+le,pe+le,le+b.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(Se-b.outline/2,pe-b.outline/2,te+b.outline,te+b.outline))}),O!==void 0}),O!==void 0}),O===void 0)return;const M=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-S),e.clip(),O?.(),e.restore()};return M(),M}function r0(e,t,n,r,i,o,l,a,s){s===void 0||s.size===0||(e.beginPath(),hd(t,n,o,r,(u,c,d,g,h,p)=>{s.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,p)}),Tr(t,a,o,l,i,(u,c,d,g)=>{const h=Math.max(0,g-c),p=c+h+1,m=u.width-h-1;s.has([u.sourceIndex,-1])&&e.rect(p,r,m,i-r)}),e.clip())}function i0(e,t,n,r,i,o,l,a,s,u){let c=0;return Tr(e,o,r,i,n,(d,g,h,p,m)=>(xa(m,h,t,l,a,s,u,void 0,(y,v,b,x)=>{x||(c=Math.max(v,c))}),!0)),c}function yu(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:p,drawFocus:m,headerHeight:y,groupHeaderHeight:v,disabledRows:b,rowHeight:x,verticalBorder:T,overrideCursor:k,isResizing:R,selection:P,fillHandle:I,freezeTrailingRows:C,rows:F,getCellContent:D,getGroupDetails:S,getRowThemeOverride:E,isFocused:O,drawHeaderCallback:M,prelightCells:V,drawCellCallback:W,highlightRegions:j,resizeCol:oe,imageLoader:Q,lastBlitData:re,hoverValues:se,hyperWrapping:ae,hoverInfo:de,spriteManager:fe,maxScaleFactor:ue,hasAppendRow:H,touchMode:L,enqueue:Y,renderStateProvider:te,getCellRenderer:le,renderStrategy:Se,bufferACtx:pe,bufferBCtx:et,damage:ke,minimumCellWidth:Dt,resizeIndicator:dt}=e;if(i===0||o===0)return;const Ne=Se==="double-buffer",ne=Math.min(ue,Math.ceil(window.devicePixelRatio??1)),ve=Se!=="direct"&&n0(e,t),me=n.canvas;(me.width!==i*ne||me.height!==o*ne)&&(me.width=i*ne,me.height=o*ne,me.style.width=i+"px",me.style.height=o+"px");const he=r.canvas,Ce=d?v+y:y,Ae=Ce+1;(he.width!==i*ne||he.height!==Ae*ne)&&(he.width=i*ne,he.height=Ae*ne,he.style.width=i+"px",he.style.height=Ae+"px");const Oe=pe.canvas,at=et.canvas;Ne&&(Oe.width!==i*ne||Oe.height!==o*ne)&&(Oe.width=i*ne,Oe.height=o*ne,re.current!==void 0&&(re.current.aBufferScroll=void 0)),Ne&&(at.width!==i*ne||at.height!==o*ne)&&(at.width=i*ne,at.height=o*ne,re.current!==void 0&&(re.current.bBufferScroll=void 0));const Pe=re.current;if(ve===!0&&l===Pe?.cellXOffset&&a===Pe?.cellYOffset&&s===Pe?.translateX&&u===Pe?.translateY)return;let we=null;Ne&&(we=n);const He=r;let Re;Ne?ke!==void 0?Re=Pe?.lastBuffer==="b"?et:pe:Re=Pe?.lastBuffer==="b"?pe:et:Re=n;
165const Be=Re.canvas,ft=Ne?Be===Oe?at:Oe:me,ht=typeof x=="number"?()=>x:x;He.save(),Re.save(),He.beginPath(),Re.beginPath(),He.textBaseline="middle",Re.textBaseline="middle",ne!==1&&(He.scale(ne,ne),Re.scale(ne,ne));const Ye=xl(c,l,i,h,s);let pt=[];const Nt=m&&P.current?.cell[1]===a&&u===0;let St=!1;if(j!==void 0){for(const wt of j)if(wt.style!=="no-outline"&&wt.range.y===a&&u===0){St=!0;break}}const Tt=()=>{jm(He,Ye,d,de,i,s,y,v,h,R,P,p,fe,se,T,S,ke,M,L),vu(He,Ye,a,s,u,i,o,void 0,void 0,v,Ce,ht,E,T,C,F,p,!0),He.beginPath(),He.moveTo(0,Ae-.5),He.lineTo(i,Ae-.5),He.strokeStyle=Pn(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),He.stroke(),St&&bu(He,i,o,l,a,s,u,c,g,y,v,x,C,F,j,p),Nt&&nl(He,i,o,a,s,u,Ye,c,p,Ce,P,ht,D,C,H,I,F)};if(ke!==void 0){const wt=Ye[Ye.length-1].sourceIndex+1,ln=ke.hasItemInRegion([{x:l,y:-2,width:wt,height:2},{x:l,y:a,width:wt,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:l,y:F-C,width:wt,height:C,when:C>0}]),Mn=De=>{pu(De,Ye,c,o,Ce,s,u,a,F,ht,D,S,E,b,O,m,C,H,pt,ke,P,V,j,Q,fe,se,de,W,ae,p,Y,te,le,k,Dt);const mt=P.current;I!==!1&&I!==void 0&&m&&mt!==void 0&&ke.has(Qc(mt.range))&&nl(De,i,o,a,s,u,Ye,c,p,Ce,P,ht,D,C,H,I,F)};ln&&(Mn(Re),we!==null&&(we.save(),we.scale(ne,ne),we.textBaseline="middle",Mn(we),we.restore()),ke.hasHeader()&&(r0(He,Ye,i,v,Ce,s,u,a,ke),Tt())),Re.restore(),He.restore();return}if((ve!==!0||l!==Pe?.cellXOffset||s!==Pe?.translateX||Nt!==Pe?.mustDrawFocusOnHeader||St!==Pe?.mustDrawHighlightRingsOnHeader)&&Tt(),ve===!0){On(ft!==void 0&&Pe!==void 0);const{regions:wt}=e0(Re,ft,ft===Oe?Pe.aBufferScroll:Pe.bBufferScroll,ft===Oe?Pe.bBufferScroll:Pe.aBufferScroll,Pe,l,a,s,u,C,i,o,F,Ce,ne,c,Ye,x,Ne);pt=wt}else ve!==!1&&(On(Pe!==void 0),pt=t0(Pe,l,a,s,u,i,o,Ce,Ye,ve));Jm(Re,Ye,i,o,C,F,T,ht,p);const Bt=bu(Re,i,o,l,a,s,u,c,g,y,v,x,C,F,j,p),qt=m?nl(Re,i,o,a,s,u,Ye,c,p,Ce,P,ht,D,C,H,I,F):void 0;if(Re.fillStyle=p.bgCell,pt.length>0){Re.beginPath();for(const wt of pt)Re.rect(wt.x,wt.y,wt.width,wt.height);Re.clip(),Re.fill(),Re.beginPath()}else Re.fillRect(0,0,i,o);const an=pu(Re,Ye,c,o,Ce,s,u,a,F,ht,D,S,E,b,O,m,C,H,pt,ke,P,V,j,Q,fe,se,de,W,ae,p,Y,te,le,k,Dt);Zm(Re,Ye,c,i,o,Ce,s,u,a,F,ht,E,P.rows,b,C,H,pt,ke,p),Qm(Re,Ye,a,s,u,i,o,pt,Ce,ht,E,T,C,F,p),vu(Re,Ye,a,s,u,i,o,pt,an,v,Ce,ht,E,T,C,F,p),Bt?.(),qt?.(),R&&dt!=="none"&&Tr(Ye,0,s,0,Ce,(wt,ln)=>wt.sourceIndex===oe?(wu(He,ln+wt.width,0,Ce+1,Pn(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),dt==="full"&&wu(Re,ln+wt.width,Ce,o,Pn(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),we!==null&&(we.fillStyle=p.bgCell,we.fillRect(0,0,i,o),we.drawImage(Re.canvas,0,0));const It=i0(Ye,o,Ce,s,u,a,F,ht,C,H);Q?.setWindow({x:l,y:a,width:Ye.length,height:It-a},g,Array.from({length:C},(wt,ln)=>F-1-ln));const gt=Pe!==void 0&&(l!==Pe.cellXOffset||s!==Pe.translateX),Wt=Pe!==void 0&&(a!==Pe.cellYOffset||u!==Pe.translateY);re.current={cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mustDrawFocusOnHeader:Nt,mustDrawHighlightRingsOnHeader:St,lastBuffer:Ne?Be===Oe?"a":"b":void 0,aBufferScroll:Be===Oe?[gt,Wt]:Pe?.aBufferScroll,bBufferScroll:Be===at?[gt,Wt]:Pe?.bBufferScroll},Re.restore(),He.restore()}const o0=80;function a0(e){const t=e-1;return t*t*t+1}class l0{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(r=>ao(r.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>ao(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),n?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)};shouldStep=()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n};getAnimatingItems=()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:a0(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/o0;for(const o of this.leavingItems)o.hoverAmount=zn(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=zn(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>
165{if(!ao(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class s0{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ql(e){return new s0(e)}const u0=ql(()=>window.navigator.userAgent.includes("Firefox")),ua=ql(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ca=ql(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function c0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(l),l=()=>{const a=t.current.map(Yl);t.current=[],r.current(new so(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:l)},[]);return f.useCallback(o=>{t.current.length===0&&i();const l=Yn(o[0],o[1]);t.current.includes(l)||t.current.push(l)},[i])}const xr="header",Xn="group-header",da="out-of-bounds";var Ii;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Ii||(Ii={}));function Cd(e,t){return e===t?!0:e?.kind==="out-of-bounds"?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}const d0=(e,t)=>e.kind===Z.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",f0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:l,cellYOffset:a,headerHeight:s,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:y,enableGroups:v,isFilling:b,onCanvasFocused:x,onCanvasBlur:T,isFocused:k,selection:R,freezeColumns:P,onContextMenu:I,freezeTrailingRows:C,fixedShadowX:F=!0,fixedShadowY:D=!0,drawFocusRing:S,onMouseDown:E,onMouseUp:O,onMouseMoveRaw:M,onMouseMove:V,onItemHovered:W,dragAndDropState:j,firstColAccessible:oe,onKeyDown:Q,onKeyUp:re,highlightRegions:se,canvasRef:ae,onDragStart:de,onDragEnd:fe,eventTargetRef:ue,isResizing:H,resizeColumn:L,isDragging:Y,isDraggable:te=!1,allowResize:le,disabledRows:Se,hasAppendRow:pe,getGroupDetails:et,theme:ke,prelightCells:Dt,headerIcons:dt,verticalBorder:Ne,drawCell:ne,drawHeader:ve,onCellFocused:me,onDragOverCell:he,onDrop:Ce,onDragLeave:Ae,imageWindowLoader:Oe,smoothScrollX:at=!1,smoothScrollY:Pe=!1,experimental:we,getCellRenderer:He,resizeIndicator:Re="full"}=e,Be=e.translateX??0,ft=e.translateY??0,ht=Math.max(P,Math.min(o.length-1,l)),Ye=f.useRef(null),pt=f.useRef(we?.eventTarget??window),Nt=pt.current,St=Oe,Tt=f.useRef(),[Bt,qt]=f.useState(!1),an=f.useRef([]),It=f.useRef(),[gt,Wt]=f.useState(),[wt,ln]=f.useState(),Mn=f.useRef(null),[De,mt]=f.useState(),[xt,bn]=f.useState(!1),tn=f.useRef(xt);tn.current=xt;const nn=f.useMemo(()=>new Nm(dt,()=>{rn.current=void 0,Cn.current()}),[dt]),cn=v?c+s:s,$t=f.useRef(-1),Zt=(we?.enableFirefoxRescaling??!1)&&u0.value,Ge=(we?.enableSafariRescaling??!1)&&ua.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Zt&&!Ge||($t.current!==-1&&qt(!0),window.clearTimeout($t.current),$t.current=window.setTimeout(()=>{qt(!1),$t.current=-1},200))},[a,ht,Be,ft,Zt,Ge]);const kt=Yp(o,P),Rn=f.useMemo(()=>F?Oi(kt,j):0,[kt,j,F]),Ot=f.useCallback(($,ee,xe)=>{const Te=$.getBoundingClientRect();if(ee>=kt.length||xe>=g)return;const ce=Te.width/n,ge=kl(ee,xe,n,r,c,cn,ht,a,Be,ft,g,P,C,kt,d);return ce!==1&&(ge.x*=ce,ge.y*=ce,ge.width*=ce,ge.height*=ce),ge.x+=Te.x,ge.y+=Te.y,ge},[n,r,c,cn,ht,a,Be,ft,g,P,C,kt,d]),bt=f.useCallback(($,ee,xe,Te)=>{const ce=$.getBoundingClientRect(),ge=ce.width/n,Xe=(ee-ce.left)/ge,Me=(xe-ce.top)/ge,Ze=5,vt=xl(kt,ht,n,void 0,Be);let un=0,Ut=0;const Mt=typeof PointerEvent<"u"&&Te instanceof PointerEvent&&Te.pointerType==="mouse"||typeof MouseEvent<"u"&&Te instanceof MouseEvent,lt=typeof PointerEvent<"u"&&Te instanceof PointerEvent&&Te.pointerType==="touch"||typeof TouchEvent<"u"&&Te instanceof TouchEvent;Mt&&(un=Te.button,Ut=Te.buttons);const qe=Zp(Xe,vt,Be),st=Jp(Me,r,v,s,c,g,d,a,ft,C),At=Te?.shiftKey===!0,si=Te?.ctrlKey===!0,Lr=Te?.metaKey===!0,Jt=[Xe<0?-1:n<Xe?1:0,Me<cn?-1:r<Me?1:0];let on;if(qe===-1||Me<0||Xe<0||st===void 0||Xe>n||Me>r){const Lt=Xe>n?1:Xe<0?-1:0,An=Me>r?1:Me<0?-1:0;let hn=Lt*2,ui=An*2;Lt===0&&(hn=qe===-1?Ii.EndPadding:Ii.Center),An===0&&(ui=st===void 0?Ii.EndPadding:Ii.Center);let sr=!1;if(qe===-1&&st===-1){const Qt=Ot($,kt.length-1,-1);On(Qt!==void 0),sr=ee<Qt.x+Qt.width+Ze}const tt=Xe>n&&Xe<n+wl()||Me>r&&Me<r+wl();on={kind:da,location:[qe!==-1?qe:Xe<0?0:kt.length-1,st??g-1],region:[hn,ui],shift
165Key:At,ctrlKey:si,metaKey:Lr,isEdge:sr,isTouch:lt,button:un,buttons:Ut,scrollEdge:Jt,isMaybeScrollbar:tt}}else if(st<=-1){let Lt=Ot($,qe,st);On(Lt!==void 0);let An=Lt!==void 0&&Lt.x+Lt.width-ee<=Ze;const hn=qe-1;ee-Lt.x<=Ze&&hn>=0?(An=!0,Lt=Ot($,hn,st),On(Lt!==void 0),on={kind:v&&st===-2?Xn:xr,location:[hn,st],bounds:Lt,group:kt[hn].group??"",isEdge:An,shiftKey:At,ctrlKey:si,metaKey:Lr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:un,buttons:Ut,scrollEdge:Jt}):on={kind:v&&st===-2?Xn:xr,group:kt[qe].group??"",location:[qe,st],bounds:Lt,isEdge:An,shiftKey:At,ctrlKey:si,metaKey:Lr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:un,buttons:Ut,scrollEdge:Jt}}else{const Lt=Ot($,qe,st);On(Lt!==void 0);const An=Lt!==void 0&&Lt.x+Lt.width-ee<Ze;let hn=!1;if(u!==!1&&u!==void 0&&R.current!==void 0){const sr=typeof u=="object"?{...la,...u}:la,tt=sr.size,Qt=tt/2,Fr=Qc(R.current.range),mr=Ot($,Fr[0],Fr[1]);if(mr!==void 0){const ur=mr.x+mr.width+sr.offsetX-Qt+.5,Ht=mr.y+mr.height+sr.offsetY-Qt+.5;hn=Math.abs(ur-ee)<tt&&Math.abs(Ht-xe)<tt}}on={kind:"cell",location:[qe,st],bounds:Lt,isEdge:An,shiftKey:At,ctrlKey:si,isFillHandle:hn,metaKey:Lr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:un,buttons:Ut,scrollEdge:Jt}}return on},[n,kt,ht,Be,r,v,s,c,g,d,a,ft,C,Ot,u,R,cn]),[wn]=gt??[],or=f.useRef(()=>{}),Kn=f.useRef(gt);Kn.current=gt;const[B,We]=f.useMemo(()=>{const $=document.createElement("canvas"),ee=document.createElement("canvas");return $.style.display="none",$.style.opacity="0",$.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[$.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!(B===null||We===null))return document.documentElement.append(B.canvas),document.documentElement.append(We.canvas),()=>{B.canvas.remove(),We.canvas.remove()}},[B,We]);const je=f.useMemo(()=>new lm,[]),Pt=Zt&&Bt?1:Ge&&Bt?2:5,Kt=we?.disableMinimumCellWidth===!0?1:10,rn=f.useRef(),In=f.useRef(null),yn=f.useRef(null),Gt=f.useCallback(()=>{const $=Ye.current,ee=Mn.current;if($===null||ee===null||(In.current===null&&(In.current=$.getContext("2d",{alpha:!1}),$.width=0,$.height=0),yn.current===null&&(yn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),In.current===null||yn.current===null||B===null||We===null))return;let xe=!1;const Te=Xe=>{xe=!0,mt(Xe)},ce=rn.current,ge={headerCanvasCtx:yn.current,canvasCtx:In.current,bufferACtx:B,bufferBCtx:We,width:n,height:r,cellXOffset:ht,cellYOffset:a,translateX:Math.round(Be),translateY:Math.round(ft),mappedColumns:kt,enableGroups:v,freezeColumns:P,dragAndDropState:j,theme:ke,headerHeight:s,groupHeaderHeight:c,disabledRows:Se??Qe.empty(),rowHeight:d,verticalBorder:Ne,isResizing:H,resizeCol:L,isFocused:k,selection:R,fillHandle:u,drawCellCallback:ne,hasAppendRow:pe,overrideCursor:Te,maxScaleFactor:Pt,freezeTrailingRows:C,rows:g,drawFocus:S,getCellContent:h,getGroupDetails:et??(Xe=>({name:Xe})),getRowThemeOverride:p,drawHeaderCallback:ve,prelightCells:Dt,highlightRegions:se,imageLoader:St,lastBlitData:It,damage:Tt.current,hoverValues:an.current,hoverInfo:Kn.current,spriteManager:nn,scrolling:Bt,hyperWrapping:we?.hyperWrapping??!1,touchMode:xt,enqueue:or.current,renderStateProvider:je,renderStrategy:we?.renderStrategy??(ua.value?"double-buffer":"single-buffer"),getCellRenderer:He,minimumCellWidth:Kt,resizeIndicator:Re};ge.damage===void 0?(rn.current=ge,yu(ge,ce)):yu(ge,void 0),!xe&&(ge.damage===void 0||ge.damage.has(Kn?.current?.[0]))&&mt(void 0)},[B,We,n,r,ht,a,Be,ft,kt,v,P,j,ke,s,c,Se,d,Ne,H,pe,L,k,R,u,C,g,S,Pt,h,et,p,ne,ve,Dt,se,St,nn,Bt,we?.hyperWrapping,we?.renderStrategy,xt,je,He,Kt,Re]),Cn=f.useRef(Gt);f.useLayoutEffect(()=>{Gt(),Cn.current=Gt},[Gt]),f.useLayoutEffect(()=>{(async()=>document?.fonts?.ready!==void 0&&(await document.fonts.ready,rn.current=void 0,Cn.current()))()},[]);const Sn=f.useCallback($=>{Tt.current=$,Cn.current(),Tt.current=void 0},[]),qr=c0(Sn);or.current=qr;const Kr=f.useCallback($=>{Sn(new so($.map(ee=>ee.cell)))},[Sn]);St.setCallback(Sn);const[Zr,Li]=f.useState(!1),[Fn,Zn]=wn??[],Jr=Fn!==void 0&&Zn===-1&&Fn>=0&&Fn<kt.length&&kt[Fn].headerRowMarkerDisabled!==!0,Qr=Fn!==void 0&&Zn===-2;let $n=!1,ei=!1,Nn=De;if(Nn===void 0&&Fn!==void 0&&Zn!==void 0&&Zn>-1&&Zn<g){const $=h([Fn,Zn],!0);$n=$.kind===Vn.NewRow||$.kind===Vn.Marker&&$.markerKind!=="number",ei=$.kind===Z.Boolean&&Hl($),Nn=$.cursor}const fn=Y?"grabbing":(wt??!1)||H?"col-resize":Zr||b?"crosshair":Nn!==void 0?Nn:Jr||$n||ei||Qr?"pointer":"default",Jn=f.useMemo(()=>({contain:"strict",display:"block",cursor:fn}),[fn]),_n=f.useRef("default"),sn=ue?.current;sn!=null&&_n.current!==Jn.cursor&&(sn.style.cursor=_n.current=Jn.cursor);const ti=f.useCallback(($,ee,xe,Te)=>{if(et===void 0)return;const ce=et($);if(ce.actions!==void 0){const ge=vd(ee,ce.actions);for(const[Xe,Me]of ge.entries())if(Wr(Me,xe+ee.x,Te+Me.y))return ce.actions[Xe]}},[et]),ar=f.useCallback(($,ee,xe,Te)=>{const ce=kt[ee];if(!Y&&!H&&!(wt??!1)){const ge=Ot($,ee,-1);On(ge!==void 0);const Xe=bd(void 0,ce,ge.x,ge.y,ge.width,ge.height,ke,$l(ce.title)==="rtl");
165if(ce.hasMenu===!0&&Xe.menuBounds!==void 0&&Wr(Xe.menuBounds,xe,Te))return{area:"menu",bounds:Xe.menuBounds};if(ce.indicatorIcon!==void 0&&Xe.indicatorIconBounds!==void 0&&Wr(Xe.indicatorIconBounds,xe,Te))return{area:"indicator",bounds:Xe.indicatorIconBounds}}},[kt,Ot,wt,Y,H,ke]),ni=f.useRef(0),hr=f.useRef(),ri=f.useRef(!1),ii=f.useCallback($=>{const ee=Ye.current,xe=ue?.current;if(ee===null||$.target!==ee&&$.target!==xe)return;ri.current=!0;const Te=$.clientX,ce=$.clientY;if($.target===xe&&xe!==null){const Xe=xe.getBoundingClientRect();if(Te>Xe.right||ce>Xe.bottom)return}const ge=bt(ee,Te,ce,$);hr.current=ge.location,ge.isTouch&&(ni.current=Date.now()),tn.current!==ge.isTouch&&bn(ge.isTouch),!(ge.kind===xr&&ar(ee,ge.location[0],Te,ce)!==void 0)&&(ge.kind===Xn&&ti(ge.group,ge.bounds,ge.localEventX,ge.localEventY)!==void 0||(E?.(ge),!ge.isTouch&&te!==!0&&te!==ge.kind&&ge.button<3&&ge.button!==1&&$.preventDefault()))},[ue,te,bt,ti,ar,E]);kn("pointerdown",ii,Nt,!1);const Dr=f.useRef(0),gr=f.useCallback($=>{const ee=Dr.current;Dr.current=Date.now();const xe=Ye.current;if(ri.current=!1,O===void 0||xe===null)return;const Te=ue?.current,ce=$.target!==xe&&$.target!==Te,ge=$.clientX,Xe=$.clientY,Me=$.pointerType==="mouse"?$.button<3:!0;let Ze=bt(xe,ge,Xe,$);Ze.isTouch&&ni.current!==0&&Date.now()-ni.current>500&&(Ze={...Ze,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ze.isTouch?1e3:500)&&(Ze={...Ze,isDoubleClick:!0}),tn.current!==Ze.isTouch&&bn(Ze.isTouch),!ce&&$.cancelable&&Me&&$.preventDefault();const[vt]=Ze.location,un=ar(xe,vt,ge,Xe);if(Ze.kind===xr&&un!==void 0){(Ze.button!==0||hr.current?.[0]!==vt||hr.current?.[1]!==-1)&&O(Ze,!0);return}else if(Ze.kind===Xn){const Ut=ti(Ze.group,Ze.bounds,Ze.localEventX,Ze.localEventY);if(Ut!==void 0){Ze.button===0&&Ut.onClick(Ze);return}}O(Ze,ce)},[O,ue,bt,ar,ti]);kn("pointerup",gr,Nt,!1);const oi=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;const xe=ue?.current,Te=$.target!==ee&&$.target!==xe;let ce,ge,Xe=!0;$ instanceof MouseEvent?(ce=$.clientX,ge=$.clientY,Xe=$.button<3):(ce=$.changedTouches[0].clientX,ge=$.changedTouches[0].clientY);const Me=bt(ee,ce,ge,$);tn.current!==Me.isTouch&&bn(Me.isTouch),!Te&&$.cancelable&&Xe&&$.preventDefault();const[Ze]=Me.location;if(Me.kind===xr){const vt=ar(ee,Ze,ce,ge);vt!==void 0&&Me.button===0&&hr.current?.[0]===Ze&&hr.current?.[1]===-1&&(vt.area==="menu"?m?.(Ze,vt.bounds):vt.area==="indicator"&&y?.(Ze,vt.bounds))}},[ue,bt,ar,m,y]);kn("click",oi,Nt,!1);const Ia=f.useCallback($=>{const ee=Ye.current,xe=ue?.current;if(ee===null||$.target!==ee&&$.target!==xe||I===void 0)return;const Te=bt(ee,$.clientX,$.clientY,$);I(Te,()=>{$.cancelable&&$.preventDefault()})},[ue,bt,I]);kn("contextmenu",Ia,ue?.current??null,!1);const Fi=f.useCallback($=>{Tt.current=new so($.map(ee=>ee.item)),an.current=$,Cn.current(),Tt.current=void 0},[]),ze=f.useMemo(()=>new l0(Fi),[Fi]),_i=f.useRef(ze);_i.current=ze,f.useLayoutEffect(()=>{const $=_i.current;if(wn===void 0||wn[1]<0){$.setHovered(wn);return}const ee=h(wn,!0),xe=He(ee),Te=xe===void 0&&ee.kind===Z.Custom||xe?.needsHover!==void 0&&(typeof xe.needsHover=="boolean"?xe.needsHover:xe.needsHover(ee));$.setHovered(Te?wn:void 0)},[h,He,wn]);const yo=f.useRef(),Or=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;const xe=ue?.current,Te=$.target!==ee&&$.target!==xe,ce=bt(ee,$.clientX,$.clientY,$);if(ce.kind!=="out-of-bounds"&&Te&&!ri.current&&!ce.isTouch)return;const ge=(Me,Ze)=>{Wt(vt=>vt===Me||vt?.[0][0]===Me?.[0][0]&&vt?.[0][1]===Me?.[0][1]&&(vt?.[1][0]===Me?.[1][0]&&vt?.[1][1]===Me?.[1][1]||!Ze)?vt:Me)};if(!Cd(ce,yo.current))mt(void 0),W?.(ce),ge(ce.kind===da?void 0:[ce.location,[ce.localEventX,ce.localEventY]],!0),yo.current=ce;else if(ce.kind==="cell"||ce.kind===xr||ce.kind===Xn){let Me=!1,Ze=!0;if(ce.kind==="cell"){const un=h(ce.location);Ze=He(un)?.needsHoverPosition??un.kind===Z.Custom,Me=Ze}else Me=!0;const vt=[ce.location,[ce.localEventX,ce.localEventY]];ge(vt,Ze),Kn.current=vt,Me&&Sn(new so([ce.location]))}const Xe=ce.location[0]>=(oe?0:1);ln(ce.kind===xr&&ce.isEdge&&Xe&&le===!0),Li(ce.kind==="cell"&&ce.isFillHandle),M?.($),V(ce)},[ue,bt,oe,le,M,V,W,h,He,Sn]);kn("pointermove",Or,Nt,!0);const Ea=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;let xe,Te;R.current!==void 0&&(xe=Ot(ee,R.current.cell[0],R.current.cell[1]),Te=R.current.cell),Q?.({bounds:xe,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Te})},[Q,R,Ot]),Qn=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;let xe,Te;R.current!==void 0&&(xe=Ot(ee,R.current.cell[0],R.current.cell[1]),Te=R.current.cell),re?.({bounds:xe,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Te})},[re,R,Ot]),Ai=f.useCallback($=>{if(Ye.current=$,ae!==void 0&&(ae.current=$),we?.eventTarget)pt.current=we.eventTarget;else if($===null)pt.current=window;else{const ee=$.getRootNode();ee===document&&(pt.current=window),pt.current=ee}},[ae,we?.eventTarget]),Co=f.useCallback($=>{const ee=Ye.current;if(ee===null||te===!1||H){$.preventDefault();return}let xe,Te;const ce=bt(ee,$.clientX,$.clientY);if(te!==!0&&ce.kind!==te){$.preventDefault();return}const ge=(Ut,Mt)=>{xe=Ut,Te=Mt};let Xe,Me,Ze;const vt=(Ut,Mt,lt)=>{Xe=Ut,Me=Mt,Ze=lt};let un=!1;if(de?.({...ce,setData:ge,setDragImage:vt,preventDefault:()=>un=!0,defaultPrevented:()=>un}),!un&&xe!==void 0&&Te!==void 0&&$.dataTransfer!==null)if($.dataTransfer.setData(xe,Te),$.dataTransfer.effectAllowed="copyLink",Xe!==void 0&&Me!==void 0&&Ze!==void 0)$.dataTransfer.setDragImage(Xe,Me,Ze);else{const[Ut,Mt]=ce.location;if(Mt!==void 0){const lt=document.createElement("canvas"),qe=Ot(ee,Ut,Mt);On(qe!==void 0);const st=Math.ceil(window.devicePixelRatio??1);lt.width=qe.width*st,lt.height=qe.height*st;const At=lt.getContext("2d");At!==null&&(At.scale(st,st),At.textBaseline="middle",Mt===-1?(At.font=ke.headerFontFull,At.fillStyle=ke.bgHeader,At.fillRect(0,0,lt.width,lt.height),wd(At,0,0,qe.width,qe.height,kt[Ut],!1,ke,!1,void 0,void 0,!1,0,nn,ve,!1)):(At.font=ke.baseFontFull,At.fillStyle=ke.bgCell,At.fillRect(0,0,lt.width,lt.height),md(At,h([Ut,Mt]),0,Mt,!1,!1,0,0,qe.width,qe.height,!1,ke,ke.bgCell,St,nn,1,void 0,!1,0,void 0,void 0,void 0,je,He,()=>{}))),lt.style.left="-100%",lt.style.position="absolute",lt.style.width=`${qe.width}px`,lt.style.height=`${qe.height}px`,document.body.append(lt),$.dataTransfer.setDragImage(lt,qe.width/2,qe.height/2),window.setTimeout(()=>{lt.remove()},0)}}else $.preventDefault()},[te,H,bt,de,Ot,ke,kt,nn,ve,h,St,je,He]);kn("dragstart",Co,ue?.current??null,!1,!1);const ai=f.useRef(),Ta=f.useCallback($=>{const ee=Ye.current;if(Ce!==void 0&&$.preventDefault(),ee===null||he===void 0)return;const xe=bt(ee,$.clientX,$.clientY),[Te,ce]=xe.location,ge=Te-(oe?0:1),[Xe,Me]=ai.current??[];(Xe!==ge||Me!==ce)&&(ai.current=[ge,ce],he([ge,ce],$.dataTransfer))},[oe,bt,he,Ce]);kn("dragover",Ta,ue?.current??null,!1,!1);const Da=f.useCallback(()=>{ai.current=void 0,fe?.()},[fe]);kn("dragend",Da,ue?.current??null,!1,!1);const er=f.useCallback($=>{const ee=Ye.current;if(ee===null||Ce===void 0)return;$.preventDefault();const xe=bt(ee,$.clientX,$.clientY),[Te,ce]=xe.location,ge=Te-(oe?0:1);Ce([ge,ce],$.dataTransfer)},[oe,bt,Ce]);kn("drop",er,ue?.current??null,!1,!1);const pr=f.useCallback(()=>{Ae?.()},[Ae]);kn("dragleave",pr,ue?.current??null,!1,!1);const En=f.useRef(R);En.current=R;const G=f.useRef(null),_t=f.useCallback($=>{Ye.current===null||!Ye.current.contains(document.activeElement)||($===null&&En.current.current!==void 0?ae?.current?.focus({preventScroll:!0}):$!==null&&$.focus({preventScroll:!0}),G.current=$)},[ae]);f.useImperativeHandle(t,()=>({focus:()=>{const $=G.current;$===null||!document.contains($)?ae?.current?.focus({preventScroll:!0}):$.focus({preventScroll:!0})},getBounds:($,ee)=>{if(!(ae===void 0||ae.current===null))return Ot(ae.current,$??0,ee??-1)},damage:Kr,getMouseArgsForPosition:($,ee,xe)=>{if(!(ae===void 0||ae.current===null))return bt(ae.current,$,ee,xe)}}),[ae,Kr,Ot,bt]);const lr=f.useRef(),Oa=fp(()=>
165{if(n<50||we?.disableAccessibilityTree===!0)return null;let $=xl(kt,ht,n,j,Be);const ee=oe?0:-1;!oe&&$[0]?.sourceIndex===0&&($=$.slice(1));const[xe,Te]=R.current?.cell??[],ce=R.current?.range,ge=$.map(Me=>Me.sourceIndex),Xe=Mr(a,Math.min(g,a+i));return xe!==void 0&&Te!==void 0&&!(ge.includes(xe)&&Xe.includes(Te))&&_t(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":kt.length+ee},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},$.map(Me=>f.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(Me.sourceIndex),"aria-colindex":Me.sourceIndex+1+ee,tabIndex:-1,onFocus:Ze=>{if(Ze.target!==G.current)return me?.([Me.sourceIndex,-1])},key:Me.sourceIndex},Me.title)))),f.createElement("tbody",{role:"rowgroup"},Xe.map(Me=>f.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(Me),key:Me,"aria-rowindex":Me+2},$.map(Ze=>{const vt=Ze.sourceIndex,un=Yn(vt,Me),Ut=xe===vt&&Te===Me,Mt=ce!==void 0&&vt>=ce.x&&vt<ce.x+ce.width&&Me>=ce.y&&Me<ce.y+ce.height,lt=`glide-cell-${vt}-${Me}`,qe=[vt,Me],st=h(qe,!0);return f.createElement("td",{key:un,role:"gridcell","aria-colindex":vt+1+ee,"aria-selected":Mt,"aria-readonly":Mi(st)||!xi(st),id:lt,"data-testid":lt,onClick:()=>{const At=ae?.current;if(At!=null)return Q?.({bounds:Ot(At,vt,Me),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:qe})},onFocusCapture:At=>{if(!(At.target===G.current||lr.current?.[0]===vt&&lr.current?.[1]===Me))return lr.current=qe,me?.(qe)},ref:Ut?_t:void 0,tabIndex:-1},d0(st,He))})))))},[n,kt,ht,j,Be,g,a,i,R,_t,h,ae,Q,Ot,me],200),Pr=P===0||!F?0:ht>P?1:zn(-Be/100,0,1),Pa=-a*32+ft,li=D?zn(-Pa/100,0,1):0,vs=f.useMemo(()=>{if(!Pr&&!li)return null;const $={position:"absolute",top:0,left:Rn,width:n-Rn,height:r,opacity:Pr,pointerEvents:"none",transition:at?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:cn,left:0,width:n,height:r,opacity:li,pointerEvents:"none",transition:Pe?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Pr>0&&f.createElement("div",{id:"shadow-x",style:$}),li>0&&f.createElement("div",{id:"shadow-y",style:ee}))},[Pr,li,Rn,n,at,cn,r,Pe]),q=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Ea,onKeyUp:Qn,onFocus:x,onBlur:T,ref:Ai,style:Jn},Oa),f.createElement("canvas",{ref:Mn,style:q}),vs)},h0=f.memo(f.forwardRef(f0));function to(e,t,n,r){return zn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const g0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,l]=f.useState(),[a,s]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,p]=f.useState(),[m,y]=f.useState(),[v,b]=f.useState(!1),[x,T]=f.useState(),{onHeaderMenuClick:k,onHeaderIndicatorClick:R,getCellContent:P,onColumnMoved:I,onColumnResize:C,onColumnResizeStart:F,onColumnResizeEnd:D,gridRef:S,maxColumnWidth:E,minColumnWidth:O,onRowMoved:M,lockColumns:V,onColumnProposeMove:W,onMouseDown:j,onMouseUp:oe,onItemHovered:Q,onDragStart:re,canvasRef:se}=e,ae=(C??D??F)!==void 0,{columns:de,selection:fe}=e,ue=fe.columns,H=f.useCallback(ne=>{const[ve,me]=ne.location;o!==void 0&&a!==ve&&ve>=V?(c(!0),s(ve)):h!==void 0&&me!==void 0?(b(!0),y(Math.max(0,me))):r===void 0&&!u&&!v&&Q?.(ne)},[o,h,a,Q,V,r,u,v]),L=I!==void 0,Y=f.useCallback(ne=>{if(ne.button===0){const[ve,me]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&ae){const he=S?.current?.getBounds(de.length-1,-1);he!==void 0&&(n(he.x),i(de.length-1))}else if(ne.kind==="header"&&ve>=V){const he=se?.current;if(ne.isEdge&&ae&&he){n(ne.bounds.x),i(ve);const Ae=he.getBoundingClientRect().width/he.offsetWidth,Oe=ne.bounds.width/Ae;F?.(de[ve],Oe,ve,Oe+(de[ve].growOffset??0))}else ne.kind==="header"&&L&&(g(ne.bounds.x),l(ve))}else ne.kind==="cell"&&V>0&&ve===0&&me!==void 0&&M!==void 0&&(T(ne.bounds.y),p(me))}j?.(ne)},[j,ae,V,M,S,de,L,F,se]),te=f.useCallback((ne,ve)=>{u||v||k?.(ne,ve)},[u,v,k]),le=f.useCallback((ne,ve)=>{u||v||R?.(ne,ve)},[u,v,R]),Se=f.useRef(-1),pe=f.useCallback(()=>{Se.current=-1,p(void 0),y(void 0),T(void 0),b(!1),l(void 0),s(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),et=f.useCallback((ne,ve)=>{if(ne.button===0){if(r!==void 0){if(ue?.hasIndex(r)===!0)for(const he of ue){if(he===r)continue;const Ce=de[he],Ae=to(Ce,Se.current,O,E);C?.(Ce,Ae,he,Ae+(Ce.growOffset??0))}const me=to(de[r],Se.current,O,E);if(D?.(de[r],me,r,me+(de[r].growOffset??0)),ue.hasIndex(r))for(const he of ue){if(he===r)continue;const Ce=de[he],Ae=to(Ce,Se.current,O,E);D?.(Ce,Ae,he,Ae+(Ce.growOffset??0))}}pe(),o!==void 0&&a!==void 0&&W?.(o,a)!==!1&&I?.(o,a),h!==void 0&&m!==void 0&&M?.(h,m)}oe?.(ne,ve)},[oe,r,o,a,h,m,ue,D,de,O,E,C,I,M,pe,W]),ke=f.useMemo(()=>
165{if(!(o===void 0||a===void 0)&&o!==a&&W?.(o,a)!==!1)return{src:o,dest:a}},[o,a,W]),Dt=f.useCallback(ne=>{const ve=se?.current;if(o!==void 0&&d!==void 0)Math.abs(ne.clientX-d)>20&&c(!0);else if(h!==void 0&&x!==void 0)Math.abs(ne.clientY-x)>20&&b(!0);else if(r!==void 0&&t!==void 0&&ve){const he=ve.getBoundingClientRect().width/ve.offsetWidth,Ce=(ne.clientX-t)/he,Ae=de[r],Oe=to(Ae,Ce,O,E);if(C?.(Ae,Oe,r,Oe+(Ae.growOffset??0)),Se.current=Ce,ue?.first()===r)for(const at of ue){if(at===r)continue;const Pe=de[at],we=to(Pe,Se.current,O,E);C?.(Pe,we,at,we+(Pe.growOffset??0))}}},[o,d,h,x,r,t,de,O,E,C,ue,se]),dt=f.useCallback((ne,ve)=>{if(h===void 0||m===void 0)return P(ne,ve);let[me,he]=ne;return he===m?he=h:(he>m&&(he-=1),he>=h&&(he+=1)),P([me,he],ve)},[h,m,P]),Ne=f.useCallback(ne=>{re?.(ne),ne.defaultPrevented()||pe()},[pe,re]);return f.createElement(h0,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:dt,isResizing:r!==void 0,onHeaderMenuClick:te,onHeaderIndicatorClick:le,isDragging:u,onItemHovered:H,onDragStart:Ne,onMouseDown:Y,allowResize:ae,onMouseUp:et,dragAndDropState:ke,onMouseMoveRaw:Dt,ref:S})};function p0(e){const t=f.useRef(null),[n,r]=f.useState({width:e?.[0],height:e?.[1]});return f.useLayoutEffect(()=>{const i=l=>{for(const a of l){const{width:s,height:u}=a&&a.contentRect||{};r(c=>c.width===s&&c.height===u?c:{width:s,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const m0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),l=f.useRef(0),a=f.useRef(t);a.current=t;const s=n.current;f.useEffect(()=>{const u=()=>{if(i.current===!1&&s!==null){const g=[s.scrollLeft,s.scrollTop];if(o.current?.[0]===g[0]&&o.current?.[1]===g[1])if(l.current>10){o.current=null,i.current=null;return}else l.current++;else l.current=0,a.current(g[0],g[1]),o.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,l.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&s!==null){const g=s;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},v0=()=>e=>e.isSafari?"scroll":"auto",b0=dn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[v0()]}}),w0=33554400,y0=5e6;function C0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return kn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),kn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const S0=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:l,className:a,preventDiagonalScrolling:s=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:p,initialSize:m}=e,y=[],v=g?.sticky??!1,b=g?.fill??!1,x=f.useRef(0),T=f.useRef(0),k=f.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,P=f.useRef(R);f.useEffect(()=>{if(P.current!==R){x.current=0,T.current=0,P.current=R;const fe=k.current;fe!==null&&M.current(fe.scrollLeft,fe.scrollTop)}},[R]);const I=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),C=f.useRef(null),F=C0(200),[D,S]=f.useState(!0),E=f.useRef(0);f.useLayoutEffect(()=>{if(!D||F||I.current.lockDirection===void 0)return;const fe=k.current;if(fe===null)return;const[ue,H]=I.current.lockDirection;ue!==void 0?fe.scrollLeft=ue:H!==void 0&&(fe.scrollTop=H),I.current.lockDirection=void 0},[F,D]);const O=f.useCallback((fe,ue)=>{const H=k.current;if(H===null)return;ue=ue??H.scrollTop,fe=fe??H.scrollLeft;const L=I.current.scrollTop,Y=I.current.scrollLeft,te=fe-Y,le=ue-L;F&&te!==0&&le!==0&&(Math.abs(te)>3||Math.abs(le)>3)&&s&&I.current.lockDirection===void 0&&(I.current.lockDirection=Math.abs(te)<Math.abs(le)?[Y,void 0]:[void 0,L]);const Se=I.current.lockDirection;
165fe=Se?.[0]??fe,ue=Se?.[1]??ue,I.current.scrollLeft=fe,I.current.scrollTop=ue;const pe=H.clientWidth,et=H.clientHeight,ke=ue,Dt=T.current-ke,dt=H.scrollHeight-et;T.current=ke;let Ne;if(dt>0&&r>H.scrollHeight+5)if(Math.abs(Dt)>2e3||ke===0||ke===dt){const ne=Math.max(0,Math.min(1,ke/dt)),ve=r-et;Ne=ne*ve,x.current=Ne}else x.current-=Dt,Ne=x.current;else Ne=ke,x.current=Ne;Ne=Math.max(0,Math.min(Ne,r-et)),x.current=Ne,Se!==void 0&&(window.clearTimeout(E.current),S(!1),E.current=window.setTimeout(()=>S(!0),200)),o({x:fe,y:Ne,width:pe-c,height:et-u,paddingRight:C.current?.clientWidth??0})},[u,c,r,o,s,F]);m0(h&&ua.value,O,k);const M=f.useRef(O);M.current=O;const V=f.useRef(),W=f.useRef(!1);f.useLayoutEffect(()=>{W.current?O():W.current=!0},[O,u,c]);const j=f.useCallback(fe=>{k.current=fe,p!==void 0&&(p.current=fe)},[p]);let oe=0,Q=0;const re=Math.min(r,w0);for(y.push(f.createElement("div",{key:oe++,style:{width:i,height:0}}));Q<re;){const fe=Math.min(y0,re-Q);y.push(f.createElement("div",{key:oe++,style:{width:0,height:fe}})),Q+=fe}const{ref:se,width:ae,height:de}=p0(m);return typeof window<"u"&&(V.current?.height!==de||V.current?.width!==ae)&&(window.setTimeout(()=>M.current(),0),V.current={width:ae,height:de}),(ae??0)===0||(de??0)===0?f.createElement("div",{ref:se}):f.createElement("div",{ref:se},f.createElement(b0,{isSafari:ua.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:j,style:V.current,draggable:l,onDragStart:fe=>{l||(fe.stopPropagation(),fe.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>O()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},y),d!==void 0&&f.createElement(f.Fragment,null,!b&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:C,style:{height:de,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:b?1:void 0,right:v?c??0:void 0,pointerEvents:"auto"}},d))))))},x0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:l,freezeColumns:a,experimental:s,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:p,rightElement:m,rightElementProps:y,overscrollX:v,overscrollY:b,initialSize:x,smoothScrollX:T=!1,smoothScrollY:k=!1,isDraggable:R}=e,{paddingRight:P,paddingBottom:I}=s??{},[C,F]=c,D=f.useRef(),S=f.useRef(),E=f.useRef(),O=f.useRef(),M=u+Math.max(0,v??0);let V=l?i+o:i;if(typeof r=="number")V+=n*r;else for(let Q=0;Q<n;Q++)V+=r(Q);b!==void 0&&(V+=b);const W=f.useRef(),j=f.useCallback(()=>{if(W.current===void 0)return;const Q={...W.current};let re=0,se=Q.x<0?-Q.x:0,ae=0,de=0;Q.x=Q.x<0?0:Q.x;let fe=0;for(let le=0;le<a;le++)fe+=t[le].width;for(const le of t){const Se=re-fe;if(Q.x>=Se+le.width)re+=le.width,de++,ae++;else if(Q.x>Se)re+=le.width,T?se+=Se-Q.x:de++,ae++;else if(Q.x+Q.width>Se)re+=le.width,ae++;else break}let ue=0,H=0,L=0;if(typeof r=="number")k?(H=Math.floor(Q.y/r),ue=H*r-Q.y):H=Math.ceil(Q.y/r),L=Math.ceil(Q.height/r)+H,ue<0&&L++;else{let le=0;for(let Se=0;Se<n;Se++){const pe=r(Se),et=le+(k?0:pe/2);if(Q.y>=le+pe)le+=pe,H++,L++;else if(Q.y>et)le+=pe,k?ue+=et-Q.y:H++,L++;else if(Q.y+Q.height>pe/2+le)le+=pe,L++;else break}}H=Math.max(0,Math.min(H,n-1)),L=Math.max(H,Math.min(L,n));const Y={x:de,y:H,width:ae-de,height:L-H},te=D.current;(te===void 0||te.y!==Y.y||te.x!==Y.x||te.height!==Y.height||te.width!==Y.width||S.current!==se||E.current!==ue||Q.width!==O.current?.[0]||Q.height!==O.current?.[1])&&(g?.({x:de,y:H,width:ae-de,height:L-H},Q.width,Q.height,Q.paddingRight??0,se,ue),D.current=Y,S.current=se,E.current=ue,O.current=[Q.width,Q.height])},[t,r,n,g,a,T,k]),oe=f.useCallback(Q=>{W.current=Q,j()},[j]);return f.useEffect(()=>{j()},[j]),f.createElement(S0,{scrollRef:h,className:d,kineticScrollPerfHack:s?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:R===!0||typeof R=="string",scrollWidth:M+(P??0),scrollHeight:V+(I??0),clientHeight:F,rightElement:m,paddingBottom:I,paddingRight:P,rightElementProps:y,update:oe,initialSize:x}
165,f.createElement(g0,{eventTargetRef:h,width:C,height:F,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},k0=dn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),M0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),R0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),I0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),E0=10,T0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:l,searchResults:a,onSearchValueChange:s,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=f.useState(""),y=l??p,v=f.useCallback(re=>{m(re),s?.(re)},[s]),[b,x]=f.useState(),T=f.useRef(b);T.current=b,f.useEffect(()=>{a!==void 0&&(a.length>0?x(re=>({rowsSearched:r,results:a.length,selectedIndex:re?.selectedIndex??-1})):x(void 0))},[r,a]);const k=f.useRef();k.current===void 0&&(k.current=new AbortController);const R=f.useRef(),[P,I]=f.useState([]),C=a??P,F=f.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0),k.current!==void 0&&k.current.abort(),k.current=new AbortController},[]),D=f.useRef(n);D.current=n;const S=f.useCallback(re=>{const se=new RegExp(re.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=D.current,de=Math.min(10,r),fe=0;x(void 0),I([]);const ue=[],H=async()=>{if(u===void 0)return;const L=performance.now(),Y=r-fe;let te=u({x:0,y:ae,width:i.length,height:Math.min(de,Y,r-ae)},k.current.signal);typeof te=="function"&&(te=await te());let le=!1;for(const[dt,Ne]of te.entries())for(const[ne,ve]of Ne.entries()){let me;switch(ve.kind){case Z.Text:case Z.Number:me=ve.displayData;break;case Z.Uri:case Z.Markdown:me=ve.data;break;case Z.Boolean:me=typeof ve.data=="boolean"?ve.data.toString():void 0;break;case Z.Image:case Z.Bubble:me=ve.data.join("ð³");break;case Z.Custom:me=ve.copyData;break}me!==void 0&&se.test(me)&&(ue.push([ne,dt+ae]),le=!0)}const Se=performance.now();le&&I([...ue]),fe+=te.length,On(fe<=r);const pe=T.current?.selectedIndex??-1;x({results:ue.length,rowsSearched:fe,selectedIndex:pe}),c?.(ue,pe),ae+de>=r?ae=0:ae+=de;const et=Se-L,ke=Math.max(et,1),Dt=E0/ke;de=Math.ceil(de*Dt),fe<r&&ue.length<1e3&&(R.current=window.requestAnimationFrame(H))};F(),R.current=window.requestAnimationFrame(H)},[F,i.length,u,c,r]),E=f.useCallback(()=>{g?.(),x(void 0),I([]),c?.([],-1),F(),t?.current?.focus()},[F,t,g,c]),O=f.useCallback(re=>{v(re.target.value),a===void 0&&(re.target.value===""?(x(void 0),I([]),F()):S(re.target.value))},[S,F,v,a]);f.useEffect(()=>{o.current!==null&&(v(""),x(void 0),P.length>0&&(I([]),c?.([],-1)),d?o.current.focus({preventScroll:!0}
165):F())},[d,o]);const M=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;const se=(b.selectedIndex+1)%b.results;x({...b,selectedIndex:se}),c?.(C,se)},[b,c,C]),V=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;let se=(b.selectedIndex-1)%b.results;se<0&&(se+=b.results),x({...b,selectedIndex:se}),c?.(C,se)},[c,C,b]),W=f.useCallback(re=>{(re.ctrlKey||re.metaKey)&&re.nativeEvent.code==="KeyF"||re.key==="Escape"?(E(),re.stopPropagation(),re.preventDefault()):re.key==="Enter"&&(re.shiftKey?V():M())},[E,M,V]);f.useEffect(()=>()=>{F()},[F]);const[j,oe]=f.useState(!1);f.useEffect(()=>{if(d)oe(!0);else{const re=setTimeout(()=>oe(!1),150);return()=>clearTimeout(re)}},[d]);const Q=f.useMemo(()=>{if(!d&&!j)return null;let re;b!==void 0&&(re=b.results>=1e3?"over 1000":`${b.results} result${b.results!==1?"s":""}`,b.selectedIndex>=0&&(re=`${b.selectedIndex+1} of ${re}`));const se=fe=>{fe.stopPropagation()},de={width:`${r>0?Math.floor((b?.rowsSearched??0)/r*100):0}%`};return f.createElement(k0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:se,onMouseMove:se,onMouseUp:se,onClick:se},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:O,value:y,tabIndex:d?void 0:-1,onKeyDownCapture:W}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:V,disabled:(b?.results??0)===0},M0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:M,disabled:(b?.results??0)===0},R0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:E},I0)),b!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},re)),f.createElement("div",{className:"gdg-search-progress",style:de})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,j,b,r,h,o,O,y,W,V,M,g,E]);return f.createElement(f.Fragment,null,f.createElement(x0,{prelightCells:C,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),Q)};class D0 extends f.PureComponent{wrapperRef=f.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...i}=this.props;return f.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const O0=()=>e=>Math.max(16,e.targetHeight-10),P0=dn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[O0(),"px"]}}),L0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[l,a]=zt.useState(n);return zt.createElement(D0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},zt.createElement(P0,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,l.length),onChange:s=>a(s.target.value),onKeyDown:s=>{s.key==="Enter"?o(l):s.key==="Escape"&&r()},autoFocus:!0}))};function F0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function rt(e,t,n){const r=Sd(e,t);return r&&(n.didMatch=!0),r}function Sd(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const u of s)if(Sd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const l=e.split("+"),a=l.pop();if(!F0(a,t))return!1;if(l[0]==="any")return!0;for(const s of l)switch(s){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":ca.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function _0(e,t,n,r,i,o,l){const a=zt.useCallback((c,d,g,h)=>{(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!l&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});
165const p=n==="mixed"&&(g||h==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,y=(i==="mixed"||i==="additive")&&p;let v={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:Qe.empty(),rows:y?e.rows:Qe.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v={...v,current:{...v.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(v,d)},[r,e,n,o,l,i,t]),s=zt.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:Qe.empty(),rows:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";h={current:p?e.current:void 0,columns:m?e.columns:Qe.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=zt.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:Qe.empty(),columns:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&i==="mixed"||i==="additive";h={current:p?e.current:void 0,rows:m?e.rows:Qe.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,s,u]}function A0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:Z.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return e?.(u,r.signal)??[]},[r.signal,t,e,i]),l=e!==void 0?o:void 0,a=f.useCallback(u=>{if(l===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=l(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:Z.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:Z.Loading,allowOverlay:!1},...g])}return l(c,r.signal)},[r.signal,l,n]);return[e!==void 0?a:void 0,l]}function H0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Al?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:uo()}}function z0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(l=>l.span!==void 0&&l.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:H0(l))})}function Cu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function V0(e){const t=[];for(const n of e){const r=[];for(const i of n)i.format==="url"?r.push(i.rawValue?.toString()??""):i.format==="string-array"?r.push(i.formatted.map(o=>Cu(o,!0)).join(",")):r.push(i.doNotEscape===!0?i.formatted:Cu(i.formatted,!1));t.push(r.join(" "))}return t.join(` 166`)}function rl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Su(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function $0(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function N0(e){const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const n of e){t.push("<tr>");for(const r of n){const i=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${i}><a href="${r.rawValue}">${rl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${i}><ol>${r.formatted.map((o,l)=>`<li gdg-raw-value=${Su(r.rawValue[l])}>`+rl(o)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Su(r.rawValue?.toString()??"")} ${i}>${rl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function B0(e,t){const n=z0(e,t),r=V0(n),i=N0(n);return{textPlain:r,textHtml:i}}function xu(e){const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],i=[];let o;for(;r.length>0;){const l=r.pop();if(l===void 0)break;if(l instanceof HTMLTableElement||l.nodeName==="TBODY")r.push(...[...l.children].reverse());else if(l instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...l.children].reverse());else if(l instanceof HTMLTableCellElement){const a=l.cloneNode(!0),u=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,c=u?.children.length===1&&u.children[0].nodeName==="FONT",d=a.querySelectorAll("br");for(const p of d)p.replaceWith(` 167`);const g=a.getAttribute("gdg-raw-value"),h=a.getAttribute("gdg-format")??"string";
167if(a.querySelector("a")!==null)o?.push({rawValue:a.querySelector("a")?.getAttribute("href")??"",formatted:a.textContent??"",format:h});else if(a.querySelector("ol")!==null){const p=a.querySelectorAll("li");o?.push({rawValue:[...p].map(m=>m.getAttribute("gdg-raw-value")??""),formatted:[...p].map(m=>m.textContent??""),format:"string-array"})}else if(g!==null)o?.push({rawValue:$0(g),formatted:a.textContent??"",format:h});else{let p=a.textContent??"";c&&(p=p.replace(/\n(?!\n)/g,"")),o?.push({rawValue:p??"",formatted:p??"",format:h})}}}return o!==void 0&&i.push(o),i}function W0(e,t,n,r,i){const o=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if(e?.current===void 0)break;const a=e.current?.range,s=[];if(a.width>2){const d=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof d=="function")return o;s.push(...d);const g=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof g=="function")return o;s.push(...g)}else{const d=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof d=="function")return o;s.push(...d)}let u=a.x-n,c=a.x+a.width-1-n;for(const d of s)for(const g of d)g.span!==void 0&&(u=Math.min(g.span[0],u),c=Math.max(g.span[1],c));u===a.x-n&&c===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:c-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function ku(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function U0(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,` 168`);let l=0;for(const a of e){switch(o){case t.None:a===" "||a===` 169`?(r.push(e.slice(i,l)),i=l+1,a===` 170`&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===` 171`)&&(r.push(ku(e.slice(i,l))),i=l+1,a===` 172`&&(n.push(r),r=[])),o=t.None);break}l++}return i<e.length&&r.push(ku(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Mu(e,t,n){const r=B0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),l=(a,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",s)}catch{o(a,s)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?l(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function xd(e){return e!==!0}function Ru(e){return typeof e=="string"?e:`${e}px`}const G0=()=>e=>e.innerWidth,X0=()=>e=>e.innerHeight,Y0=dn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[G0()],"wmyidgi-1":[X0()]}}),j0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(Y0,{innerHeight:Ru(n),innerWidth:Ru(t),...i},r)},q0=2,K0=1300;function Z0(e,t,n){const r=zt.useRef(0),[i,o]=e??[0,0];zt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let l=!1,a=0;const s=u=>{if(!l){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/K0);const d=r.current**1.618*c*q0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,i,o,n])}function J0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:l,remSize:a}){const[s,u,c,d,g,h]=zt.useMemo(()=>{if(!l||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=ld();return[typeof m=="number"?m*p:v=>Math.ceil(m(v)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*p},Math.ceil((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,l,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const Cr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function it(e,t){return e===!0?t:e===!1?"":e}function Iu(e){const t=ca.value;return{activateCell:it(e.activateCell," |Enter|shift+Enter"),clear:it(e.clear,"any+Escape"),closeOverlay:it(e.closeOverlay,"any+Escape"),acceptOverlayDown:it(e.acceptOverlayDown,"Enter"),acceptOverlayUp:it(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:it(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:it(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:it(e.delete,t?"Backspace|Delete":"Delete"),downFill:it(e.downFill,"primary+_68"),scrollToSelectedCell:it(e.scrollToSelectedCell,"primary+Enter"),goDownCell:it(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:it(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:it(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:it(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:it(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:it(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:it(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:it(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:it(e.goToFirstCell,"primary+Home"),goToFirstColumn:it(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:it(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:it(e.goToLastCell,"primary+End"),goToLastColumn:it(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:it(e.goToLastRow,"primary+ArrowDown"),goToNextPage:it(e.goToNextPage,"PageDown"),goToPreviousPage:it(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:it(e.rightFill,"primary+_82"),search:it(e.search,"primary+f"),selectAll:it(e.selectAll,"primary+a"),selectColumn:it(e.selectColumn,"ctrl+ "),selectGrowDown:it(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:it(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:it(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:it(e.selectGrowUp,"shift+ArrowUp"),selectRow:it(e.selectRow,"shift+ "),selectToFirstCell:it(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:it(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:it(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:it(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:it(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:it(e.selectToLastRow,"primary+shift+ArrowDown")}}function Q0(e){const t=vp(e);return zt.useMemo(()=>
172{if(t===void 0)return Iu(Cr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Cr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Cr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Cr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Cr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Cr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Cr.selectToLastCell};return Iu({...Cr,...n})},[t])}function ev(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const l={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(l.subGroups=r.subGroups.map((a,s)=>t(a,i+1,[...o,s])).sort((a,s)=>a.headerIndex-s.headerIndex)),l}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Kl(e,t){const n=[];function r(a,s,u=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:s;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=ev(e.groups);for(let a=0;a<i.length;a++){const s=a<i.length-1?i[a+1].headerIndex:null;r(i[a],s)}let o=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...u}=a;return u})}function Il(e,t){if(t===void 0||Kl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function tv(e,t,n,r){const i=zt.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]),o=zt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),l=zt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=zt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),s=zt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Sr(r??e?.themeOverride,zt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Il(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:u}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:u}}function nv(e,t){const n=zt.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]);return{getRowGroupingForPath:Md,updateRowGroupingByPath:kd,mapper:zt.useCallback(r=>{if(typeof r=="number")return Il(r,n);const i=Il(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function kd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,l)=>l===r?{...o,...n}:o):e.map((o,l)=>l===r?{...o,subGroups:kd(o.subGroups??[],i,n)}:o)}function Md(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Md(e[n].subGroups??[],r)}function rv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function iv(e,t,n,r,i){const[o,l]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,o]),[s,u,c]=mp(a),d=f.useRef(i);d.current=i;const g=rv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(s.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const p=(s.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,p,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const ov=f.lazy(async()=>await Fl(()=>import("./data-grid-overlay-editor.C2VVwcz1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url));let av=0;function lv(e){return Xg(Ps(Ps(e).filter(t=>t.span!==void 0).map(t=>Mr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Bo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Wo={kind:Z.Loading,allowOverlay:!1},Uo={columns:Qe.empty(),rows:Qe.empty(),current:void 0},sv=(e,t)=>{const[n,r]=f.useState(Uo),[i,o]=f.useState(),l=f.useRef(null),a=f.useRef(null),[s,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:y,columns:v,rows:b,getCellContent:x,onCellClicked:T,onCellActivated:k,onFillPattern:R,onFinishedEditing:P,coercePasteValue:I,drawHeader:C,drawCell:F,editorBloom:D,onHeaderClicked:S,onColumnProposeMove:E,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:M="default",onGroupHeaderClicked:V,onCellContextMenu:W,className:j,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:re,onGroupHeaderRenamed:se,onCellEdited:ae,onCellsEdited:de,onSearchResultsChanged:fe,searchResults:ue,onSearchValueChange:H,searchValue:L,onKeyDown:Y,onKeyUp:te,keybindings:le,editOnType:Se=!0,onRowAppended:pe,onColumnAppended:et,onColumnMoved:ke,validateCell:Dt,highlightRegions:dt,rangeSelect:Ne="rect",columnSelect:ne="multi",rowSelect:ve="multi",rangeSelectionBlending:me="exclusive",columnSelectionBlending:he="exclusive",rowSelectionBlending:Ce="exclusive",onDelete:Ae,onDragStart:Oe,onMouseMove:at,onPaste:Pe,copyHeaders:we=!1,freezeColumns:He=0,cellActivationBehavior:Re="second-click",rowSelectionMode:Be="auto",columnSelectionMode:ft="auto",onHeaderMenuClick:ht,onHeaderIndicatorClick:Ye,getGroupDetail
172s:pt,rowGrouping:Nt,onSearchClose:St,onItemHovered:Tt,onSelectionCleared:Bt,showSearch:qt,onVisibleRegionChanged:an,gridSelection:It,onGridSelectionChange:gt,minColumnWidth:Wt=50,maxColumnWidth:wt=500,maxColumnAutoWidth:ln,provideEditor:Mn,trailingRowOptions:De,freezeTrailingRows:mt=0,allowedFillDirections:xt="orthogonal",scrollOffsetX:bn,scrollOffsetY:tn,verticalBorder:nn,onDragOverCell:cn,onDrop:$t,onColumnResize:Zt,onColumnResizeEnd:Ge,onColumnResizeStart:kt,customRenderers:Rn,fillHandle:Ot,experimental:bt,fixedShadowX:wn,fixedShadowY:or,headerIcons:Kn,imageWindowLoader:B,initialSize:We,isDraggable:je,onDragLeave:Pt,onRowMoved:Kt,overscrollX:rn,overscrollY:In,preventDiagonalScrolling:yn,rightElement:Gt,rightElementProps:Cn,trapFocus:Sn=!1,smoothScrollX:qr,smoothScrollY:Kr,scaleToRem:Zr=!1,rowHeight:Li=34,headerHeight:Fn=36,groupHeaderHeight:Zn=Fn,theme:Jr,isOutsideClick:Qr,renderers:$n,resizeIndicator:ei,scrollToActiveCell:Nn=!0,drawFocusRing:Le=!0,portalElementRef:fn}=e,Jn=Le==="no-editor"?i===void 0:Le,_n=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,sn=_n?.kind??e.rowMarkers??"none",ti=_n?.width??e.rowMarkerWidth,ar=_n?.startIndex??e.rowMarkerStartIndex??1,ni=_n?.theme??e.rowMarkerTheme,hr=_n?.headerTheme,ri=_n?.headerAlwaysVisible,ii=ve!=="multi"||_n?.headerDisabled===!0,Dr=_n?.checkboxStyle??"square",gr=Math.max(Wt,20),oi=Math.max(wt,gr),Ia=Math.max(ln??oi,gr),Fi=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:ze,rowNumberMapper:_i,rowHeight:yo,getRowThemeOverride:Or}=tv(Nt,b,Li,h),Ea=f.useMemo(()=>Number.parseFloat(Fi.fontSize),[Fi]),{rowHeight:Qn,headerHeight:Ai,groupHeaderHeight:Co,theme:ai,overscrollX:Ta,overscrollY:Da}=J0({groupHeaderHeight:Zn,headerHeight:Fn,overscrollX:rn,overscrollY:In,remSize:Ea,rowHeight:yo,scaleToRem:Zr,theme:Jr}),er=Q0(le),pr=ti??(b>1e4?48:b>1e3?44:b>100?36:32),En=sn!=="none",G=En?1:0,_t=De!==void 0,lr=De?.sticky===!0,[Oa,Pr]=f.useState(!1),Pa=qt??Oa,li=f.useCallback(()=>{St!==void 0?St():Pr(!1)},[St]),q=f.useMemo(()=>It===void 0?void 0:Bo(It,G),[It,G])??n,$=f.useRef();$.current===void 0&&($.current=new AbortController),f.useEffect(()=>()=>$?.current.abort(),[]);const[ee,xe]=A0(Q,x,G,$.current,ze),Te=f.useCallback((w,A,_)=>{if(Dt===void 0)return!0;const N=[w[0]-G,w[1]];return Dt?.(N,A,_)},[G,Dt]),ce=f.useRef(It),ge=f.useCallback((w,A)=>{A&&(w=W0(w,ee,G,M,$.current)),gt!==void 0?(ce.current=Bo(w,-G),gt(ce.current)):r(w)},[gt,ee,G,M]),Xe=Sr(Zt,f.useCallback((w,A,_,N)=>{Zt?.(v[_-G],A,_-G,N)},[Zt,G,v])),Me=Sr(Ge,f.useCallback((w,A,_,N)=>{Ge?.(v[_-G],A,_-G,N)},[Ge,G,v])),Ze=Sr(kt,f.useCallback((w,A,_,N)=>{kt?.(v[_-G],A,_-G,N)},[kt,G,v])),vt=Sr(C,f.useCallback((w,A)=>C?.({...w,columnIndex:w.columnIndex-G},A)??!1,[C,G])),un=Sr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-G},A)??!1,[F,G])),Ut=f.useCallback(w=>{if(Ae!==void 0){const A=Ae(Bo(w,-G));return typeof A=="boolean"?A:Bo(A,G)}return!0},[Ae,G]),[Mt,lt,qe]=_0(q,ge,me,he,Ce,Ne,O),st=f.useMemo(()=>dr(ld(),ai),[ai]),[At,si]=f.useState([0,0,0]),Lr=f.useMemo(()=>{if($n===void 0)return{};const w={};for(const A of $n)w[A.kind]=A;return w},[$n]),Jt=f.useCallback(w=>w.kind!==Z.Custom?Lr[w.kind]:Rn?.find(A=>A.isMatch(w)),[Rn,Lr]);let{sizedColumns:on,nonGrowWidth:Lt}=cm(v,ze,xe,At[0]-(G===0?0:pr)-At[2],gr,Ia,st,Jt,$.current);sn!=="none"&&(Lt+=pr);const An=f.useMemo(()=>on.some(w=>w.group!==void 0),[on]),hn=An?Ai+Co:Ai,ui=q.rows.length,sr=sn==="none"?void 0:ui===0?!1:ui===ze?!0:void 0,tt=f.useMemo(()=>sn==="none"?on:[{title:"",width:pr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ni,rowMarker:Dr,rowMarkerChecked:sr,headerRowMarkerTheme:hr,headerRowMarkerAlwaysVisible:ri,headerRowMarkerDisabled:ii},...on],[sn,on,pr,ni,Dr,sr,hr,ri,ii]),Qt=f.useRef({height:1,width:1,x:0,y:0}),Fr=f.useRef(!1),{setVisibleRegion:mr,visibleRegion:ur,scrollRef:Ht}=iv(bn,tn,Qn,Qt,()=>Fr.current=!0);Qt.current=ur;const Lf=ur.x+G,So=ur.y,gn=f.useRef(null),xn=f.useCallback(w=>{w===!0?gn.current?.focus():window.requestAnimationFrame(()=>{gn.current?.focus()})},[]),pn=_t?ze+1:ze,Hn=f.useCallback(w=>{const A=G===0?w:w.map(N=>({...N,location:[N.location[0]-G,N.location[1]]})),_=de?.(A);
172if(_!==!0)for(const N of A)ae?.(N.location,N.value);return _},[ae,de,G]),[_r,La]=f.useState(),xo=q.current!==void 0&&q.current.range.width*q.current.range.height>1?q.current.range:void 0,bs=Jn?q.current?.cell:void 0,ko=bs?.[0],Mo=bs?.[1],Ff=f.useMemo(()=>{if((dt===void 0||dt.length===0)&&(xo??ko??Mo??_r)===void 0)return;const w=[];if(dt!==void 0)for(const A of dt){const _=tt.length-A.range.x-G;_>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+G,width:Math.min(_,A.range.width)},style:A.style})}return _r!==void 0&&w.push({color:Ur(st.accentColor,0),range:_r,style:"dashed"}),xo!==void 0&&w.push({color:Ur(st.accentColor,.5),range:xo,style:"solid-outline"}),ko!==void 0&&Mo!==void 0&&w.push({color:st.accentColor,range:{x:ko,y:Mo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[_r,xo,ko,Mo,dt,tt.length,st.accentColor,G]),ws=f.useRef(tt);ws.current=tt;const Tn=f.useCallback(([w,A],_=!1)=>{const N=_t&&A===pn-1;if(w===0&&En){if(N)return Wo;const K=_i(A);return K===void 0?Wo:{kind:Vn.Marker,allowOverlay:!1,checkboxStyle:Dr,checked:q?.rows.hasIndex(A)===!0,markerKind:sn==="clickable-number"?"number":sn,row:ar+K,drawHandle:Kt!==void 0,cursor:sn==="clickable-number"?"pointer":void 0}}else if(N){const z=w===G?De?.hint??"":"",U=ws.current[w];if(U?.trailingRowOptions?.disabled===!0)return Wo;{const J=U?.trailingRowOptions?.hint??z,ie=U?.trailingRowOptions?.addIcon??De?.addIcon;return{kind:Vn.NewRow,hint:J,allowOverlay:!1,icon:ie}}}else{const K=w-G;if(_||bt?.strict===!0){const U=Qt.current,J=U.x>K||K>U.x+U.width||U.y>A||A>U.y+U.height||A>=Ha.current,ie=K===U.extras?.selected?.[0]&&A===U.extras?.selected[1];let ye=!1;if(U.extras?.freezeRegions!==void 0){for(const Rt of U.extras.freezeRegions)if(Wr(Rt,K,A)){ye=!0;break}}if(J&&!ie&&!ye)return Wo}let z=x([K,A]);return G!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+G,z.span[1]+G]}),z}},[_t,pn,En,_i,Dr,q?.rows,sn,ar,Kt,G,De?.hint,De?.addIcon,bt?.strict,x]),Fa=f.useCallback(w=>{let A=pt?.(w)??{name:w};return se!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:_=>Va({group:A.name,bounds:_.bounds})}]}),A},[pt,se]),Ro=f.useCallback(w=>{const[A,_]=w.cell,N=tt[A],X=N?.group!==void 0?Fa(N.group)?.overrideTheme:void 0,K=N?.themeOverride,z=Or?.(_);o({...w,theme:dr(st,X,K,z,w.content.themeOverride)})},[Or,tt,Fa,st]),ci=f.useCallback((w,A,_)=>{if(q.current===void 0)return;const[N,X]=q.current.cell,K=Tn([N,X]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(_!==void 0)switch(z.kind){case Z.Number:{const U=Yg(()=>_==="-"?-0:Number.parseFloat(_),0);z={...z,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:_};break}Ro({target:w,content:z,initialValue:_,cell:[N,X],highlight:_===void 0,forceEditMode:_!==void 0,activation:A})}else K.kind===Z.Boolean&&A.inputType==="keyboard"&&K.readonly!==!0&&(Hn([{location:q.current.cell,value:{...K,data:xd(K.data)}}]),gn.current?.damage([{cell:q.current.cell}]))},[Tn,q,Hn,Ro]),ys=f.useCallback((w,A)=>{const _=gn.current?.getBounds(w,A);if(_===void 0||Ht.current===null)return;const N=Tn([w,A]);N.allowOverlay&&Ro({target:_,content:N,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Tn,Ht,Ro]),Xt=f.useCallback((w,A,_="both",N=0,X=0,K=void 0)=>{if(Ht.current!==null){const z=gn.current,U=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ie=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,ye=typeof w!="number"&&w.unit==="px"?w.amount:void 0,Rt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&U!==null){let Je={x:0,y:0,width:0,height:0},Ke=0,ut=0;if((J!==void 0||ie!==void 0)&&(Je=z.getBounds((J??0)+G,ie??0)??Je,Je.width===0||Je.height===0))return;const nt=U.getBoundingClientRect(),yt=nt.width/U.offsetWidth;if(ye!==void 0&&(Je={...Je,x:ye-nt.left-Ht.current.scrollLeft,width:1}),Rt!==void 0&&(Je={...Je,y:Rt+nt.top-Ht.current.scrollTop,height:1}),Je!==void 0){const Ct={x:Je.x-N,y:Je.y-X,width:Je.width+2*N,height:Je.height+2*X};let mi=0;for(let Xa=0;Xa<He;Xa++)mi+=on[Xa].width;let Wi=0;const Ui=mt+(lr?1:0);Ui>0&&(Wi=jr(pn,Ui,Qn));let nr=mi*yt+nt.left+G*pr*yt,vi=nt.right,Vr=nt.top+hn*yt,bi=nt.bottom-Wi*yt;const Lo=Je.width+N*2;switch(K?.hAlign){case"start":vi=nr+Lo;break;case"end":nr=vi-Lo;break;case"center":nr=Math.floor((nr+vi)/2)-Lo/2,vi=nr+Lo;break}const Fo=Je.height+X*2;switch(K?.vAlign){case"start":bi=Vr+Fo;break;
172case"end":Vr=bi-Fo;break;case"center":Vr=Math.floor((Vr+bi)/2)-Fo/2,bi=Vr+Fo;break}nr>Ct.x?Ke=Ct.x-nr:vi<Ct.x+Ct.width&&(Ke=Ct.x+Ct.width-vi),Vr>Ct.y?ut=Ct.y-Vr:bi<Ct.y+Ct.height&&(ut=Ct.y+Ct.height-bi),_==="vertical"||typeof w=="number"&&w<He?Ke=0:(_==="horizontal"||typeof A=="number"&&A>=pn-Ui)&&(ut=0),(Ke!==0||ut!==0)&&(yt!==1&&(Ke/=yt,ut/=yt),Ht.current.scrollTo({left:Ke+Ht.current.scrollLeft,top:ut+Ht.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[G,mt,pr,Ht,hn,He,on,pn,lr,Qn]),_a=f.useRef(ys),Aa=f.useRef(x);_a.current=ys,Aa.current=x;const Ha=f.useRef(ze);Ha.current=ze;const Cs=f.useRef(tt.length);Cs.current=tt.length;const vr=f.useCallback(async(w,A=!0,_)=>{if(tt[w]?.trailingRowOptions?.disabled===!0)return;const X=pe?.();let K,z=!0;X!==void 0&&(K=await X,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let U=0;const J=()=>{if(Ha.current<=ze){U<500&&window.setTimeout(J,U),U=50+U*2;return}const ie=typeof K=="number"?K:z?ze:0;Po.current(w-G,ie,"both",0,0,_?{behavior:_}:void 0),Mt({cell:[w,ie],range:{x:w,y:ie,width:1,height:1}},!1,!1,"edit");const ye=Aa.current([w-G,ie]);ye.allowOverlay&&xi(ye)&&ye.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(w,ie)},0)};J()},[tt,pe,G,ze,Mt]),Io=f.useCallback(async(w,A=!0)=>{const _=et?.();let N,X=!0;_!==void 0&&(N=await _,N==="left"&&(X=!1),typeof N=="number"&&(X=!1));let K=0;const z=()=>{if(Cs.current<=tt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const U=typeof N=="number"?N:X?tt.length:0;Xt(U-G,w),Mt({cell:[U,w],range:{x:U,y:w,width:1,height:1}},!1,!1,"edit");const J=Aa.current([U-G,w]);J.allowOverlay&&xi(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(U,w)},0)};z()},[tt,et,G,Xt,Mt]),di=f.useCallback(w=>{const A=on[w]?.trailingRowOptions?.targetColumn??De?.targetColumn;if(typeof A=="number")return A+(En?1:0);if(typeof A=="object"){const _=v.indexOf(A);if(_>=0)return _+(En?1:0)}},[on,v,En,De?.targetColumn]),br=f.useRef(),fi=f.useRef(),Hi=f.useCallback((w,A)=>{const[_,N]=A;return dr(st,tt[_]?.themeOverride,Or?.(N),w.themeOverride)},[Or,tt,st]),{mapper:Ar}=nv(Nt,b),Bn=Nt?.navigationBehavior,zi=f.useCallback(w=>{const A=ca.value?w.metaKey:w.ctrlKey,_=A&&ve==="multi",[N,X]=w.location,K=q.columns,z=q.rows,[U,J]=q.current?.cell??[];if(w.kind==="cell"){if(fi.current=void 0,Hr.current=[N,X],N===0&&En){if(_t===!0&&X===ze||sn==="number"||ve==="none")return;const ie=Tn(w.location);if(ie.kind!==Vn.Marker)return;if(Kt!==void 0){const Je=Jt(ie);On(Je?.kind===Vn.Marker);const Ke=Je?.onClick?.({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Hi(ie,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ie.checked)return}o(void 0),xn();const ye=z.hasIndex(X),Rt=br.current;if(ve==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Rt!==void 0&&z.hasIndex(Rt)){const Je=[Math.min(Rt,X),Math.max(Rt,X)+1];_||Be==="multi"?lt(void 0,Je,!0):lt(Qe.fromSingleSelection(Je),void 0,_)}else ve==="multi"&&(_||w.isTouch||Be==="multi")?ye?lt(z.remove(X),void 0,!0):(lt(void 0,X,!0),br.current=X):ye&&z.length===1?lt(Qe.empty(),void 0,A):(lt(Qe.fromSingleSelection(X),void 0,A),br.current=X)}else if(N>=G&&_t&&X===ze){const ie=di(N);vr(ie??N)}else if(U!==N||J!==X){const ie=Tn(w.location),ye=Jt(ie);if(ye?.onSelect!==void 0){let Ke=!1;if(ye.onSelect({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:Hi(ie,w.location)}),Ke)return}if(Bn==="block"&&Ar(X).isGroupHeader)return;const Rt=lr&&X===ze,Je=lr&&q!==void 0&&q.current?.cell[1]===ze;if((w.shiftKey||w.isLongTouch===!0)&&U!==void 0&&J!==void 0&&q.current!==void 0&&!Je){if(Rt)return;const Ke=Math.min(N,U),ut=Math.max(N,U),nt=Math.min(X,J),yt=Math.max(X,J);Mt({...q.current,range:{x:Ke,y:nt,width:ut-Ke+1,height:yt-nt+1}},!0,A,"click"),br.current=void 0,xn()}else Mt({cell:[N,X],range:{x:N,y:X,width:1,height:1}},!0,A,"click"),br.current=void 0,o(void 0),xn()}}else if(w.kind==="header")if(Hr.current=[N,X],o(void 0),En&&N===0)br.current=void 0,fi.current=void 0,!ii&&ve==="multi"&&(z.length!==ze?lt(Qe.fromSingleSelection([0,ze]),void 0,A):lt(Qe.empty(),void 0,A),xn());else{const ie=fi.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&ie!==void 0&&K.hasIndex(ie)){const ye=[Math.min(ie,N),Math.max(ie,N)+1];A||w.isTouch||ft==="multi"?qe(void 0,ye,A):qe(Qe.fromSingleSelection(ye),void 0,A)}else ne==="multi"&&(A||w.isTouch||ft==="multi")?(K.hasIndex(N)?qe(K.remove(N),void 0,A):qe(void 0,N,A),fi.current=N):ne!=="none"&&(K.hasIndex(N)?qe(K.remove(N),void 0,A):qe(Qe.fromSingleSelection(N),void 0,A),fi.current=N);br.current=void 0,xn()}else w.kind===Xn?Hr.current=[N,X]:w.kind===da&&!w.isMaybeScrollbar&&(ge(Uo,!1),o(void 0),xn(),Bt?.(),br.current=void 0,fi.current=void 0)},[ve,ne,q,En,G,_t,ze,sn,Tn,Kt,xn,Be,ft,Jt,Hi,lt,di,vr,Bn,Ar,lr,Mt,ii,qe,ge,Bt]),Vi=f.useRef(!1),Hr=f.useRef(),Ss=f.useRef(ur),tr=f.useRef(),_f=f.useCallback(w=>{if(hi.current=!1,Ss.current=Qt.current,w.button!==0&&w.button!==1){tr.current=void 0;return}const A=performance.now();tr.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Vi.current=!0);const _=w.kind==="cell"&&w.isFillHandle;!_&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:q,fillHandle:_}),Hr.current=void 0,!w.isTouch&&w.button===0&&!_?zi(w):!w.isTouch&&w.button===1&&(Hr.current=w.location))},[q,zi]),[za,Va]=f.useState(),xs=f.useCallback(w=>{if(w.kind!==Xn||ne!=="multi")return;const A=ca.value?w.metaKey:w.ctrlKey,[_]=w.location,N=q.columns;if(_<G)return;const X=tt[_];let K=_,z=_;for(let U=_-1;U>=G&&fo(X.group,tt[U].group);U--)K--;for(let U=_+1;U<tt.length&&fo(X.group,tt[U].group);U++)z++;
172if(xn(),A||w.isTouch||ft==="multi")if(N.hasAll([K,z+1])){let U=N;for(let J=K;J<=z;J++)U=U.remove(J);qe(U,void 0,A)}else qe(void 0,[K,z+1],A);else qe(Qe.fromSingleSelection([K,z+1]),void 0,A)},[ne,xn,q.columns,tt,G,qe,ft]),hi=f.useRef(!1),Eo=f.useCallback(async w=>{if(ee!==void 0&&Xe!==void 0){const A=Qt.current.y,_=Qt.current.height;let N=ee({x:w,y:A,width:1,height:Math.min(_,ze-A)},$.current.signal);typeof N!="object"&&(N=await N());const X=on[w-G],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=st.baseFontFull;const U=cd(z,st,X,0,N,gr,oi,!1,Jt);Xe?.(X,U.width,w,U.width)}}},[on,ee,oi,st,gr,Xe,G,ze,Jt]),[Af,$a]=f.useState(),gi=f.useCallback(async(w,A)=>{const _=w.current?.range;if(_===void 0||ee===void 0||A.current===void 0)return;const N=A.current.range;if(R!==void 0){let U=!1;if(R({fillDestination:{...N,x:N.x-G},patternSource:{..._,x:_.x-G},preventDefault:()=>U=!0}),U)return}let X=ee(_,$.current.signal);typeof X!="object"&&(X=await X());const K=X,z=[];for(let U=0;U<N.width;U++)for(let J=0;J<N.height;J++){const ie=[N.x+U,N.y+J];if(Jc(ie,_))continue;const ye=K[J%_.height][U%_.width];Mi(ye)||!xi(ye)||z.push({location:ie,value:{...ye}})}Hn(z),gn.current?.damage(z.map(U=>({cell:U.location})))},[ee,Hn,R,G]),ks=f.useCallback(()=>{if(q.current===void 0||q.current.range.width<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,width:1}}};gi(w,q)},[gi,q]),Ms=f.useCallback(()=>{if(q.current===void 0||q.current.range.height<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,height:1}}};gi(w,q)},[gi,q]),Hf=f.useCallback((w,A)=>{const _=s;if(u(void 0),La(void 0),$a(void 0),Vi.current=!1,A)return;if(_?.fillHandle===!0&&q.current!==void 0&&_.previousSelection?.current!==void 0){if(_r===void 0)return;const ye={...q,current:{...q.current,range:pd(_.previousSelection.current.range,_r)}};gi(_.previousSelection,ye),ge(ye,!0);return}const[N,X]=w.location,[K,z]=Hr.current??[],U=()=>{hi.current=!0},J=ye=>{const Rt=ye.isTouch||K===N&&z===X;if(Rt&&T?.([N-G,X],{...ye,preventDefault:U}),ye.button===1)return!hi.current;if(!hi.current){const Je=Tn(w.location),Ke=Jt(Je);if(Ke!==void 0&&Ke.onClick!==void 0&&Rt){const nt=Ke.onClick({...ye,cell:Je,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:Hi(Je,w.location),preventDefault:U});nt!==void 0&&!Mi(nt)&&Si(nt)&&(Hn([{location:ye.location,value:nt}]),gn.current?.damage([{cell:ye.location}]))}if(hi.current||q.current===void 0)return!1;let ut=!1;switch(Je.activationBehaviorOverride??Re){case"double-click":case"second-click":{if(_?.previousSelection?.current?.cell===void 0)break;const[nt,yt]=q.current.cell,[Ct,mi]=_.previousSelection.current.cell;ut=N===nt&&N===Ct&&X===yt&&X===mi&&(ye.isDoubleClick===!0||Re==="second-click");break}case"single-click":{ut=!0;break}}if(ut){const yt={inputType:"pointer",pointerActivation:ye.isDoubleClick===!0?"double-click":Je.activationBehaviorOverride??Re,pointerType:ye.isTouch?"touch":"mouse"};return k?.([N-G,X],yt),ci(ye.bounds,yt),!0}}return!1},ie=w.location[0]-G;if(w.isTouch){const ye=Qt.current,Rt=Ss.current;if(ye.x!==Rt.x||ye.y!==Rt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&ao(q.current?.cell,w.location)){W?.([ie,w.location[1]],{...w,preventDefault:U});return}else if(w.kind==="header"&&q.columns.hasIndex(N)){oe?.(ie,{...w,preventDefault:U});return}else if(w.kind===Xn){if(ie<0)return;re?.(ie,{...w,preventDefault:U});return}}w.kind==="cell"?J(w)||zi(w):w.kind===Xn?V?.(ie,{...w,preventDefault:U}):(w.kind===xr&&S?.(ie,{...w,preventDefault:U}),zi(w));return}if(w.kind==="header"){if(ie<0)return;w.isEdge?w.isDoubleClick===!0&&Eo(N):w.button===0&&N===K&&X===z&&S?.(ie,{...w,preventDefault:U})}if(w.kind===Xn){if(ie<0)return;w.button===0&&N===K&&X===z&&(V?.(ie,{...w,preventDefault:U}),hi.current||xs(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),Hr.current=void 0},[s,q,G,_r,gi,ge,T,Tn,Jt,Re,Hi,Hn,k,ci,W,oe,re,zi,V,S,Eo,xs]),zf=f.useCallback(w=>{const A={...w,location:[w.location[0]-G,w.location[1]]};at?.(A),s!==void 0&&w.buttons===0&&(u(void 0),La(void 0),$a(void 0),Vi.current=!1),$a(_=>Vi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===_?.[0]&&w.scrollEdge[1]===_[1]?_:s===void 0||(tr.current?.location[0]??0)<G?void 0:w.scrollEdge)},[s,at,G]),Vf=f.useCallback((w,A)=>{ht?.(w-G,A)},[ht,G]),$f=f.useCallback((w,A)=>{Ye?.(w-G,A)},[Ye,G]),pi=q?.current?.cell,Nf=f.useCallback((w,A,_,N,X,K)=>{Fr.current=!1;let z=pi;z!==void 0&&(z=[z[0]-G,z[1]]);const U=He===0?void 0:{x:0,y:w.y,width:He,height:w.height},J=[];U!==void 0&&J.push(U),mt>0&&(J.push({x:w.x-G,y:ze-mt,width:w.width,height:mt}),He>0&&J.push({x:0,y:ze-mt,width:He,height:mt}));const ie={x:w.x-G,y:w.y,width:w.width,height:_t&&w.y+w.height>=ze?w.height-1:w.height,tx:X,ty:K,extras:{selected:z,freezeRegion:U,freezeRegions:J}};Qt.current=ie,mr(ie),si([A,_,N]),an?.(ie,ie.tx,ie.ty,ie.extras)},[pi,G,_t,ze,He,mt,mr,an]),Bf=Sr(E,f.useCallback((w,A)=>E?.(w-G,A-G)!==!1,[E,G])),Wf=Sr(ke,f.useCallback((w,A)=>{ke?.(w-G,A-G),ne!=="none"&&qe(Qe.fromSingleSelection(A),void 0,!0)},[ne,ke,G,qe])),Na=f.useRef(!1),Uf=f.useCallback(w=>{if(w.location[0]===0&&G>0){w.preventDefault();return}Oe?.({...w,location:[w.location[0]-G,w.location[1]]}),w.defaultPrevented()||(Na.current=!0),u(void 0)},[Oe,G]),Gf=f.useCallback(()=>{Na.current=!1},[]),Rs=Nt?.selectionBehavior,To=f.useCallback(w=>{if(Rs!=="block-spanning")return;const{isGroupHeader:A,path:_,groupRows:N}=Ar(w);if(A)return[w,w];const X=_[_.length-1],K=w-X,z=w+N-X-1;return[K,z]},[Ar,Rs]),Ba=f.useRef(),Wa=f.useCallback(w=>{if(!Cd(w,Ba.current)&&(Ba.current=w,!(tr?.current?.button!==void 0&&tr.current.button>=1))){if(w.buttons!==0&&s!==void 0&&tr.current?.location[0]===0&&G===1&&ve==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(tr.current.location[1])&&q.rows.hasIndex(tr.current.location[1])){const A=Math.min(tr.current.location[1],w.location[1]),_=Math.max(tr.current.location[1],w.location[1])+1;lt(Qe.fromSingleSelection([A,_]),void 0,!1)}else if(w.buttons!==0&&s!==void 0&&q.current!==void 0&&!Na.current&&!Vi.current&&(Ne==="rect"||Ne==="multi-rect")){const[A,_]=q.current.cell;let[N,X]=w.location;if(X<0&&(X=Qt.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const K=s.previousSelection.current.range;X=Math.min(X,_t?ze-1:ze);const z=Bm(K,N,X,xt);La(z)}else{if(_t&&_===ze)return;if(_t&&X===ze)if(w.kind===da)X--;else return;N=Math.max(N,G);const U=To(_);X=U===void 0?X:zn(X,U[0],U[1]);const J=N-A,ie=X-_,ye={x:J>=0?A:N,y:ie>=0?_:X,width:Math.abs(J)+1,height:Math.abs(ie)+1};Mt({...q.current,range:ye},!0,!1,"drag")}}Tt?.({...w,location:[w.location[0]-G,w.location[1]]})}},[s,G,ve,q,Ne,Tt,lt,_t,ze,xt,To,Mt]),Xf=f.useCallback(()=>{const w=Ba.current;if(w===void 0)return;const[A,_]=w.scrollEdge;let[N,X]=w.location;const K=Qt.current;A===-1?N=K.extras?.freezeRegion?.x??K.x:A===1&&(N=K.x+K.width),_===-1?X=Math.max(0,K.y):_===1&&(X=Math.min(ze-1,K.y+K.height)),N=zn(N,0,tt.length-1),X=zn(X,0,ze-1),Wa({...w,location:[N,X]})},[tt.length,Wa,ze]);Z0(Af,Ht,Xf);const Wn=f.useCallback(w=>{if(q.current===void 0)return;const[A,_]=w,[N,X]=q.current.cell,K=q.current.range;let z=K.x,U=K.x+K.width,J=K.y,ie=K.y+K.height;const[ye,Rt]=To(X)??[0,ze-1],Je=Rt+1;if(_!==0)switch(_){case 2:{ie=Je,J=X,Xt(0,ie,"vertical");break}case-2:{J=ye,ie=X+1,Xt(0,J,"vertical");break}case 1:{J<X?(J++,Xt(0,J,"vertical")):(ie=Math.min(Je,ie+1),Xt(0,ie,"vertical"));break}case-1:{ie>X+1?(ie--,Xt(0,ie,"vertical")):(J=Math.max(ye,J-1),Xt(0,J,"vertical"));break}default:uo()}if(A!==0)if(A===2)U=tt.length,z=N,Xt(U-1-G,0,"horizontal");else if(A===-2)z=G,U=N+1,Xt(z-G,0,"horizontal");else{let Ke=[];if(ee!==void 0){const ut=ee({x:z,y:J,width:U-z-G,height:ie-J},$.current.signal);typeof ut=="object"&&(Ke=lv(ut))}if(A===1){let ut=!1;
172if(z<N){if(Ke.length>0){const nt=Mr(z+1,N+1).find(yt=>!Ke.includes(yt-G));nt!==void 0&&(z=nt,ut=!0)}else z++,ut=!0;ut&&Xt(z,0,"horizontal")}ut||(U=Math.min(tt.length,U+1),Xt(U-1-G,0,"horizontal"))}else if(A===-1){let ut=!1;if(U>N+1){if(Ke.length>0){const nt=Mr(U-1,N,-1).find(yt=>!Ke.includes(yt-G));nt!==void 0&&(U=nt,ut=!0)}else U--,ut=!0;ut&&Xt(U-G,0,"horizontal")}ut||(z=Math.max(G,z-1),Xt(z-G,0,"horizontal"))}else uo()}Mt({cell:q.current.cell,range:{x:z,y:J,width:U-z,height:ie-J}},!0,!1,"keyboard-select")},[ee,To,q,tt.length,G,ze,Xt,Mt]),Ua=f.useRef(Nn);Ua.current=Nn;const wr=f.useCallback((w,A,_,N)=>{const X=pn-(_?0:1);w=zn(w,G,on.length-1+G),A=zn(A,0,X);const K=pi?.[0],z=pi?.[1];if(w===K&&A===z)return!1;if(N&&q.current!==void 0){const U=[...q.current.rangeStack];(q.current.range.width>1||q.current.range.height>1)&&U.push(q.current.range),ge({...q,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:U}},!0)}else Mt({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Ua.current&&Xt(w-G,A),!0},[pn,G,on.length,pi,q,Xt,ge,Mt]),Yf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&Si(w)&&(Hn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{gn.current?.damage([{cell:i.cell}])})),xn(!0),o(void 0);const[_,N]=A;if(q.current!==void 0&&(_!==0||N!==0)){const X=q.current.cell[1]===pn-1&&w!==void 0,K=q.current.cell[0]===tt.length-1&&w!==void 0;let z=!0;if(X&&N===1&&pe!==void 0){z=!1;const U=q.current.cell[0]+_,J=di(U);vr(J??U,!1)}if(K&&_===1&&et!==void 0){z=!1;const U=q.current.cell[1]+N;Io(U,!1)}z&&wr(zn(q.current.cell[0]+_,0,tt.length-1),zn(q.current.cell[1]+N,0,pn-1),X,!1)}P?.(w,A)},[i?.cell,xn,q,P,Hn,pn,wr,tt.length,vr,Io,pe,et,di]),jf=f.useMemo(()=>`gdg-overlay-${av++}`,[]),zr=f.useCallback(w=>{xn();const A=[];for(let _=w.x;_<w.x+w.width;_++)for(let N=w.y;N<w.y+w.height;N++){const X=x([_-G,N]);if(!X.allowOverlay&&X.kind!==Z.Boolean)continue;let K;if(X.kind===Z.Custom){const z=Jt(X),U=z?.provideEditor?.({...X,location:[_-G,N]});z?.onDelete!==void 0?K=z.onDelete(X):jg(U)&&(K=U?.deletedValue?.(X))}else(Si(X)&&X.allowOverlay||X.kind===Z.Boolean)&&(K=Jt(X)?.onDelete?.(X));K!==void 0&&!Mi(K)&&Si(K)&&A.push({location:[_,N],value:K})}Hn(A),gn.current?.damage(A.map(_=>({cell:_.location})))},[xn,x,Jt,Hn,G]),$i=i!==void 0,Is=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},_={didMatch:!1},{bounds:N}=w,X=q.columns,K=q.rows,z=er;if(!$i&&rt(z.clear,w,_))ge(Uo,!1),Bt?.();else if(!$i&&rt(z.selectAll,w,_))ge({columns:Qe.empty(),rows:Qe.empty(),current:{cell:q.current?.cell??[G,0],range:{x:G,y:0,width:v.length,height:ze},rangeStack:[]}},!1);else if(rt(z.search,w,_))l?.current?.focus({preventScroll:!0}),Pr(!0);else if(rt(z.delete,w,_)){const nt=Ut?.(q)??!0;if(nt!==!1){const yt=nt===!0?q:nt;if(yt.current!==void 0){zr(yt.current.range);for(const Ct of yt.current.rangeStack)zr(Ct)}for(const Ct of yt.rows)zr({x:G,y:Ct,width:v.length,height:1});for(const Ct of yt.columns)zr({x:Ct,y:0,width:1,height:ze})}}if(_.didMatch)return A(),!0;if(q.current===void 0)return!1;let[U,J]=q.current.cell;const[,ie]=q.current.cell;let ye=!1,Rt=!1;if(rt(z.scrollToSelectedCell,w,_))Po.current(U-G,J);else if(ne!=="none"&&rt(z.selectColumn,w,_))X.hasIndex(U)?qe(X.remove(U),void 0,!0):ne==="single"?qe(Qe.fromSingleSelection(U),void 0,!0):qe(void 0,U,!0);else if(ve!=="none"&&rt(z.selectRow,w,_))K.hasIndex(J)?lt(K.remove(J),void 0,!0):ve==="single"?lt(Qe.fromSingleSelection(J),void 0,!0):lt(void 0,J,!0);else if(!$i&&N!==void 0&&rt(z.activateCell,w,_))if(J===ze&&_t)window.setTimeout(()=>{const nt=di(U);vr(nt??U)},0);else{const nt={inputType:"keyboard",key:w.key};k?.([U-G,J],nt),ci(N,nt)}else q.current.range.height>1&&rt(z.downFill,w,_)?Ms():q.current.range.width>1&&rt(z.rightFill,w,_)?ks():rt(z.goToNextPage,w,_)?J+=Math.max(1,Qt.current.height-4):rt(z.goToPreviousPage,w,_)?J-=Math.max(1,Qt.current.height-4):rt(z.goToFirstCell,w,_)?(o(void 0),J=0,U=0):rt(z.goToLastCell,w,_)?(o(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):rt(z.selectToFirstCell,w,_)?(o(void 0),Wn([-2,-2])):rt(z.selectToLastCell,w,_)?(o(void 0),Wn([2,2])):$i?(rt(z.closeOverlay,w,_)&&o(void 0),rt(z.acceptOverlayDown,w,_)&&(o(void 0),J++),rt(z.acceptOverlayUp,w,_)&&(o(void 0),J--),rt(z.acceptOverlayLeft,w,_)&&(o(void 0),U--),rt(z.acceptOverlayRight,w,_)&&(o(void 0),U++)):(rt(z.goDownCell,w,_)?J+=1:rt(z.goUpCell,w,_)?J-=1:rt(z.goRightCell,w,_)?U+=1:rt(z.goLeftCell,w,_)?U-=1:rt(z.goDownCellRetainSelection,w,_)?(J+=1,ye=!0):rt(z.goUpCellRetainSelection,w,_)?(J-=1,ye=!0):rt(z.goRightCellRetainSelection,w,_)?(U+=1,ye=!0):rt(z.goLeftCellRetainSelection,w,_)?(U-=1,ye=!0):rt(z.goToLastRow,w,_)?J=ze-1:rt(z.goToFirstRow,w,_)?J=Number.MIN_SAFE_INTEGER:rt(z.goToLastColumn,w,_)?U=Number.MAX_SAFE_INTEGER:rt(z.goToFirstColumn,w,_)?U=Number.MIN_SAFE_INTEGER:(Ne==="rect"||Ne==="multi-rect")&&(rt(z.selectGrowDown,w,_)?Wn([0,1]):rt(z.selectGrowUp,w,_)?Wn([0,-1]):rt(z.selectGrowRight,w,_)?Wn([1,0]):rt(z.selectGrowLeft,w,_)?Wn([-1,0]):rt(z.selectToLastRow,w,_)?Wn([0,2]):rt(z.selectToFirstRow,w,_)?Wn([0,-2]):rt(z.selectToLastColumn,w,_)?Wn([2,0]):rt(z.selectToFirstColumn,w,_)&&Wn([-2,0])),Rt=_.didMatch);if(Bn!==void 0&&Bn!=="normal"&&J!==ie){const nt=Bn==="skip-up"||Bn==="skip"||Bn==="block",yt=Bn==="skip-down"||Bn==="skip"||Bn==="block",Ct=J<ie;if(Ct&&nt){for(;J>=0&&Ar(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!Ct&&yt){for(;J<ze&&Ar(J).isGroupHeader;)J++;J>=ze&&(J=ie)}}const Ke=wr(U,J,!1,ye),ut=_.didMatch;return ut&&(Ke||!Rt||Sn)&&A(),ut}
172,[Bn,$i,q,er,ne,ve,Ne,G,Ar,ze,wr,ge,Bt,v.length,Ut,Sn,zr,qe,lt,_t,di,vr,k,ci,Ms,ks,Wn]),Ni=f.useCallback(w=>{let A=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-G,w.location[1]]},cancel:()=>{A=!0}}),A||Is(w)||q.current===void 0)return;const[_,N]=q.current.cell,X=Qt.current;if(Se&&!w.metaKey&&!w.ctrlKey&&q.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&xi(x([_-G,Math.max(0,Math.min(N,ze-1))]))){if((!_t||N!==ze)&&(X.y>N||N>X.y+X.height||X.x>_||_>X.x+X.width))return;const K={inputType:"keyboard",key:w.key};k?.([_-G,N],K),ci(w.bounds,K,w.key),w.stopPropagation(),w.preventDefault()}},[Se,Y,Is,q,x,G,ze,_t,k,ci]),qf=f.useCallback((w,A)=>{const _=w.location[0]-G;if(w.kind==="header"&&oe?.(_,{...w,preventDefault:A}),w.kind===Xn){if(_<0)return;re?.(_,{...w,preventDefault:A})}if(w.kind==="cell"){const[N,X]=w.location;W?.([_,X],{...w,preventDefault:A}),jp(q,w.location)||wr(N,X,!1,!1)}},[q,W,re,oe,G,wr]),Ga=f.useCallback(async w=>{if(!er.paste)return;function A(z,U,J,ie){const ye=typeof J=="object"?J?.join(` 173`)??"":J?.toString()??"";if(!Mi(z)&&xi(z)&&z.readonly!==!0){const Rt=I?.(ye,z);if(Rt!==void 0&&Si(Rt))return{location:U,value:Rt};const Je=Jt(z);if(Je===void 0)return;if(Je.kind===Z.Custom){On(z.kind===Z.Custom);const Ke=Je.onPaste?.(ye,z.data);return Ke===void 0?void 0:{location:U,value:{...z,data:Ke}}}else{const Ke=Je.onPaste?.(ye,z,{formatted:ie,formattedString:typeof ie=="string"?ie:ie?.join(` 174`),rawValue:J});return Ke===void 0?void 0:(On(Ke.kind===z.kind),{location:U,value:Ke})}}}const _=q.columns,N=q.rows,X=Ht.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let K;if(q.current!==void 0?K=[q.current.range.x,q.current.range.y]:_.length===1?K=[_.first()??0,0]:N.length===1&&(K=[G,N.first()??0]),X&&K!==void 0){let z,U;const J="text/plain",ie="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const ut of Ke){if(ut.types.includes(ie)){const yt=await(await ut.getType(ie)).text(),Ct=xu(yt);if(Ct!==void 0){z=Ct;break}}ut.types.includes(J)&&(U=await(await ut.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(w!==void 0&&w?.clipboardData!==null){if(w.clipboardData.types.includes(ie)){const Ke=w.clipboardData.getData(ie);z=xu(Ke)}z===void 0&&w.clipboardData.types.includes(J)&&(U=w.clipboardData.getData(J))}else return;const[ye,Rt]=K,Je=[];do{if(Pe===void 0){const Ke=Tn(K),ut=U??z?.map(yt=>yt.map(Ct=>Ct.rawValue).join(" ")).join(" ")??"",nt=A(Ke,K,ut,void 0);nt!==void 0&&Je.push(nt);break}if(z===void 0){if(U===void 0)return;z=U0(U)}if(Pe===!1||typeof Pe=="function"&&Pe?.([K[0]-G,K[1]],z.map(Ke=>Ke.map(ut=>ut.rawValue?.toString()??"")))!==!0)return;for(const[Ke,ut]of z.entries()){if(Ke+Rt>=ze)break;for(const[nt,yt]of ut.entries()){const Ct=[nt+ye,Ke+Rt],[mi,Wi]=Ct;if(mi>=tt.length||Wi>=pn)continue;const Ui=Tn(Ct),nr=A(Ui,Ct,yt.rawValue,yt.formatted);nr!==void 0&&Je.push(nr)}}}while(!1);Hn(Je),gn.current?.damage(Je.map(Ke=>({cell:Ke.location})))}},[I,Jt,Tn,q,er.paste,Ht,tt.length,Hn,pn,Pe,G,ze]);kn("paste",Ga,d,!1,!0);const Bi=f.useCallback(async(w,A)=>{if(!er.copy)return;const _=A===!0||Ht.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,N=q.columns,X=q.rows,K=(z,U)=>{if(!we)Mu(z,U,w);else{const J=U.map(ie=>({kind:Z.Text,data:v[ie].title,displayData:v[ie].title,allowOverlay:!1}));Mu([J,...z],U,w)}};if(_&&ee!==void 0){if(q.current!==void 0){let z=ee(q.current.range,$.current.signal);typeof z!="object"&&(z=await z()),K(z,Mr(q.current.range.x-G,q.current.range.x+q.current.range.width-G))}else if(X!==void 0&&X.length>0){const U=[...X].map(J=>{const ie=ee({x:G,y:J,width:v.length,height:1},$.current.signal);return typeof ie=="object"?ie[0]:ie().then(ye=>ye[0])});if(U.some(J=>J instanceof Promise)){const J=await Promise.all(U);K(J,Mr(v.length))}else K(U,Mr(v.length))}else if(N.length>0){const z=[],U=[];for(const J of N){let ie=ee({x:J,y:0,width:1,height:ze},$.current.signal);
174typeof ie!="object"&&(ie=await ie()),z.push(ie),U.push(J-G)}if(z.length===1)K(z[0],U);else{const J=z.reduce((ie,ye)=>ie.map((Rt,Je)=>[...Rt,...ye[Je]]));K(J,U)}}}},[v,ee,q,er.copy,G,Ht,ze,we]);kn("copy",Bi,d,!1,!1);const Kf=f.useCallback(async w=>{if(!(!er.cut||!(Ht.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Bi(w),q.current!==void 0)){let _={current:{cell:q.current.cell,range:q.current.range,rangeStack:[]},rows:Qe.empty(),columns:Qe.empty()};const N=Ut?.(_);if(N===!1||(_=N===!0?_:N,_.current===void 0))return;zr(_.current.range)}},[zr,q,er.cut,Bi,Ht,Ut]);kn("cut",Kf,d,!1,!1);const Zf=f.useCallback((w,A)=>{if(fe!==void 0){G!==0&&(w=w.map(X=>[X[0]-G,X[1]])),fe(w,A);return}if(w.length===0||A===-1)return;const[_,N]=w[A];c.current!==void 0&&c.current[0]===_&&c.current[1]===N||(c.current=[_,N],wr(_,N,!1,!1))},[fe,G,wr]),[Do,Oo]=It?.current?.cell??[],Po=f.useRef(Xt);Po.current=Xt,f.useLayoutEffect(()=>{Ua.current&&!Fr.current&&Do!==void 0&&Oo!==void 0&&(Do!==ce.current?.current?.cell[0]||Oo!==ce.current?.current?.cell[1])&&Po.current(Do,Oo),Fr.current=!1},[Do,Oo]);const Es=q.current!==void 0&&(q.current.cell[0]>=tt.length||q.current.cell[1]>=pn);f.useLayoutEffect(()=>{Es&&ge(Uo,!1)},[Es,ge]);const Jf=f.useMemo(()=>_t===!0&&De?.tint===!0?Qe.fromSingleSelection(pn-1):Qe.empty(),[pn,_t,De?.tint]),Qf=f.useCallback(w=>typeof nn=="boolean"?nn:nn?.(w-G)??!0,[G,nn]),eh=f.useMemo(()=>{if(za===void 0||a.current===null)return null;const{bounds:w,group:A}=za,_=a.current.getBoundingClientRect();return f.createElement(L0,{bounds:w,group:A,canvasBounds:_,onClose:()=>Va(void 0),onFinish:N=>{Va(void 0),se?.(A,N)}})},[se,za]),th=Math.min(tt.length,He+(En?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>vr(w+G,A),appendColumn:(w,A)=>Io(w,A),updateCells:w=>(G!==0&&(w=w.map(A=>({cell:[A.cell[0]+G,A.cell[1]]}))),gn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Ht?.current===null)){if(w===void 0&&A===void 0){const _=a.current.getBoundingClientRect(),N=_.width/Ht.current.clientWidth;return{x:_.x-Ht.current.scrollLeft*N,y:_.y-Ht.current.scrollTop*N,width:Ht.current.scrollWidth*N,height:Ht.current.scrollHeight*N}}return gn.current?.getBounds((w??0)+G,A)}},focus:()=>gn.current?.focus(),emit:async w=>{switch(w){case"delete":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Bi(void 0,!0);break;case"paste":await Ga();break}},scrollTo:Xt,remeasureColumns:w=>{for(const A of w)Eo(A+G)},getMouseArgsForPosition:(w,A,_)=>{if(gn?.current===null)return;const N=gn.current.getMouseArgsForPosition(w,A,_);if(N!==void 0)return{...N,location:[N.location[0]-G,N.location[1]]}}}),[vr,Io,Eo,Ht,Bi,Ni,Ga,G,Xt]);const[Ts,Ds]=pi??[],nh=f.useCallback(w=>{const[A,_]=w;if(_===-1){ne!=="none"&&(qe(Qe.fromSingleSelection(A),void 0,!1),xn());return}Ts===A&&Ds===_||(Mt({cell:w,range:{x:A,y:_,width:1,height:1}},!0,!1,"keyboard-nav"),Xt(A,_))},[ne,xn,Xt,Ts,Ds,Mt,qe]),[rh,ih]=f.useState(!1),Os=f.useRef(Tc(w=>{ih(w)},5)),oh=f.useCallback(()=>{Os.current(!0),q.current===void 0&&q.columns.length===0&&q.rows.length===0&&s===void 0&&Mt({cell:[G,So],range:{x:G,y:So,width:1,height:1}},!0,!1,"keyboard-select")},[So,q,s,G,Mt]),ah=f.useCallback(()=>{Os.current(!1)},[]),[lh,sh]=f.useMemo(()=>{let w;const A=bt?.scrollbarWidthOverride??wl(),_=ze+(_t?1:0);if(typeof Qn=="number")w=hn+_*Qn;else{let X=0;const K=Math.min(_,10);for(let z=0;z<K;z++)X+=Qn(z);X=Math.floor(X/K),w=hn+_*X}w+=A;const N=tt.reduce((X,K)=>K.width+X,0)+A;return[`${Math.min(1e5,N)}px`,`${Math.min(1e5,w)}px`]},[tt,bt?.scrollbarWidthOverride,Qn,ze,_t,hn]),uh=f.useMemo(()=>sm(st),[st]);return f.createElement(sd.Provider,{value:st},f.createElement(j0,{style:uh,className:j,inWidth:m??lh,inHeight:y??sh},f.createElement(T0,{fillHandle:Ot,drawFocusRing:Jn,experimental:bt,fixedShadowX:wn,fixedShadowY:or,getRowThemeOverride:Or,headerIcons:Kn,imageWindowLoader:B,initialSize:We,isDraggable:je,onDragLeave:Pt,onRowMoved:Kt,overscrollX:Ta,overscrollY:Da,preventDiagonalScrolling:yn,r
174ightElement:Gt,rightElementProps:Cn,smoothScrollX:qr,smoothScrollY:Kr,className:j,enableGroups:An,onCanvasFocused:oh,onCanvasBlur:ah,canvasRef:a,onContextMenu:qf,theme:st,cellXOffset:Lf,cellYOffset:So,accessibilityHeight:ur.height,onDragEnd:Gf,columns:tt,nonGrowWidth:Lt,drawHeader:vt,onColumnProposeMove:Bf,drawCell:un,disabledRows:Jf,freezeColumns:th,lockColumns:G,firstColAccessible:G===0,getCellContent:Tn,minColumnWidth:gr,maxColumnWidth:oi,searchInputRef:l,showSearch:Pa,onSearchClose:li,highlightRegions:Ff,getCellsForSelection:ee,getGroupDetails:Fa,headerHeight:Ai,isFocused:rh,groupHeaderHeight:An?Co:0,freezeTrailingRows:mt+(_t&&De?.sticky===!0?1:0),hasAppendRow:_t,onColumnResize:Xe,onColumnResizeEnd:Me,onColumnResizeStart:Ze,onCellFocused:nh,onColumnMoved:Wf,onDragStart:Uf,onHeaderMenuClick:Vf,onHeaderIndicatorClick:$f,onItemHovered:Wa,isFilling:s?.fillHandle===!0,onMouseMove:zf,onKeyDown:Ni,onKeyUp:te,onMouseDown:_f,onMouseUp:Hf,onDragOverCell:cn,onDrop:$t,onSearchResultsChanged:Zf,onVisibleRegionChanged:Nf,clientSize:At,rowHeight:Qn,searchResults:ue,searchValue:L,onSearchValueChange:H,rows:pn,scrollRef:Ht,selection:q,translateX:ur.tx,translateY:ur.ty,verticalBorder:Qf,gridRef:gn,getCellRenderer:Jt,resizeIndicator:ei}),eh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(ov,{...i,validateCell:Te,bloom:D,id:jf,getCellRenderer:Jt,className:bt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:Mn,imageEditorOverride:g,portalElementRef:fn,onFinishEditing:Yf,markdownDivCreateNode:p,isOutsideClick:Qr,customEventTarget:bt?.eventTarget}))))},uv=f.forwardRef(sv);function Eu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:l,height:a,x:s,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=Bc(c,a,o.cellVerticalPadding),h=Nc(t.contentAlign??"center",s,l,o.cellHorizontalPadding,g),p=$c(h,d,g),m=Wc(s+n,u+r,p);return Hl(t)&&m}const cv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>dv(e,e.cell.data,Hl(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Eu(e)&&e.preventDefault()},onClick:e=>{if(Eu(e))return{...e.cell,data:xd(e.cell.data)}},onPaste:(e,t)=>{let n=oa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Al),n===t.data?void 0:{...t,data:n}}};function dv(e,t,n,r,i){if(!n&&t===oa)return;const{ctx:o,hoverAmount:l,theme:a,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:y}=s;let v=!1;if(i>0){let b=n?1-i+i*l:.4;if(t===oa&&(b*=l),b===0)return;b<1&&(v=!0,o.globalAlpha=b)}jl(o,a,t,h,p,m,y,u,c,d,r,g),v&&(o.globalAlpha=1)}const fv=dn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),hv=e=>{const{bubbles:t}=e;return f.createElement(fv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},gv={getAccessibilityString:e=>Uc(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>pv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(hv,{bubbles:t.data})},onPaste:()=>{}};function pv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:l,y:a,width:s,height:u}=n;let c=l+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>l+s)break;const h=Er(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)jn(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+qn(i,r))}const mv=dn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),vv=e=>{const{drilldowns:t}=e;return f.createElement(mv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},bv={getAccessibilityString:e=>Uc(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n
174)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>yv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(vv,{drilldowns:t.data})},onPaste:()=>{}},il={};function wv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,l=n-o*2,a=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(il[g]!==void 0)return{el:il[g],height:s,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),p=h.getContext("2d");return p===null?null:(h.width=d,h.height=s,p.scale(i,i),il[g]=h,p.beginPath(),jn(p,o,o,c,l,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),jn(p,o+.5,o+.5,c,l,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:s,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function yv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:l,row:a}=e,{x:s,width:u}=n,c=r.baseFontFull,d=Ul(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,y=r.bubbleMargin;let v=s+r.cellHorizontalPadding;const b=r.roundingRadius??6,x=wv(r.bgCell,r.drilldownBorder,g,b),T=[];for(const k of t){if(v>s+u)break;const P=Er(k.text,i,c).width;let I=0;k.img!==void 0&&o.loadOrGetImage(k.img,l,a)!==void 0&&(I=p-8+4);const C=P+I+m*2;T.push({x:v,width:C}),v+=C+y}if(x!==null){const{el:k,height:R,middleWidth:P,sideWidth:I,width:C,dpr:F,padding:D}=x,S=I/F,E=D/F;for(const O of T){const M=Math.floor(O.x),V=Math.floor(O.width),W=V-(S-E)*2;i.imageSmoothingEnabled=!1,i.drawImage(k,0,0,I,R,M-E,h,S,g),W>0&&i.drawImage(k,I,0,P,R,M+(S-E),h,W,g),i.drawImage(k,C-I,0,I,R,M+V-(S-E),h,S,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[k,R]of T.entries()){const P=t[k];let I=R.x+m;if(P.img!==void 0){const C=o.loadOrGetImage(P.img,l,a);if(C!==void 0){const F=p-8;let D=0,S=0,E=C.width,O=C.height;E>O?(D+=(E-O)/2,E=O):O>E&&(S+=(O-E)/2,O=E),i.beginPath(),jn(i,I,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(C,D,S,E,O,I,h+g/2-F/2,F,F),i.restore(),I+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,I,h+g/2+qn(i,r))}}const Cv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Sv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??bp;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},ol=4;function Sv(e,t,n,r){const{rect:i,col:o,row:l,theme:a,ctx:s,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,p=g-a.cellVerticalPadding*2,m=[];let y=0;for(let b=0;b<t.length;b++){const x=t[b];if(x.length===0)continue;const T=u.loadOrGetImage(x,o,l);if(T!==void 0){m[b]=T;const k=T.width*(p/T.height);y+=k+ol}}if(y===0)return;y-=ol;let v=c+a.cellHorizontalPadding;r==="right"?v=Math.floor(c+h-a.cellHorizontalPadding-y):r==="center"&&(v=Math.floor(c+h/2-y/2));for(const b of m){if(b===void 0)continue;const x=b.width*(p/b.height);n>0&&(s.beginPath(),jn(s,v,d+a.cellVerticalPadding,x,p,n),s.save(),s.clip()),s.drawImage(b,v,d+a.cellVerticalPadding,x,p),n>0&&s.restore(),v+=x+ol}}function xv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const kv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(xv(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+s*2>=o.width&&(a=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*l.cellVerticalPadding);jn(i,o.x+s,o.y+(o.height-u)/2,a,u,l.roundingRadius??3),i.fillStyle=Ur(l.textDark,.1),i.fill()},onPaste:()=>{}},Mv=()=>e=>e.targetWidth,Tu=dn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Mv(),"px"]}}),Rv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:l,validatedSelection:a}=e,s=t.data,u=t.readonly===!0,[c,d]=f.useState(s===""||r),g=f.useCallback(()=>{d(p=>!p)},[]),h=s?"gdg-ml-6":"";return c?f.createElement(Tu,{targetWidth:o.width-20},f.createElement(Yr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t)},f.createElement(dp,null))):f.createElement(Tu,{targetWidth:o.width},f.createElement(Hp,{contents:s,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Vl,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Iv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:wo,measure:(e,t,n
174)=>{const r=t.data.split(` 175`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>rr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:l,validatedSelection:a}=e;return f.createElement(Rv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ev={getAccessibilityString:e=>e.row.toString(),kind:Vn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Tv,measure:()=>44,draw:e=>Ov(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:l}=t,a=n.drawHandle?7+(o-7)/2:o/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Tv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Dv,n.textAlign="center",o}function Dv(e){const{ctx:t}=e;t.textAlign="start"}function Ov(e,t,n,r,i,o){const{ctx:l,rect:a,hoverAmount:s,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){l.globalAlpha=p;const m=7*(n?s:1);if(jl(l,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){l.globalAlpha=s,l.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])l.rect(c+y,d+h/2+v,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,v=c+g/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=u.textLight,l.font=y,l.fillText(m,v,d+h/2+qn(l,y)),s!==0&&(l.globalAlpha=1)}}const Pv={getAccessibilityString:()=>"",kind:Vn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Lv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Lv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:l,spriteManager:a}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=s+8/2,v=u+8/2;a.drawSprite(n,"normal",r,y,v,m,l,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,v=l.cellHorizontalPadding+4;m>0&&(r.moveTo(s+v+y,u+d/2),r.lineTo(s+v+y+m,u+d/2),r.moveTo(s+v+y+m*.5,u+d/2-m*.5),r.lineTo(s+v+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,h+s+l.cellHorizontalPadding+.5,u+d/2+qn(r,l)),r.beginPath()}function Rd(e,t,n,r,i,o,l){e.textBaseline="alphabetic";const a=Fv(e,i,r,t,n?.fullSize??!1);e.beginPath(),jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Ur(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l?.("text")}function Fv(e,t,n,r,i){const o=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+l/2+1,width:t.width-o,height:t.height-l-1};const a=Er(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,u=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const _v=f.lazy(async()=>await Fl(()=>import("./number-overlay-editor.DPA2PLb4.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Av={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:wo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:u}=n;a===!0&&t>0&&Rd(r,i,u,s,o,t,l),rr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(_v,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thous
175andSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},Hv={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:zv,onPaste:()=>{}};function zv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:l}=r;t.beginPath();const a=2.5;let s=i+n.cellHorizontalPadding+a;const u=o+l/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(s,u-a),t.lineTo(s,u+a),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Vv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>wo(e,t,e.theme.textLight),draw:e=>rr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return zt.createElement(Yr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:wo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Rd(i,l,g,s,o,n,a),rr(e,s,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(` 176`,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Yr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:l=>r({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Nv=dn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Bv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:l}=e,[a,s]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{s(!0)},[]);return a?f.createElement(Yr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Nv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Vl,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Id(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-l-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-l/2),{x:i,y:o,width:l,height:a}}function Du(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=nd(l,o.baseFontFull);if(a===void 0)return!1;const s=Id(a,n,o,t.contentAlign);return Wr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const Wv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:wo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:l,ctx:a}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Er(s,a,n.baseFontFull),d=Id(c,l,n,t.contentAlign),{x:g,y:h,width:p,height:m}=d;if(i>=g-4&&i<=g-4+p+8&&o>=h-4&&o<=h-4+m+8){const y=qn(a,n.baseFontFull);r("pointer");const v=5,b=h-y;a.beginPath(),a.moveTo(l.x+g,Math.floor(l.y+b+m+v)+.5),a.lineTo(l.x+g+p,Math.floor(l.y+b+m+v)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,rr({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),rr({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),rr({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),rr({...e,rect:{...l,x:l.x+2}}
176,s,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,rr(e,s,t.contentAlign)},onSelect:e=>{Du(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Du(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(Bv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Uv=[Ev,Pv,cv,gv,bv,Cv,kv,Iv,Av,Hv,Vv,$v,Wv],al=[];class Gv extends od{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Sg(()=>{this.imageLoaded(new so(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const l=r.cells[o];
176if(this.isInWindow(l)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const l=al.pop()??new Image;let a=!1;const s={img:void 0,cells:[Yn(n,r)],url:t,cancel:()=>{a||(a=!0,al.length<12?al.unshift(l):o||(l.src=""))}},u=new Promise(c=>l.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{l.src=t,await u,await l.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=l;for(const d of c.cells)this.loadedLocations.push(Yl(d));o=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[i]=s}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const l=Yn(n,r);return o.cells.includes(l)||o.cells.push(l),o.img}else this.loadImage(t,n,r,i)}}const Xv=(e,t)=>{const n=f.useMemo(()=>({...Vm,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Uv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Gv,[e.imageWindowLoader]);return f.createElement(uv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Yv=f.forwardRef(Xv);function Ed(e,t){const n=f.useRef(),r=f.useRef(e);f.useEffect(()=>{r.current=e},[e]);const{clear:i,restart:o}=ra(()=>{n.current&&(r.current(...n.current),n.current=void 0)},t,{autoStart:!1}),l=f.useCallback(()=>{i(),n.current=void 0},[i]);return{debouncedCallback:f.useCallback((...s)=>{n.current=s,o()},[o]),cancel:l}}var Qo={exports:{}};var jv=Qo.exports,Ou;function qv(){return Ou||(Ou=1,(function(e,t){(function(n,r){try{e.exports=r(vg)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(jv,function(n){var r=!1,i=!1,o=!1,l=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,L){return L.length>H.length?!1:H.indexOf(L)!==-1}function c(H){for(var L="";H;)L+="0",H-=1;return L}function d(H){for(var L=H.split("").reverse(),Y=0,te=!0;te&&Y<L.length;)Y?L[Y]==="9"?L[Y]="0":(L[Y]=(parseInt(L[Y],10)+1).toString(),te=!1):(parseInt(L[Y],10)<5&&(te=!1),L[Y]="0"),Y+=1;return te&&L.push("1"),L.reverse().join("")}function g(H,L){var Y=P(M(L).sort(),function(le){return le+":"+L[le]}).join(","),te=H+"+"+Y;return g.cache[te]||(g.cache[te]=Intl.NumberFormat(H,L)),g.cache[te]}g.cache={};function h(H,L,Y){var te=L.useToLocaleString,le=L.useGrouping,Se=le&&L.grouping.slice(),pe=L.maximumSignificantDigits,et=L.minimumIntegerDigits||1,ke=L.fractionDigits||0,Dt=L.groupingSeparator,dt=L.decimalSeparator;if(te&&Y){var Ne={minimumIntegerDigits:et,useGrouping:le};if(ke&&(Ne.maximumFractionDigits=ke,Ne.minimumFractionDigits=ke),pe&&H>0&&(Ne.maximumSignificantDigits=pe),o){if(!l){var ne=O({},L);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return g(Y,Ne).format(H)}else{if(!i){var ne=O({},L);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return H.toLocaleString(Y,Ne)}}var ve;pe?ve=H.toPrecision(pe+1):ve=H.toFixed(ke+1);var me,he,Ce,Ae=ve.split("e");Ce=Ae[1]||"",Ae=Ae[0].split("."),he=Ae[1]||"",me=Ae[0]||"";var Oe=me.length,at=he.length,Pe=Oe+at,we=me+he;(pe&&Pe===pe+1||!pe&&at===ke+1)&&(we=d(we),we.length===Pe+1&&(Oe=Oe+1),at&&(we=we.slice(0,-1)),me=we.slice(0,Oe),he=we.slice(Oe)),pe&&(he=he.replace(/0*$/,""));var He=parseInt(Ce,10);He>0?he.length<=He?(he=he+c(He-he.length),me=me+he,he=""):(me=me+he.slice(0,He),he=he.slice(He)):He<0&&(he=c(Math.abs(He)-me.length)+me+he,me="0"),pe||(he=he.slice(0,ke),he.length<ke&&(he=he+c(ke-he.length)),me.length<et&&(me=c(et-me.length)+me));var Re="";if(le){Ae=me;for(var Be;Ae.length;)Se.length&&(Be=Se.shift()),Re&&(Re=Dt+Re),Re=Ae.slice(-Be)+Re,Ae=Ae.slice(0,-Be)}else Re=me;return he&&(Re=Re+dt+he),Re}function p(H,L){return H.label.length>L.label.length?-1:H.label.length<L.label.length?1:0}function m(H,L){var Y=[];return R(M(L),function(te){if(te.slice(0,15)==="_durationLabels"){var le=te.slice(15).toLowerCase();R(M(L[te]),function(Se){Se.slice(0,1)===H&&Y.push({type:le,key:Se,label:L[te][Se]})})}}),Y}function y(H,L,Y){return L===1&&Y===null?H:H+H}var v={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"}
176,durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:y};function b(H){return Object.prototype.toString.call(H)==="[object Array]"}function x(H){return Object.prototype.toString.call(H)==="[object Object]"}function T(H,L){for(var Y=H.length;Y-=1;)if(L(H[Y]))return H[Y]}function k(H,L){var Y=0,te=H&&H.length||0,le;for(typeof L!="function"&&(le=L,L=function(Se){return Se===le});Y<te;){if(L(H[Y]))return H[Y];Y+=1}}function R(H,L){var Y=0,te=H.length;if(!(!H||!te))for(;Y<te;){if(L(H[Y],Y)===!1)return;Y+=1}}function P(H,L){var Y=0,te=H.length,le=[];if(!H||!te)return le;for(;Y<te;)le[Y]=L(H[Y],Y),Y+=1;return le}function I(H,L){return P(H,function(Y){return Y[L]})}function C(H){var L=[];return R(H,function(Y){Y&&L.push(Y)}),L}function F(H){var L=[];return R(H,function(Y){k(L,Y)||L.push(Y)}),L}function D(H,L){var Y=[];return R(H,function(te){R(L,function(le){te===le&&Y.push(te)})}),F(Y)}function S(H,L){var Y=[];return R(H,function(te,le){if(!L(te))return Y=H.slice(le),!1}),Y}function E(H,L){var Y=H.slice().reverse();return S(Y,L).reverse()}function O(H,L){for(var Y in L)L.hasOwnProperty(Y)&&(H[Y]=L[Y]);return H}function M(H){var L=[];for(var Y in H)H.hasOwnProperty(Y)&&L.push(Y);return L}function V(H,L){var Y=0,te=H.length;if(!H||!te)return!1;for(;Y<te;){if(L(H[Y],Y)===!0)return!0;Y+=1}return!1}function W(H){var L=[];return R(H,function(Y){L=L.concat(Y)}),L}function j(){var H=0;try{H.toLocaleString("i")}catch(L){return L.name==="RangeError"}return!1}function oe(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function Q(H){var L=!0;return L=L&&H(1,"en",{minimumIntegerDigits:1})==="1",L=L&&H(1,"en",{minimumIntegerDigits:2})==="01",L=L&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!L||(L=L&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",L=L&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",L=L&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",L=L&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!L)||(L=L&&H(99.99,"en",{maximumSignificantDigits:1})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:2})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:3})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",L=L&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!L)||(L=L&&H(1e3,"en",{useGrouping:!0})==="1,000",L=L&&H(1e3,"en",{useGrouping:!1})==="1000",!L))}function re(){var H=[].slice.call(arguments),L={},Y;if(R(H,function(pe,et){if(!et){if(!b(pe))throw"Expected array as the first argument to durationsFormat.";Y=pe}
176if(typeof pe=="string"||typeof pe=="function"){L.template=pe;return}if(typeof pe=="number"){L.precision=pe;return}x(pe)&&O(L,pe)}),!Y||!Y.length)return[];L.returnMomentTypes=!0;var te=P(Y,function(pe){return pe.format(L)}),le=D(a,F(I(W(te),"type"))),Se=L.largest;return Se&&(le=le.slice(0,Se)),L.returnMomentTypes=!1,L.outputTypes=le,P(Y,function(pe){return pe.format(L)})}function se(){var H=[].slice.call(arguments),L=O({},this.format.defaults),Y=this.asMilliseconds(),te=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(Y=0,te=0);var le=Y<0,Se=n.duration(Math.abs(Y),"milliseconds"),pe=n.duration(Math.abs(te),"months");R(H,function(B){if(typeof B=="string"||typeof B=="function"){L.template=B;return}if(typeof B=="number"){L.precision=B;return}x(B)&&O(L,B)});var et={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},ke={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};L.types=a;var Dt=function(B){return k(a,function(We){return ke[We].test(B)})},dt=new RegExp(P(a,function(B){return ke[B].source}).join("|"),"g");L.duration=this;var Ne=typeof L.template=="function"?L.template.apply(L):L.template,ne=L.outputTypes,ve=L.returnMomentTypes,me=L.largest,he=[];ne||(b(L.stopTrim)&&(L.stopTrim=L.stopTrim.join("")),L.stopTrim&&R(L.stopTrim.match(dt),function(B){var We=Dt(B);We==="escape"||We==="general"||he.push(We)}));var Ce=n.localeData();Ce||(Ce={}),R(M(v),function(B){if(typeof v[B]=="function"){Ce[B]||(Ce[B]=v[B]);return}Ce["_"+B]||(Ce["_"+B]=v[B])}),R(M(Ce._durationTimeTemplates),function(B){Ne=Ne.replace("_"+B+"_",Ce._durationTimeTemplates[B])});var Ae=L.userLocale||n.locale(),Oe=L.useLeftUnits,at=L.usePlural,Pe=L.precision,we=L.forceLength,He=L.useGrouping,Re=L.trunc,Be=L.useSignificantDigits&&Pe>0,ft=Be?L.precision:0,ht=ft,Ye=L.minValue,pt=!1,Nt=L.maxValue,St=!1,Tt=L.useToLocaleString,Bt=L.groupingSeparator,qt=L.decimalSeparator,an=L.grouping;Tt=Tt&&(r||o);var It=L.trim;b(It)&&(It=It.join(" ")),It===null&&(me||Nt||Be)&&(It="all"),(It===null||It===!0||It==="left"||It==="right")&&(It="large"),It===!1&&(It="");var gt=function(B){return B.test(It)},Wt=/large/,wt=/small/,ln=/both/,Mn=/mid/,De=/^all|[^sm]all/,mt=/final/,xt=me>0||V([Wt,ln,De],gt),bn=V([wt,ln,De],gt),tn=V([Mn,De],gt),nn=V([mt,De],gt),cn=P(Ne.match(dt),function(B,We){var je=Dt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),je!=="escape"&&je!=="general"&&he.push(je)),{index:We,length:B.length,text:"",token:je==="escape"?B.replace(ke.escape,"$1"):B,type:je==="escape"||je==="general"?null:je}}),$t={index:0,length:0,token:"",text:"",type:null},Zt=[];Oe&&cn.reverse(),R(cn,function(B){if(B.type){($t.type||$t.text)&&Zt.push($t),$t=B;return}Oe?$t.text=B.token+$t.text:$t.text+=B.token}),($t.type||$t.text)&&Zt.push($t),Oe&&Zt.reverse();var Ge=D(a,F(C(I(Zt,"type"))));if(!Ge.length)return I(Zt,"text").join("");Ge=P(Ge,function(B,We){var je=We+1===Ge.length,Pt=!We,Kt;B==="years"||B==="months"?Kt=pe.as(B):Kt=Se.as(B);var rn=Math.floor(Kt),In=Kt-rn,yn=k(Zt,function(Gt){return B===Gt.type});return Pt&&Nt&&Kt>Nt&&(St=!0),je&&Ye&&Math.abs(L.duration.as(B))<Ye&&(pt=!0),Pt&&we===null&&yn.length>1&&(we=!0),Se.subtract(rn,B),pe.subtract(rn,B),{rawValue:Kt,wholeValue:rn,decimalValue:je?In:0,isSmallest:je,isLargest:Pt,type:B,tokenLength:yn.length}});var kt=Re?Math.floor:Math.round,Rn=function(B,We){var je=Math.pow(10,We);return kt(B*je)/je},Ot=!1,bt=!1,wn=function(B,We){var je={useGrouping:He,groupingSeparator:Bt,decimalSeparator:qt,grouping:an,useToLocaleString:Tt};return Be&&(ft<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(je.maximumSignificantDigits=ft,B.significantDigits=ft)),St&&!bt&&(B.isLargest?(B.wholeValue=Nt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),pt&&!bt&&(B.isSmallest?(B.wholeValue=Ye,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Pe<0?B.value=Rn(B.wholeValue,Pe):Pe===0?B.value=kt(B.wholeValue+B.decimalValue):Be?(Re?B.value=Rn(B.rawValue,ft-B.wholeValue.toString().length):B.value=
176B.rawValue,B.wholeValue&&(ft-=B.wholeValue.toString().length)):(je.fractionDigits=Pe,Re?B.value=B.wholeValue+Rn(B.decimalValue,Pe):B.value=B.wholeValue+B.decimalValue):Be&&B.wholeValue?(B.value=Math.round(Rn(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ft-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(we||Ot)&&(je.minimumIntegerDigits=B.tokenLength,bt&&je.maximumSignificantDigits<B.tokenLength&&delete je.maximumSignificantDigits),!Ot&&(B.value>0||It===""||k(he,B.type)||k(ne,B.type))&&(Ot=!0),B.formattedValue=h(B.value,je,Ae),je.useGrouping=!1,je.decimalSeparator=".",B.formattedValueEn=h(B.value,je,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=h(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Ge=P(Ge,wn),Ge=C(Ge),Ge.length>1){var or=function(B){return k(Ge,function(We){return We.type===B})},Kn=function(B){var We=or(B.type);We&&R(B.targets,function(je){var Pt=or(je.type);Pt&&parseInt(We.formattedValueEn,10)===je.value&&(We.rawValue=0,We.wholeValue=0,We.decimalValue=0,Pt.rawValue+=1,Pt.wholeValue+=1,Pt.decimalValue=0,Pt.formattedValueEn=Pt.wholeValue.toString(),bt=!0)})};R(s,Kn)}return bt&&(Ot=!1,ft=ht,Ge=P(Ge,wn),Ge=C(Ge)),ne&&!(St&&!L.trim)?(Ge=P(Ge,function(B){return k(ne,function(We){return B.type===We})?B:null}),Ge=C(Ge)):(xt&&(Ge=S(Ge,function(B){return!B.isSmallest&&!B.wholeValue&&!k(he,B.type)})),me&&Ge.length&&(Ge=Ge.slice(0,me)),bn&&Ge.length>1&&(Ge=E(Ge,function(B){return!B.wholeValue&&!k(he,B.type)&&!B.isLargest})),tn&&(Ge=P(Ge,function(B,We){return We>0&&We<Ge.length-1&&!B.wholeValue?null:B}),Ge=C(Ge)),nn&&Ge.length===1&&!Ge[0].wholeValue&&!(!Re&&Ge[0].isSmallest&&Ge[0].rawValue<Ye)&&(Ge=[])),ve?Ge:(R(Zt,function(B){var We=et[B.type],je=k(Ge,function(Gt){return Gt.type===B.type});if(!(!We||!je)){var Pt=je.formattedValueEn.split(".");Pt[0]=parseInt(Pt[0],10),Pt[1]?Pt[1]=parseFloat("0."+Pt[1],10):Pt[1]=null;var Kt=Ce.durationPluralKey(We,Pt[0],Pt[1]),rn=m(We,Ce),In=!1,yn={};R(Ce._durationLabelTypes,function(Gt){var Cn=k(rn,function(Sn){return Sn.type===Gt.type&&Sn.key===Kt});Cn&&(yn[Cn.type]=Cn.label,u(B.text,Gt.string)&&(B.text=B.text.replace(Gt.string,Cn.label),In=!0))}),at&&!In&&(rn.sort(p),R(rn,function(Gt){if(yn[Gt.type]===Gt.label)return u(B.text,Gt.label)?!1:void 0;if(u(B.text,Gt.label))return B.text=B.text.replace(Gt.label,yn[Gt.type]),!1}))}}),Zt=P(Zt,function(B){if(!B.type)return B.text;var We=k(Ge,function(Pt){return Pt.type===B.type});if(!We)return"";var je="";return Oe&&(je+=B.text),(le&&St||!le&&pt)&&(je+="< ",St=!1,pt=!1),(le&&pt||!le&&St)&&(je+="> ",St=!1,pt=!1),le&&(We.value>0||It===""||k(he,We.type)||k(ne,We.type))&&(je+="-",le=!1),B.type==="milliseconds"&&We.formattedValueMS?je+=We.formattedValueMS:je+=We.formattedValue,Oe||(je+=B.text),je}),Zt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var H=this.duration,L=function(Se){return H._data[Se]},Y=k(this.types,L),te=T(this.types,L);switch(Y){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(Y===te)return"d __";case"weeks":return Y===te?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(Y===te)return"M __";case"years":return Y===te?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function de(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=re,H.duration.fn.format=se,H.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ae,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",v)}var fe=function(H,L,Y){return H.toLocaleString(L,Y)};r=j()&&Q(fe),i=r&&oe(fe);var ue=function(H,L,Y){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(L,Y).format(H)};return o=Q(ue),l=o&&oe(ue),de(n),de})}
176)(Qo)),Qo.exports}qv();const Kv=["true","t","yes","y","on","1"],Zv=["false","f","no","n","off","0"];function Et(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Ti(e){return Object.hasOwn(e,"isError")&&e.isError}function Jv(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Zl(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function El(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function Qv(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Tl(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function Pi(e,t){return Ee(e)?t||{}:Ee(t)?e||{}:vc(e,t)}function Jl(e){if(Ee(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:ot(n)):[ot(t)]}catch{return[ot(e)]}}function Td(e){return typeof e=="string"||e instanceof String?!0:(e instanceof kh&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function eb(e){return e?.startsWith("{")&&e.endsWith("}")}function ot(e){try{try{return xh(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Dd(e){if(Ee(e))return null;if(typeof e=="boolean")return e;const t=ot(e).toLowerCase().trim();if(t==="")return null;if(Kv.includes(t))return!0;if(Zv.includes(t))return!1}function go(e){if(Ee(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=yg.unformat(e.trim());if(ct(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Od(e){return Ee(e)?"":ot(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function fa(e){if(Ee(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return ot(e)}}function Go(e){if(Ee(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Nr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Nr.utc(e);if(n.isValid())return n.toDate();const r=Nr.utc(e,[Nr.HTML5_FMT.TIME_MS,Nr.HTML5_FMT.TIME_SECONDS,Nr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Pd(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function tb(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const nb=new RegExp(/(\r\n|\n|\r)/gm);function po(e){return e.indexOf(` 177`)!==-1?e.replace(nb," "):e}function rb(e,t){if(Ee(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const ib=Ln("div",{target:"ee5ryew0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),Ld=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?Za.parse(e):Za.parse(Za.stringify(e))}catch{n=void 0}return Ee(n)?Ie(Yr,{highlight:!0,autoFocus:!1,disabled:!0,value:fa(e)??"",onChange:()=>{}}):Ie(ib,{"data-testid":"stJsonColumnViewer",children:Ie(Cg,{src:n,collapsed:2,theme:Mh(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})},ob=e=>{const t=e.theme,n=e.value.data;return Ie(Ld,{jsonValue:n.value||n.displayValue,theme:t})},ab=e=>{const t=e.theme,n=e.value;return Ie(Ld,{jsonValue:n.data,theme:t})},lb={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Wl(e,r??fa(n)??"",t.contentAlign),!0}
177,measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??fa(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:ob})};var sb=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Fd(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,l=o===void 0?null:o,a=e.inputValue,s=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,p=ir(e,sb),m=f.useState(a!==void 0?a:n),y=cr(m,2),v=y[0],b=y[1],x=f.useState(s!==void 0?s:i),T=cr(x,2),k=T[0],R=T[1],P=f.useState(h!==void 0?h:l),I=cr(P,2),C=I[0],F=I[1],D=f.useCallback(function(j,oe){typeof u=="function"&&u(j,oe),F(j)},[u]),S=f.useCallback(function(j,oe){var Q;typeof c=="function"&&(Q=c(j,oe)),b(Q!==void 0?Q:j)},[c]),E=f.useCallback(function(){typeof g=="function"&&g(),R(!0)},[g]),O=f.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),M=a!==void 0?a:v,V=s!==void 0?s:k,W=h!==void 0?h:C;return Fe(Fe({},p),{},{inputValue:M,menuIsOpen:V,onChange:D,onInputChange:S,onMenuClose:O,onMenuOpen:E,value:W})}function ub(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const cb=Math.min,db=Math.max,ha=Math.round,Xo=Math.floor,ga=e=>({x:e,y:e});function fb(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ka(){return typeof window<"u"}function _d(e){return Hd(e)?(e.nodeName||"").toLowerCase():"#document"}function fr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ad(e){var t;return(t=(Hd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hd(e){return ka()?e instanceof Node||e instanceof fr(e).Node:!1}function hb(e){return ka()?e instanceof Element||e instanceof fr(e).Element:!1}function Ql(e){return ka()?e instanceof HTMLElement||e instanceof fr(e).HTMLElement:!1}function Pu(e){return!ka()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fr(e).ShadowRoot}function zd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function gb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pb(e){return["html","body","#document"].includes(_d(e))}function es(e){return fr(e).getComputedStyle(e)}function mb(e){if(_d(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pu(e)&&e.host||Ad(e);return Pu(t)?t.host:t}function Vd(e){const t=mb(e);return pb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ql(t)&&zd(t)?t:Vd(t)}function pa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Vd(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=fr(i);if(o){const a=Dl(l);return t.concat(l,l.visualViewport||[],zd(i)?i:[],a&&n?pa(a):[])}return t.concat(i,pa(i,[],n))}function Dl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vb(e){const t=es(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ql(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=ha(n)!==o||ha(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function ts(e){return hb(e)?e:e.contextElement}function Lu(e){const t=ts(e);if(!Ql(t))return ga(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=vb(t);let l=(o?ha(n.width):n.width)/r,a=(o?ha(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const bb=ga(0);function wb(e){const t=fr(e);return!gb()||!t.visualViewport?bb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yb(e,t,n){return!1}function Fu(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=ts(e);let l=ga(1);t&&(l=Lu(e));const a=yb()?wb(o):ga(0);let s=(i.left+a.x)/l.x,u=(i.top+a.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const g=fr(o),h=r;let p=g,m=Dl(p);for(;m&&r&&h!==p;){const y=Lu(m),v=m.getBoundingClientRect(),b=es(m),x=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,T=v.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;s*=y.x,u*=y.y,c*=y.x,d*=y.y,s+=x,u+=T,p=fr(m),m=Dl(p)}}
177return fb({width:c,height:d,x:s,y:u})}function Cb(e,t){let n=null,r;const i=Ad(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=Xo(c),p=Xo(i.clientWidth-(u+d)),m=Xo(i.clientHeight-(c+g)),y=Xo(u),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-y+"px",threshold:db(0,cb(1,s))||1};let x=!0;function T(k){const R=k[0].intersectionRatio;if(R!==s){if(!x)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return l(!0),o}function Sb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=ts(e),c=i||o?[...u?pa(u):[],...pa(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&a?Cb(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!s&&h.observe(u),h.observe(t));let p,m=s?Fu(e):null;s&&y();function y(){const v=Fu(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d?.(),(v=h)==null||v.disconnect(),h=null,s&&cancelAnimationFrame(p)}}var Ol=f.useLayoutEffect,xb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ma=function(){};function kb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Mb(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var l in t)t.hasOwnProperty(l)&&t[l]&&o.push("".concat(kb(e,l)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var va=function(t){return Fb(t)?t.filter(Boolean):Rh(t)==="object"&&t!==null?[t]:[]},$d=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=ir(t,xb);return Fe({},n)},jt=function(t,n,r){var i=t.cx,o=t.getStyles,l=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},l(n,t),a)}};function Ma(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Rb(e){return Ma(e)?window.innerHeight:e.clientHeight}function Nd(e){return Ma(e)?window.pageYOffset:e.scrollTop}function ba(e,t){if(Ma(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Ib(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function Eb(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Yo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ma,i=Nd(e),o=t-i,l=10,a=0;function s(){a+=l;var u=Eb(a,i,o,n);ba(e,u),a<n?window.requestAnimationFrame(s):r(e)}s()}function _u(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ba(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ba(e,Math.max(t.offsetTop-i,0))}function Tb(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Au(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Db(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Bd=!1,Ob={get passive(){return Bd=!0}},jo=typeof window<"u"?window:{};jo.addEventListener&&jo.removeEventListener&&(jo.addEventListener("p",ma,Ob),jo.removeEventListener("p",ma,!1));var Pb=Bd;
177function Lb(e){return e!=null}function Fb(e){return Array.isArray(e)}function ro(e,t,n){return e?t:n}var _b=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(l){var a=cr(l,1),s=a[0];return!r.includes(s)});return o.reduce(function(l,a){var s=cr(a,2),u=s[0],c=s[1];return l[u]=c,l},{})},Ab=["children","innerProps"],Hb=["children","innerProps"];function zb(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,l=e.isFixedPosition,a=e.controlHeight,s=Ib(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=s.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,p=g.height,m=g.top,y=n.offsetParent.getBoundingClientRect(),v=y.top,b=l?window.innerHeight:Rb(s),x=Nd(s),T=parseInt(getComputedStyle(n).marginBottom,10),k=parseInt(getComputedStyle(n).marginTop,10),R=v-k,P=b-m,I=R+x,C=d-x-m,F=h-b+x+T,D=x+m-k,S=160;switch(i){case"auto":case"bottom":if(P>=p)return{placement:"bottom",maxHeight:t};if(C>=p&&!l)return o&&Yo(s,F,S),{placement:"bottom",maxHeight:t};if(!l&&C>=r||l&&P>=r){o&&Yo(s,F,S);var E=l?P-T:C-T;return{placement:"bottom",maxHeight:E}}if(i==="auto"||l){var O=t,M=l?R:I;return M>=r&&(O=Math.min(M-T-a,t)),{placement:"top",maxHeight:O}}if(i==="bottom")return o&&ba(s,F),{placement:"bottom",maxHeight:t};break;case"top":if(R>=p)return{placement:"top",maxHeight:t};if(I>=p&&!l)return o&&Yo(s,D,S),{placement:"top",maxHeight:t};if(!l&&I>=r||l&&R>=r){var V=t;return(!l&&I>=r||l&&R>=r)&&(V=l?R-k:I-k),o&&Yo(s,D,S),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function Vb(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Wd=function(t){return t==="auto"?"bottom":t},$b=function(t,n){var r,i=t.placement,o=t.theme,l=o.borderRadius,a=o.spacing,s=o.colors;return Fe((r={label:"menu"},_o(r,Vb(i),"100%"),_o(r,"position","absolute"),_o(r,"width","100%"),_o(r,"zIndex",1),r),n?{}:{backgroundColor:s.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},Ud=f.createContext(null),Nb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,l=t.menuPosition,a=t.menuShouldScrollIntoView,s=t.theme,u=f.useContext(Ud)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=cr(g,2),p=h[0],m=h[1],y=f.useState(null),v=cr(y,2),b=v[0],x=v[1],T=s.spacing.controlHeight;return Ol(function(){var k=d.current;if(k){var R=l==="fixed",P=a&&!R,I=zb({maxHeight:i,menuEl:k,minHeight:r,placement:o,shouldScroll:P,isFixedPosition:R,controlHeight:T});m(I.maxHeight),x(I.placement),c?.(I.placement)}},[i,o,l,a,r,c,T]),n({ref:d,placerProps:Fe(Fe({},t),{},{placement:b||Wd(o),maxHeight:p})})},Bb=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return _e("div",Ve({},jt(t,"menu",{menu:!0}),{ref:r},i),n)},Wb=Bb,Ub=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Fe({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},Gb=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return _e("div",Ve({},jt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},Gd=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Fe({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},Xb=Gd,Yb=Gd,jb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=ir(t,Ab);return _e("div",Ve({},jt(Fe(Fe({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},qb=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=ir(t,Hb);return _e("div",Ve({},jt(Fe(Fe({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},Kb=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},Zb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,l=t.menuPlacement,a=t.menuPosition,s=f.useRef(null),u=f.useRef(null),c=f.useState(Wd(l)),d=cr(c,2),g=d[0],h=d[1],p=f.useMemo(function(){return{setPortalPlacement:h}},[]),m=f.useState(null),y=cr(m,2),v=y[0],b=y[1],x=f.useCallback(function(){if(i){var P=Tb(i),I=a==="fixed"?0:window.pageYOffset,C=P[g]+I;(C!==v?.offset||P.left!==v?.rect.left||P.width!==v?.rect.width)&&b({offset:C,rect:P})}},[i,a,g,v?.offset,v?.rect.left,v?.rect.width]);Ol(function(){x()},[x]);var T=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&s.current&&(u.current=Sb(i,s.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);Ol(function(){T()},[T]);var k=f.useCallback(function(P){s.current=P,T()},[T]);if(!n&&a!=="fixed"||!v)return null;var R=_e("div",Ve({ref:k},jt(Fe(Fe({},t),{},{offset:v.offset,position:a,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),r);return _e(Ud.Provider,{value:p},n?bc.createPortal(R,n):R)},Jb=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}}
177,Qb=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return _e("div",Ve({},jt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},e1=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,l=t.selectProps.controlShouldRenderValue;return Fe({alignItems:"center",display:i&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},t1=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return _e("div",Ve({},jt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},n1=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},r1=function(t){var n=t.children,r=t.innerProps;return _e("div",Ve({},jt(t,"indicatorsContainer",{indicators:!0}),r),n)},Hu,i1=["size"],o1=["innerProps","isRtl","size"],a1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Xd=function(t){var n=t.size,r=ir(t,i1);return _e("svg",Ve({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:a1},r))},ns=function(t){return _e(Xd,Ve({size:20},t),_e("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Yd=function(t){return _e(Xd,Ve({size:20},t),_e("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},jd=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Fe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?l.neutral60:l.neutral20,padding:o*2,":hover":{color:r?l.neutral80:l.neutral40}})},l1=jd,s1=function(t){var n=t.children,r=t.innerProps;return _e("div",Ve({},jt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||_e(Yd,null))},u1=jd,c1=function(t){var n=t.children,r=t.innerProps;return _e("div",Ve({},jt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||_e(ns,null))},d1=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Fe({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:o*2,marginTop:o*2})},f1=function(t){var n=t.innerProps;return _e("span",Ve({},n,jt(t,"indicatorSeparator",{"indicator-separator":!0})))},h1=Ih(Hu||(Hu=ub([` 178 0%, 80%, 100% { opacity: 0; } 179 40% { opacity: 1; } 180`]))),g1=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,l=o.colors,a=o.spacing.baseUnit;return Fe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?l.neutral60:l.neutral20,padding:a*2})},ll=function(t){var n=t.delay,r=t.offset;return _e("span",{css:wc({animation:"".concat(h1," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},p1=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,l=ir(t,o1);return _e("div",Ve({},jt(Fe(Fe({},l),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),_e(ll,{delay:0,offset:r}),_e(ll,{delay:160,offset:!0}),_e(ll,{delay:320,offset:!r}))},m1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,l=o.colors,a=o.borderRadius,s=o.spacing;return Fe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?l.neutral5:l.neutral0,borderColor:r?l.neutral10:i?l.primary:l.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},v1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,l=t.innerProps,a=t.menuIsOpen;return _e("div",Ve({ref:o}
180,jt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),l,{"aria-disabled":r||void 0}),n)},b1=v1,w1=["data"],y1=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},C1=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,l=t.Heading,a=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return _e("div",Ve({},jt(t,"group",{group:!0}),s),_e(l,Ve({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),_e("div",null,n))},S1=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Fe({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},x1=function(t){var n=$d(t);n.data;var r=ir(n,w1);return _e("div",Ve({},jt(t,"groupHeading",{"group-heading":!0}),r))},k1=C1,M1=["innerRef","isDisabled","isHidden","inputClassName"],R1=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,l=o.spacing,a=o.colors;return Fe(Fe({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},I1),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:a.neutral80})},qd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},I1={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Fe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},qd)},E1=function(t){return Fe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},qd)},T1=function(t){var n=t.cx,r=t.value,i=$d(t),o=i.innerRef,l=i.isDisabled,a=i.isHidden,s=i.inputClassName,u=ir(i,M1);return _e("div",Ve({},jt(t,"input",{"input-container":!0}),{"data-value":r||""}),_e("input",Ve({className:n({input:!0},s),ref:o,style:E1(a),disabled:l},u)))},D1=T1,O1=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors;return Fe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},P1=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,l=t.cropWithEllipsis;return Fe({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},L1=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors,a=t.isFocused;return Fe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},Kd=function(t){var n=t.children,r=t.innerProps;return _e("div",r,n)},F1=Kd,_1=Kd;function A1(e){var t=e.children,n=e.innerProps;return _e("div",Ve({role:"button"},n),t||_e(ns,{size:14}))}var H1=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,l=t.isDisabled,a=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return _e(u,{data:i,innerProps:Fe(Fe({},jt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:s},_e(c,{data:i,innerProps:Fe({},jt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),_e(d,{data:i,innerProps:Fe(Fe({},jt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:s}))},z1=H1,V1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.theme,a=l.spacing,s=l.colors;return Fe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?s.primary:i?s.primary25:"transparent",color:r?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},$1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.innerRef,a=t.innerProps;return _e("div",Ve({},jt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":r},a),n)},N1=$1,B1=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Fe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},W1=function(t){var n=t.children,r=t.innerProps;return _e("div",Ve({},jt(t,"placeholder",{placeholder:!0}),r),n)},U1=W1,G1=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,l=i.colors;return Fe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},X1=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return _e("div",Ve({},jt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Y1=X1,Ra={ClearIndicator:c1,Control:b1,DropdownIndicator:s1,DownChevron:Yd,CrossIcon:ns,Group:k1,GroupHeading:x1,IndicatorsContainer:r1,IndicatorSeparator:f1,Input:D1,LoadingIndicator:p1,Menu:Wb,MenuList:Gb,MenuPortal:Zb,LoadingMessage:qb,NoOptionsMessage:jb,MultiValue:z1,MultiValueContainer:F1,MultiValueLabel:_1,MultiValueRemove:A1,Option:N1,Placeholder:U1,SelectContainer:Qb,SingleValue:Y1,ValueContainer:t1},j1=function(t){return Fe(Fe({},Ra),t.components)},zu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function q1(e,t){return!!(e===t||zu(e)&&zu(t))}function K1(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!q1(e[n],t[n]))return!1;return!0}function Z1(e,t){t===void 0&&(t=K1);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var l=e.apply(this,i);return n={lastResult:l,lastArgs:i,lastThis:this},l}return r.clear=function(){n=null},r}var J1={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Q1=function(t){return _e("span",Ve({css:J1},t))},Vu=Q1,ew={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,l=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,l=t.isDisabled;
180switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return l?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,l=o===void 0?"":o,a=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(m,y){return m&&m.length?"".concat(m.indexOf(y)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(l," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=s?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(l).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},tw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,l=t.isFocused,a=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,g=s.getOptionLabel,h=s.inputValue,p=s.isMulti,m=s.isOptionDisabled,y=s.isSearchable,v=s.menuIsOpen,b=s.options,x=s.screenReaderStatus,T=s.tabSelectsValue,k=s.isLoading,R=s["aria-label"],P=s["aria-live"],I=f.useMemo(function(){return Fe(Fe({},ew),d||{})},[d]),C=f.useMemo(function(){var M="";if(n&&I.onChange){var V=n.option,W=n.options,j=n.removedValue,oe=n.removedValues,Q=n.value,re=function(L){return Array.isArray(L)?null:L},se=j||V||re(Q),ae=se?g(se):"",de=W||oe||void 0,fe=de?de.map(g):[],ue=Fe({isDisabled:se&&m(se,a),label:ae,labels:fe},n);M=I.onChange(ue)}return M},[n,I,m,a,g]),F=f.useMemo(function(){var M="",V=r||i,W=!!(r&&a&&a.includes(r));
180if(V&&I.onFocus){var j={focused:V,label:g(V),isDisabled:m(V,a),isSelected:W,options:o,context:V===r?"menu":"value",selectValue:a,isAppleDevice:c};M=I.onFocus(j)}return M},[r,i,g,m,I,o,a,c]),D=f.useMemo(function(){var M="";if(v&&b.length&&!k&&I.onFilter){var V=x({count:o.length});M=I.onFilter({inputValue:h,resultsMessage:V})}return M},[o,h,v,I,b,x,k]),S=n?.action==="initial-input-focus",E=f.useMemo(function(){var M="";if(I.guidance){var V=i?"value":v?"menu":"input";M=I.guidance({"aria-label":R,context:V,isDisabled:r&&m(r,a),isMulti:p,isSearchable:y,tabSelectsValue:T,isInitialFocus:S})}return M},[R,r,i,p,m,y,v,I,a,T,S]),O=_e(f.Fragment,null,_e("span",{id:"aria-selection"},C),_e("span",{id:"aria-focused"},F),_e("span",{id:"aria-results"},D),_e("span",{id:"aria-guidance"},E));return _e(f.Fragment,null,_e(Vu,{id:u},S&&O),_e(Vu,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!S&&O))},nw=tw,Pl=[{base:"A",letters:"Aâ¶ï¼¡ÃÃÃẦẤẪẨÃÄÄáº°áº®áº´áº²È¦Ç ÃÇẢÃ
ǺÇÈÈẠẬẶá¸ÄȺⱯ"},{base:"AA",letters:"ê²"},{base:"AE",letters:"ÃǼǢ"},{base:"AO",letters:"ê´"},{base:"AU",letters:"ê¶"},{base:"AV",letters:"ê¸êº"},{base:"AY",letters:"ê¼"},{base:"B",letters:"Bâ·ï¼¢á¸á¸á¸ÉÆÆ"},{base:"C",letters:"Câ¸ï¼£ÄÄÄÄÃá¸ÆÈ»ê¾"},{base:"D",letters:"Dâ¹ï¼¤á¸Äá¸á¸á¸á¸ÄÆÆÆê¹"},{base:"DZ",letters:"DZÇ"},{base:"Dz",letters:"DzÇ
"},{base:"E",letters:"Eâºï¼¥ÃÃÃá»áº¾á»á»áº¼Äá¸á¸ÄÄÃẺÄÈÈẸá»È¨á¸Äá¸á¸ÆÆ"},{base:"F",letters:"Fâ»ï¼¦á¸Æê»"},{base:"G",letters:"Gâ¼ï¼§Ç´ÄḠÄÄ Ç¦Ä¢Ç¤Æê ê½ê¾"},{base:"H",letters:"Hâ½ï¼¨Ä¤á¸¢á¸¦ÈḤḨḪĦⱧⱵê"},{base:"I",letters:"Iâ¾ï¼©ÃÃÃĨĪĬİÃḮá»ÇÈÈá»Ä®á¸¬Æ"},{base:"J",letters:"Jâ¿ï¼ªÄ´É"},{base:"K",letters:"KâKḰǨḲĶḴÆâ±©êêêê¢"},{base:"L",letters:"LâLĿĹĽḶḸĻḼḺÅȽⱢⱠêêê"},{base:"LJ",letters:"Ç"},{base:"Lj",letters:"Ç"},{base:"M",letters:"Mâï¼á¸¾á¹á¹â±®Æ"},{base:"N",letters:"NâNǸÅÃá¹Åá¹Å
á¹á¹È Æêê¤"},{base:"NJ",letters:"Ç"},{base:"Nj",letters:"Ç"},{base:"O",letters:"OâOÃÃÃá»á»á»á»Ãá¹È¬á¹Åá¹á¹ÅȮȰÃȪá»ÅÇÈÈÆ á»á»á» á»á»¢á»á»ÇªÇ¬ÃÇ¾ÆÆêê"},{base:"OI",letters:"Æ¢"},{base:"OO",letters:"ê"},{base:"OU",letters:"È¢"},{base:"P",letters:"Pâ
ï¼°á¹á¹Æ¤â±£êêê"},{base:"Q",letters:"Qâï¼±êêÉ"},{base:"R",letters:"Râï¼²Åá¹ÅÈÈá¹á¹Åá¹ÉⱤêê¦ê"},{base:"S",letters:"Sâï¼³áºÅṤÅṠŠṦṢṨÈÅâ±¾ê¨ê"},{base:"T",letters:"TâTṪŤṬÈŢṰṮŦƬƮȾê"},{base:"TZ",letters:"ê¨"},{base:"U",letters:"Uâï¼µÃÃÃŨṸŪṺŬÃÇÇÇÇỦŮŰÇÈÈÆ¯á»ªá»¨á»®á»¬á»°á»¤á¹²Å²á¹¶á¹´É"},{base:"V",letters:"VâVṼṾƲêÉ
"},{base:"VY",letters:"ê "},{base:"W",letters:"Wâï¼·áºáºÅ´áºáºáºâ±²"},{base:"X",letters:"XâXáºáº"},{base:"Y",letters:"YâYỲÃŶỸȲáºÅ¸á»¶á»´Æ³ÉỾ"},{base:"Z",letters:"ZâZŹáºÅ»Å½áºáºÆµÈ¤â±¿â±«ê¢"},{base:"a",letters:"aâï½áºÃ áâầấẫẩãÄÄằắẵẳȧǡäÇảåǻÇÈÈạáºáº·á¸Ä
â±¥É"},{base:"aa",letters:"ê³"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"êµ"},{base:"au",letters:"ê·"},{base:"av",letters:"ê¹ê»"},{base:"ay",letters:"ê½"},{base:"b",letters:"bâï½á¸á¸
á¸ÆÆÉ"},{base:"c",letters:"câï½ÄÄÄÄÃ§á¸ÆÈ¼ê¿â"},{base:"d",letters:"dâï½á¸Äá¸á¸á¸á¸ÄÆÉÉêº"},{base:"dz",letters:"dzÇ"},{base:"e",letters:"eâï½
èéêá»áº¿á»
á»áº½Äá¸á¸ÄÄëẻÄÈ
Èẹá»È©á¸Äá¸á¸ÉÉÇ"},{base:"f",letters:"fâï½á¸Æê¼"},{base:"g",letters:"gâï½ÇµÄḡÄÄ¡Ç§Ä£Ç¥É ê¡áµ¹ê¿"},{base:"h",letters:"hâï½Ä¥á¸£á¸§ÈḥḩḫáºÄ§â±¨â±¶É¥"},{base:"hv",letters:"Æ"},{base:"i",letters:"iâï½Ã¬ÃîĩīÄïḯá»ÇÈÈá»Ä¯á¸É¨Ä±"},{base:"j",letters:"jâï½ÄµÇ°É"},{base:"k",letters:"kâï½á¸±Ç©á¸³Ä·á¸µÆâ±ªêêê
ê£"},{base:"l",letters:"lâï½ÅÄºÄ¾á¸·á¸¹Ä¼á¸½á¸»Å¿ÅÆÉ«â±¡êêê"},{base:"lj",letters:"Ç"},{base:"m",letters:"mâï½á¸¿á¹á¹É±É¯"},{base:"n",letters:"nâï½Ç¹Åñá¹
Åá¹Åá¹á¹ÆÉ²Åêê¥"},{base:"nj",letters:"Ç"},{base:"o",letters:"oâï½Ã²Ã³Ã´á»á»á»á»Ãµá¹Èá¹Åá¹á¹Åȯȱöȫá»ÅÇÈÈÆ¡á»á»á»¡á»á»£á»á»Ç«ÇøǿÉêêɵ"},{base:"oi",letters:"Æ£"},{base:"ou",letters:"È£"},{base:"oo",letters:"ê"},{base:"p",letters:"pâï½á¹á¹Æ¥áµ½êêê"},{base:"q",letters:"qâ ï½Éêê"},{base:"r",letters:"râ¡ï½Åá¹ÅÈÈá¹á¹Åá¹Éɽêê§ê"},{base:"s",letters:"sâ¢ï½ÃÅá¹¥ÅṡšṧṣṩÈÅÈ¿ê©ê
áº"},{base:"t",letters:"tâ£ï½á¹«áºÅ¥á¹ÈţṱṯŧÆÊⱦê"},{base:"tz",letters:"ê©"},{base:"u",letters:"uâ¤ï½Ã¹ÃºÃ»Å©á¹¹Å«á¹»ÅüÇÇÇÇủůűÇÈÈÆ°á»«á»©á»¯á»á»±á»¥á¹³Å³á¹·á¹µÊ"},{base:"v",letters:"vâ¥ï½á¹½á¹¿ÊêÊ"},{base:"vy",letters:"ê¡"},{base:"w",letters:"wâ¦ï½áºáºÅµáºáº
áºáºâ±³"},{base:"x",letters:"xâ§ï½áºáº"},{base:"y",letters:"yâ¨ï½á»³Ã½Å·á»¹È³áºÃ¿á»·áºá»µÆ´Éỿ"},{base:"z",letters:"zâ©ï½ÅºáºÅ¼Å¾áºáºÆ¶È¥Éⱬê£"}],rw=new RegExp("["+Pl.map(function(e){return e.letters}).join("")+"]","g"),Zd={};for(var sl=0;sl<Pl.length;sl++)for(var ul=Pl[sl],cl=0;cl<ul.letters.length;cl++)Zd[ul.letters[cl]]=ul.base;var Jd=function(t){return t.replace(rw,function(n){return Zd[n]})},iw=Z1(Jd),$u=function(t){return t.replace(/^\s+|\s+$/g,"")},ow=function(t){return"".concat(t.label," ").concat(t.value)},aw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Fe({ignoreCase:!0,ignoreAccents:!0,stringify:ow,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,l=i.ignoreAccents,a=i.stringify,s=i.trim,u=i.matchFrom,c=s?$u(r):r,d=s?$u(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),l&&(c=iw(c),d=Jd(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},lw=["innerRef"];function sw(e){var t=e.innerRef,n=ir(e,lw),r=_b(n,"onExited","in","enter","exit","appear");return _e("input",Ve({ref:t},r,{css:wc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var uw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function cw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,
180i=e.onTopArrive,o=e.onTopLeave,l=f.useRef(!1),a=f.useRef(!1),s=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,v){if(u.current!==null){var b=u.current,x=b.scrollTop,T=b.scrollHeight,k=b.clientHeight,R=u.current,P=v>0,I=T-k-x,C=!1;I>v&&l.current&&(r&&r(y),l.current=!1),P&&a.current&&(o&&o(y),a.current=!1),P&&v>I?(n&&!l.current&&n(y),R.scrollTop=T,C=!0,l.current=!0):!P&&-v>x&&(i&&!a.current&&i(y),R.scrollTop=0,C=!0,a.current=!0),C&&uw(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){s.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var v=s.current-y.changedTouches[0].clientY;c(y,v)},[c]),p=f.useCallback(function(y){if(y){var v=Pb?{passive:!1}:!1;y.addEventListener("wheel",d,v),y.addEventListener("touchstart",g,v),y.addEventListener("touchmove",h,v)}},[h,g,d]),m=f.useCallback(function(y){y&&(y.removeEventListener("wheel",d,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var y=u.current;return p(y),function(){m(y)}}},[t,p,m]),function(y){u.current=y}}var Nu=["boxSizing","height","overflow","paddingRight","position"],Bu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Wu(e){e.cancelable&&e.preventDefault()}function Uu(e){e.stopPropagation()}function Gu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Xu(){return"ontouchstart"in window||navigator.maxTouchPoints}var Yu=!!(typeof window<"u"&&window.document&&window.document.createElement),no=0,yi={capture:!1,passive:!1};function dw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),l=f.useCallback(function(s){if(Yu){var u=document.body,c=u&&u.style;if(r&&Nu.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&no<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(Bu).forEach(function(p){var m=Bu[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&Xu()&&(u.addEventListener("touchmove",Wu,yi),s&&(s.addEventListener("touchstart",Gu,yi),s.addEventListener("touchmove",Uu,yi))),no+=1}},[r]),a=f.useCallback(function(s){if(Yu){var u=document.body,c=u&&u.style;no=Math.max(no-1,0),r&&no<1&&Nu.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&Xu()&&(u.removeEventListener("touchmove",Wu,yi),s&&(s.removeEventListener("touchstart",Gu,yi),s.removeEventListener("touchmove",Uu,yi)))}},[r]);return f.useEffect(function(){if(t){var s=o.current;return l(s),function(){a(s)}}},[t,l,a]),function(s){o.current=s}}var fw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},hw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function gw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,l=e.onBottomLeave,a=e.onTopArrive,s=e.onTopLeave,u=cw({isEnabled:i,onBottomArrive:o,onBottomLeave:l,onTopArrive:a,onTopLeave:s}),c=dw({isEnabled:n}),d=function(h){u(h),c(h)};return _e(f.Fragment,null,n&&_e("div",{onClick:fw,css:hw}),t(d))}var pw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},mw=function(t){var n=t.name,r=t.onFocus;return _e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:pw,value:"",onChange:function(){}})},vw=mw;function rs(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function bw(){return rs(/^iPhone/i)}function Qd(){return rs(/^Mac/i)}function ww(){return rs(/^iPad/i)||Qd()&&navigator.maxTouchPoints>1}function yw(){return bw()||ww()}function Cw(){return Qd()||yw()}var Sw=function(t){return t.label},ef=function(t){return t.label},tf=function(t){return t.value},xw=function(t){return!!t.isDisabled},kw={clearIndicator:u1,container:Jb,control:m1,dropdownIndicator:l1,group:y1,groupHeading:S1,indicatorsContainer:n1,indicatorSeparator:d1,input:R1,loadingIndicator:g1,loadingMessage:Yb,menu:$b,menuList:Ub,menuPortal:Kb,multiValue:O1,multiValueLabel:P1,multiValueRemove:L1,noOptionsMessage:Xb,option:V1,placeholder:B1,singleValue:G1,valueContainer:e1},Mw={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Rw=4,nf=4,Iw=38,Ew=nf*2,Tw={baseUnit:nf,controlHeight:Iw,menuGutter:Ew}
180,dl={borderRadius:Rw,colors:Mw,spacing:Tw},Dw={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Au(),captureMenuScroll:!Au(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:aw(),formatGroupLabel:Sw,getOptionLabel:ef,getOptionValue:tf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:xw,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Db(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function ju(e,t,n,r){var i=af(e,t,n),o=lf(e,t,n),l=of(e,t),a=wa(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:l,value:a,index:r}}function ea(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(l,a){return ju(e,l,t,a)}).filter(function(l){return Ku(e,l)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=ju(e,n,t,r);return Ku(e,o)?o:void 0}).filter(Lb)}function rf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ei(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function qu(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Ei(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Ow(e,t){return rf(ea(e,t))}function Ku(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,l=t.label,a=t.value;return(!uf(e)||!o)&&sf(e,{label:l,value:a,data:i},r)}function Pw(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function Lw(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var fl=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},of=function(t,n){return t.getOptionLabel(n)},wa=function(t,n){return t.getOptionValue(n)};function af(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function lf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=wa(e,t);return n.some(function(i){return wa(e,i)===r})}function sf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var uf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Fw=1,is=(function(e){Eh(n,e);var t=Th(n);function n(r){var i;if(Dh(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(s){i.controlRef=s},i.focusedOptionRef=null,i.getFocusedOptionRef=function(s){i.focusedOptionRef=s},i.menuListRef=null,i.getMenuListRef=function(s){i.menuListRef=s},i.inputRef=null,i.getInputRef=function(s){i.inputRef=s},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(s,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,p=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(s,{action:u,option:c})},i.selectOption=function(s){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,p=d&&i.isOptionSelected(s,h),m=i.isOptionDisabled(s,h);if(p){var y=i.getOptionValue(s);i.setValue(h.filter(function(v){return i.getOptionValue(v)!==y}),"deselect-option",s)}else if(!m)d?i.setValue([].concat(Ei(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:g});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),g=c.filter(function(p){return i.getOptionValue(p)!==d}),h=ro(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(ro(i.props.isMulti,[],null),{action:"clear",removedValues:s})},i.popValue=function(){var s=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=ro(s,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return fl(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return qu(ea(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return Mb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return of(i.props,s)},i.getOptionValue=function(s){return wa(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=kw[s](u,c);d.boxSizing="border-box";var g=i.props.styles[s];return g?g(d,u):d},i.getClassNames=function(s,u){var c,d;return(c=(d=i.props.classNames)[s])===null||c===void 0?void 0:c.call(
180d,u)},i.getElementId=function(s){return"".concat(i.state.instancePrefix,"-").concat(s)},i.getComponents=function(){return j1(i.props)},i.buildCategorizedOptions=function(){return ea(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return rf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:Fe({value:s},u)})},i.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(s){i.blockOptionHover=!1},i.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},i.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),s.preventDefault()}},i.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(i.clearValue(),s.preventDefault(),i.openAfterFocus=!1,s.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(s){typeof i.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Ma(s.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(s)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(s){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(s.target)&&i.menuListRef&&!i.menuListRef.contains(s.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(s){i.userIsDragging||i.onControlMouseDown(s)},i.onClearIndicatorTouchEnd=function(s){i.userIsDragging||i.onClearIndicatorMouseDown(s)},i.onDropdownIndicatorTouchEnd=function(s){i.userIsDragging||i.onDropdownIndicatorMouseDown(s)},i.handleInputChange=function(s){var u=i.props.inputValue,c=s.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(s){i.props.onFocus&&i.props.onFocus(s),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(s){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(s),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(s){if(!(i.blockOptionHover||i.state.focusedOption===s)){var u=i.getFocusableOptions(),c=u.indexOf(s);i.setState({focusedOption:s,focusedOptionId:c>-1?i.getFocusedOptionId(s):null})}},i.shouldHideSelectedOptions=function(){return uf(i.props)},i.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),i.focus()},i.onKeyDown=function(s){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,p=u.isClearable,m=u.isDisabled,y=u.menuIsOpen,v=u.onKeyDown,b=u.tabSelectsValue,x=u.openMenuOnFocus,T=i.state,k=T.focusedOption,R=T.focusedValue,P=T.selectValue;if(!m&&!(typeof v=="function"&&(v(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||s.shiftKey||!y||!b||!k||x&&i.isOptionSelected(k,P))return;i.selectOption(k);break;case"Enter":if(s.keyCode===229)break;
180if(y){if(!k||i.isComposing)return;i.selectOption(k);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!k)return;i.selectOption(k);break;case"ArrowUp":y?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":y?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!y)return;i.focusOption("pageup");break;case"PageDown":if(!y)return;i.focusOption("pagedown");break;case"Home":if(!y)return;i.focusOption("first");break;case"End":if(!y)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Fw),i.state.selectValue=va(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),l=i.buildFocusableOptions(),a=l.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=l[a],i.state.focusedOptionId=fl(o,l[a])}return i}return Oh(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&_u(this.menuListRef,this.focusedOptionRef),Cw()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var o=this.props,l=o.isDisabled,a=o.menuIsOpen,s=this.state.isFocused;(s&&!l&&i.isDisabled||s&&a&&!i.menuIsOpen)&&this.focusInput(),s&&l&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!l&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(_u(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,l=this.state,a=l.selectValue,s=l.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,l=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=l.indexOf(a);a||(s=-1);var u=l.length-1,c=-1;if(l.length){switch(i){case"previous":s===0?c=0:s===-1?c=u:c=s-1;break;case"next":s>-1&&s<u&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:l[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,l=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var s=0,u=a.indexOf(l);l||(u=-1),i==="up"?s=u>0?u-1:a.length-1:i==="down"?s=(u+1)%a.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>a.length-1&&(s=a.length-1)):i==="last"&&(s=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[s])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(dl):Fe(Fe({},dl),this.props.theme):dl})},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,l=this.getStyles,a=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:l,getClassNames:a,getValue:s,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,l=i.isMulti;return o===void 0?l:o}},{key:"isOptionDisabled",value:function(i,o){return af(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return lf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return sf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:l,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var i=this.props,o=i.isDisabled,l=i.isSearchable,a=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,y=m.inputIsHidden,v=m.ariaSelection,b=this.commonProps,x=a||this.getElementId("input"),T=Fe(Fe(Fe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?v?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?f.createElement(p,Ve({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},T)):f.createElement(sw,Ve({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ma,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},T))})},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),l=o.MultiValue,a=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,y=h.isMulti,v=h.inputValue,b=h.placeholder,x=this.state,T=x.selectValue,k=x.focusedValue,R=x.isFocused;if(!this.hasValue()||!p)return v?null:f.createElement(d,Ve({},g,{key:"placeholder",isDisabled:m,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),b);if(y)return T.map(function(I,C){var F=I===k,D="".concat(i.getOptionLabel(I),"-").concat(i.getOptionValue(I));return f.createElement(l,Ve({},g,{components:{Container:a,Label:s,Remove:u},isFocused:F,isDisabled:m,key:D,index:C,removeProps:{onClick:function(){return i.removeValue(I)},onTouchEnd:function(){return i.removeValue(I)},onMouseDown:function(E){E.preventDefault()}},data:I}),i.formatOptionLabel(I,"value"))});if(v)return null;var P=T[0];return f.createElement(c,Ve({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||s||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ve({},l,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,Ve({},l,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,l=i.IndicatorSeparator;if(!o||!l)return null;var a=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return f.createElement(l,Ve({},a,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var l=this.commonProps,a=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ve({},l,{innerProps:u,isDisabled:a,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),l=o.Group,a=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g
180=o.NoOptionsMessage,h=o.Option,p=this.commonProps,m=this.state.focusedOption,y=this.props,v=y.captureMenuScroll,b=y.inputValue,x=y.isLoading,T=y.loadingMessage,k=y.minMenuHeight,R=y.maxMenuHeight,P=y.menuIsOpen,I=y.menuPlacement,C=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,S=y.menuShouldScrollIntoView,E=y.noOptionsMessage,O=y.onMenuScrollToTop,M=y.onMenuScrollToBottom;if(!P)return null;var V=function(ae,de){var fe=ae.type,ue=ae.data,H=ae.isDisabled,L=ae.isSelected,Y=ae.label,te=ae.value,le=m===ue,Se=H?void 0:function(){return i.onOptionHover(ue)},pe=H?void 0:function(){return i.selectOption(ue)},et="".concat(i.getElementId("option"),"-").concat(de),ke={id:et,onClick:pe,onMouseMove:Se,onMouseOver:Se,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:L};return f.createElement(h,Ve({},p,{innerProps:ke,data:ue,isDisabled:H,isSelected:L,key:et,label:Y,type:fe,value:te,isFocused:le,innerRef:le?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},W;if(this.hasOptions())W=this.getCategorizedOptions().map(function(se){if(se.type==="group"){var ae=se.data,de=se.options,fe=se.index,ue="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(ue,"-heading");return f.createElement(l,Ve({},p,{key:ue,data:ae,options:de,Heading:a,headingProps:{id:H,data:se.data},label:i.formatGroupLabel(se.data)}),se.options.map(function(L){return V(L,"".concat(fe,"-").concat(L.index))}))}else if(se.type==="option")return V(se,"".concat(se.index))});else if(x){var j=T({inputValue:b});if(j===null)return null;W=f.createElement(d,p,j)}else{var oe=E({inputValue:b});if(oe===null)return null;W=f.createElement(g,p,oe)}var Q={minMenuHeight:k,maxMenuHeight:R,menuPlacement:I,menuPosition:C,menuShouldScrollIntoView:S},re=f.createElement(Nb,Ve({},p,Q),function(se){var ae=se.ref,de=se.placerProps,fe=de.placement,ue=de.maxHeight;return f.createElement(s,Ve({},p,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:fe}),f.createElement(gw,{captureEnabled:v,onTopArrive:O,onBottomArrive:M,lockEnabled:D},function(H){return f.createElement(u,Ve({},p,{innerRef:function(Y){i.getMenuListRef(Y),H(Y)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:ue,focusedOption:m}),W)}))});return F||C==="fixed"?f.createElement(c,Ve({},p,{appendTo:F,controlElement:this.controlRef,menuPlacement:I,menuPosition:C}),re):re}},{key:"renderFormField",value:function(){var i=this,o=this.props,l=o.delimiter,a=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(vw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(s)if(l){var g=d.map(function(m){return i.getOptionValue(m)}).join(l);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(m,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(m)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var p=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,l=o.ariaSelection,a=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(nw,Ve({},i,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:a,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,l=i.IndicatorsContainer,a=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return f.createElement(a,Ve({},m,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),f.createElement(o,Ve({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),f.createElement(s,Ve({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(l,Ve({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var l=o.prevProps,a=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,y=i.inputValue,v=i.isMulti,b=va(p),x={};if(l&&(p!==l.value||h!==l.options||m!==l.menuIsOpen||y!==l.inputValue)){var T=m?O
180w(i,b):[],k=m?qu(ea(i,b),"".concat(g,"-option")):[],R=a?Pw(o,b):null,P=Lw(o,T),I=fl(k,P);x={selectValue:b,focusedOption:P,focusedOptionId:I,focusableOptionsWithIds:k,focusedValue:R,clearFocusValueOnUpdate:!1}}var C=s!=null&&i!==l?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:ro(v,b,b[0]||null),options:b,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Fe(Fe(Fe({},x),C),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n})(f.Component);is.defaultProps=Dw;var _w=f.forwardRef(function(e,t){var n=Fd(e);return f.createElement(is,Ve({ref:t},n))}),cf=_w,Aw=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Zu=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),l=String(r.getOptionLabel(n)).toLowerCase();return o===i||l===i},hl={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return Zu(t,o,i)})||r.some(function(o){return Zu(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function Hw(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,l=o===void 0?hl.formatCreateLabel:o,a=e.isValidNewOption,s=a===void 0?hl.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?hl.getNewOptionData:u,d=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=ir(e,Aw),y=m.getOptionValue,v=y===void 0?tf:y,b=m.getOptionLabel,x=b===void 0?ef:b,T=m.inputValue,k=m.isLoading,R=m.isMulti,P=m.value,I=m.name,C=f.useMemo(function(){return s(T,va(P),h,{getOptionValue:v,getOptionLabel:x})?c(T,l(T)):void 0},[l,c,x,v,T,s,h,P]),F=f.useMemo(function(){return(n||!k)&&C?i==="first"?[C].concat(Ei(h)):[].concat(Ei(h),[C]):h},[n,i,k,C,h]),D=f.useCallback(function(S,E){if(E.action!=="select-option")return p(S,E);var O=Array.isArray(S)?S:[S];if(O[O.length-1]===C){if(d)d(T);else{var M=c(T,T),V={action:"create-option",name:I,option:M};p(ro(R,[].concat(Ei(va(P)),[M]),M),V)}return}p(S,E)},[c,T,R,I,C,d,p,P]);return Fe(Fe({},m),{},{options:F,onChange:D})}var zw=f.forwardRef(function(e,t){var n=Fd(e),r=Hw(n);return f.createElement(is,Ve({ref:t},r))}),Vw=zw;const os="__value",$w=new RegExp(`^${os}\\d+__`),Nw=Ln("div",{target:"ek2dub20"})("display:flex;flex-direction:column;align-items:stretch;margin-top:auto;margin-bottom:auto;.gdg-multi-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);}"),Bw=Ln("div",{target:"ek2dub21"})("font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark);> div{border-radius:0.25rem;border:1px solid var(--gdg-border-color);}"),ta=e=>e.map(t=>typeof t=="string"?{value:t,label:t,color:void 0}:Ee(t)?{value:"",label:"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color}),df=(e,t,n)=>Ee(e)?[]:e.map((r,i)=>{const o=n?`${os}${i}__`:"",l=t.find(a=>a.value===r);return l?{...l,value:`${o}${l.value}`}:{value:`${o}${r}`,label:r}}),Ww=e=>{const{Menu:t}=Ra,{children:n,...r}=e;return Ie(t,{...r,children:n})},Uw=e=>{const t=e.innerProps,n={...t,onMouseDown:r=>{r.stopPropagation(),t?.onMouseDown?.(r)},onTouchEnd:r=>{r.stopPropagation(),t?.onTouchEnd?.(r)}};return Ie(Ra.MultiValueLabel,{...e,innerProps:n})},Gw=()=>null,Xw=()=>null,Yw=e=>e.selectProps?.menuDisabled?null:Ie(Bw,{children:Ie(Ww,{...e,className:[e.className,"click-outside-ignore"].filter(Boolean).join(" ")})}),jw=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i}=e,{options:o,values:l,allowCreation:a,allowDuplicates:s}=t.data,u=ud(),[c,d]=f.useState(l),[g,h]=f.useState(!0),[p,m]=f.useState(n??""),[y]=f.useState(()=>document.getElementById("portal")),v=f.useMemo(()=>ta(o??[]),[o]),b=a&&s&&v.length===0,x=f.useCallback(E=>{g&&E.stopPropagation()},[g]),T=f.useCallback(()=>h(!0),[]),k=f.useCallback(()=>h(!1),[]),R=f.useCallback(E=>a&&s&&E.inputValue?`Create "${E.inputValue}"`:void 0,[a,s]),P=f.useMemo(()=>({control:(E,O)=>({...E,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:O.isDisabled?"auto":E.pointerEvents,cursor:O.isDisabled?"default":E.cursor}),valueContainer:E=>({...E,flexWrap:E.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:E=>({...E,backgroundColor:u.bgCell}),option:(E,O)=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...O.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{}
180,":active":{...E[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(E,{isDisabled:O})=>O?{display:"none"}:{...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:E=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:E=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:E=>({...E,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(E,{data:O})=>({...E,backgroundColor:O.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(E,{data:O,isDisabled:M})=>({...E,paddingRight:M?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:O.color?Cl(O.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(E,{data:O,isDisabled:M,isFocused:V})=>M?{display:"none"}:{...E,color:O.color?Cl(O.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:V?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}}),[u]),I=f.useCallback(E=>{const O=E.map(M=>s&&M.startsWith(os)?M.replace(new RegExp($w),""):M);d(O),r({...t,data:{...t.data,values:O}})},[t,r,s]),C=E=>{switch(E.key){case"Enter":case"Tab":if(!p){i(t,[0,1]);return}s&&a&&(m(""),I([...c??[],p]),h(!1),E.preventDefault())}},F=f.useMemo(()=>({DropdownIndicator:Gw,IndicatorSeparator:Xw,MultiValueLabel:Uw,Menu:Yw}),[]),D=f.useCallback(E=>{E===null||!Array.isArray(E)||I(E.map(O=>O.value))},[I]);return Ie(Nw,{onKeyDown:x,"data-testid":"multi-select-cell",children:Ie(a?Vw:cf,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:p,onInputChange:m,options:v,placeholder:t.readonly?"":a?"Add...":void 0,noOptionsMessage:R,menuIsOpen:t.readonly?!1:g,onMenuOpen:T,onMenuClose:k,value:df(c,v,s),onKeyDown:t.readonly?void 0:C,menuPlacement:"auto",menuPortalTarget:y,autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:P,components:F,onChange:D,menuDisabled:b})})},qw={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:l,options:a}=t.data;if(Ee(l))return!0;const s=ta(a??[]),u={x:i.x+r.cellHorizontalPadding,y:i.y+r.cellVerticalPadding,width:i.width-2*r.cellHorizontalPadding,height:i.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:d}=u,g=1,h=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const p of l){const m=s.find(k=>k.value===p),y=m?.color??(o?r.bgBubbleSelected:r.bgBubble),v=m?.label??p,x=Er(v,n).width+r.bubblePadding*2,T=r.bubbleHeight/2;if(d!==u.x&&d+x>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,d=u.x),n.fillStyle=y,n.beginPath(),jn(n,d,h,x,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Cl(y)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(v,d+r.bubblePadding,h+T+qn(n,r)),d+=x+r.bubbleMargin,d>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:i}=t.data;if(!r)return n.cellHorizontalPadding*2;const o=df(r,ta(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),l=o.reduce((a,s)=>e.measureText(s).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:l+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:jw,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e?.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,i)=>n.indexOf(r)===i)),!t.allowCreation){const r=ta(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},ff="line_chart",Kw="area_chart",hf="bar_chart";function as(e,t,n,r){const i=Pi({y_min:null,y_max:null,color:void 0},t.columnTypeOptions);let o;i.color==="auto"||i.color==="auto-inverse"?o=r.colors.greenColor:o=i.color?yc(i.color,r):void 0;const l={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:o,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===ff?":material/show_chart:":e===hf?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(a){if(Ee(a))return El();
180const s=Jl(a),u=[];let c=[];if(s.length===0)return El();let d=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER;for(let y=0;y<s.length;y++){const v=go(s[y]);if(Number.isNaN(v)||Ee(v))return Et(ot(s),`The value cannot be interpreted as a numeric array. ${ot(v)} is not a number.`);v>d&&(d=v),v<g&&(g=v),u.push(v)}let h,p;if(g===d){let y;d<=0?y=d===0?1:0:y=d,h=i.y_max??y,p=i.y_min??(d>=0?0:d)}else h=i.y_max??d,p=i.y_min??g;if(Ee(p)||Ee(h)||Number.isNaN(p)||Number.isNaN(h)||p>=h)return Et("Invalid min/max y-axis configuration",`The y_min (${p}) and y_max (${h}) configuration options must be valid numbers.`);u.length>0&&(d>h||g<p)?c=u.map(y=>d-g===0?d>(h||1)?h:p:(h-p)*((y-g)/(d-g))+p):c=u;let m=o;return(i.color==="auto"&&c[0]>c[c.length-1]||i.color==="auto-inverse"&&c[0]<c[c.length-1])&&(m=r.colors.redColor),{...l,copyData:u.join(","),data:{...l.data,values:c,displayValues:u.map(y=>ia(y)),yAxis:[p,h],color:m},isMissingValue:Ee(a)}},getCellValue(a){return a.kind===Z.Loading||a.data?.values===void 0?null:a.data?.values}}}function gf(e,t){return as(ff,e,"line",t)}gf.isEditableType=!1;function pf(e,t){return as(hf,e,"bar",t)}pf.isEditableType=!1;function mf(e,t){return as(Kw,e,"area",t)}mf.isEditableType=!1;function ls(e,t){const n={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(en(t.radii.sm),en(t.radii.maxCheckbox)))},getCell(r){let i=null;return i=Dd(r),i===void 0?Et(ot(r),"The value cannot be interpreted as boolean."):{...n,data:i,isMissingValue:Ee(i)}},getCellValue(r){return r.data===void 0?null:r.data}}}ls.isEditableType=!0;function Ju(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function ss(e,t,n,r,i,o,l){const a=Pi({format:n,step:r,timezone:l},t.columnTypeOptions);let s;if(ct(a.timezone))try{s=Ju(_s(),a.timezone)?.utcOffset()||void 0}catch{}let u;ct(a.min_value)&&(u=Go(a.min_value)||void 0);let c;ct(a.max_value)&&(c=Go(a.max_value)||void 0);const d={kind:Z.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:a.step?.toString()||"1",format:i,min:u,max:c}},g=h=>{const p=Go(h);return p===null?!t.isRequired:!(p===void 0||ct(u)&&o(p)<o(u)||ct(c)&&o(p)>o(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(h,p){if(p===!0){const x=g(h);if(x===!1)return Et(ot(h),"Invalid input.");x instanceof Date&&(h=x)}const m=Go(h);let y="",v="",b=s;if(m===void 0)return Et(ot(h),"The value cannot be interpreted as a datetime object.");if(m!==null){let x=_s.utc(m);if(!x.isValid())return Et(ot(m),`Invalid moment date. This should never happen. Please report this bug. 181Error: ${x.toString()}`);if(a.timezone){try{x=Ju(x,a.timezone)}catch(T){return Et(x.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}. 182Error: ${T}`)}b=x.utcOffset()}try{v=As(x,a.format||n,e)}catch(T){return Et(x.toISOString(),`Failed to format the date for rendering with: ${a.format}. 183Error: ${T}`)}y=As(x,n,e)}return{...d,copyData:y,isMissingValue:Ee(m),data:{...d.data,date:m,displayDate:v,timezoneOffset:b}}},getCellValue(h){return Ee(h?.data?.date)?null:o(h.data.date)}}}function us(e){let t="YYYY-MM-DD HH:mm:ss";e.columnTypeOptions?.step>=60?t="YYYY-MM-DD HH:mm":e.columnTypeOptions?.step<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=Ph(e.arrowType),r=ct(n)||ct(e?.columnTypeOptions?.timezone);return ss("datetime",e,r?t+"Z":t,1,"datetime-local",i=>r?i.toISOString():i.toISOString().replace("Z",""),n)}us.isEditableType=!0;function cs(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),ss("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}cs.isEditableType=!0;function ds(e){return ss("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}ds.isEditableType=!0;function vf(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",typeIcon:":material/image:",sortMode:"default",isEditable:!1,getCell(n){const r=ct(n)?[ot(n)]:[];return{...t,data:r,isMissingValue:!ct(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}vf.isEditableType=!1;function bf(e){const t={kind:Z.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",typeIcon:":material/code_blocks:",sortMode:"default",isEditable:!1,getCell(n){try{const r=ct(n)?po(fa(n)):"";return{...t,copyData:r,isMissingValue:Ee(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Et(ot(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}bf.isEditableType=!1;function wf(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(s){n=`Invalid validate regex: ${t.validate}. 184Error: ${s}`}let r=!1,i=t.display_text,o;if(!Ee(i)){if(i.startsWith(":material/")&&Lh(i))i=Fh(i).icon,r=!0;else if(i.includes("(")&&i.includes(")"))try{o=new RegExp(i,"us")}catch{o=void 0}}const l={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:_h.iconFont,linkColor:void 0}}},a=s=>{if(Ee(s))return!e.isRequired;const u=ot(s);return!(t.max_chars&&u.length>t.max_chars||n instanceof RegExp&&n.test(u)===!1)};return{...e,kind:"link",typeIcon:":material/link:",sortMode:"default",validateInput:a,getCell(s,u){if(Ee(s))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=s;if(typeof n=="string")return Et(ot(c),n);if(u&&a(c)===!1)return Et(ot(c),"Invalid input.");let d="";return c&&(o!==void 0?d=rb(o,c):d=i||c),{...l,data:c,displayData:d,isMissingValue:Ee(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(s){return Ee(s.data)?null:s.data}}}wf.isEditableType=!0;function fs(e){const t={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",copyData:"",data:{kind:"multi-select-cell",values:[],options:void 0,allowCreation:!0,allowDuplicates:!0}};return{...e,kind:"list",sortMode:"default",typeIcon:":material/list:",getCell(n){if(Ee(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=Jl(n);return{...t,data:{...t.data,values:r},copyData:Od(r),...e.isEditable&&!Td(n)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with
184non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(n){return Ee(n.data?.values)?null:n.data.values}}}fs.isEditableType=!0;const Zw=(e,t)=>{if(Ee(e))return[];const n=t.colors.chartCategoricalColors,r=Cc(t);let i=0;return e.filter(o=>o!==null&&o!=="").map(o=>{if(typeof o=="string")return{value:ot(o).trim(),label:void 0,color:void 0};let l;o.color==="auto"?(l=Ci(n[i%n.length],r?.7:.6),i+=1):o.color&&(l=Ah(o.color,t));const a=l?Hh(l,t.colors.bgColor):void 0;return{value:ot(o.value).trim(),label:o.label??void 0,color:a}})};function yf(e,t){const n=Pi({options:[],accept_new_options:!1},e.columnTypeOptions),r=Zw(n.options,t),i=new Set(r.map(l=>l.value)),o={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(l,a){if(Ee(l))return{...o,data:{...o.data,values:null},isMissingValue:!0,copyData:""};let s=Jl(l);return s=s.map(u=>ot(u).trim()),a&&s.length>0&&n.accept_new_options===!1&&(s=s.filter(u=>i.has(u)),s.length===0)?Et(ot(l),"The values could not be matched with the configured options."):{...o,data:{...o.data,values:s},copyData:Od(s),...e.isEditable&&!Td(l)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(l){return Ee(l.data?.values)?null:l.data.values}}}yf.isEditableType=!0;function hs(e){const t=Pi({step:Sc(e.arrowType)?1:void 0,min_value:zh(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Vh(e.arrowType)||$h(e.arrowType)),r=Ee(t.min_value)||t.min_value<0,i=ct(t.step)&&!Number.isNaN(t.step)?Pd(t.step):void 0,o={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:i,thousandSeparator:""},l=a=>{let s=go(a);if(Ee(s))return!e.isRequired;if(Number.isNaN(s))return!1;let u=!1;return ct(t.max_value)&&s>t.max_value&&(s=t.max_value,u=!0),ct(t.min_value)&&s<t.min_value?!1:u?s:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:l,getCell(a,s){if(s===!0){const d=l(a);if(d===!1)return Et(ot(a),"Invalid input.");typeof d=="number"&&(a=d)}let u=go(a),c="";if(ct(u)){if(Number.isNaN(u))return Et(ot(a),"The value cannot be interpreted as a number.");if(ct(i)&&(u=tb(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Et(ot(a),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=bl(u,e.arrowType):c=ia(u,t.format,i)}catch(d){return Et(ot(u),ct(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}}return{...o,data:u,displayData:c,isMissingValue:Ee(u),copyData:Ee(u)?"":ot(u)}},getCellValue(a){return a.data===void 0?null:a.data}}}hs.isEditableType=!0;function mo(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",typeIcon:":material/data_object:",isEditable:!1,getCell(n){try{const r=ct(n)?ot(n):null,i=ct(r)?po(r):"";return{...t,data:r,displayData:i,isMissingValue:Ee(n)}}catch(r){return Et(ot(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}mo.isEditableType=!1;function Cf(e,t){const n=Sc(e.arrowType),r=Pi({min_value:0,max_value:n?100:1,format:n?"%3d%%":"percent",step:n?1:void 0,color:void 0},e.columnTypeOptions),i=Ee(r.step)||Number.isNaN(r.step)?void 0:Pd(r.step);let o;try{o=ia(r.max_value,r.format,i)}catch{o=ot(r.max_value)}const l={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:r.min_value,max:r.max_value,step:r.step??.01,value:r.min_value,label:String(r.min_value),measureLabel:o}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(a){if(Ee(a))return El();if(Ee(r.min_value)||Ee(r.max_value)||Number.isNaN(r.min_value)||Number.isNaN(r.max_value)||r.min_value>=r.max_value)return Et("Invalid min/max parameters",`The min_value (${r.min_value}) and max_value (${r.max_value}) parameters must be valid numbers.`);if(ct(r.step)&&Number.isNaN(r.step))return Et("Invalid step parameter",`The step parameter (${r.step}) must be a valid number.`);const s=go(a);if(Number.isNaN(s)||Ee(s))return Et(ot(a),"The value cannot be interpreted as a number.");if(Number.isInteger(s)&&!Number.isSafeInteger(s))return Et(ot(a),"The value is larger than the maximum supported integer values in number columns (2^53).");let u="";try{u=ia(s,r.format,i)}catch(g){return Et(ot(s),ct(r.format)?`Failed to format the number based on the provided format configuration: (${r.format}). Error: ${g}`:`Failed to format the number. Error: ${g}`)}const c=Math.min(r.max_value,Math.max(r.min_value,s));let d;if(r.color==="auto"||r.color==="auto-inverse"){const g=r.max_value-r.min_value,p=(g===0?0:(c-r.min_value)/g)>.5;r.color==="auto"?d=p?t?.colors.greenColor:t?.colors.redColor:d=p?t?.colors.redColor:t?.colors.greenColor}else r.color&&(d=yc(r.color,t));return{...l,isMissingValue:Ee(a),copyData:String(s),data:{...l.data,value:c,label:u,measureLabel:u.length>
184o.length?u:o,color:d}}},getCellValue(a){return a.kind===Z.Loading||a.data?.value===void 0?null:a.data?.value}}}Cf.isEditableType=!1;const Jw=e=>Ee(e)?[]:e.filter(t=>ct(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=ot(t.value).trim();return{value:r,label:t.label??r}}const n=ot(t).trim();return{value:n,label:n}});function gs(e){let t="string";const n=Pi({options:xc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=s=>typeof s=="object"&&s!==null&&"value"in s,i=s=>r(s)?typeof s.value:typeof s,o=new Set(n.options.map(i));o.size===1&&(o.has("number")||o.has("bigint")?t="number":o.has("boolean")&&(t="boolean"));const l=Jw(n.options),a={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...l],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(s,u){let c=null;return ct(s)&&s!==""&&(c=ot(s)),u&&!a.data.allowedValues.some(g=>g===null?c===null:typeof g=="string"?g===c:typeof g=="object"&&"value"in g?g.value===c:!1)?Et(ot(c),"The value is not part of the allowed options."):{...a,isMissingValue:c===null,copyData:c||"",data:{...a.data,value:c}}},getCellValue(s){return Ee(s.data?.value)||s.data?.value===""?null:t==="number"?go(s.data?.value)??null:t==="boolean"?Dd(s.data?.value)??null:s.data?.value}}}gs.isEditableType=!0;function ps(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}. 185Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Ee(o))return!e.isRequired;let l=ot(o),a=!1;return t.max_chars&&l.length>t.max_chars&&(l=l.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(l)===!1?!1:a?l:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:i,getCell(o,l){if(typeof n=="string")return Et(ot(o),n);if(l){const a=i(o);if(a===!1)return Et(ot(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=ct(o)?ot(o):null,s=ct(a)?po(a):"";return{...r,isMissingValue:Ee(a),data:a,displayData:s}}catch(a){return Et("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ps.isEditableType=!0;const Qu=Ln("img",{target:"e16b5pc80"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),Qw=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?Ie("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:Ie(Qu,{src:t})}):Ie(Qu,{src:t})},ec=new Map(Object.entries({object:mo,text:ps,checkbox:ls,selectbox:gs,list:fs,multiselect:yf,number:hs,link:wf,datetime:us,date:ds,time:cs,line_chart:gf,bar_chart:pf,area_chart:mf,image:vf,progress:Cf,json:bf})),ey=[lb,qw],vo=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i?.type_config||n?.type_config)&&(o.type_config={...i?.type_config||{},...n?.type_config||{}}),r.set(e,o),r};function ty(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>vo({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function gl(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function ny(e,t,n){const r={};if(!n.includes(t))return e;const i=gl(t,"color",n);i&&(r.textDark=i,(e.kind===Z.Bubble||e.kind===Z.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=i),e.kind===Z.Uri&&(r.linkColor=i));const o=gl(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const l=gl(t,"font-weight",n);return l&&(r.baseFontStyle=`${l} ${eg.sm}`),r?{...e,themeOverride:r}:e}function ry(e){return Gh(e)||Xh(e)?ps:Yh(e)?us:kc(e)?cs:jh(e)?ds:qh(e)||Kh(e)?mo:xc(e)?ls:Zh(e)?hs:Jh(e)?gs:Qh(e)?fs:mo}function Sf(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function ms(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function iy(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=Sf(n),o=e.columnTypes[t];let l=!0;return Uh(o)&&(l=!1),ms({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:l,arrowType:o,isIndex:!0,isPinned:!0})}
185function oy(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:i}=Sf(n),o=e.columnTypes[t];return ms({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function xf(){return ms({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:tg.INDEX,arrowField:new Nh("",new Bh,!0),pandasType:void 0}})}function tc(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(xf()),t;for(let o=0;o<r;o++)t.push(iy(e,o));for(let o=0;o<i;o++)t.push(oy(e,o+r));return t}function ay(e,t,n,r=void 0){let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(ct(t.content)?po(bl(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&ct(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let o;kc(t.contentType)&&ct(t.field?.type?.unit)?o=bg(t.content,t.field):o=Nr.utc(Number(t.content)).toDate(),i=e.getCell(o)}else if(Wh(t.contentType)){const o=Ee(t.content)?null:bl(t.content,t.contentType);i=e.getCell(o)}else i=e.getCell(t.content);if(Ti(i))return i;if(!e.isEditable){if(n&&ct(n?.displayContent)){const o=po(n.displayContent);i.kind===Z.Text?i={...i,displayData:o}:i.kind===Z.Number&&Ee(e.columnTypeOptions?.format)?i={...i,displayData:o}:i.kind===Z.Uri&&Ee(e.columnTypeOptions?.display_text)?i={...i,displayData:o}:i.kind===Z.Custom&&i.data?.kind==="date-picker-cell"&&Ee(e.columnTypeOptions?.format)&&(i={...i,data:{...i.data,displayDate:o}})}r&&n?.cssId&&(i=ny(i,n.cssId,r))}return i}function kf(e){return e?.useStretch??!1}function Mf(e){if(e?.pixelWidth)return e.pixelWidth}function ly(e){return e?.useContent??!1}function sy(e,t){return t?!1:e?.useStretch??!1}function uy(e){return e?.useContent??!1}function cy(e){if(e?.pixelHeight)return e.pixelHeight}function pl({numRows:e,rowHeight:t,theme:n,numHeaderRows:r=1}){return e*t+r*n.defaultHeaderHeight+2*n.tableBorderWidth}const na="_index",nc="_pos:",rc={small:75,medium:200,large:400},Rf=_l.getLogger("useColumnLoader");function dy(e){if(!Ee(e)){if(typeof e=="number")return e;if(e in rc)return rc[e]}}const qo=(e,t)=>ng(e,t,(r,i)=>{if(pc(i))return i});function ic(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(na)&&(n=qo(n,t.get(na)??{})),t.has(`${nc}${e.indexNumber}`)&&(n=qo(n,t.get(`${nc}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==na&&(n=qo(n,t.get(e.name)??{})),t.has(e.id)&&(n=qo(n,t.get(e.id)??{})),Ng(n)?e:vc({...e},{title:n.label,width:dy(n.width),isEditable:ct(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,
185columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function fy(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return Rf.error(t),new Map}}function oc(e){const t=e.columnTypeOptions?.type;let n;return ct(t)&&(ec.has(t)?n=ec.get(t):Rf.warn(`Unknown column type configured in column configuration: ${t}`)),Ee(n)&&(n=ry(e.arrowType)),n}function hy(e,t,n,r,i){const o=Gr(),l=f.useMemo(()=>fy(e.columns),[e.columns]),[a,s]=f.useState(l);f.useEffect(()=>{s(l)},[l]);const u=f.useMemo(()=>kf(i),[i]),c=f.useMemo(()=>Mf(i),[i]),d=u||ct(c)&&c>0,g=ct(e.rowHeight)&&e.rowHeight>en("4rem"),h=f.useMemo(()=>tc(t).map(m=>{let y={...m,...ic(m,a),isStretched:d};const v=oc(y);return(e.editingMode===Yt.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(y={...y,isEditable:!1}),e.editingMode!==Yt.EditingMode.READ_ONLY&&y.isEditable==!0&&(y={...y,icon:"editable"},y.isRequired&&e.editingMode===Yt.EditingMode.DYNAMIC&&(y={...y,isHidden:!1})),v(y,o)}),[t,a,d,e.editingMode,n,o]);return{columns:f.useMemo(()=>{const m=tc(t).map(x=>{let T={...x,...ic(x,a),isStretched:d,isWrappingAllowed:g};const k=oc(T);return(e.editingMode===Yt.EditingMode.READ_ONLY||n||k.isEditableType===!1)&&(T={...T,isEditable:!1}),e.editingMode!==Yt.EditingMode.READ_ONLY&&T.isEditable==!0&&(T={...T,icon:"editable"},T.isRequired&&e.editingMode===Yt.EditingMode.DYNAMIC&&(T={...T,isHidden:!1})),k(T,o)}).filter(x=>!x.isHidden),y=[],v=[];r?.length?(m.forEach(x=>{x.isIndex&&!r.includes(x.name)&&!r.includes(x.id)&&x.isPinned!==!1&&y.push(x)}),r.forEach(x=>{const T=m.find(k=>k.name===x||k.id===x);T&&(T.isPinned?y.push(T):v.push(T))})):m.forEach(x=>{x.isPinned?y.push(x):v.push(x)});const b=[...y,...v];return b.length>0?b:[mo(xf())]},[t,a,g,d,n,e.editingMode,r,o]),allColumns:h,setColumnConfigMapping:s}}function gy(e,t,n,r,i,o){const l=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||l?0:e.filter(c=>c.isPinned).length,s=f.useCallback(c=>{o(d=>vo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>vo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:s,freezeColumns:a}}function py(e,t,n,r,i){return{onColumnMoved:f.useCallback((l,a)=>{const s=[...e],[u]=s.splice(l,1);s.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(s.map(c=>c.id))},[e,t,n,r,i])}}function my(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,l,a,s)=>{o.id&&n(new Map(t).set(o.id,s))},[t]);return{columns:f.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function vy(e){switch(e.kind){case Z.Number:return e.data?.toString()??"";case Z.Boolean:return e.data?.toString()??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(t=>t.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function ac(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function by(e,t){return e=ac(e),t=ac(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function wy(e,t){return e>t?1:e===t?0:-1}function yy(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),l=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let p=0;p<n;p++)h[1]=p,c[d][p]=vy(r(h))}return Mr(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:p}=u[h],m=c[h][d],y=c[h][g];let v;if(p.mode==="raw"?v=wy(m,y):p.mode==="smart"?v=by(m,y):v=m.localeCompare(y),v!==0)return(p.direction??"asc")==="desc"&&(v=-v),v}return 0})},[r,n,i,o]),a=f.useCallback(u=>l===void 0?u:l[u],[l]),s=f.useCallback(([u,c])=>l===void 0?r([u,c]):(c=l[c],r([u,c])),[r,l]);return l===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:s}}function Cy(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`â ${n.title}`:`â ${n.title}`}:n)}function Sy(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:l}=yy({columns:t.map(u=>Tl(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>Cy(t,r),[t,r]),s=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r?.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===r?.direction?i(void 0):i({column:Tl(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:s,getOriginalIndex:l,getCellContent:o}}function xy(e,t){const n=f.useCallback(i=>{t(o=>vo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>vo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function ky(){return{provideEditor:f.useCallback(t=>{if(t.kind===Z.Text&&t.readonly&&eb(t.data))return{editor:ab}},[])}}const My={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:l}=e;let{values:a,yAxis:s,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,p]=s;if(a.length===0)return!0;a=a.map(R=>Math.min(1,Math.max(0,(R-h)/(p-h))));const m=r.cellHorizontalPadding,y=m+i.x,v=i.y+3,b=i.height-6,x=i.width-m*2,T=p-h,k=p<=0?v:h>=0?v+b:v+b*(p/T);if(!g&&h<=0&&p>=0&&(n.beginPath(),n.moveTo(y,k),n.lineTo(y+x,k),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const R=2,P=(a.length-1)*R,I=(x-P)/a.length;let C=y;for(const F of a){const D=v+b-F*b;n.moveTo(C,k),n.lineTo(C+I,k),n.lineTo(C+I,D),n.lineTo(C,D),C+=I+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();
185const R=(i.width-16)/(a.length-1),P=a.map((C,F)=>({x:y+R*F,y:v+b-C*b}));n.moveTo(P[0].x,P[0].y);let I=0;if(P.length>2)for(I=1;I<P.length-2;I++){const C=(P[I].x+P[I+1].x)/2,F=(P[I].y+P[I+1].y)/2;n.quadraticCurveTo(P[I].x,P[I].y,C,F)}if(n.quadraticCurveTo(P[I].x,P[I].y,P[I+1].x,P[I+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-m,k),n.lineTo(i.x+m,k),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const C=n.createLinearGradient(0,v,0,v+b*1.4);C.addColorStop(0,u??r.accentColor);const[F,D,S]=co(u??r.accentColor);C.addColorStop(1,`rgba(${F}, ${D}, ${S}, 0)`),n.fillStyle=C,n.fill(),n.globalAlpha=1}if(l!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const C=Math.min(a.length-1,Math.max(0,Math.round((l-m)/R)));n.moveTo(y+C*R,i.y+1),n.lineTo(y+C*R,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[C],y,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function lc(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}const Ry=e=>{const{Menu:t}=Ra,{children:n,...r}=e;return f.createElement(t,{...r},n)},Iy=dn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Ey=dn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Ty=dn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Dy=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:l}=t.data,[a,s]=f.useState(l),[u,c]=f.useState(r??""),d=ud(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(Ty,null,f.createElement(Yr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(Iy,null,f.createElement(cf,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:p})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:p?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(Ey,null,f.createElement(Ry,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(s(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},Oy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,l=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),a=typeof l=="string"?l:l?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+qn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Dy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>
185({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function Py(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],l=i*t;return e.replace(n,`${Number(l.toPrecision(3))}${o}`)}return e}const Ly={marginRight:8},Fy={display:"flex",alignItems:"center",flexGrow:1},_y={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:l,value:a,label:s,measureLabel:u,color:c}=t.data,d=i.x+r.cellHorizontalPadding,g=i.y+i.height/2,h=l-o,p=(a-o)/h,m=`${Py(r.baseFontStyle,.9)} ${r.fontFamily}`,v=Ul(n,m)/2;n.save();let b=0;s!==void 0&&(n.font=m,b=Er(u??s,n,m).width+r.cellHorizontalPadding);const x=i.width-r.cellHorizontalPadding*2-b;if(x>=v){const T=n.createLinearGradient(d,g,d+x,g),k=c??r.accentColor;T.addColorStop(0,k),T.addColorStop(p,k),T.addColorStop(p,r.bgBubble),T.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=T,lc(n,d,g-v/2,x,v,v/2),n.fill(),n.beginPath(),lc(n,d+.5,g-v/2+.5,x-1,v-1,(v-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,i.x+i.width-r.cellHorizontalPadding,g+qn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),l=t.step.toString(),a=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return f.createElement("label",{style:Fy},f.createElement("input",{style:Ly,type:"range",value:r,min:i,max:o,step:l,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Ay=dn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ml=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Hy=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,l=t.min instanceof Date?ml(n,t.min,o):t.min,a=t.max instanceof Date?ml(n,t.max,o):t.max,s=ml(n,t.date,o);return e.value.readonly?zt.createElement(Yr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):zt.createElement(Ay,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:l,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},zy={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Wl(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Hy}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},Vy="None";function sc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const $y=(e,t)=>{const{cell:n,theme:r,ctx:i}=e;Wl({...e,theme:{...r,textDark:r.textLight,headerFontFull:`${r.headerFontStyle} ${r.fontFamily}`,baseFontFull:`${r.baseFontStyle} ${r.fontFamily}`,markerFontFull:`${r.markerFontStyle} ${r.fontFamily}`}},t,n.contentAlign),i.fillStyle=r.textDark};function Ny(e,t){const n=f.useCallback((i,o)=>{const{cell:l,theme:a,ctx:s,rect:u}=i,c=i.col;if(Ti(l))sc(s,u,a);else if(Zl(l)&&c<e.length){const d=e[c],g=t??Vy;["checkbox","line_chart","bar_chart","progress"].includes(d.kind)?o():$y(i,g),d.isRequired&&d.isEditable&&sc(s,u,a);return}o()},[e,t]),r=f.useMemo(()=>[My,Oy,_y,zy,...ey],[]);return{drawCell:n,customRenderers:r}}function By(){const e=Gr();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:Ci(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Ci(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroun
185dColor,bgHeaderHasFocus:Ci(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Ci(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(en("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${en(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${en(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Ci(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(en(e.spacing.sm)),cellVerticalPadding:Math.round(en("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:rg(e.colors.secondaryBg,.1),bubbleHeight:Math.round(en("1.25rem")),bubblePadding:Math.round(en(e.spacing.sm)),bubbleMargin:Math.round(en(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(en(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:parseInt(e.sizes.borderWidth),defaultTableHeight:Math.round(en("25rem")),minColumnWidth:Math.round(en("3.125rem")),maxColumnWidth:Math.round(en("62.5rem")),maxColumnAutoWidth:Math.round(en("31.25rem")),defaultRowHeight:Math.round(en("2.1875rem")),defaultHeaderHeight:Math.round(en("2.1875rem")),bgRowHovered:ig(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Wy=_l.getLogger("useDataEditor");function Uy({columns:e,allColumns:t,canAddRows:n,canDeleteRows:r,editingState:i,getCellContent:o,getOriginalIndex:l,refreshCells:a,updateNumRows:s,syncEditState:u,clearSelection:c}){const d=f.useCallback(([v,b],x)=>{const T=e[v];if(!T.isEditable)return;const k=T.indexNumber,R=i.current.getOriginalRowIndex(l(b)),P=o([v,b]),I=T.getCellValue(P),C=T.getCellValue(x);if(!Ti(P)&&C===I)return;const F=T.getCell(C,!0);Ti(F)?Wy.warn(`Not applying the cell edit since it causes this error: 186 ${F.data}`):(i.current.setCell(k,R,{...F,lastUpdated:performance.now()}),u())},[e,i,l,o,u]),g=f.useCallback(()=>{if(!n)return;const v=new Map;t.forEach(b=>{v.set(b.indexNumber,b.getCell(b.defaultValue))}),i.current.addRow(v),s()},[t,i,n,s]),h=f.useCallback(()=>{n&&(g(),u())},[g,u,n]),p=f.useCallback(v=>{if(v.rows.length>0){if(!r)return!0;const b=v.rows.toArray().map(x=>i.current.getOriginalRowIndex(l(x)));return i.current.deleteRows(b),s(),c(),u(),!1}if(v.current?.range){const b=[],x=v.current.range;for(let T=x.y;T<x.y+x.height;T++)for(let k=x.x;k<x.x+x.width;k++){const R=e[k];R.isEditable&&!R.isRequired&&(b.push({cell:[k,T]}),d([k,T],R.getCell(null)))}return b.length>0&&(u(),a(b)),!1}return!0},[e,i,r,a,l,u,d,c,s]),m=f.useCallback((v,b)=>{const[x,T]=v,k=[];for(let R=0;R<b.length;R++){const P=b[R];if(R+T>=i.current.getNumRows()){if(!n)break;g()}for(let I=0;I<P.length;I++){const C=P[I],F=R+T,D=I+x;if(D>=e.length)break;const S=e[D];if(S.isEditable){const E=S.getCell(C,!0);if(ct(E)&&!Ti(E)){const O=S.indexNumber,M=i.current.getOriginalRowIndex(l(F)),V=S.getCellValue(o([D,F]));S.getCellValue(E)!==V&&(i.current.setCell(O,M,{...E,lastUpdated:performance.now()}),k.push({cell:[D,F]}))}}}k.length>0&&(u(),a(k))}return!1},[e,i,n,l,o,g,u,a]),y=f.useCallback((v,b)=>{const x=v[0];if(x>=e.length)return!0;const T=e[x];if(T.validateInput){const k=T.validateInput(T.getCellValue(b));return k===!0||k===!1?k:T.getCell(k)}return!0},[e]);return{onCellEdited:d,onPaste:m,onRowAppended:h,onDelete:p,validateCell:y}}const If=",",io='"',Gy='"',Ef=` 187`,Xy="\uFEFF",Yy=new RegExp(`[${[If,io,Ef].join("")}]`),uc=_l.getLogger("useDataExporter");function cc(e){return e.map(t=>jy(t)).join(If)+Ef}function jy(e){if(Ee(e))return"";const t=ot(e);return Yy.test(t)?`${io}${t.replace(new RegExp(io,"g"),Gy+io)}${io}`:t}async function dc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Xy));const o=n.map(l=>l.name);await e.write(i.encode(cc(o)));for(let l=0;l<r;l++){const a=[];n.forEach((s,u,c)=>{a.push(s.getCellValue(t([u,l])))}),await e.write(i.encode(cc(a)))}await e.close()}function qy(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const l=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fl(()=>import("./es6.dvmAQaa3.js").then(c=>c.a),__vite__mapDeps([21,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:l,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await dc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{uc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let s="";const u=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await dc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Ig({enforceDownloadInNewTab:r,url:d,filename:l});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}
187catch(s){uc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Ky(e,t,n,r){return{getCellContent:f.useCallback(([o,l])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(l>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],s=a.indexNumber,u=r.current.getOriginalRowIndex(l),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(s,u);if(ct(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Et("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}const d=e.getCell(u,s),g=wg(e,u,s);return ay(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug. 188Error: ${a}`)}},[t,n,e,r])}}function Zy(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,l]=o.location;n(l)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Jy(e,t,n,r,i){const[o,l]=f.useState({columns:Qe.empty(),rows:Qe.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(Yt.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Yt.SelectionMode.SINGLE_ROW)),s=a&&e.selectionMode.includes(Yt.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Yt.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Yt.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Yt.SelectionMode.MULTI_COLUMN),d=!t&&!n&&(e.selectionMode.includes(Yt.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(Yt.SelectionMode.MULTI_CELL)),g=d&&e.selectionMode.includes(Yt.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,y=f.useCallback(b=>{const x=!Ka(b.rows.toArray(),o.rows.toArray()),T=!Ka(b.columns.toArray(),o.columns.toArray()),k=!Ka(b.current,o.current),R=a&&x||u&&T||d&&k;let P=b;if(T&&P.columns.length>=0){let I=P.columns;r.forEach((C,F)=>{C.isIndex&&(I=I.remove(F))}),I.length<P.columns.length&&(P={...P,columns:I})}l(P),R&&i(P,d)},[o,a,u,d,i,r]),v=f.useCallback((b=!1,x=!1)=>{const T={columns:x?o.columns:Qe.empty(),rows:b?o.rows:Qe.empty(),current:void 0};l(T),(!b&&a||!x&&u||d)&&i(T,d)},[o,a,u,d,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:d,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:v,processSelectionChange:y}}function Qy(e,t,n,r,i,o,l,a,s,u,c){const d=e.rowHeight??t.defaultRowHeight,g=r?2:1,h=e.editingMode===Yt.EditingMode.DYNAMIC||e.editingMode===Yt.EditingMode.ADD_ONLY?1:0,p=n+h,m=pl({numRows:p,rowHeight:d,theme:t,numHeaderRows:g}),y=cy(s),v=sy(s,c),b=uy(s),x=v?Math.max(1,Math.min(n,3)):1,T=pl({numRows:x,rowHeight:d,theme:t}),k=1e4;let R=Math.max(m,T),P=Math.min(R,t.defaultTableHeight);if(v&&u&&u>0)R=Math.max(u,R);else if(b){const W=Math.ceil(k/d),j=Math.min(p,W),oe=pl({numRows:j,rowHeight:d,theme:t,numHeaderRows:g})+1;P=Math.max(oe,T),R=Math.max(P,R)}else y&&(P=Math.max(y,T),R=Math.max(P,R));o&&(P=Math.min(P,o),R=Math.min(R,o),y||(P=R));const I=t.minColumnWidth+2*t.tableBorderWidth,C=Math.max(i,I);let F,D=C;const S=kf(a),E=Mf(a),O=ly(a);S?F=C:E?(F=Math.min(Math.max(E,I),C),D=Math.min(Math.max(E,D),C)):O&&(F=void 0);const[M,V]=f.useState({width:F||"100%",height:v?"100%":P});return f.useLayoutEffect(()=>{S&&M.width==="100%"&&V(W=>({...W,width:C}))},[C]),f.useLayoutEffect(()=>{V(W=>({...W,width:F||"100%"}))},[F]),f.useLayoutEffect(()=>{V(W=>({...W,height:v?"100%":P}))},[P,n,u,v,c]),f.useLayoutEffect(()=>{if(l){const W=S||ct(E)&&E>0;V({width:W?D:"100%",height:R})}else V({width:F||"100%",height:P})},[l]),{minHeight:T,maxHeight:R,minWidth:I,maxWidth:D,rowHeight:d,resizableSize:M,setResizableSize:V}}const eC=600,tC="â ï¸ Please fill out this cell.";function nC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(),{clear:l,restart:a}=ra(()=>{o.current&&(i(o.current),o.current=void 0)},eC,{autoStart:!1}),s=f.useCallback(c=>{if(l(),o.current=void 0,i(void 0),(c.kind==="header"||c.kind==="cell")&&c.location){const d=c.location[0],g=c.location[1];let h;if(d<0||d>=e.length||n.includes(g))return;const p=e[d];if(c.kind==="header"&&ct(p))h=p.help;else if(c.kind==="cell"){const m=t([d,g]);Ti(m)?h=m.errorDetails:p.isRequired&&p.isEditable&&Zl(m)?h=tC:Jv(m)&&(h=m.tooltip)}h&&(o.current={content:h,left:c.bounds.x+c.bounds.width/2,top:c.bounds.y},a())}},[l,e,t,n,a]),u=f.useCallback(()=>
188{l(),o.current=void 0,i(void 0)},[l,i]);return{tooltip:r,clearTooltip:u,onItemHovered:s}}function Br(e){return e.isIndex?na:Ee(e.name)?"":e.name}class Ko{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,l,a)=>{const s={};o.forEach((u,c)=>{const d=n.get(c);d&&(s[Br(d)]=d.getCellValue(u))}),r.edited_rows[l]=s}),this.addedRows.forEach(o=>{const l={};let a=!1;o.forEach((s,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(s);d.isRequired&&d.isEditable&&Zl(s)&&(a=!0),ct(g)&&(l[Br(d)]=g)}}),a||r.added_rows.push(l)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,l)=>l===void 0?null:l)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(l=>{i.set(l.indexNumber,l)});const o=new Map;n.forEach(l=>{o.set(Br(l),l)}),Object.keys(r.edited_rows).forEach(l=>{const a=Number(l),s=r.edited_rows[l];Object.keys(s).forEach(u=>{const c=s[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(d.indexNumber,g))}})}),r.added_rows.forEach(l=>{const a=new Map;n.forEach(s=>{a.set(s.indexNumber,s.getCell(null))}),Object.keys(l).forEach(s=>{const u=l[s],c=o.get(s);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Ee(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const Tf=150;function rC({element:e,widgetMgr:t,fragmentId:n,originalNumRows:r,originalColumns:i}){const{READ_ONLY:o}=Yt.EditingMode,l=f.useRef(new Ko(r)),[a,s]=f.useState(l.current.getNumRows());og(()=>{l.current=new Ko(r),s(l.current.getNumRows())},[r]);const u=f.useCallback(()=>{l.current=new Ko(r),s(l.current.getNumRows())},[r]),c=f.useCallback(()=>{s(y=>{const v=l.current.getNumRows();return y!==v?v:y})},[]);f.useEffect(()=>{if(e.editingMode===o||!t)return;const y=t.getStringValue({id:e.id,formId:e.formId});y&&(l.current.fromJson(y,i),s(l.current.getNumRows()))},[]);const d=f.useCallback(()=>{if(!t)return;const y=l.current.toJson(i);let v=t.getStringValue({id:e.id,formId:e.formId});v===void 0&&(v=new Ko(0).toJson([])),y!==v&&t.setStringValue({id:e.id,formId:e.formId},y,{fromUi:!0},n)},[i,e.id,e.formId,t,n]),{debouncedCallback:g}=Ed(d,Tf),h=f.useCallback((y,v)=>(b,x)=>{if(!t)return;const T={selection:{rows:[],columns:[],cells:[]}};if(T.selection.rows=b.rows.toArray().map(P=>v(P)),T.selection.columns=b.columns.toArray().map(P=>Br(y[P])),x&&b.current){const{cell:P,range:I}=b.current;if(I)for(let C=I.y;C<I.y+I.height;C++)for(let F=I.x;F<I.x+I.width;F++)y[F].isIndex||T.selection.cells.push([v(C),Br(y[F])]);else if(P){const[C,F]=P;y[C].isIndex||T.selection.cells.push([v(F),Br(y[C])])}}const k=JSON.stringify(T),R=t.getStringValue({id:e.id,formId:e.formId});(R===void 0||R!==k)&&t.setStringValue({id:e.id,formId:e.formId},k,{fromUi:!0},n)},[e.id,e.formId,t,n]),p=f.useCallback(({columns:y,isRowSelectionActivated:v,isColumnSelectionActivated:b,isCellSelectionActivated:x,isMultiCellSelectionActivated:T})=>{if(!v&&!b&&!x||!t)return;const k=t.getStringValue({id:e.id,formId:e.formId});if(!k)return;const R=y.map(D=>Br(D)),P=JSON.parse(k);let I=Qe.empty(),C=Qe.empty(),F;if(P.selection?.rows?.forEach(D=>{I=I.add(D)}),P.selection?.columns?.forEach(D=>{C=C.add(R.indexOf(D))}),x&&!T){const[D,S]=P.selection?.cells?.[0]??[];D!==void 0&&S!==void 0&&(F=[R.indexOf(S),D])}if(I.length>0||C.length>0||F!==void 0)return{rows:I,columns:C,current:F?{cell:F,range:{x:F[0],y:F[1],width:1,height:1},rangeStack:[]}:void 0}},[t,e.id,e.formId]),m=f.useCallback(()=>{u()},[u]);return{editingState:l,numRows:a,resetEditingState:u,updateNumRows:c,syncEditState:g,createSyncSelectionState:h,onFormCleared:m,loadInitialSelectionState:p}}const Df=Ln("div",{target:"e1gmp2ct0"})(({theme:e})=>({paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS,paddingLeft:e.spacing.xs,paddingRight:e.spacing.xs})),kr=Ln("div",{target:"e1gmp2ct1"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",ga
188p:e.spacing.sm,marginTop:e.spacing.twoXS,marginBottom:e.spacing.twoXS,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS,cursor:"pointer",borderRadius:e.radii.md2,backgroundColor:t?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),Of=Ln("div",{target:"e1gmp2ct2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs,marginLeft:e.spacing.xs,marginRight:`max(0px, calc(${e.spacing.xs} - var(--scrollbar-gutter-size, 0px)))`})),iC=Ln("div",{target:"e1gmp2ct3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.twoXS} ${e.spacing.none}`,cursor:"default",gap:e.spacing.twoXS})),oC=Ln("div",{target:"e1gmp2ct4"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md2,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"})),aC=Ln("div",{target:"e1gmp2ct5"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md2,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"})),lC=Ln("span",{target:"e1gmp2ct6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),sC=Ln("button",{target:"e1gmp2ct7"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.sm,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}})),fc=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],uC={number:fc,progress:fc,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function cC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:l}){const a=Gr(),{colors:s,fontSizes:u,fontWeights:c}=a,d=uC[e]||[];return d.length===0?Ie(Mc,{}):Ie(Sa,{triggerType:Rc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:Ie(Df,{role:"menu",children:d.map(g=>mn(kr,{onClick:()=>{i(g.format),o()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:g.icon}),g.label]},g.format))}),placement:ya.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:()=>({...Ca(a),paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"})},Inner:{style:()=>({backgroundColor:s.bgColor,color:s.bodyText,fontSize:u.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"})}},children:l})}const dC=f.memo(cC);function fC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:l,onHideColumn:a,column:s,onChangeFormat:u,onAutosize:c}){const d=Gr(),[g,h]=f.useState(!1),{colors:p,fontSizes:m,fontWeights:y}=d,{isCopied:v,copyToClipboard:b}=ag();f.useEffect(()=>{function k(R){R.preventDefault()}return document.addEventListener("wheel",k,{passive:!1}),document.addEventListener("touchmove",k,{passive:!1}),()=>{document.removeEventListener("wheel",k),document.removeEventListener("touchmove",k)}},[]);const x=f.useCallback(()=>{o()},[o]),T=f.useCallback(()=>{b(s.title)},[s.title,b]);return Ie(Sa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:mn(Df,{children:[mn(iC,{children:[Ie(oC,{title:s.kind,children:Ie(Gn,{size:"base",iconValue:s.typeIcon||":material/notes:"})}),mn(aC,{title:s.title,children:[Ie(lC,{children:s.title}),Ie(sC,{onClick:T,title:"Copy column name","aria-label":"Copy column name",children:Ie(Gn,{size:"sm",iconValue:v?":material/check:":":material/content_copy:"})})]})]}),l&&mn(Mc,{children:[mn(kr,{onClick:()=>{l("asc"),x()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),mn(kr,{onClick:()=>{l("desc"),x()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Ie(Of,{})]}),u&&Ie(dC,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:x,children:mn(kr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[mn("div",{children:[Ie(Gn,{size:"base",iconValue:":material/format_list_numbered:"}),"Format"]}),Ie(Gn,{size:"base",iconValue:":material/chevron_right:"})]})}),c&&mn(kr,{onClick:()=>{c(),x()},children:[Ie(Gn,{size:"base",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&mn(kr,{onClick:()=>{i(),x()},children:[Ie(Gn,{size:"base",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&mn(kr,{onClick:()=>{r(),x()},children:[Ie(Gn,{size:"base",iconValue:":material/keep:"}),"Pin column"]}),a&&mn(kr,{onClick:()=>{a(),x()},children:[Ie(Gn,{size:"base",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:ya.bottomRight,accessibilityType:Ic.menu,showArrow:!1,popoverMargin:en("0.375rem"),onClickOutside:g?void 0:x,onEsc:x,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",boxShadow:"none"}},Inner:{style:()=>({...Ca(d),backgroundColor:p.bgColor,color:p.bodyText,fontSize:m.sm,fontWeight:y.normal,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"})}},isOpen:!0,children:Ie("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const hC=f.memo(fC),gC="(index)";function vl(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const hc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Gr();return Ie(Rg,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:Mg.default,labelPlacement:kg.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:l,$isIndeterminate:a})=>{const s=l||a?i.colors.primary:i.colors.borderColor;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(l||a)?i.shadows.focusRing:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},pC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:l,onClose:a})=>{const s=Gr(),u=Ec(),c=p=>!(p.isHidden===!0||vl(p,t)),d=e.every(c),g=e.some(c)&&!d,h=p=>{e.forEach(m=>{const y=vl(m,t);p?(i(m.id),y&&n(v=>[...v,m.id])):r(m.id)})};return Ie(Sa,{triggerType:Rc.click,placement:ya.bottomRight,autoFocus:!0,focusLock:!0,content:()=>mn("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:`min(${s.sizes.maxDropdownHeight}, 70vh)`,overflow:"auto","--scrollbar-gutter-size":`${u}px`},children:[Ie(hc,{label:"Select all",isIndeterminate:g,initialValue:d,onChange:p=>{h(p)}}),Ie(Of,{}),Ie("div",{children:e.map(p=>{const m=vl(p,t);return Ie(hc,{label:!p.title&&p.isIndex?gC:p.title,initialValue:!(p.isHidden===!0||m),onChange:y=>{y?(i(p.id),m&&n(v=>[...v,p.id])):r(p.id)}}
188,p.id)})})]}),isOpen:l,onClickOutside:a,onClick:()=>l?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:()=>({...Ca(s),paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",overflow:"hidden"})},Inner:{style:()=>({backgroundColor:s.colors.bgColor,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"})}},children:Ie("div",{children:o})})},mC=f.memo(pC),gc=Ln("div",{target:"e6fw1190"})(({theme:e,disableResize:t,minHeight:n})=>({position:"relative",display:t?"flex":"inline-block",height:"100%","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",minHeight:n,borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{...Ca(e),maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}));function vC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),l=Gr(),{colors:a,fontSizes:s,radii:u,fontWeights:c}=l,d=f.useCallback(()=>{o(!1),r()},[r,o]);return Ie(Sa,{content:Ie(lg,{"data-testid":"stDataFrameTooltipContent",children:Ie(sg,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:ya.top,accessibilityType:Ic.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Cc(l)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Ie("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const bC=f.memo(vC),wC=15e4,yC="0.5rem";function CC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:l,widthConfig:a,heightConfig:s}){const{expanded:u,expand:c,collapse:d,width:g,height:h}=Ls(pg),{isInHorizontalLayout:p,isInRoot:m}=Ls(ug),y=f.useRef(null),v=f.useRef(null),b=Ec(),{height:x,elementRef:T}=cg(),k=By(),{getRowThemeOverride:R,onItemHovered:P}=Zy(k),{enforceDownloadInNewTab:I=!1}=f.useContext(dg),[C,F]=f.useState(!0),[D,S]=f.useState(!1),[E,O]=f.useState(!1),[M,V]=f.useState(!1),[W,j]=f.useState(),[oe,Q]=f.useState(!1),re=f.useCallback(()=>Q(Le=>!Le),[]),se=f.useCallback(()=>Q(!1),[]),ae=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Ee(e.editingMode)&&(e.editingMode=Yt.EditingMode.READ_ONLY);const{READ_ONLY:de,DYNAMIC:fe,ADD_ONLY:ue,DELETE_ONLY:H}=Yt.EditingMode,L=t.dimensions,Y=Math.max(0,L.numDataRows),te=Y===0&&!((e.editingMode===fe||e.editingMode===ue)&&L.numDataColumns>0),le=Y>wC,Se=!le&&!te&&e.editingMode!==fe&&e.editingMode!==ue,pe=!te&&(e.editingMode===fe||e.editingMode===ue)&&!n,et=!te&&(e.editingMode===fe||e.editingMode===H)&&!n,[ke,Dt]=f.useState(e.columnOrder);f.useEffect(()=>{Dt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:dt,allColumns:Ne,setColumnConfigMapping:ne}=hy(e,t,n,ke,a),{editingState:ve,numRows:me,updateNumRows:he,syncEditState:Ce,createSyncSelectionState:Ae,onFormCleared:Oe,loadInitialSelectionState:at}=rC({element:e,widgetMgr:r,fragmentId:o,originalNumRows:Y,originalColumns:dt}),{getCellContent:Pe}=Ky(t,dt,me,ve),{columns:we,sortColumn:He,getOriginalIndex:Re,getCellContent:Be}=Sy(Y,dt,Pe),ft=f.useMemo(()=>Ae(we,Re),[Ae,we,Re]),{debouncedCallback:ht}=Ed(ft,Tf),{gridSelection:Ye,isRowSelectionActivated:pt,isMultiRowSelectionActivated:Nt,isColumnSelectionActivated:St,isMultiColumnSelectionActivated:Tt,isCellSelectionActivated:Bt,isMultiCellSelectionActivated:qt,isRowSelected:an,isColumnSelected:It,isCellSelected:gt,clearSelection:Wt,processSelectionChange:wt}=Jy(e,te,n,we,ht);f.useEffect(()=>{Bt||Wt(!0,!0)},[u]);const ln=f.useCallback(Le=>{v.current?.updateCells(Le)},[]);f.useEffect(()=>{const Le=at({columns:we,isRowSelectionActivated:pt,isColumnSelectionActivated:St,isCellSelectionActivated:Bt,isMultiCellSelectionActivated:qt});Le&&wt(Le)},[]);const{exportToCsv:Mn}=qy(Be,we,me,I),{onCellEdited:De,onPaste:mt,onRowAppended:xt,onDelete:bn,validateCell:tn}=Uy({columns:we,allColumns:Ne,canAddRows:pe,canDeleteRows:et,editingState:ve,getCellContent:Be,getOriginalIndex:Re,refreshCells:ln,updateNumRows:he,syncEditState:Ce,clearSelection:Wt}),nn=f.useMemo(()=>te?[0]:pe?[me]:[],[te,pe,me]),{tooltip:cn,clearTooltip:$t,onItemHovered:Zt}=nC(we,Be,nn),{drawCell:Ge,customRenderers:kt}=Ny(we,e.placeholder??void 0),{provideEditor:Rn}=ky(),Ot=f.useCallback(Le=>({...Le,hasMenu:!te}
188),[te]),bt=f.useMemo(()=>we.map(Le=>Ot(Tl(Le))),[we,Ot]),{columns:wn,onColumnResize:or}=my(bt),Kn=t.dimensions.numHeaderRows>1,{minHeight:B,maxHeight:We,minWidth:je,maxWidth:Pt,rowHeight:Kt,resizableSize:rn,setResizableSize:In}=Qy(e,k,me,Kn,g||0,h,u,a,s,x,m),yn=f.useCallback(([Le,fn])=>({...Qv(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:k.glideTheme.textLight},span:[0,Math.max(we.length-1,0)]}),[we,k.glideTheme.textLight]),Gt=f.useCallback(()=>{Oe(),Wt()},[Oe,Wt]);mg({element:e,widgetMgr:r,onFormCleared:Gt});const{pinColumn:Cn,unpinColumn:Sn,freezeColumns:qr}=gy(we,te,g||0,k.minColumnWidth,Wt,ne),{changeColumnFormat:Kr}=ty(ne),{hideColumn:Zr,showColumn:Li}=xy(Wt,ne),{onColumnMoved:Fn}=py(we,qr,Cn,Sn,Dt),Zn=f.useCallback(()=>{if(T.current&&v.current){const Le=T.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Le&&(O(Le.height>T.current.clientHeight),V(Le.width>T.current.clientWidth))}},[v,T]),{clear:Jr,restart:Qr}=ra(Zn,0,{autoStart:!1}),$n=f.useRef(null),{restart:ei}=ra(()=>{Ee($n.current)||(v.current?.remeasureColumns(Qe.fromSingleSelection($n.current)),$n.current=null)},100,{autoStart:!1});f.useEffect(()=>{const Le=requestAnimationFrame(()=>{Qr()});return()=>{cancelAnimationFrame(Le),Jr()}},[Jr,wn,me,T,rn,Qr]),f.useEffect(()=>{Ne.length==we.length&&Q(!1)},[Ne.length,we.length]);const Nn=!!(p||a?.useContent&&!m);return mn(gc,{className:"stDataFrame","data-testid":"stDataFrame",ref:T,isInHorizontalLayout:p,minHeight:B,disableResize:Nn,onPointerDown:Le=>{if(T.current){const fn=T.current.getBoundingClientRect(),Jn=(b||Math.round(en(yC)))+1;M&&fn.height-Jn<Le.clientY-fn.top&&Le.stopPropagation(),E&&fn.width-Jn<Le.clientX-fn.left&&Le.stopPropagation()}},onBlur:Le=>{!C&&!ae&&!Le.currentTarget.contains(Le.relatedTarget)&&!Bt&&Wt(!0,!0)},children:[mn(fg,{isFullScreen:u,disableFullscreenMode:i,locked:an&&!pt||gt||ae&&C||oe,onExpand:c,onCollapse:d,target:gc,children:[l?.map(Le=>Le),(pt&&an||St&&It||Bt&>)&&Ie(wi,{label:"Clear selection",icon:xg,onClick:()=>{Wt(),$t()}}),et&&an&&Ie(wi,{label:"Delete row(s)",icon:Eg,onClick:()=>{bn&&(bn(Ye),$t())}}),pe&&!an&&Ie(wi,{label:"Add row",icon:Dc,onClick:()=>{xt&&(F(!0),xt(),$t(),v.current?.scrollTo(0,me,"vertical"))}}),!te&&Ne.length>we.length&&Ie(mC,{columns:Ne,columnOrder:ke,setColumnOrder:Dt,hideColumn:Zr,showColumn:Li,isOpen:oe,onClose:se,children:Ie(wi,{label:"Show/hide columns",icon:Pc,onClick:re})}),!le&&!te&&Ie(wi,{label:"Download as CSV",icon:Tg,onClick:Mn}),!te&&Ie(wi,{label:"Search",icon:Oc,onClick:()=>{D?S(!1):(F(!0),S(!0)),$t()}})]}),Ie(hg,{"data-testid":"stDataFrameResizable",ref:y,defaultSize:rn,style:{border:`${k.tableBorderWidth}px solid ${k.glideTheme.borderColor}`,borderRadius:`${k.tableBorderRadius}`},minHeight:B,maxHeight:We,minWidth:je,maxWidth:Nn?void 0:Pt,size:rn,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!Nn,bottomLeft:!1,topLeft:!1},grid:[1,Kt],snapGap:Kt/3,onResizeStop:(Le,fn,Jn,_n)=>{if(y.current){const sn=2*k.tableBorderWidth;In({width:y.current.size.width,height:We-y.current.size.height===sn?y.current.size.height+sn:y.current.size.height})}},children:Ie(Yv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:v,columns:wn,rows:te?1:me,minColumnWidth:k.minColumnWidth,maxColumnWidth:k.maxColumnWidth,maxColumnAutoWidth:k.maxColumnAutoWidth,rowHeight:Kt,headerHeight:k.defaultHeaderHeight,getCellContent:te?yn:Be,onColumnResize:ae?void 0:or,resizeIndicator:"header",freezeColumns:qr,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:ae?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:St?void 0:Fn,onItemHovered:Le=>{P?.(Le),Zt?.(Le)},keybindings:{downFill:!0,...Bt||le?{selectAll:!1}:{}},onKeyDown:Le=>{(Le.ctrlKey||Le.metaKey)&&Le.key==="f"&&(S(fn=>!fn),Le.stopPropagation(),Le.preventDefault())},showSearch:D,searchResults:D?void 0:[],onSearchClose:()=>{S(!1),$t()},onHeaderClicked:(Le,fn)=>{!Se||St||(D&&S(!1),pt&&an?Wt():Wt(!0,!0),He(Le,"auto"))},gridSelection:Ye,onGridSelectionChange:Le=>{(C||ae)&&(wt(Le),cn!==void 0&&$t(),j(void 0),Q(!1))},theme:k.glideTheme,getRowThemeOverride:R,onMouseMove:Le=>{Le.kind==="out-of-bounds"&&C?F(!1):Le.kind!=="out-of-bounds"&&!C&&F(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:M?-b:void 0,paddingRight:E?-b:void 0},provideEditor:Rn,drawCell:Ge,customRenderers:kt,imageEditorOverride:Qw,headerIcons:k.headerIcons,validateCell:tn,onHeaderMenuClick:(Le,fn)=>{oe||j({columnIdx:Le,headerBounds:fn})},onPaste:!1,...pt&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader,textMedium:k.glideTheme.textLight}},rowSelectionMode:Nt?"multi":"auto",rowSelect:n?"none":Nt?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...St&&{columnSelect:n?"none":Tt?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Tt?"multi":"auto",rangeSelectionBlending:"additive"},...Bt&&{rangeSelect:qt?"rect":"cell",rangeSelectionBlending:"additive"},...!te&&e.editingMode!==de&&!n&&{fillHandle:!ae,onCellEdited:De,onPaste:mt,onDelete:bn},...pe&&{trailingRowOptions:{sticky:!1,tint:!0},onRowAppended:xt,onHeaderClicked:void 0},...et&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi"}})}
188),cn?.content&&Ie(bC,{top:cn.top,left:cn.left,content:cn.content,clearTooltip:$t}),W&&bc.createPortal(Ie(hC,{top:W.headerBounds.y+W.headerBounds.height,left:W.headerBounds.x+W.headerBounds.width,column:dt[W.columnIdx],onCloseMenu:()=>j(void 0),onSortColumn:Se?Le=>{D&&S(!1),Wt(!(pt&&an),!0),He(W.columnIdx,Le,!0)}:void 0,isColumnPinned:dt[W.columnIdx].isPinned,onUnpinColumn:()=>{Sn(dt[W.columnIdx].id)},onPinColumn:()=>{Cn(dt[W.columnIdx].id)},onHideColumn:()=>{Zr(dt[W.columnIdx].id)},onChangeFormat:Le=>{Kr(dt[W.columnIdx].id,Le),$n.current=W.columnIdx,ei()},onAutosize:()=>{v.current?.remeasureColumns(Qe.fromSingleSelection(W.columnIdx))}}),document.querySelector("#portal"))]})}const SC=gg(CC),Pf=f.memo(SC),xC=({data:e,height:t,width:n,customToolbarActions:r})=>Ie(Pf,{element:new Yt({editingMode:Yt.EditingMode.READ_ONLY,disabled:!0,arrowData:null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:r,widthConfig:n??new Fs.WidthConfig({useStretch:!0}),heightConfig:t?new Fs.HeightConfig({pixelHeight:t}):void 0}),$C=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:xC,default:Pf},Symbol.toStringTag,{value:"Module"}));export{D0 as C,xC as R,sd as T,Mi as a,jg as b,$C as c,Si as i,sm as m,dn as s};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.