@stlite/desktop 0.82.0 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dump_artifacts.js +15 -15
- package/build/assets/ErrorOutline.esm-w3SotGgg.js +1 -0
- package/build/assets/{FileDownload.esm-Bzb3HjS9.js → FileDownload.esm-DNaG7mhy.js} +1 -1
- package/build/assets/{FileHelper-BNpeYRlH.js → FileHelper-DoUfoupm.js} +4 -4
- package/build/assets/{FormClearHelper-DxeY-rII.js → FormClearHelper-DI9KwuTl.js} +1 -1
- package/build/assets/{Hooks-BOkao1bO.js → Hooks-BRr-mPDr.js} +1 -1
- package/build/assets/{InputInstructions-DuxSO2sS.js → InputInstructions-mpv25B9R.js} +1 -1
- package/build/assets/MaterialSymbols-Rounded.DsbC8sYI.woff2 +0 -0
- package/build/assets/{ProgressBar-xr2SnNK1.js → ProgressBar-DalMRT-4.js} +2 -2
- package/build/assets/{RenderInPortalIfExists-D-C7LcEp.js → RenderInPortalIfExists-CfX3LXlx.js} +1 -1
- package/build/assets/Toolbar-1r13KE9d.js +1 -0
- package/build/assets/{base-input-NsRtpzFx.js → base-input-BJ4WO1K3.js} +4 -4
- package/build/assets/{checkbox-Dj0lswiB.js → checkbox-COr-UunX.js} +1 -1
- package/build/assets/{createSuper-Ipqc67nc.js → createSuper-BD8Om4of.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-BDv7jlce.js → data-grid-overlay-editor-DUKLRWRf.js} +1 -1
- package/build/assets/{downloader-CaOAUbUF.js → downloader-K2yu2VBv.js} +1 -1
- package/build/assets/{es6-BZHzmZtr.js → es6-CqFPgbyx.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-CHGlD-N9.js → iframeResizer.contentWindow-CYxwXEKD.js} +1 -1
- package/build/assets/{index-D1dbR74e.js → index-B7nFcP4b.js} +1 -1
- package/build/assets/index-BBSx627c.js +12 -0
- package/build/assets/index-BTWAYrEA.js +1 -0
- package/build/assets/index-BVYhtbL7.js +1 -0
- package/build/assets/{index-CTC0h65f.js → index-BY2_5dEP.js} +1 -1
- package/build/assets/index-Bga7N97D.js +1 -0
- package/build/assets/index-CBHSzhtV.js +1 -0
- package/build/assets/index-CG0w2Shn.js +3 -0
- package/build/assets/index-CJj5-jL6.js +2 -0
- package/build/assets/index-CTKSPDuj.js +3 -0
- package/build/assets/{index-OxGwEg3m.js → index-CVPZJuoC.js} +144 -144
- package/build/assets/{index-BTv0oYZW.js → index-CbGVTpRX.js} +1 -1
- package/build/assets/{index-B-ykjfbX.js → index-CgIf_789.js} +260 -233
- package/build/assets/index-CgaLKbNA.js +1 -0
- package/build/assets/index-Chg_Z_Ai.js +1 -0
- package/build/assets/{index-B4X2D_eW.js → index-Cy3sYumn.js} +1 -1
- package/build/assets/{index-CUa9G_2w.js → index-D4DI0i3_.js} +2 -2
- package/build/assets/index-DAFr20lD.js +1 -0
- package/build/assets/{index-DhYvQko1.js → index-DAyJZph2.js} +1 -1
- package/build/assets/{index-CA7xtrC9.js → index-DHvjd_NM.js} +8 -8
- package/build/assets/{index-GJHR2pBi.js → index-DIR2fiU3.js} +1 -1
- package/build/assets/{index-B-LSEdUZ.js → index-DJ9ENWJ6.js} +1 -1
- package/build/assets/{index-DrIrAYez.js → index-DZGNB9Z2.js} +2 -2
- package/build/assets/{index-Cns8y39_.js → index-D_aTbShm.js} +1 -1
- package/build/assets/{index-Cyc3gr_v.js → index-DbWqdg_N.js} +2 -2
- package/build/assets/index-DhpOSNWU.js +1 -0
- package/build/assets/{index-Cp10Db30.js → index-Dkkplt7E.js} +1 -1
- package/build/assets/{index-DvUGK7b6.js → index-FQnDjdgN.js} +1 -1
- package/build/assets/index-GeTKqk0L.js +1 -0
- package/build/assets/{index-CRx6-P3W.js → index-QxKGd3KZ.js} +1 -1
- package/build/assets/{index-DJZ72tug.js → index-TIqCq-vm.js} +1 -1
- package/build/assets/{index-By6Q65Pf.js → index-WJi2gbUd.js} +1 -1
- package/build/assets/index-bXFpQSEH.js +1 -0
- package/build/assets/index-dOLNZa0u.js +1 -0
- package/build/assets/index-h6PFbOmO.js +188 -0
- package/build/assets/{index-Dk-OPVLJ.js → index-oIFkiM-w.js} +1 -1
- package/build/assets/index-qPiigGKE.js +1 -0
- package/build/assets/index-xsH4HHeE.js +6 -0
- package/build/assets/{index.5L7agjmb.css → index.Bqb_jNud.css} +1 -1
- package/build/assets/{inherits-BbfuKc-R.js → inherits-DtR6i4OG.js} +1 -1
- package/build/assets/{input-CkptI290.js → input-9qldoJOB.js} +2 -2
- package/build/assets/{memory-BDEJOdDh.js → memory-Cy3-iIgx.js} +1 -1
- package/build/assets/mergeWith-DdD-5zWL.js +1 -0
- package/build/assets/{number-overlay-editor-cmVGLaYJ.js → number-overlay-editor-DmP64vrs.js} +1 -1
- package/build/assets/{sandbox-VVt-VWM8.js → sandbox-DzhFXmWd.js} +1 -1
- package/build/assets/{slicedToArray-HZKHLTaA.js → slicedToArray-CNrowD0v.js} +2 -2
- package/build/assets/{textarea-Cy6EVtfz.js → textarea-Bql4j-_M.js} +2 -2
- package/build/assets/{timepicker-DQlSkM-Q.js → timepicker-sEhIITXf.js} +2 -2
- package/build/assets/{uniqueId-Dka3DuQQ.js → uniqueId-DfRnwW3q.js} +1 -1
- package/build/assets/{useBasicWidgetState-Bm5AJWX7.js → useBasicWidgetState-DJ8kXLgn.js} +1 -1
- package/build/assets/{useOnInputChange-C3lvbUNp.js → useOnInputChange-CZX_IkMh.js} +1 -1
- package/build/assets/withFullScreenWrapper-DBlEST2L.js +1 -0
- package/build/assets/{worker-eTai8nRu.js → worker-CXcujS1W.js} +10 -10
- package/build/electron/worker.js +8 -8
- package/build/index.html +2 -2
- package/package.json +8 -7
- package/wheels/streamlit-1.45.1-cp312-none-any.whl +0 -0
- package/build/assets/MaterialSymbols-Rounded.BFCIvovZ.woff2 +0 -0
- package/build/assets/Toolbar-CJ0mD5An.js +0 -1
- package/build/assets/index-7fVMC6lw.js +0 -1
- package/build/assets/index-BfXMsSNA.js +0 -188
- package/build/assets/index-BtnOdn6v.js +0 -1
- package/build/assets/index-BwTtx5nh.js +0 -1
- package/build/assets/index-C7CxGGAJ.js +0 -3
- package/build/assets/index-CHhIqZol.js +0 -1
- package/build/assets/index-Ck_7L8T4.js +0 -3
- package/build/assets/index-CnyprtY_.js +0 -1
- package/build/assets/index-CoJDuQ5Y.js +0 -1
- package/build/assets/index-D9Fv1oGe.js +0 -1
- package/build/assets/index-D9ZJ5ysG.js +0 -1
- package/build/assets/index-DMVOLuV0.js +0 -1
- package/build/assets/index-DX_vgtQT.js +0 -1
- package/build/assets/index-DbTxB5ik.js +0 -12
- package/build/assets/index-DeRs-vXN.js +0 -1
- package/build/assets/index-SCb8nZ6H.js +0 -2
- package/build/assets/index-t--hEgTQ.js +0 -6
- package/build/assets/index-zPhSbuEH.js +0 -1
- package/build/assets/mergeWith-D2cULMN8.js +0 -1
- package/build/assets/withFullScreenWrapper-CEJUxUJC.js +0 -1
- package/wheels/streamlit-1.44.1-cp312-none-any.whl +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-DUKLRWRf.js","assets/index-CVPZJuoC.js","assets/index.Bqb_jNud.css","assets/FormClearHelper-DI9KwuTl.js","assets/withFullScreenWrapper-DBlEST2L.js","assets/Toolbar-1r13KE9d.js","assets/checkbox-COr-UunX.js","assets/mergeWith-DdD-5zWL.js","assets/sprintf-D7DtBTRn.js","assets/createDownloadLinkElement-DZMwyjvU.js","assets/slicedToArray-CNrowD0v.js","assets/inherits-DtR6i4OG.js","assets/createSuper-BD8Om4of.js","assets/FileDownload.esm-DNaG7mhy.js","assets/number-overlay-editor-DmP64vrs.js","assets/es6-CqFPgbyx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as p,E as gs,_ as Ke,d as Ay,g as vo,R as te,i as ms,e as pi,f as Fy,h as _y,m as Ny,n as Ph,o as Hh,p as By,q as Ah,s as Vy,t as $y,v as Wy,w as jy,x as Uy,y as Yy,a as so,z as vs,c as Sr,A as Jo,j as Oe,B as xl,C as Cl,T as Fh,D as kl,F as bo,G as Vn,H as _h,I as Sl,J as Xy,K as Gy,L as Ve,M as Nh,N as mt,O as gi,Q as Qo,S as bs,U as Ky,V as qy,W as Zy,X as Bh,Y as Jy,Z as Vh,$ as Qy,a0 as ex,a1 as ws,a2 as $h,a3 as Wh,a4 as tx,a5 as nx,a6 as ox,a7 as rx,a8 as ix,a9 as lx,aa as ax,ab as sx,ac as cx,ad as jh,ae as ux,af as dx,ag as hx,ah as fx,ai as px,aj as gx,ak as mx,al as vx,am as bx,an as wx,ao as yx,ap as xx,aq as Cx,ar as En,l as ys,as as mi,at as wo,au as kx,av as Sx,aw as Mx,ax as Rx,ay as Ex,az as Ix,aA as Ml,aB as vi,aC as Ut,aD as Tx,aE as Ox,aF as Dx,aG as zx,aH as er,aI as It,aJ as xn,aK as Uh,aL as Yh,aM as Rl,aN as Lx,aO as Xh,aP as Gh,aQ as Px,aR as xs,aS as Hx,aT as Ax,aU as Kh,aV as Fx,aW as qh,aX as _x,aY as Zh,aZ as Nx,a_ as Bx,a$ as Vx,b as Jh,b0 as Cs,b1 as $x,b2 as Wx,b3 as ks,b4 as jx,b5 as Ux,b6 as Yx,b7 as Xx,b8 as Gx,__tla as Kx}from"./index-CVPZJuoC.js";import{u as qx}from"./FormClearHelper-DI9KwuTl.js";import{w as Zx,E as Jx}from"./withFullScreenWrapper-DBlEST2L.js";import{T as Qx,a as Mr}from"./Toolbar-1r13KE9d.js";import{S as eC,L as tC,a as nC}from"./checkbox-COr-UunX.js";import{m as oC}from"./mergeWith-DdD-5zWL.js";import{s as rC}from"./sprintf-D7DtBTRn.js";import{c as iC}from"./createDownloadLinkElement-DZMwyjvU.js";import{_ as yo,C as lC}from"./slicedToArray-CNrowD0v.js";import{_ as aC,a as sC,b as cC}from"./inherits-DtR6i4OG.js";import{_ as uC}from"./createSuper-BD8Om4of.js";import{D as dC,F as hC}from"./FileDownload.esm-DNaG7mhy.js";let Ss,El,Po,Ms,Qh,Ho,Rs,cn,fC=Promise.all([(()=>{try{return Kx}catch{}})()]).then(async()=>{var ef=Object.defineProperty,tf=(e,t,n)=>t in e?ef(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ht=(e,t,n)=>tf(e,typeof t!="symbol"?t+"":t,n),Es=p.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(gs,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),p.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),p.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Es.displayName="Add";var Is=p.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(gs,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),p.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),p.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"}))});Is.displayName="Search";var Ts=p.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(gs,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),p.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),p.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"}))});Ts.displayName="Visibility";function Os(e="This should not happen"){throw new Error(e)}function zn(e,t="Assertion failed"){if(!e)return Os(t)}function Rr(e,t){return Os(t??"Hell froze over")}function nf(e,t){try{return e()}catch{return t}}const Ds=Object.prototype.hasOwnProperty;function tr(e,t){let n,o;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((o=e.length)===t.length)for(;o--&&tr(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(Ds.call(e,n)&&++o&&!Ds.call(t,n)||!(n in t)||!tr(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}var Tl,zs;function of(){if(zs)return Tl;zs=1;var e=Object.prototype,t=e.hasOwnProperty;function n(o,r){return o!=null&&t.call(o,r)}return Tl=n,Tl}var Ol,Ls;function rf(){if(Ls)return Ol;Ls=1;var e=of(),t=Ay();function n(o,r){return o!=null&&t(o,r,e)}return Ol=n,Ol}var lf=rf();const af=vo(lf),bi=null,Dl=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 Ps;(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"})(Ps||(Ps={}));var wi;(function(e){e.Triangle="triangle",e.Dots="dots"})(wi||(wi={}));function yi(e){return"width"in e&&typeof e.width=="number"}async function Hs(e){return typeof e=="object"?e:await e()}Ho=function(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)},Po=function(e){return e.kind===Fn.Marker||e.kind===Fn.NewRow};function Er(e){if(!Ho(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;Rr(e,"A cell was passed with an invalid kind")}Ms=function(e){return af(e,"editor")};function zl(e){return!(e.readonly??!1)}var Fn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Fn||(Fn={}));function sf(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(o,r){return o[0]-r[0]}),n.push([...t[0]]);for(const o of t.slice(1)){const r=n[n.length-1];r[1]<o[0]?n.push([...o]):r[1]<o[1]&&(r[1]=o[1])}return n}let As;const Ir=class Il{constructor(t){ht(this,"items"),this.items=t}offset(t){if(t===0)return this;const n=this.items.map(o=>[o[0]+t,o[1]+t]);return new Il(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=sf([...this.items,n]);return new Il(o)}remove(t){const n=[...this.items],o=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[i,l]of n.entries()){const[s,a]=l;if(s<=r&&o<=a){const c=[];s<o&&c.push([s,o]),r<a&&c.push([r,a]),n.splice(i,1,...c)}}return new Il(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[o,r]=this.items[n];if(t>=o&&t<r)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;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const o=t.items[n],r=this.items[n];if(o[0]!==r[0]||o[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,o]of this.items)for(let r=n;r<o;r++)t.push(r);return t}get length(){let t=0;for(const[n,o]of this.items)t+=o-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let o=t;o<n;o++)yield o}};ht(Ir,"empty",()=>As??(As=new Ir([]))),ht(Ir,"fromSingleSelection",e=>Ir.empty().add(e));let vt=Ir;var cf=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(r=>{(r?r.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,l]=i.split("_");t[l]=i}else n.push(i)})});const o=[];for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.push(t[r]);return o.push(...n),o.join(" ")},Fs=cf,uf=e=>e.toUpperCase()===e,df=e=>t=>e.indexOf(t)===-1,_s=(e,t)=>{const n={};return Object.keys(e).filter(df(t)).forEach(o=>{n[o]=e[o]}),n};function hf(e,t,n){const o=_s(t,n);if(!e){const r=typeof ms=="function"?{default:ms}:ms;Object.keys(o).forEach(i=>{r.default(i)||delete o[i]})}return o}var ff=(e,t)=>{};function pf(e){let t="";return n=>{const o=(i,l)=>{const{as:s=e,class:a=t}=i,c=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!uf(s[0])):n.propsAsIs,u=hf(c,i,["as","class"]);u.ref=l,u.className=n.atomic?Fs(n.class,u.className||a):Fs(u.className||a,n.class);const{vars:d}=n;if(d){const f={};for(const m in d){const b=d[m],y=b[0],v=b[1]||"",I=typeof y=="function"?y(i):y;ff(I,n.name),f[`--${m}`]=`${I}${v}`}const h=u.style||{},g=Object.keys(h);g.length>0&&g.forEach(m=>{f[m]=h[m]}),u.style=f}return e.__linaria&&e!==s?(u.as=s,te.createElement(e,u)):te.createElement(s,u)},r=te.forwardRef?te.forwardRef(o):i=>{const l=_s(i,["innerRef"]);return o(l,i.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}cn=pf;const gf=cn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ns={},Tr={},Ll={},Pl={},Bs;function mf(){return Bs||(Bs=1,function(e){(function(t,n){n(e,pi(),Fy())})(Pl,function(t,n,o){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=g;var r=l(n),i=l(o);function l(v){return v&&v.__esModule?v:{default:v}}var s=Object.assign||function(v){for(var I=1;I<arguments.length;I++){var T=arguments[I];for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(v[k]=T[k])}return v};function a(v,I){var T={};for(var k in v)I.indexOf(k)>=0||Object.prototype.hasOwnProperty.call(v,k)&&(T[k]=v[k]);return T}function c(v,I){if(!(v instanceof I))throw new TypeError("Cannot call a class as a function")}var u=function(){function v(I,T){for(var k=0;k<T.length;k++){var x=T[k];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(I,x.key,x)}}return function(I,T,k){return T&&v(I.prototype,T),k&&v(I,k),I}}();function d(v,I){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:v}function f(v,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);v.prototype=Object.create(I&&I.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(v,I):v.__proto__=I)}var h=!1;function g(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){g(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function b(v){if("touches"in v){var I=v.touches[0],T=I.pageX,k=I.pageY;return{x:T,y:k}}var x=v.screenX,L=v.screenY;return{x,y:L}}var y=function(v){f(I,v);function I(){var T;c(this,I);for(var k=arguments.length,x=Array(k),L=0;L<k;L++)x[L]=arguments[L];var O=d(this,(T=I.__proto__||Object.getPrototypeOf(I)).call.apply(T,[this].concat(x)));return O._handleSwipeStart=O._handleSwipeStart.bind(O),O._handleSwipeMove=O._handleSwipeMove.bind(O),O._handleSwipeEnd=O._handleSwipeEnd.bind(O),O._onMouseDown=O._onMouseDown.bind(O),O._onMouseMove=O._onMouseMove.bind(O),O._onMouseUp=O._onMouseUp.bind(O),O._setSwiperRef=O._setSwiperRef.bind(O),O}return u(I,[{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(T){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(T))}},{key:"_onMouseMove",value:function(T){this.mouseDown&&this._handleSwipeMove(T)}},{key:"_onMouseUp",value:function(T){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(T)}},{key:"_handleSwipeStart",value:function(T){var k=b(T),x=k.x,L=k.y;this.moveStart={x,y:L},this.props.onSwipeStart(T)}},{key:"_handleSwipeMove",value:function(T){if(this.moveStart){var k=b(T),x=k.x,L=k.y,O=x-this.moveStart.x,R=L-this.moveStart.y;this.moving=!0;var P=this.props.onSwipeMove({x:O,y:R},T);P&&T.cancelable&&T.preventDefault(),this.movePosition={deltaX:O,deltaY:R}}}},{key:"_handleSwipeEnd",value:function(T){this.props.onSwipeEnd(T);var k=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-k?this.props.onSwipeLeft(1,T):this.movePosition.deltaX>k&&this.props.onSwipeRight(1,T),this.movePosition.deltaY<-k?this.props.onSwipeUp(1,T):this.movePosition.deltaY>k&&this.props.onSwipeDown(1,T)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(T){this.swiper=T,this.props.innerRef(T)}},{key:"render",value:function(){var T=this.props;T.tagName;var k=T.className,x=T.style,L=T.children;T.allowMouseEvents,T.onSwipeUp,T.onSwipeDown,T.onSwipeLeft,T.onSwipeRight,T.onSwipeStart,T.onSwipeMove,T.onSwipeEnd,T.innerRef,T.tolerance;var O=a(T,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:k,style:x},O),L)}}]),I}(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},y.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=y})}(Pl)),Pl}var Vs;function $s(){return Vs||(Vs=1,function(e){(function(t,n){n(e,mf())})(Ll,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=r(n);function r(i){return i&&i.__esModule?i:{default:i}}t.default=o.default})}(Ll)),Ll}var Or={},Ws;function js(){if(Ws)return Or;Ws=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.default=void 0;var e=t(_y());function t(r){return r&&r.__esModule?r:{default:r}}function n(r,i,l){return i in r?Object.defineProperty(r,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[i]=l,r}var o={ROOT:function(r){return(0,e.default)(n({"carousel-root":!0},r||"",!!r))},CAROUSEL:function(r){return(0,e.default)({carousel:!0,"carousel-slider":r})},WRAPPER:function(r,i){return(0,e.default)({"thumbs-wrapper":!r,"slider-wrapper":r,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(r,i){return(0,e.default)({thumbs:!r,slider:r,animated:!i})},ITEM:function(r,i,l){return(0,e.default)({thumb:!r,slide:r,selected:i,previous:l})},ARROW_PREV:function(r){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":r})},ARROW_NEXT:function(r){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":r})},DOT:function(r){return(0,e.default)({dot:!0,selected:r})}};return Or.default=o,Or}var Dr={},zr={},Us;function vf(){if(Us)return zr;Us=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,o=getComputedStyle(t);return n+=parseInt(o.marginLeft)+parseInt(o.marginRight),n};return zr.outerWidth=e,zr}var Lr={},Ys;function Hl(){if(Ys)return Lr;Ys=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.default=void 0;var e=function(t,n,o){var r=t===0?t:t+n,i=o==="horizontal"?[r,0,0]:[0,r,0],l="translate3d",s="("+i.join(",")+")";return l+s};return Lr.default=e,Lr}var Pr={},Xs;function Gs(){if(Xs)return Pr;Xs=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.default=void 0;var e=function(){return window};return Pr.default=e,Pr}var Ks;function qs(){if(Ks)return Dr;Ks=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.default=void 0;var e=a(pi()),t=l(js()),n=vf(),o=l(Hl()),r=l($s()),i=l(Gs());function l(O){return O&&O.__esModule?O:{default:O}}function s(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return s=function(){return O},O}function a(O){if(O&&O.__esModule)return O;if(O===null||c(O)!=="object"&&typeof O!="function")return{default:O};var R=s();if(R&&R.has(O))return R.get(O);var P={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var E=M?Object.getOwnPropertyDescriptor(O,S):null;E&&(E.get||E.set)?Object.defineProperty(P,S,E):P[S]=O[S]}return P.default=O,R&&R.set(O,P),P}function c(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(R){return typeof R}:c=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},c(O)}function u(){return u=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var P=arguments[R];for(var M in P)Object.prototype.hasOwnProperty.call(P,M)&&(O[M]=P[M])}return O},u.apply(this,arguments)}function d(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function f(O,R){for(var P=0;P<R.length;P++){var M=R[P];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(O,M.key,M)}}function h(O,R,P){return R&&f(O.prototype,R),O}function g(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(R&&R.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),R&&m(O,R)}function m(O,R){return m=Object.setPrototypeOf||function(P,M){return P.__proto__=M,P},m(O,R)}function b(O){var R=I();return function(){var P=T(O),M;if(R){var S=T(this).constructor;M=Reflect.construct(P,arguments,S)}else M=P.apply(this,arguments);return y(this,M)}}function y(O,R){return R&&(c(R)==="object"||typeof R=="function")?R:v(O)}function v(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function I(){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(O){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},T(O)}function k(O,R,P){return R in O?Object.defineProperty(O,R,{value:P,enumerable:!0,configurable:!0,writable:!0}):O[R]=P,O}var x=function(O){return O.hasOwnProperty("key")},L=function(O){g(P,O);var R=b(P);function P(M){var S;return d(this,P),S=R.call(this,M),k(v(S),"itemsWrapperRef",void 0),k(v(S),"itemsListRef",void 0),k(v(S),"thumbsRef",void 0),k(v(S),"setItemsWrapperRef",function(E){S.itemsWrapperRef=E}),k(v(S),"setItemsListRef",function(E){S.itemsListRef=E}),k(v(S),"setThumbsRef",function(E,D){S.thumbsRef||(S.thumbsRef=[]),S.thumbsRef[D]=E}),k(v(S),"updateSizes",function(){if(!(!S.props.children||!S.itemsWrapperRef||!S.thumbsRef)){var E=e.Children.count(S.props.children),D=S.itemsWrapperRef.clientWidth,C=S.props.thumbWidth?S.props.thumbWidth:(0,n.outerWidth)(S.thumbsRef[0]),X=Math.floor(D/C),B=X<E,J=B?E-X:0;S.setState(function(ae,ne){return{itemSize:C,visibleItems:X,firstItem:B?S.getFirstItem(ne.selectedItem):0,lastPosition:J,showArrows:B}})}}),k(v(S),"handleClickItem",function(E,D,C){if(!x(C)||C.key==="Enter"){var X=S.props.onSelectItem;typeof X=="function"&&X(E,D)}}),k(v(S),"onSwipeStart",function(){S.setState({swiping:!0})}),k(v(S),"onSwipeEnd",function(){S.setState({swiping:!1})}),k(v(S),"onSwipeMove",function(E){var D=E.x;if(!S.state.itemSize||!S.itemsWrapperRef||!S.state.visibleItems)return!1;var C=0,X=e.Children.count(S.props.children),B=-(S.state.firstItem*100)/S.state.visibleItems,J=Math.max(X-S.state.visibleItems,0),ae=-J*100/S.state.visibleItems;B===C&&D>0&&(D=0),B===ae&&D<0&&(D=0);var ne=S.itemsWrapperRef.clientWidth,U=B+100/(ne/D);return S.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(re){S.itemsListRef.style[re]=(0,o.default)(U,"%",S.props.axis)}),!0}),k(v(S),"slideRight",function(E){S.moveTo(S.state.firstItem-(typeof E=="number"?E:1))}),k(v(S),"slideLeft",function(E){S.moveTo(S.state.firstItem+(typeof E=="number"?E:1))}),k(v(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:M.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},S}return h(P,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(M){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==M.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(M){var S=M;return M>=this.state.lastPosition&&(S=this.state.lastPosition),M<this.state.firstItem+this.state.visibleItems&&(S=this.state.firstItem),M<this.state.firstItem&&(S=M),S}},{key:"renderItems",value:function(){var M=this;return this.props.children.map(function(S,E){var D=t.default.ITEM(!1,E===M.state.selectedItem),C={key:E,ref:function(X){return M.setThumbsRef(X,E)},className:D,onClick:M.handleClickItem.bind(M,E,M.props.children[E]),onKeyDown:M.handleClickItem.bind(M,E,M.props.children[E]),"aria-label":"".concat(M.props.labels.item," ").concat(E+1),style:{width:M.props.thumbWidth}};return e.default.createElement("li",u({},C,{role:"button",tabIndex:0}),S)})}},{key:"render",value:function(){var M=this;if(!this.props.children)return null;var S=e.Children.count(this.props.children)>1,E=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,C={},X=-this.state.firstItem*(this.state.itemSize||0),B=(0,o.default)(X,"px",this.props.axis),J=this.props.transitionTime+"ms";return C={WebkitTransform:B,MozTransform:B,MsTransform:B,OTransform:B,transform:B,msTransform:B,WebkitTransitionDuration:J,MozTransitionDuration:J,MsTransitionDuration:J,OTransitionDuration:J,transitionDuration:J,msTransitionDuration:J},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(!E),onClick:function(){return M.slideRight()},"aria-label":this.props.labels.leftArrow}),S?e.default.createElement(r.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:C,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ae){return M.setItemsListRef(ae)},style:C},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return M.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),P}(e.Component);return Dr.default=L,k(L,"displayName","Thumbs"),k(L,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Dr}var Hr={},Zs;function bf(){if(Zs)return Hr;Zs=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.default=void 0;var e=function(){return document};return Hr.default=e,Hr}var Ln={},Js;function Qs(){if(Js)return Ln;Js=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=pi(),t=n(Hl());function n(a){return a&&a.__esModule?a:{default:a}}var o=function(){};Ln.noop=o;var r=function(a,c){return"".concat(a," of ").concat(c)};Ln.defaultStatusFormatter=r;var i=function(a){return a?a.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=i;var l=function(a,c){if(c.infiniteLoop&&++a,a===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var d=-a*c.centerSlidePercentage,f=u-1;return a&&(a!==f||c.infiniteLoop)?d+=(100-c.centerSlidePercentage)/2:a===f&&(d+=100-c.centerSlidePercentage),d}return-a*100};Ln.getPosition=l;var s=function(a,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(d){u[d]=(0,t.default)(a,"%",c)}),u};return Ln.setPosition=s,Ln}var $n={},ec;function wf(){if(ec)return $n;ec=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.fadeAnimationHandler=$n.slideStopSwipingHandler=$n.slideSwipeAnimationHandler=$n.slideAnimationHandler=void 0;var e=pi(),t=o(Hl()),n=Qs();function o(d){return d&&d.__esModule?d:{default:d}}function r(d,f){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);f&&(g=g.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,g)}return h}function i(d){for(var f=1;f<arguments.length;f++){var h=arguments[f]!=null?arguments[f]:{};f%2?r(Object(h),!0).forEach(function(g){l(d,g,h[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):r(Object(h)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(h,g))})}return d}function l(d,f,h){return f in d?Object.defineProperty(d,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[f]=h,d}var s=function(d,f){var h={},g=f.selectedItem,m=g,b=e.Children.count(d.children)-1,y=d.infiniteLoop&&(g<0||g>b);if(y)return m<0?d.centerMode&&d.centerSlidePercentage&&d.axis==="horizontal"?h.itemListStyle=(0,n.setPosition)(-(b+2)*d.centerSlidePercentage-(100-d.centerSlidePercentage)/2,d.axis):h.itemListStyle=(0,n.setPosition)(-(b+2)*100,d.axis):m>b&&(h.itemListStyle=(0,n.setPosition)(0,d.axis)),h;var v=(0,n.getPosition)(g,d),I=(0,t.default)(v,"%",d.axis),T=d.transitionTime+"ms";return h.itemListStyle={WebkitTransform:I,msTransform:I,OTransform:I,transform:I},f.swiping||(h.itemListStyle=i(i({},h.itemListStyle),{},{WebkitTransitionDuration:T,MozTransitionDuration:T,OTransitionDuration:T,transitionDuration:T,msTransitionDuration:T})),h};$n.slideAnimationHandler=s;var a=function(d,f,h,g){var m={},b=f.axis==="horizontal",y=e.Children.count(f.children),v=0,I=(0,n.getPosition)(h.selectedItem,f),T=f.infiniteLoop?(0,n.getPosition)(y-1,f)-100:(0,n.getPosition)(y-1,f),k=b?d.x:d.y,x=k;I===v&&k>0&&(x=0),I===T&&k<0&&(x=0);var L=I+100/(h.itemSize/x),O=Math.abs(k)>f.swipeScrollTolerance;return f.infiniteLoop&&O&&(h.selectedItem===0&&L>-100?L-=y*100:h.selectedItem===y-1&&L<-y*100&&(L+=y*100)),(!f.preventMovementUntilSwipeScrollTolerance||O||h.swipeMovementStarted)&&(h.swipeMovementStarted||g({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(L,f.axis)),O&&!h.cancelClick&&g({cancelClick:!0}),m};$n.slideSwipeAnimationHandler=a;var c=function(d,f){var h=(0,n.getPosition)(f.selectedItem,d),g=(0,n.setPosition)(h,d.axis);return{itemListStyle:g}};$n.slideStopSwipingHandler=c;var u=function(d,f){var h=d.transitionTime+"ms",g="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:g,msTransitionTimingFunction:g,MozTransitionTimingFunction:g,WebkitTransitionTimingFunction:g,OTransitionTimingFunction:g};return f.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:h,MozTransitionDuration:h,OTransitionDuration:h,transitionDuration:h,msTransitionDuration:h})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return $n.fadeAnimationHandler=u,$n}var tc;function yf(){if(tc)return Tr;tc=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.default=void 0;var e=u(pi()),t=a($s()),n=a(js()),o=a(qs()),r=a(bf()),i=a(Gs()),l=Qs(),s=wf();function a(M){return M&&M.__esModule?M:{default:M}}function c(){if(typeof WeakMap!="function")return null;var M=new WeakMap;return c=function(){return M},M}function u(M){if(M&&M.__esModule)return M;if(M===null||d(M)!=="object"&&typeof M!="function")return{default:M};var S=c();if(S&&S.has(M))return S.get(M);var E={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in M)if(Object.prototype.hasOwnProperty.call(M,C)){var X=D?Object.getOwnPropertyDescriptor(M,C):null;X&&(X.get||X.set)?Object.defineProperty(E,C,X):E[C]=M[C]}return E.default=M,S&&S.set(M,E),E}function d(M){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(S){return typeof S}:d=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},d(M)}function f(){return f=Object.assign||function(M){for(var S=1;S<arguments.length;S++){var E=arguments[S];for(var D in E)Object.prototype.hasOwnProperty.call(E,D)&&(M[D]=E[D])}return M},f.apply(this,arguments)}function h(M,S){var E=Object.keys(M);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(M);S&&(D=D.filter(function(C){return Object.getOwnPropertyDescriptor(M,C).enumerable})),E.push.apply(E,D)}return E}function g(M){for(var S=1;S<arguments.length;S++){var E=arguments[S]!=null?arguments[S]:{};S%2?h(Object(E),!0).forEach(function(D){R(M,D,E[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(M,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(D){Object.defineProperty(M,D,Object.getOwnPropertyDescriptor(E,D))})}return M}function m(M,S){if(!(M instanceof S))throw new TypeError("Cannot call a class as a function")}function b(M,S){for(var E=0;E<S.length;E++){var D=S[E];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(M,D.key,D)}}function y(M,S,E){return S&&b(M.prototype,S),M}function v(M,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");M.prototype=Object.create(S&&S.prototype,{constructor:{value:M,writable:!0,configurable:!0}}),S&&I(M,S)}function I(M,S){return I=Object.setPrototypeOf||function(E,D){return E.__proto__=D,E},I(M,S)}function T(M){var S=L();return function(){var E=O(M),D;if(S){var C=O(this).constructor;D=Reflect.construct(E,arguments,C)}else D=E.apply(this,arguments);return k(this,D)}}function k(M,S){return S&&(d(S)==="object"||typeof S=="function")?S:x(M)}function x(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}function L(){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 O(M){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},O(M)}function R(M,S,E){return S in M?Object.defineProperty(M,S,{value:E,enumerable:!0,configurable:!0,writable:!0}):M[S]=E,M}var P=function(M){v(E,M);var S=T(E);function E(D){var C;m(this,E),C=S.call(this,D),R(x(C),"thumbsRef",void 0),R(x(C),"carouselWrapperRef",void 0),R(x(C),"listRef",void 0),R(x(C),"itemsRef",void 0),R(x(C),"timer",void 0),R(x(C),"animationHandler",void 0),R(x(C),"setThumbsRef",function(B){C.thumbsRef=B}),R(x(C),"setCarouselWrapperRef",function(B){C.carouselWrapperRef=B}),R(x(C),"setListRef",function(B){C.listRef=B}),R(x(C),"setItemsRef",function(B,J){C.itemsRef||(C.itemsRef=[]),C.itemsRef[J]=B}),R(x(C),"autoPlay",function(){e.Children.count(C.props.children)<=1||(C.clearAutoPlay(),C.props.autoPlay&&(C.timer=setTimeout(function(){C.increment()},C.props.interval)))}),R(x(C),"clearAutoPlay",function(){C.timer&&clearTimeout(C.timer)}),R(x(C),"resetAutoPlay",function(){C.clearAutoPlay(),C.autoPlay()}),R(x(C),"stopOnHover",function(){C.setState({isMouseEntered:!0},C.clearAutoPlay)}),R(x(C),"startOnLeave",function(){C.setState({isMouseEntered:!1},C.autoPlay)}),R(x(C),"isFocusWithinTheCarousel",function(){return C.carouselWrapperRef?!!((0,r.default)().activeElement===C.carouselWrapperRef||C.carouselWrapperRef.contains((0,r.default)().activeElement)):!1}),R(x(C),"navigateWithKeyboard",function(B){if(C.isFocusWithinTheCarousel()){var J=C.props.axis,ae=J==="horizontal",ne={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},U=ae?ne.ArrowRight:ne.ArrowDown,re=ae?ne.ArrowLeft:ne.ArrowUp;U===B.keyCode?C.increment():re===B.keyCode&&C.decrement()}}),R(x(C),"updateSizes",function(){if(!(!C.state.initialized||!C.itemsRef||C.itemsRef.length===0)){var B=C.props.axis==="horizontal",J=C.itemsRef[0];if(J){var ae=B?J.clientWidth:J.clientHeight;C.setState({itemSize:ae}),C.thumbsRef&&C.thumbsRef.updateSizes()}}}),R(x(C),"setMountState",function(){C.setState({hasMount:!0}),C.updateSizes()}),R(x(C),"handleClickItem",function(B,J){if(e.Children.count(C.props.children)!==0){if(C.state.cancelClick){C.setState({cancelClick:!1});return}C.props.onClickItem(B,J),B!==C.state.selectedItem&&C.setState({selectedItem:B})}}),R(x(C),"handleOnChange",function(B,J){e.Children.count(C.props.children)<=1||C.props.onChange(B,J)}),R(x(C),"handleClickThumb",function(B,J){C.props.onClickThumb(B,J),C.moveTo(B)}),R(x(C),"onSwipeStart",function(B){C.setState({swiping:!0}),C.props.onSwipeStart(B)}),R(x(C),"onSwipeEnd",function(B){C.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),C.props.onSwipeEnd(B),C.clearAutoPlay(),C.state.autoPlay&&C.autoPlay()}),R(x(C),"onSwipeMove",function(B,J){C.props.onSwipeMove(J);var ae=C.props.swipeAnimationHandler(B,C.props,C.state,C.setState.bind(x(C)));return C.setState(g({},ae)),!!Object.keys(ae).length}),R(x(C),"decrement",function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem-(typeof B=="number"?B:1))}),R(x(C),"increment",function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem+(typeof B=="number"?B:1))}),R(x(C),"moveTo",function(B){if(typeof B=="number"){var J=e.Children.count(C.props.children)-1;B<0&&(B=C.props.infiniteLoop?J:0),B>J&&(B=C.props.infiniteLoop?0:J),C.selectItem({selectedItem:B}),C.state.autoPlay&&C.state.isMouseEntered===!1&&C.resetAutoPlay()}}),R(x(C),"onClickNext",function(){C.increment(1)}),R(x(C),"onClickPrev",function(){C.decrement(1)}),R(x(C),"onSwipeForward",function(){C.increment(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),R(x(C),"onSwipeBackwards",function(){C.decrement(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),R(x(C),"changeItem",function(B){return function(J){(!(0,l.isKeyboardEvent)(J)||J.key==="Enter")&&C.moveTo(B)}}),R(x(C),"selectItem",function(B){C.setState(g({previousItem:C.state.selectedItem},B),function(){C.setState(C.animationHandler(C.props,C.state))}),C.handleOnChange(B.selectedItem,e.Children.toArray(C.props.children)[B.selectedItem])}),R(x(C),"getInitialImage",function(){var B=C.props.selectedItem,J=C.itemsRef&&C.itemsRef[B],ae=J&&J.getElementsByTagName("img")||[];return ae[0]}),R(x(C),"getVariableItemHeight",function(B){var J=C.itemsRef&&C.itemsRef[B];if(C.state.hasMount&&J&&J.children.length){var ae=J.children[0].getElementsByTagName("img")||[];if(ae.length>0){var ne=ae[0];if(!ne.complete){var U=function de(){C.forceUpdate(),ne.removeEventListener("load",de)};ne.addEventListener("load",U)}}var re=ae[0]||J.children[0],se=re.clientHeight;return se>0?se:null}return null});var X={initialized:!1,previousItem:D.selectedItem,selectedItem:D.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:D.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return C.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&s.fadeAnimationHandler||s.slideAnimationHandler,C.state=g(g({},X),C.animationHandler(D,X)),C}return y(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,C){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),C.swiping&&!this.state.swiping&&this.setState(g({},this.props.stopSwipingHandler(this.props,this.state))),(D.selectedItem!==this.props.selectedItem||D.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),D.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 D=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 C=D.getInitialImage();C&&!C.complete?C.addEventListener("load",D.setMountState):D.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.addEventListener("mouseenter",this.stopOnHover),D.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.removeEventListener("mouseenter",this.stopOnHover),D.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,r.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var D=this.getInitialImage();D&&D.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,r.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var D;(D=this.carouselWrapperRef)===null||D===void 0||D.focus()}},{key:"renderItems",value:function(D){var C=this;return this.props.children?e.Children.map(this.props.children,function(X,B){var J=B===C.state.selectedItem,ae=B===C.state.previousItem,ne=J&&C.state.selectedStyle||ae&&C.state.prevStyle||C.state.slideStyle||{};C.props.centerMode&&C.props.axis==="horizontal"&&(ne=g(g({},ne),{},{minWidth:C.props.centerSlidePercentage+"%"})),C.state.swiping&&C.state.swipeMovementStarted&&(ne=g(g({},ne),{},{pointerEvents:"none"}));var U={ref:function(re){return C.setItemsRef(re,B)},key:"itemKey"+B+(D?"clone":""),className:n.default.ITEM(!0,B===C.state.selectedItem,B===C.state.previousItem),onClick:C.handleClickItem.bind(C,B,X),style:ne};return e.default.createElement("li",U,C.props.renderItem(X,{isSelected:B===C.state.selectedItem,isPrevious:B===C.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,C=this.props,X=C.showIndicators,B=C.labels,J=C.renderIndicator,ae=C.children;return X?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ae,function(ne,U){return J&&J(D.changeItem(U),U===D.state.selectedItem,U,B.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(o.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 D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var C=this.props.swipeable&&e.Children.count(this.props.children)>1,X=this.props.axis==="horizontal",B=this.props.showArrows&&e.Children.count(this.props.children)>1,J=B&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ae=B&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ne=this.renderItems(!0),U=ne.shift(),re=ne.pop(),se={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},de={};if(X){if(se.onSwipeLeft=this.onSwipeForward,se.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var fe=this.getVariableItemHeight(this.state.selectedItem);de.height=fe||"auto"}}else se.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,se.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,se.style=g(g({},se.style),{},{height:this.state.itemSize}),de.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,J,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},C?e.default.createElement(t.default,f({tagName:"ul",innerRef:this.setListRef},se,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&re,this.renderItems(),this.props.infiniteLoop&&U):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(Q){return D.setListRef(Q)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&re,this.renderItems(),this.props.infiniteLoop&&U)),this.props.renderArrowNext(this.onClickNext,ae,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E}(e.default.Component);return Tr.default=P,R(P,"displayName","Carousel"),R(P,"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(M,S,E){return e.default.createElement("button",{type:"button","aria-label":E,className:n.default.ARROW_PREV(!S),onClick:M})},renderArrowNext:function(M,S,E){return e.default.createElement("button",{type:"button","aria-label":E,className:n.default.ARROW_NEXT(!S),onClick:M})},renderIndicator:function(M,S,E,D){return e.default.createElement("li",{className:n.default.DOT(S),onClick:M,onKeyDown:M,value:E,key:E,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(E+1)})},renderItem:function(M){return M},renderThumbs:function(M){var S=e.Children.map(M,function(E){var D=E;if(E.type!=="img"&&(D=e.Children.toArray(E.props.children).find(function(C){return C.type==="img"})),!!D)return D});return S.filter(function(E){return E}).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"),[]):S},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:s.slideSwipeAnimationHandler,stopSwipingHandler:s.slideStopSwipingHandler}),Tr}var xf={},nc;function Cf(){return nc||(nc=1),xf}var oc;function kf(){return oc||(oc=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 o.default}});var t=r(yf()),n=Cf(),o=r(qs());function r(i){return i&&i.__esModule?i:{default:i}}}(Ns)),Ns}var Sf=kf(),Al,rc;function Mf(){if(rc)return Al;rc=1;var e=Ny(),t=function(){return e.Date.now()};return Al=t,Al}var Fl,ic;function lc(){if(ic)return Fl;ic=1;var e=Ph(),t=Mf(),n=Hh(),o="Expected a function",r=Math.max,i=Math.min;function l(s,a,c){var u,d,f,h,g,m,b=0,y=!1,v=!1,I=!0;if(typeof s!="function")throw new TypeError(o);a=n(a)||0,e(c)&&(y=!!c.leading,v="maxWait"in c,f=v?r(n(c.maxWait)||0,a):f,I="trailing"in c?!!c.trailing:I);function T(E){var D=u,C=d;return u=d=void 0,b=E,h=s.apply(C,D),h}function k(E){return b=E,g=setTimeout(O,a),y?T(E):h}function x(E){var D=E-m,C=E-b,X=a-D;return v?i(X,f-C):X}function L(E){var D=E-m,C=E-b;return m===void 0||D>=a||D<0||v&&C>=f}function O(){var E=t();if(L(E))return R(E);g=setTimeout(O,x(E))}function R(E){return g=void 0,I&&u?T(E):(u=d=void 0,h)}function P(){g!==void 0&&clearTimeout(g),b=0,u=m=d=g=void 0}function M(){return g===void 0?h:R(t())}function S(){var E=t(),D=L(E);if(u=arguments,d=this,m=E,D){if(g===void 0)return k(m);if(v)return clearTimeout(g),g=setTimeout(O,a),T(m)}return g===void 0&&(g=setTimeout(O,a)),h}return S.cancel=P,S.flush=M,S}return Fl=l,Fl}var Rf=lc();const ac=vo(Rf);function pn(e,t,n,o,r=!1){const i=p.useRef();i.current=t,p.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,s=a=>{var c;(c=i.current)==null||c.call(l,a)};return l.addEventListener(e,s,{passive:o,capture:r}),()=>{l.removeEventListener(e,s,{capture:r})}},[e,n,o,r])}function Ao(e,t){return e===void 0?void 0:t}const Ef=Math.PI;function sc(e){return e*Ef/180}const cc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),uc=(e,t,n,o,r)=>{switch(e){case"left":return Math.floor(t)+o+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-o-r/2}},dc=(e,t,n)=>Math.min(e,t-n*2),hc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,_l=e=>{const t=e.fgColor??"currentColor";return p.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.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"}),p.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"}))},If=e=>{const t=e.fgColor??"currentColor";return p.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Tf(e,t,n){const[o,r]=p.useState(e),i=p.useRef(!0);p.useEffect(()=>()=>{i.current=!1},[]);const l=p.useRef(ac(s=>{i.current&&r(s)},n));return p.useLayoutEffect(()=>{i.current&&l.current(()=>e())},t),o}const Of="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Df="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",zf=new RegExp("^[^"+Df+"]*["+Of+"]");function Nl(e){return zf.test(e)?"rtl":"not-rtl"}let xi;function Bl(){if(typeof document>"u")return 0;if(xi!==void 0)return xi;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 o=e.offsetWidth;return n===o&&(o=t.clientWidth),t.remove(),xi=n-o,xi}const Fo=Symbol();function Lf(e){const t=p.useRef([Fo,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=p.useState(e),[,r]=p.useState(),i=p.useCallback(s=>{const a=t.current[0];a!==Fo&&(s=typeof s=="function"?s(a):s,s===a)||(a!==Fo&&r({}),o(c=>typeof s=="function"?s(a===Fo?c:a):s),t.current[0]=Fo)},[]),l=p.useCallback(()=>{t.current[0]=Fo,r({})},[]);return[t.current[0]===Fo?n:t.current[0],i,l]}function fc(e){if(e.length===0)return"";let t=0,n=0;for(const o of e){if(n+=o.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Pf(e){const t=p.useRef(e);return tr(e,t.current)||(t.current=e),t.current}const Hf=e=>{const{urls:t,canWrite:n,onEditClick:o,renderImage:r}=e,i=t.filter(s=>s!=="");if(i.length===0)return null;const l=i.length>1;return p.createElement(gf,{"data-testid":"GDG-default-image-overlay-editor"},p.createElement(Sf.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(s=>{const a=(r==null?void 0:r(s))??p.createElement("img",{draggable:!1,src:s});return p.createElement("div",{className:"gdg-centering-container",key:s},a)})),n&&o&&p.createElement("button",{className:"gdg-edit-icon",onClick:o},p.createElement(_l,null)))};function pc(){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 _o=pc();function Af(e){_o=e}const gc=/[&<>"']/,Ff=new RegExp(gc.source,"g"),mc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,_f=new RegExp(mc.source,"g"),Nf={"&":"&","<":"<",">":">",'"':""","'":"'"},vc=e=>Nf[e];function vn(e,t){if(t){if(gc.test(e))return e.replace(Ff,vc)}else if(mc.test(e))return e.replace(_f,vc);return e}const Bf=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function bc(e){return e.replace(Bf,(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 Vf=/(^|[^\[])\^/g;function Nt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(o,r)=>(r=r.source||r,r=r.replace(Vf,"$1"),e=e.replace(o,r),n),getRegex:()=>new RegExp(e,t)};return n}const $f=/[^\w:]/g,Wf=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function wc(e,t,n){if(e){let o;try{o=decodeURIComponent(bc(n)).replace($f,"").toLowerCase()}catch{return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}t&&!Wf.test(n)&&(n=Xf(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ci={},jf=/^[^:]+:\/*[^/]*$/,Uf=/^([^:]+:)[\s\S]*$/,Yf=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Xf(e,t){Ci[" "+e]||(jf.test(e)?Ci[" "+e]=e+"/":Ci[" "+e]=Si(e,"/",!0)),e=Ci[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Uf,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Yf,"$1")+t:e+t}const ki={exec:function(){}};function yc(e,t){const n=e.replace(/\|/g,(i,l,s)=>{let a=!1,c=l;for(;--c>=0&&s[c]==="\\";)a=!a;return a?"|":" |"}),o=n.split(/ \|/);let r=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),o.length>t)o.splice(t);else for(;o.length<t;)o.push("");for(;r<o.length;r++)o[r]=o[r].trim().replace(/\\\|/g,"|");return o}function Si(e,t,n){const o=e.length;if(o===0)return"";let r=0;for(;r<o;){const i=e.charAt(o-r-1);if(i===t&&!n)r++;else if(i!==t&&n)r++;else break}return e.slice(0,o-r)}function Gf(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let o=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])o++;else if(e[r]===t[1]&&(o--,o<0))return r;return-1}function Kf(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 xc(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Cc(e,t,n,o){const r=t.href,i=t.title?vn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){o.state.inLink=!0;const s={type:"link",raw:n,href:r,title:i,text:l,tokens:o.inlineTokens(l)};return o.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:i,text:vn(l)}}function qf(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const o=n[1];return t.split(`
|
|
3
|
+
`).map(r=>{const i=r.match(/^\s+/);if(i===null)return r;const[l]=i;return l.length>=o.length?r.slice(o.length):r}).join(`
|
|
4
|
+
`)}class Vl{constructor(t){this.options=t||_o}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 o=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Si(o,`
|
|
5
|
+
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const o=n[0],r=qf(o,n[3]||"");return{type:"code",raw:o,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let o=n[2].trim();if(/#$/.test(o)){const r=Si(o,"#");(this.options.pedantic||!r||/ $/.test(r))&&(o=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:o,tokens:this.lexer.inline(o)}}}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 o=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(o);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:i,text:o}}}list(t){let n=this.rules.block.list.exec(t);if(n){let o,r,i,l,s,a,c,u,d,f,h,g,m=n[1].trim();const b=m.length>1,y={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const v=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(g=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(o=n[0],t=t.substring(o.length),u=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=u.trimLeft()):(l=n[2].search(/[^ ]/),l=l>4?1:l,h=u.slice(l),l+=n[1].length),a=!1,!u&&/^ *$/.test(d)&&(o+=d+`
|
|
8
|
+
`,t=t.substring(d.length+1),g=!0),!g){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+|$)`),x=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),L=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;t&&(f=t.split(`
|
|
9
|
+
`,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(x.test(d)||L.test(d)||T.test(d)||k.test(t)));){if(d.search(/[^ ]/)>=l||!d.trim())h+=`
|
|
10
|
+
`+d.slice(l);else{if(a||u.search(/[^ ]/)>=4||x.test(u)||L.test(u)||k.test(u))break;h+=`
|
|
11
|
+
`+d}!a&&!d.trim()&&(a=!0),o+=f+`
|
|
12
|
+
`,t=t.substring(f.length+1),u=d.slice(l)}}y.loose||(c?y.loose=!0:/\n *\n *$/.test(o)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(i=r[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:o,task:!!r,checked:i,loose:!1,text:h}),y.raw+=o}y.items[y.items.length-1].raw=o.trimRight(),y.items[y.items.length-1].text=h.trimRight(),y.raw=y.raw.trimRight();const I=y.items.length;for(s=0;s<I;s++)if(this.lexer.state.top=!1,y.items[s].tokens=this.lexer.blockTokens(y.items[s].text,[]),!y.loose){const T=y.items[s].tokens.filter(x=>x.type==="space"),k=T.length>0&&T.some(x=>/\n.*\n/.test(x.raw));y.loose=k}if(y.loose)for(s=0;s<I;s++)y.items[s].loose=!0;return y}}html(t){const n=this.rules.block.html.exec(t);if(n){const o={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 r=this.options.sanitizer?this.options.sanitizer(n[0]):vn(n[0]);o.type="paragraph",o.text=r,o.tokens=this.lexer.inline(r)}return o}}def(t){const n=this.rules.block.def.exec(t);if(n){const o=n[1].toLowerCase().replace(/\s+/g," "),r=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:o,raw:n[0],href:r,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(n){const o={type:"table",header:yc(n[1]).map(r=>({text:r})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
|
13
|
+
`):[]};if(o.header.length===o.align.length){o.raw=n[0];let r=o.align.length,i,l,s,a;for(i=0;i<r;i++)/^ *-+: *$/.test(o.align[i])?o.align[i]="right":/^ *:-+: *$/.test(o.align[i])?o.align[i]="center":/^ *:-+ *$/.test(o.align[i])?o.align[i]="left":o.align[i]=null;for(r=o.rows.length,i=0;i<r;i++)o.rows[i]=yc(o.rows[i],o.header.length).map(c=>({text:c}));for(r=o.header.length,l=0;l<r;l++)o.header[l].tokens=this.lexer.inline(o.header[l].text);for(r=o.rows.length,l=0;l<r;l++)for(a=o.rows[l],s=0;s<a.length;s++)a[s].tokens=this.lexer.inline(a[s].text);return o}}}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 o=n[1].charAt(n[1].length-1)===`
|
|
14
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:o,tokens:this.lexer.inline(o)}}}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 o=n[2].trim();if(!this.options.pedantic&&/^</.test(o)){if(!/>$/.test(o))return;const l=Si(o.slice(0,-1),"\\");if((o.length-l.length)%2===0)return}else{const l=Gf(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 r=n[2],i="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],i=l[3])}else i=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(o)?r=r.slice(1):r=r.slice(1,-1)),Cc(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let o;if((o=this.rules.inline.reflink.exec(t))||(o=this.rules.inline.nolink.exec(t))){let r=(o[2]||o[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const i=o[0].charAt(0);return{type:"text",raw:i,text:i}}return Cc(o,r,o[0],this.lexer)}}emStrong(t,n,o=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&o.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||i&&(o===""||this.rules.inline.punctuation.exec(o))){const l=r[0].length-1;let s,a,c=l,u=0;const d=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+l);(r=d.exec(n))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=s.length,r[3]||r[4]){c+=a;continue}else if((r[5]||r[6])&&l%3&&!((l+a)%3)){u+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+u);const f=t.slice(0,l+r.index+(r[0].length-s.length)+a);if(Math.min(l,a)%2){const g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}const h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let o=n[2].replace(/\n/g," ");const r=/[^ ]/.test(o),i=/^ /.test(o)&&/ $/.test(o);return r&&i&&(o=o.substring(1,o.length-1)),o=vn(o,!0),{type:"codespan",raw:n[0],text:o}}}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 o=this.rules.inline.autolink.exec(t);if(o){let r,i;return o[2]==="@"?(r=vn(this.options.mangle?n(o[1]):o[1]),i="mailto:"+r):(r=vn(o[1]),i=r),{type:"link",raw:o[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let o;if(o=this.rules.inline.url.exec(t)){let r,i;if(o[2]==="@")r=vn(this.options.mangle?n(o[0]):o[0]),i="mailto:"+r;else{let l;do l=o[0],o[0]=this.rules.inline._backpedal.exec(o[0])[0];while(l!==o[0]);r=vn(o[0]),o[1]==="www."?i="http://"+o[0]:i=o[0]}return{type:"link",raw:o[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const o=this.rules.inline.text.exec(t);if(o){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):vn(o[0]):o[0]:r=vn(this.options.smartypants?n(o[0]):o[0]),{type:"text",raw:o[0],text:r}}}}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:ki,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=Nt($e.def).replace("label",$e._label).replace("title",$e._title).getRegex(),$e.bullet=/(?:[*+-]|\d{1,9}[.)])/,$e.listItemStart=Nt(/^( *)(bull) */).replace("bull",$e.bullet).getRegex(),$e.list=Nt($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=Nt($e.html,"i").replace("comment",$e._comment).replace("tag",$e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$e.paragraph=Nt($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=Nt($e.blockquote).replace("paragraph",$e.paragraph).getRegex(),$e.normal={...$e},$e.gfm={...$e.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},$e.gfm.table=Nt($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=Nt($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:Nt(`^ *(?: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:ki,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Nt($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 Me={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ki,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:ki,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Me._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Me.punctuation=Nt(Me.punctuation).replace(/punctuation/g,Me._punctuation).getRegex(),Me.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Me.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,Me._comment=Nt($e._comment).replace("(?:-->|$)","-->").getRegex(),Me.emStrong.lDelim=Nt(Me.emStrong.lDelim).replace(/punct/g,Me._punctuation).getRegex(),Me.emStrong.rDelimAst=Nt(Me.emStrong.rDelimAst,"g").replace(/punct/g,Me._punctuation).getRegex(),Me.emStrong.rDelimUnd=Nt(Me.emStrong.rDelimUnd,"g").replace(/punct/g,Me._punctuation).getRegex(),Me._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Me._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Me._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])?)+(?![-_])/,Me.autolink=Nt(Me.autolink).replace("scheme",Me._scheme).replace("email",Me._email).getRegex(),Me._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Me.tag=Nt(Me.tag).replace("comment",Me._comment).replace("attribute",Me._attribute).getRegex(),Me._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Me._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Me._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Me.link=Nt(Me.link).replace("label",Me._label).replace("href",Me._href).replace("title",Me._title).getRegex(),Me.reflink=Nt(Me.reflink).replace("label",Me._label).replace("ref",$e._label).getRegex(),Me.nolink=Nt(Me.nolink).replace("ref",$e._label).getRegex(),Me.reflinkSearch=Nt(Me.reflinkSearch,"g").replace("reflink",Me.reflink).replace("nolink",Me.nolink).getRegex(),Me.normal={...Me},Me.pedantic={...Me.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:Nt(/^!?\[(label)\]\((.*?)\)/).replace("label",Me._label).getRegex(),reflink:Nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Me._label).getRegex()},Me.gfm={...Me.normal,escape:Nt(Me.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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Me.gfm.url=Nt(Me.gfm.url,"i").replace("email",Me.gfm._extended_email).getRegex(),Me.breaks={...Me.gfm,br:Nt(Me.br).replace("{2,}","*").getRegex(),text:Nt(Me.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function Zf(e){return e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function kc(e){let t="",n,o;const r=e.length;for(n=0;n<r;n++)o=e.charCodeAt(n),Math.random()>.5&&(o="x"+o.toString(16)),t+="&#"+o+";";return t}class xo{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||_o,this.options.tokenizer=this.options.tokenizer||new Vl,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:Me.normal};this.options.pedantic?(n.block=$e.pedantic,n.inline=Me.pedantic):this.options.gfm&&(n.block=$e.gfm,this.options.breaks?n.inline=Me.breaks:n.inline=Me.gfm),this.tokenizer.rules=n}static get rules(){return{block:$e,inline:Me}}static lex(t,n){return new xo(n).lex(t)}static lexInline(t,n){return new xo(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,(s,a,c)=>a+" ".repeat(c.length));let o,r,i,l;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(o=s.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))){if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length),o.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
|
17
|
+
`:n.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|
18
|
+
`+o.raw,r.text+=`
|
|
19
|
+
`+o.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|
20
|
+
`+o.raw,r.text+=`
|
|
21
|
+
`+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const a=t.slice(1);let c;this.options.extensions.startBlock.forEach(function(u){c=u.call({lexer:this},a),typeof c=="number"&&c>=0&&(s=Math.min(s,c))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(o=this.tokenizer.paragraph(i))){r=n[n.length-1],l&&r.type==="paragraph"?(r.raw+=`
|
|
22
|
+
`+o.raw,r.text+=`
|
|
23
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(o),l=i.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length),r=n[n.length-1],r&&r.type==="text"?(r.raw+=`
|
|
24
|
+
`+o.raw,r.text+=`
|
|
25
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(o);continue}if(t){const s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let o,r,i,l=t,s,a,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+xc("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,s.index)+"["+xc("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,s.index+s[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(a||(c=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(o=u.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))){if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),r=n[n.length-1],r&&o.type==="text"&&r.type==="text"?(r.raw+=o.raw,r.text+=o.text):n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length),r=n[n.length-1],r&&o.type==="text"&&r.type==="text"?(r.raw+=o.raw,r.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,l,c)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t,kc)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t,kc))){t=t.substring(o.raw.length),n.push(o);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(h){f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(o=this.tokenizer.inlineText(i,Zf)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),a=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=o.raw,r.text+=o.text):n.push(o);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class $l{constructor(t){this.options=t||_o}code(t,n,o){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,r);i!=null&&i!==t&&(o=!0,t=i)}return t=t.replace(/\n$/,"")+`
|
|
26
|
+
`,r?'<pre><code class="'+this.options.langPrefix+vn(r)+'">'+(o?t:vn(t,!0))+`</code></pre>
|
|
27
|
+
`:"<pre><code>"+(o?t:vn(t,!0))+`</code></pre>
|
|
28
|
+
`}blockquote(t){return`<blockquote>
|
|
29
|
+
${t}</blockquote>
|
|
30
|
+
`}html(t){return t}heading(t,n,o,r){if(this.options.headerIds){const i=this.options.headerPrefix+r.slug(o);return`<h${n} id="${i}">${t}</h${n}>
|
|
31
|
+
`}return`<h${n}>${t}</h${n}>
|
|
32
|
+
`}hr(){return this.options.xhtml?`<hr/>
|
|
33
|
+
`:`<hr>
|
|
34
|
+
`}list(t,n,o){const r=n?"ol":"ul",i=n&&o!==1?' start="'+o+'"':"";return"<"+r+i+`>
|
|
35
|
+
`+t+"</"+r+`>
|
|
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 o=n.header?"th":"td";return(n.align?`<${o} align="${n.align}">`:`<${o}>`)+t+`</${o}>
|
|
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,o){if(t=wc(this.options.sanitize,this.options.baseUrl,t),t===null)return o;let r='<a href="'+t+'"';return n&&(r+=' title="'+n+'"'),r+=">"+o+"</a>",r}image(t,n,o){if(t=wc(this.options.sanitize,this.options.baseUrl,t),t===null)return o;let r=`<img src="${t}" alt="${o}"`;return n&&(r+=` title="${n}"`),r+=this.options.xhtml?"/>":">",r}text(t){return t}}class Sc{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,o){return""+o}image(t,n,o){return""+o}br(){return""}}class Mc{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let o=t,r=0;if(this.seen.hasOwnProperty(o)){r=this.seen[t];do r++,o=t+"-"+r;while(this.seen.hasOwnProperty(o))}return n||(this.seen[t]=r,this.seen[o]=0),o}slug(t,n={}){const o=this.serialize(t);return this.getNextSafeSlug(o,n.dryrun)}}class Co{constructor(t){this.options=t||_o,this.options.renderer=this.options.renderer||new $l,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Sc,this.slugger=new Mc}static parse(t,n){return new Co(n).parse(t)}static parseInline(t,n){return new Co(n).parseInline(t)}parse(t,n=!0){let o="",r,i,l,s,a,c,u,d,f,h,g,m,b,y,v,I,T,k,x;const L=t.length;for(r=0;r<L;r++){if(h=t[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(x=this.options.extensions.renderers[h.type].call({parser:this},h),x!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){o+=x||"";continue}switch(h.type){case"space":continue;case"hr":{o+=this.renderer.hr();continue}case"heading":{o+=this.renderer.heading(this.parseInline(h.tokens),h.depth,bc(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{o+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",u="",s=h.header.length,i=0;i<s;i++)u+=this.renderer.tablecell(this.parseInline(h.header[i].tokens),{header:!0,align:h.align[i]});for(d+=this.renderer.tablerow(u),f="",s=h.rows.length,i=0;i<s;i++){for(c=h.rows[i],u="",a=c.length,l=0;l<a;l++)u+=this.renderer.tablecell(this.parseInline(c[l].tokens),{header:!1,align:h.align[l]});f+=this.renderer.tablerow(u)}o+=this.renderer.table(d,f);continue}case"blockquote":{f=this.parse(h.tokens),o+=this.renderer.blockquote(f);continue}case"list":{for(g=h.ordered,m=h.start,b=h.loose,s=h.items.length,f="",i=0;i<s;i++)v=h.items[i],I=v.checked,T=v.task,y="",v.task&&(k=this.renderer.checkbox(I),b?v.tokens.length>0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=k+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type==="text"&&(v.tokens[0].tokens[0].text=k+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:k}):y+=k),y+=this.parse(v.tokens,b),f+=this.renderer.listitem(y,T,I);o+=this.renderer.list(f,g,m);continue}case"html":{o+=this.renderer.html(h.text);continue}case"paragraph":{o+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(f=h.tokens?this.parseInline(h.tokens):h.text;r+1<L&&t[r+1].type==="text";)h=t[++r],f+=`
|
|
46
|
+
`+(h.tokens?this.parseInline(h.tokens):h.text);o+=n?this.renderer.paragraph(f):f;continue}default:{const O='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(O);return}else throw new Error(O)}}}return o}parseInline(t,n){n=n||this.renderer;let o="",r,i,l;const s=t.length;for(r=0;r<s;r++){if(i=t[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]&&(l=this.options.extensions.renderers[i.type].call({parser:this},i),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))){o+=l||"";continue}switch(i.type){case"escape":{o+=n.text(i.text);break}case"html":{o+=n.html(i.text);break}case"link":{o+=n.link(i.href,i.title,this.parseInline(i.tokens,n));break}case"image":{o+=n.image(i.href,i.title,i.text);break}case"strong":{o+=n.strong(this.parseInline(i.tokens,n));break}case"em":{o+=n.em(this.parseInline(i.tokens,n));break}case"codespan":{o+=n.codespan(i.text);break}case"br":{o+=n.br();break}case"del":{o+=n.del(this.parseInline(i.tokens,n));break}case"text":{o+=n.text(i.text);break}default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(a);return}else throw new Error(a)}}}return o}}class Mi{constructor(t){this.options=t||_o}preprocess(t){return t}postprocess(t){return t}}ht(Mi,"passThroughHooks",new Set(["preprocess","postprocess"]));function Jf(e,t,n){return o=>{if(o.message+=`
|
|
47
|
+
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+vn(o.message+"",!0)+"</pre>";if(t)return Promise.resolve(r);if(n){n(null,r);return}return r}if(t)return Promise.reject(o);if(n){n(o);return}throw o}}function Rc(e,t){return(n,o,r)=>{typeof o=="function"&&(r=o,o=null);const i={...o};o={...Xe.defaults,...i};const l=Jf(o.silent,o.async,r);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Kf(o),o.hooks&&(o.hooks.options=o),r){const s=o.highlight;let a;try{o.hooks&&(n=o.hooks.preprocess(n)),a=e(n,o)}catch(d){return l(d)}const c=function(d){let f;if(!d)try{o.walkTokens&&Xe.walkTokens(a,o.walkTokens),f=t(a,o),o.hooks&&(f=o.hooks.postprocess(f))}catch(h){d=h}return o.highlight=s,d?l(d):r(null,f)};if(!s||s.length<3||(delete o.highlight,!a.length))return c();let u=0;Xe.walkTokens(a,function(d){d.type==="code"&&(u++,setTimeout(()=>{s(d.text,d.lang,function(f,h){if(f)return c(f);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(s=>e(s,o)).then(s=>o.walkTokens?Promise.all(Xe.walkTokens(s,o.walkTokens)).then(()=>s):s).then(s=>t(s,o)).then(s=>o.hooks?o.hooks.postprocess(s):s).catch(l);try{o.hooks&&(n=o.hooks.preprocess(n));const s=e(n,o);o.walkTokens&&Xe.walkTokens(s,o.walkTokens);let a=t(s,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(s){return l(s)}}}function Xe(e,t,n){return Rc(xo.lex,Co.parse)(e,t,n)}Xe.options=Xe.setOptions=function(e){return Xe.defaults={...Xe.defaults,...e},Af(Xe.defaults),Xe},Xe.getDefaults=pc,Xe.defaults=_o,Xe.use=function(...e){const t=Xe.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const o={...n};if(o.async=Xe.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){const i=t.renderers[r.name];i?t.renderers[r.name]=function(...l){let s=r.renderer.apply(this,l);return s===!1&&(s=i.apply(this,l)),s}:t.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[r.level]?t[r.level].unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),o.extensions=t),n.renderer){const r=Xe.defaults.renderer||new $l;for(const i in n.renderer){const l=r[i];r[i]=(...s)=>{let a=n.renderer[i].apply(r,s);return a===!1&&(a=l.apply(r,s)),a}}o.renderer=r}if(n.tokenizer){const r=Xe.defaults.tokenizer||new Vl;for(const i in n.tokenizer){const l=r[i];r[i]=(...s)=>{let a=n.tokenizer[i].apply(r,s);return a===!1&&(a=l.apply(r,s)),a}}o.tokenizer=r}if(n.hooks){const r=Xe.defaults.hooks||new Mi;for(const i in n.hooks){const l=r[i];Mi.passThroughHooks.has(i)?r[i]=s=>{if(Xe.defaults.async)return Promise.resolve(n.hooks[i].call(r,s)).then(c=>l.call(r,c));const a=n.hooks[i].call(r,s);return l.call(r,a)}:r[i]=(...s)=>{let a=n.hooks[i].apply(r,s);return a===!1&&(a=l.apply(r,s)),a}}o.hooks=r}if(n.walkTokens){const r=Xe.defaults.walkTokens;o.walkTokens=function(i){let l=[];return l.push(n.walkTokens.call(this,i)),r&&(l=l.concat(r.call(this,i))),l}}Xe.setOptions(o)})},Xe.walkTokens=function(e,t){let n=[];for(const o of e)switch(n=n.concat(t.call(Xe,o)),o.type){case"table":{for(const r of o.header)n=n.concat(Xe.walkTokens(r.tokens,t));for(const r of o.rows)for(const i of r)n=n.concat(Xe.walkTokens(i.tokens,t));break}case"list":{n=n.concat(Xe.walkTokens(o.items,t));break}default:Xe.defaults.extensions&&Xe.defaults.extensions.childTokens&&Xe.defaults.extensions.childTokens[o.type]?Xe.defaults.extensions.childTokens[o.type].forEach(function(r){n=n.concat(Xe.walkTokens(o[r],t))}):o.tokens&&(n=n.concat(Xe.walkTokens(o.tokens,t)))}return n},Xe.parseInline=Rc(xo.lexInline,Co.parseInline),Xe.Parser=Co,Xe.parser=Co.parse,Xe.Renderer=$l,Xe.TextRenderer=Sc,Xe.Lexer=xo,Xe.lexer=xo.lex,Xe.Tokenizer=Vl,Xe.Slugger=Mc,Xe.Hooks=Mi,Xe.parse=Xe,Xe.options,Xe.setOptions,Xe.use,Xe.walkTokens,Xe.parseInline,Co.parse,xo.lex;const Qf=cn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class ep extends te.PureComponent{constructor(){super(...arguments),ht(this,"targetElement",null),ht(this,"containerRefHook",t=>{this.targetElement=t,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:o,createNode:r}=n,i=Xe(o),l=document.createRange();l.selectNodeContents(t),l.deleteContents();let s=r==null?void 0:r(i);if(s===void 0){const c=document.createElement("template");c.innerHTML=i,s=c.content}t.append(s);const a=t.getElementsByTagName("a");for(const c of a)c.target="_blank",c.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),te.createElement(Qf,{ref:this.containerRefHook})}}const tp=cn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),np=cn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),op=cn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Ec=0;const No=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:r,altNewline:i,validatedSelection:l,...s}=e,{onChange:a,className:c}=s,u=p.useRef(null),d=n??"";zn(a!==void 0,"GrowingEntry must be a controlled input area");const[f]=p.useState(()=>"input-box-"+(Ec=(Ec+1)%1e7));p.useEffect(()=>{const g=u.current;if(g===null||g.disabled)return;const m=d.toString().length;g.focus(),g.setSelectionRange(r?0:m,m)},[]),p.useLayoutEffect(()=>{var g;if(l!==void 0){const m=typeof l=="number"?[l,null]:l;(g=u.current)==null||g.setSelectionRange(m[0],m[1])}},[l]);const h=p.useCallback(g=>{g.key==="Enter"&&g.shiftKey&&i===!0||o==null||o(g)},[i,o]);return p.createElement(op,{className:"gdg-growing-entry"},p.createElement(np,{className:c},d+`
|
|
48
|
+
`),p.createElement(tp,{...s,className:(c??"")+" gdg-input",id:f,ref:u,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},Wl={};let ko=null;function rp(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function Ri(e){const t=e.toLowerCase().trim();if(Wl[t]!==void 0)return Wl[t];ko=ko||rp(),ko.style.color="#000",ko.style.color=t;const n=getComputedStyle(ko).color;ko.style.color="#fff",ko.style.color=t;const o=getComputedStyle(ko).color;if(o!==n)return[0,0,0,1];let r=o.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return r.length<4&&r.push(1),r=r.map(i=>Number.isNaN(i)?0:i),Wl[t]=r,r}function Bo(e,t){const[n,o,r]=Ri(e);return`rgba(${n}, ${o}, ${r}, ${t})`}const Ic=new Map;function Tc(e,t){const n=`${e}-${t}`,o=Ic.get(n);if(o!==void 0)return o;const r=Pn(e,t);return Ic.set(n,r),r}function Pn(e,t){if(t===void 0)return e;const[n,o,r,i]=Ri(e);if(i===1)return e;const[l,s,a,c]=Ri(t),u=i+c*(1-i),d=(i*n+c*l*(1-i))/u,f=(i*o+c*s*(1-i))/u,h=(i*r+c*a*(1-i))/u;return`rgba(${d}, ${f}, ${h}, ${u})`}var nr=new Map,or=new Map,jl=new Map;function ip(){nr.clear(),jl.clear(),or.clear()}function lp(e,t,n,o,r){var i,l,s;let a=0,c={};for(let d of e)a+=(i=n.get(d))!=null?i:r,c[d]=((l=c[d])!=null?l:0)+1;let u=t-a;for(let d of Object.keys(c)){let f=c[d],h=(s=n.get(d))!=null?s:r,g=h*f/a,m=u*g*o/f,b=h+m;n.set(d,b)}}function ap(e,t){var n;let o=new Map,r=0;for(let c of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let u=e.measureText(c).width;o.set(c,u),r+=u}let i=r/o.size,l=3,s=(t/i+l)/(l+1),a=o.keys();for(let c of a)o.set(c,((n=o.get(c))!=null?n:i)*s);return o}function Ar(e,t,n,o){var r,i;let l=or.get(n);if(o&&l!==void 0&&l.count>2e4){let c=jl.get(n);if(c===void 0&&(c=ap(e,l.size),jl.set(n,c)),l.count>5e5){let d=0;for(let f of t)d+=(r=c.get(f))!=null?r:l.size;return d*1.01}let u=e.measureText(t);return lp(t,u.width,c,Math.max(.05,1-l.count/2e5),l.size),or.set(n,{count:l.count+t.length,size:l.size}),u.width}let s=e.measureText(t),a=s.width/t.length;if(((i=l==null?void 0:l.count)!=null?i:0)>2e4)return s.width;if(l===void 0)or.set(n,{count:t.length,size:a});else{let c=a-l.size,u=t.length/(l.count+t.length),d=l.size+c*u;or.set(n,{count:l.count+t.length,size:d})}return s.width}function sp(e,t,n,o,r,i,l,s){if(t.length<=1)return t.length;if(r<n)return-1;let a=Math.floor(n/r*i),c=Ar(e,t.slice(0,Math.max(0,a)),o,l);if(c!==n)if(c<n){for(;c<n;)a++,c=Ar(e,t.slice(0,Math.max(0,a)),o,l);a--}else for(;c>n;){let u=t.lastIndexOf(" ",a-1);u>0?a=u:a--,c=Ar(e,t.slice(0,Math.max(0,a)),o,l)}if(t[a]!==" "){let u=0;u=t.lastIndexOf(" ",a),u>0&&(a=u)}return a}function cp(e,t,n,o,r,i){let l=`${t}_${n}_${o}px`,s=nr.get(l);if(s!==void 0)return s;if(o<=0)return[];let a=[],c=t.split(`
|
|
49
|
+
`),u=or.get(n),d=u===void 0?t.length:o/u.size*1.5,f=r&&u!==void 0&&u.count>2e4;for(let h of c){let g=Ar(e,h.slice(0,Math.max(0,d)),n,f),m=Math.min(h.length,d);if(g<=o)a.push(h);else{for(;g>o;){let b=sp(e,h,o,n,g,m,f),y=h.slice(0,Math.max(0,b));h=h.slice(y.length),a.push(y),g=Ar(e,h.slice(0,Math.max(0,d)),n,f),m=Math.min(h.length,d)}g>0&&a.push(h)}}return a=a.map((h,g)=>g===0?h.trimEnd():h.trim()),nr.set(l,a),nr.size>500&&nr.delete(nr.keys().next().value),a}function up(e,t){return te.useMemo(()=>e.map((n,o)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:o,sticky:o<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 dp(e,t){const[n,o]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(o))return!0;if(e.current!==void 0){if(_r(e.current.cell,t))return!0;const r=[e.current.range,...e.current.rangeStack];for(const i of r)if(n>=i.x&&n<i.x+i.width&&o>=i.y&&o<i.y+i.height)return!0}return!1}function Fr(e,t){return(e??"")===(t??"")}function hp(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 Oc(e,t){const[n,o]=e;return n>=t.x&&n<t.x+t.width&&o>=t.y&&o<t.y+t.height}function _r(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function Dc(e){return[e.x+e.width-1,e.y+e.height-1]}function zc(e,t,n){const o=n.x,r=n.x+n.width-1,i=n.y,l=n.y+n.height-1,[s,a]=e;if(a<i||a>l)return!1;if(t.span===void 0)return s>=o&&s<=r;const[c,u]=t.span;return c>=o&&c<=r||u>=o&&c<=r||c<o&&u>r}function fp(e,t,n,o){let r=0;if(n.current===void 0)return r;const i=n.current.range;(o||i.height*i.width>1)&&zc(e,t,i)&&r++;for(const l of n.current.rangeStack)zc(e,t,l)&&r++;return r}function Lc(e,t){let n=e;if(t!==void 0){let o=[...e];const r=n[t.src];t.src>t.dest?(o.splice(t.src,1),o.splice(t.dest,0,r)):(o.splice(t.dest+1,0,r),o.splice(t.src,1)),o=o.map((i,l)=>({...i,sticky:e[l].sticky})),n=o}return n}function rr(e,t){let n=0;const o=Lc(e,t);for(let r=0;r<o.length;r++){const i=o[r];if(i.sticky)n+=i.width;else break}return n}function Vo(e,t,n){if(typeof n=="number")return t*n;{let o=0;for(let r=e-t;r<e;r++)o+=n(r);return o}}function Ul(e,t,n,o,r){const i=Lc(e,o),l=[];for(const c of i)if(c.sticky)l.push(c);else break;if(l.length>0)for(const c of l)n-=c.width;let s=t,a=r??0;for(;a<=n&&s<i.length;)a+=i[s].width,s++;for(let c=t;c<s;c++){const u=i[c];u.sticky||l.push(u)}return l}function pp(e,t,n){let o=0;for(const r of t){const i=r.sticky?o:o+(n??0);if(e<=i+r.width)return r.sourceIndex;o+=r.width}return-1}function gp(e,t,n,o,r,i,l,s,a,c){const u=o+r;if(n&&e<=r)return-2;if(e<=u)return-1;let d=t;for(let g=0;g<c;g++){const m=i-1-g,b=typeof l=="number"?l:l(m);if(d-=b,e>=d)return m}const f=i-c,h=e-(a??0);if(typeof l=="number"){const g=Math.floor((h-u)/l)+s;return g>=f?void 0:g}else{let g=u;for(let m=s;m<f;m++){const b=l(m);if(h<=g+b)return m;g+=b}return}}let Ei=0,Nr={};const mp=typeof window>"u";async function vp(){var e;mp||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,Ei=0,Nr={},ip())}vp();function Pc(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function $o(e,t,n,o="middle"){const r=Pc(e,t,o,n);let i=Nr[r];return i===void 0&&(i=t.measureText(e),Nr[r]=i,Ei++),Ei>1e4&&(Nr={},Ei=0),i}function Hc(e,t){const n=Pc(e,void 0,"middle",t);return Nr[n]}function eo(e,t){return typeof t!="string"&&(t=t.baseFontFull),bp(e,t)}function Ac(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const Fc=[];function bp(e,t){for(const r of Fc)if(r.key===t)return r.val;const n=Ac(e,"alphabetic"),o=-(Ac(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Fc.push({key:t,val:o}),o}function wp(e,t,n,o,r,i){const{ctx:l,rect:s,theme:a}=e;let c=Number.MAX_SAFE_INTEGER;const u=500;if(t!==void 0&&(c=n-t,c<u)){const d=1-c/u;l.globalAlpha=d,l.fillStyle=a.bgSearchResult,l.fillRect(s.x+1,s.y+1,s.width-(r?2:1),s.height-(i?2:1)),l.globalAlpha=1,o!==void 0&&(o.fillStyle=a.bgSearchResult)}return c<u}function Br(e,t,n){const{ctx:o,theme:r}=e,i=t??{},l=n??r.textDark;return l!==i.fillStyle&&(o.fillStyle=l,i.fillStyle=l),i}function Yl(e,t,n){const{rect:o,ctx:r,theme:i}=e;r.fillStyle=i.textDark,to({ctx:r,rect:o,theme:i},t,n)}function _c(e,t,n,o,r,i,l,s,a){a==="right"?e.fillText(t,n+r-(s.cellHorizontalPadding+.5),o+i/2+l):a==="center"?e.fillText(t,n+r/2,o+i/2+l):e.fillText(t,n+s.cellHorizontalPadding+.5,o+i/2+l)}function Nc(e,t){const n=$o("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function yp(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 xp(e,t,n,o,r,i,l,s,a,c){const u=s.baseFontFull,d=cp(e,t,u,r-s.cellHorizontalPadding*2,c??!1),f=Nc(e,u),h=s.lineHeight*f,g=f+h*(d.length-1),m=g+s.cellVerticalPadding>i;m&&(e.save(),e.rect(n,o,r,i),e.clip());const b=o+i/2-g/2;let y=Math.max(o+s.cellVerticalPadding,b);for(const v of d)if(_c(e,v,n,y,r,f,l,s,a),y+=h,y>o+i)break;m&&e.restore()}function to(e,t,n,o,r){const{ctx:i,rect:l,theme:s}=e,{x:a,y:c,width:u,height:d}=l;o=o??!1,o||(t=yp(t,u));const f=eo(i,s),h=Nl(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(i.direction="rtl"),t.length>0){let g=!1;n==="right"?(i.textAlign="right",g=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,g=!0),o?xp(i,t,a,c,u,d,f,s,n,r):_c(i,t,a,c,u,d,f,s,n),g&&(i.textAlign="start"),h&&(i.direction="inherit")}}function no(e,t,n,o,r,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,r/2,o/2)),tr:Math.max(0,Math.min(i.tr,r/2,o/2)),bl:Math.max(0,Math.min(i.bl,r/2,o/2)),br:Math.max(0,Math.min(i.br,r/2,o/2))},e.moveTo(t+i.tl,n),e.arcTo(t+o,n,t+o,n+i.tr,i.tr),e.arcTo(t+o,n+r,t+o-i.br,n+r,i.br),e.arcTo(t,n+r,t,n+r-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function Cp(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 kp(e,t,n){const o=function(s,a){const c=a.x-s.x,u=a.y-s.y,d=Math.sqrt(c*c+u*u),f=c/d,h=u/d;return{x:c,y:a.y-s.y,len:d,nx:f,ny:h,ang:Math.atan2(h,f)}};let r;const i=t.length;let l=t[i-1];for(let s=0;s<i;s++){let a=t[s%i];const c=t[(s+1)%i],u=o(a,l),d=o(a,c),f=u.nx*d.ny-u.ny*d.nx,h=u.nx*d.nx-u.ny*-d.ny;let g=Math.asin(f<-1?-1:f>1?1:f),m=1,b=!1;h<0?g<0?g=Math.PI+g:(g=Math.PI-g,m=-1,b=!0):g>0&&(m=-1,b=!0),r=a.radius!==void 0?a.radius:n;const y=g/2;let v=Math.abs(Math.cos(y)*r/Math.sin(y)),I;v>Math.min(u.len/2,d.len/2)?(v=Math.min(u.len/2,d.len/2),I=Math.abs(v*Math.sin(y)/Math.cos(y))):I=r;let T=a.x+d.nx*v,k=a.y+d.ny*v;T+=-d.ny*I*m,k+=d.nx*I*m,e.arc(T,k,I,u.ang+Math.PI/2*m,d.ang-Math.PI/2*m,b),l=a,a=c}e.closePath()}function Xl(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g){const m={x:0,y:i+c,width:0,height:0};if(e>=h.length||t>=u||t<-2||e<0)return m;const b=i-r;if(e>=d){const y=l>e?-1:1,v=rr(h);m.x+=v+a;for(let I=l;I!==e;I+=y)m.x+=h[y===1?I:I-1].width*y}else for(let y=0;y<e;y++)m.x+=h[y].width;if(m.width=h[e].width+1,t===-1)m.y=r,m.height=b;else if(t===-2){m.y=0,m.height=r;let y=e;const v=h[e].group,I=h[e].sticky;for(;y>0&&Fr(h[y-1].group,v)&&h[y-1].sticky===I;){const k=h[y-1];m.x-=k.width,m.width+=k.width,y--}let T=e;for(;T+1<h.length&&Fr(h[T+1].group,v)&&h[T+1].sticky===I;){const k=h[T+1];m.width+=k.width,T++}if(!I){const k=rr(h),x=m.x-k;x<0&&(m.x-=x,m.width+=x),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=u-f){let y=u-t;for(m.y=o;y>0;){const v=t+y-1;m.height=typeof g=="number"?g:g(v),m.y-=m.height,y--}m.height+=1}else{const y=s>t?-1:1;if(typeof g=="number"){const v=t-s;m.y+=v*g}else for(let v=s;v!==t;v+=y)m.y+=g(v)*y;m.height=(typeof g=="number"?g:g(t))+1}return m}const Gl=1<<21;function Wn(e,t){return(t+2)*Gl+e}function Bc(e){return e%Gl}function Kl(e){return Math.floor(e/Gl)-2}function ql(e){const t=Bc(e),n=Kl(e);return[t,n]}class Vc{constructor(){ht(this,"visibleWindow",{x:0,y:0,width:0,height:0}),ht(this,"freezeCols",0),ht(this,"freezeRows",[]),ht(this,"isInWindow",t=>{const n=Bc(t),o=Kl(t),r=this.visibleWindow,i=n>=r.x&&n<=r.x+r.width||n<this.freezeCols,l=o>=r.y&&o<=r.y+r.height||this.freezeRows.includes(o);return i&&l})}setWindow(t,n,o){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&tr(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class Sp extends Vc{constructor(){super(...arguments),ht(this,"cache",new Map),ht(this,"setValue",(t,n)=>{this.cache.set(Wn(t[0],t[1]),n)}),ht(this,"getValue",t=>this.cache.get(Wn(t[0],t[1]))),ht(this,"clearOutOfWindow",()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)})}}class Vr{constructor(t=[]){ht(this,"cells"),this.cells=new Set(t.map(n=>Wn(n[0],n[1])))}add(t){this.cells.add(Wn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Wn(t[0],t[1]))}remove(t){this.cells.delete(Wn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Kl(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let o=t.x;o<t.x+t.width;o++)if(this.cells.has(Wn(o,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 ql(t)}}Rs=function(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-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-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,...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`}}};const $c={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",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};function Wc(){return $c}El=te.createContext($c);function Mp(){return te.useContext(El)}function co(e,...t){const n={...e};for(const o of t)if(o!==void 0)for(const r in o)o.hasOwnProperty(r)&&(r==="bgCell"?n[r]=Pn(o[r],n[r]):n[r]=o[r]);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 Zl=150;function Rp(e,t,n,o){var r;const i=o(t);return((r=i==null?void 0:i.measure)==null?void 0:r.call(i,e,t,n))??Zl}function jc(e,t,n,o,r,i,l,s,a){let c=0;const u=r===void 0?[]:r.map(f=>{const h=Rp(e,f[o],t,a);return c=Math.max(c,h),h});if(u.length>5&&s){c=0;let f=0;for(const g of u)f+=g;const h=f/u.length;for(let g=0;g<u.length;g++)u[g]>=h*2?u[g]=0:c=Math.max(c,u[g])}c=Math.max(c,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28));const d=Math.max(Math.ceil(i),Math.min(Math.floor(l),Math.ceil(c)));return{...n,width:d}}function Ep(e,t,n,o,r,i,l,s,a){const c=p.useRef(t),u=p.useRef(n),d=p.useRef(l);c.current=t,u.current=n,d.current=l;const[f,h]=p.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);p.useLayoutEffect(()=>(f&&document.documentElement.append(f),()=>{f==null||f.remove()}),[f]);const g=p.useRef({}),m=p.useRef(),[b,y]=p.useState();return p.useLayoutEffect(()=>{const v=u.current;if(v===void 0||e.every(yi))return;let I=Math.max(1,10-Math.floor(e.length/1e4)),T=0;I<c.current&&I>1&&(I--,T=1);const k={x:0,y:0,width:e.length,height:Math.min(c.current,I)},x={x:0,y:c.current-1,width:e.length,height:1};(async()=>{const L=v(k,a.signal),O=T>0?v(x,a.signal):void 0;let R;typeof L=="object"?R=L:R=await Hs(L),O!==void 0&&(typeof O=="object"?R=[...R,...O]:R=[...R,...await Hs(O)]),m.current=e,y(R)})()},[a.signal,e]),p.useMemo(()=>{let v=e.every(yi)?e:h===null?e.map(x=>yi(x)?x:{...x,width:Zl}):(h.font=d.current.baseFontFull,e.map((x,L)=>{if(yi(x))return x;if(g.current[x.id]!==void 0)return{...x,width:g.current[x.id]};if(b===void 0||m.current!==e||x.id===void 0)return{...x,width:Zl};const O=jc(h,l,x,L,b,r,i,!0,s);return g.current[x.id]=O.width,O})),I=0,T=0;const k=[];for(const[x,L]of v.entries())I+=L.width,L.grow!==void 0&&L.grow>0&&(T+=L.grow,k.push(x));if(I<o&&k.length>0){const x=[...v],L=o-I;let O=L;for(let R=0;R<k.length;R++){const P=k[R],M=(v[P].grow??0)/T,S=R===k.length-1?O:Math.min(O,Math.floor(L*M));x[P]={...v[P],growOffset:S,width:v[P].width+S},O-=S}v=x}return{sizedColumns:v,nonGrowWidth:I}},[o,e,h,b,l,r,i,s])}var Jl,Uc;function Ip(){if(Uc)return Jl;Uc=1;function e(t,n,o){return t===t&&(o!==void 0&&(t=t<=o?t:o),n!==void 0&&(t=t>=n?t:n)),t}return Jl=e,Jl}var Ql,Yc;function Tp(){if(Yc)return Ql;Yc=1;var e=Ip(),t=Hh();function n(o,r,i){return i===void 0&&(i=r,r=void 0),i!==void 0&&(i=t(i),i=i===i?i:0),r!==void 0&&(r=t(r),r=r===r?r:0),e(t(o),r,i)}return Ql=n,Ql}var Op=Tp();const _n=vo(Op);var ea,Xc;function Dp(){if(Xc)return ea;Xc=1;function e(){}return ea=e,ea}var ta,Gc;function zp(){if(Gc)return ta;Gc=1;var e=By(),t=Dp(),n=Ah(),o=1/0,r=e&&1/n(new e([,-0]))[1]==o?function(i){return new e(i)}:t;return ta=r,ta}var na,Kc;function Lp(){if(Kc)return na;Kc=1;var e=Vy(),t=$y(),n=jy(),o=Wy(),r=zp(),i=Ah(),l=200;function s(a,c,u){var d=-1,f=t,h=a.length,g=!0,m=[],b=m;if(u)g=!1,f=n;else if(h>=l){var y=c?null:r(a);if(y)return i(y);g=!1,f=o,b=new e}else b=c?[]:m;e:for(;++d<h;){var v=a[d],I=c?c(v):v;if(v=u||v!==0?v:0,g&&I===I){for(var T=b.length;T--;)if(b[T]===I)continue e;c&&b.push(I),m.push(v)}else f(b,I,u)||(b!==m&&b.push(I),m.push(v))}return m}return na=s,na}var oa,qc;function Pp(){if(qc)return oa;qc=1;var e=Lp();function t(n){return n&&n.length?e(n):[]}return oa=t,oa}var Hp=Pp();const Ap=vo(Hp);var Fp=Uy();const Zc=vo(Fp),Yt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',_p=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
51
|
+
${Yt}<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>`},Np=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
52
|
+
${Yt}<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>`},Bp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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-.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>`},Vp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},$p=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},Jc=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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
|
+
`},Wp=e=>{const t=e.bgColor;return`${Yt}
|
|
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
|
+
`},jp=Jc,Up=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},Yp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
83
|
+
${Yt}
|
|
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>`},Xp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},Gp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
96
|
+
${Yt}
|
|
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>`},Kp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
100
|
+
${Yt}
|
|
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>`},qp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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.682z" fill="${t}"/>
|
|
106
|
+
</svg>`},Zp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
107
|
+
${Yt}
|
|
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>`},Jp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},Qp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
116
|
+
${Yt}
|
|
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>`},e0=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},t0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
124
|
+
${Yt}
|
|
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>`},n0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
128
|
+
${Yt}
|
|
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>`},o0=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},r0=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},i0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
141
|
+
${Yt}
|
|
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>`},l0=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},a0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
148
|
+
${Yt}
|
|
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>`},s0=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},c0=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
|
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>`},u0=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>`},d0=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
|
+
`},h0={headerRowID:_p,headerNumber:Bp,headerCode:Np,headerString:Vp,headerBoolean:$p,headerAudioUri:jp,headerVideoUri:Up,headerEmoji:Yp,headerImage:Xp,headerUri:Jc,headerPhone:Gp,headerMarkdown:Kp,headerDate:qp,headerTime:Zp,headerEmail:Jp,headerReference:Qp,headerIfThenElse:e0,headerSingleValue:t0,headerLookup:n0,headerTextTemplate:o0,headerMath:r0,headerRollup:i0,headerJoinStrings:l0,headerSplitString:a0,headerGeoDistance:s0,headerArray:c0,rowOwnerOverlay:u0,protectedColumnOverlay:d0,renameIcon:Wp};function f0(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class p0{constructor(t,n){ht(this,"onSettled"),ht(this,"spriteMap",new Map),ht(this,"headerIcons"),ht(this,"inFlight",0),this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,o,r,i,l,s,a=1){const[c,u]=f0(n,s),d=l*Math.ceil(window.devicePixelRatio),f=`${c}_${u}_${d}_${t}`;let h=this.spriteMap.get(f);if(h===void 0){const g=this.headerIcons[t];if(g===void 0)return;h=document.createElement("canvas");const m=h.getContext("2d");if(m===null)return;const b=new Image;b.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g({fgColor:u,bgColor:c}))}`,this.spriteMap.set(f,h);const y=b.decode();if(y===void 0)return;this.inFlight++,y.then(()=>{m.drawImage(b,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else a<1&&(o.globalAlpha=a),o.drawImage(h,0,0,d,d,r,i,l,l),a<1&&(o.globalAlpha=1)}}function Qc(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Ii(e,t,n,o,r,i,l,s,a){s=s??t;let c=t,u=e;const d=o-i;let f=!1;for(;c<n&&u<d;){const h=r(u);if(c+h>s&&a(c,u,h,!1,l&&u===o-1)===!0){f=!0;break}c+=h,u++}if(!f){c=n;for(let h=0;h<i;h++){u=o-1-h;const g=r(u);c-=g,a(c,u,g,!0,l&&u===o-1)}}}function So(e,t,n,o,r,i){let l=0,s=0;const a=r+o;for(const c of e){const u=c.sticky?s:l+n;if(i(c,u,a,c.sticky?0:s,t)===!0)break;l+=c.width,s+=c.sticky?c.width:0}}function eu(e,t,n,o,r){let i=0,l=0;for(let s=0;s<e.length;s++){const a=e[s];let c=s+1,u=a.width;for(a.sticky&&(l+=u);c<e.length&&Fr(e[c].group,a.group)&&e[c].sticky===e[s].sticky;){const m=e[c];u+=m.width,c++,s++,m.sticky&&(l+=m.width)}const d=a.sticky?0:n,f=i+d,h=a.sticky?0:Math.max(0,l-f),g=Math.min(u-h,t-(f+h));r([a.sourceIndex,e[c-1].sourceIndex],a.group??"",f+h,0,g,o),i+=u}}function tu(e,t,n,o,r,i,l){var s;const[a,c]=e;let u,d;const f=((s=l.find(h=>!h.sticky))==null?void 0:s.sourceIndex)??0;if(c>f){const h=Math.max(a,f);let g=t,m=o;for(let b=i.sourceIndex-1;b>=h;b--)g-=l[b].width,m+=l[b].width;for(let b=i.sourceIndex+1;b<=c;b++)m+=l[b].width;d={x:g,y:n,width:m,height:r}}if(f>a){const h=Math.min(c,f-1);let g=t,m=o;for(let b=i.sourceIndex-1;b>=a;b--)g-=l[b].width,m+=l[b].width;for(let b=i.sourceIndex+1;b<=h;b++)m+=l[b].width;u={x:g,y:n,width:m,height:r}}return[u,d]}function g0(e,t,n,o){if(o==="any")return nu(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),Oc([t,n],e))return;const r=t-e.x,i=e.x+e.width-t,l=n-e.y+1,s=e.y+e.height-n,a=Math.min(o==="vertical"?Number.MAX_SAFE_INTEGER:r,o==="vertical"?Number.MAX_SAFE_INTEGER:i,o==="horizontal"?Number.MAX_SAFE_INTEGER:l,o==="horizontal"?Number.MAX_SAFE_INTEGER:s);return a===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:a===l?{x:e.x,y:n,width:e.width,height:e.y-n}:a===i?{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 $r(e,t,n,o,r,i,l,s){return e<=r+l&&r<=e+n&&t<=i+s&&i<=t+o}function Wo(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function nu(e,t){const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-n,i=Math.max(e.y+e.height,t.y+t.height)-o;return{x:n,y:o,width:r,height:i}}function m0(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 v0(e,t,n,o){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 r=-4,i=-4,l=t+4,s=n+4,a=r-e.x,c=e.x+e.width-l,u=i-e.y,d=e.y+e.height-s,f=a>0?e.x+Math.floor(a/o)*o:e.x,h=c>0?e.x+e.width-Math.floor(c/o)*o:e.x+e.width,g=u>0?e.y+Math.floor(u/o)*o:e.y,m=d>0?e.y+e.height-Math.floor(d/o)*o:e.y+e.height;return{x:f,y:g,width:h-f,height:m-g}}function b0(e,t,n,o,r){const[i,l,s,a]=t,[c,u,d,f]=r,{x:h,y:g,width:m,height:b}=e,y=[];if(m<=0||b<=0)return y;const v=h+m,I=g+b,T=h<i,k=g<l,x=h+m>s,L=g+b>a,O=h>=i&&h<s||v>i&&v<=s||h<i&&v>s,R=g>=l&&g<a||I>l&&I<=a||g<l&&I>a;if(O&&R){const P=Math.max(h,i),M=Math.max(g,l),S=Math.min(v,s),E=Math.min(I,a);y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:c,y:u,width:d-c+1,height:f-u+1}})}if(T&&k){const P=h,M=g,S=Math.min(v,i),E=Math.min(I,l);y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:0,y:0,width:c+1,height:u+1}})}if(k&&O){const P=Math.max(h,i),M=g,S=Math.min(v,s),E=Math.min(I,l);y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:c,y:0,width:d-c+1,height:u+1}})}if(k&&x){const P=Math.max(h,s),M=g,S=v,E=Math.min(I,l);y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:d,y:0,width:n-d+1,height:u+1}})}if(T&&R){const P=h,M=Math.max(g,l),S=Math.min(v,i),E=Math.min(I,a);y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:0,y:u,width:c+1,height:f-u+1}})}if(x&&R){const P=Math.max(h,s),M=Math.max(g,l),S=v,E=Math.min(I,a);y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:d,y:u,width:n-d+1,height:f-u+1}})}if(T&&L){const P=h,M=Math.max(g,a),S=Math.min(v,i),E=I;y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:0,y:f,width:c+1,height:o-f+1}})}if(L&&O){const P=Math.max(h,i),M=Math.max(g,a),S=Math.min(v,s),E=I;y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:c,y:f,width:d-c+1,height:o-f+1}})}if(x&&L){const P=Math.max(h,s),M=Math.max(g,a),S=v,E=I;y.push({rect:{x:P,y:M,width:S-P,height:E-M},clip:{x:d,y:f,width:n-d+1,height:o-f+1}})}return y}const w0={kind:Z.Loading,allowOverlay:!1};function ou(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m,b,y,v,I,T,k,x,L,O,R,P,M,S,E,D,C,X,B,J){let ae=(I==null?void 0:I.size)??Number.MAX_SAFE_INTEGER;const ne=performance.now();let U=E.baseFontFull;e.font=U;const re={ctx:e},se=[0,0],de=b>0?Vo(a,b,c):0;let fe,Q;const N=Qc(v);return So(t,s,i,l,r,(z,j,ge,ke,Fe)=>{const xe=Math.max(0,ke-j),De=j+xe,_e=r+1,et=z.width-xe,Pt=o-r-1;if(v.length>0){let Ie=!1;for(let je=0;je<v.length;je++){const tt=v[je];if($r(De,_e,et,Pt,tt.x,tt.y,tt.width,tt.height)){Ie=!0;break}}if(!Ie)return}const Mt=()=>{e.save(),e.beginPath(),e.rect(De,_e,et,Pt),e.clip()},we=T.columns.hasIndex(z.sourceIndex),be=d(z.group??"").overrideTheme,me=z.themeOverride===void 0&&be===void 0?E:co(E,be,z.themeOverride),ie=me.baseFontFull;ie!==U&&(U=ie,e.font=ie),Mt();let Ee;return Ii(Fe,ge,o,a,c,b,y,N,(Ie,je,tt,Rt,ce)=>{var it,at,Re;if(je<0||(se[0]=z.sourceIndex,se[1]=je,I!==void 0&&!I.has(se)))return;if(v.length>0){let ut=!1;for(let Vt=0;Vt<v.length;Vt++){const $t=v[Vt];if($r(j,Ie,z.width,tt,$t.x,$t.y,$t.width,$t.height)){ut=!0;break}}if(!ut)return}const Tt=T.rows.hasIndex(je),Xt=h.hasIndex(je),Ne=je<a?u(se):w0;let nt=j,kt=z.width,Et=!1,qt=!1;if(Ne.span!==void 0){const[ut,Vt]=Ne.span,$t=`${je},${ut},${Vt},${z.sticky}`;if(Q===void 0&&(Q=new Set),Q.has($t)){ae--;return}else{const rn=tu(Ne.span,j,Ie,z.width,tt,z,n),Ft=z.sticky?rn[0]:rn[1];if(!z.sticky&&rn[0]!==void 0&&(qt=!0),Ft!==void 0){nt=Ft.x,kt=Ft.width,Q.add($t),e.restore(),Ee=void 0,e.save(),e.beginPath();const Jt=Math.max(0,ke-Ft.x);e.rect(Ft.x+Jt,Ie,Ft.width-Jt,tt),fe===void 0&&(fe=[]),fe.push({x:Ft.x+Jt,y:Ie,width:Ft.width-Jt,height:tt}),e.clip(),Et=!0}}}const un=f==null?void 0:f(je),an=ce&&((it=z.trailingRowOptions)==null?void 0:it.themeOverride)!==void 0?(at=z.trailingRowOptions)==null?void 0:at.themeOverride:void 0,Bt=Ne.themeOverride===void 0&&un===void 0&&an===void 0?me:co(me,un,an,Ne.themeOverride);e.beginPath();const wt=hp(se,Ne,T);let Ot=fp(se,Ne,T,m);const In=Ne.span!==void 0&&T.columns.some(ut=>Ne.span!==void 0&&ut>=Ne.span[0]&&ut<=Ne.span[1]);wt&&!g&&m?Ot=0:wt&&m&&(Ot=Math.max(Ot,1)),In&&Ot++,wt||(Tt&&Ot++,we&&!ce&&Ot++);const Cn=Ne.kind===Z.Protected?Bt.bgCellMedium:Bt.bgCell;let ot;if((Rt||Cn!==E.bgCell)&&(ot=Pn(Cn,ot)),Ot>0||Xt){Xt&&(ot=Pn(Bt.bgHeader,ot));for(let ut=0;ut<Ot;ut++)ot=Pn(Bt.accentLight,ot)}else if(k!==void 0){for(const ut of k)if(ut[0]===z.sourceIndex&&ut[1]===je){ot=Pn(Bt.bgSearchResult,ot);break}}if(x!==void 0)for(let ut=0;ut<x.length;ut++){const Vt=x[ut],$t=Vt.range;Vt.style!=="solid-outline"&&$t.x<=z.sourceIndex&&z.sourceIndex<$t.x+$t.width&&$t.y<=je&&je<$t.y+$t.height&&(ot=Pn(Vt.color,ot))}let sn=!1;if(I!==void 0){const ut=Ie+1,Vt=(Rt?ut+tt-1:Math.min(ut+tt-1,o-de))-ut;(Vt!==tt-1||nt+1<=ke)&&(sn=!0,e.save(),e.beginPath(),e.rect(nt+1,ut,kt-1,Vt),e.clip()),ot=ot===void 0?Bt.bgCell:Pn(ot,Bt.bgCell)}const bn=z.sourceIndex===n.length-1,yt=je===a-1;ot!==void 0&&(e.fillStyle=ot,Ee!==void 0&&(Ee.fillStyle=ot),I!==void 0?e.fillRect(nt+1,Ie+1,kt-(bn?2:1),tt-(yt?2:1)):e.fillRect(nt,Ie,kt,tt)),Ne.style==="faded"&&(e.globalAlpha=.6);let Zt;for(let ut=0;ut<R.length;ut++){const Vt=R[ut];if(Vt.item[0]===z.sourceIndex&&Vt.item[1]===je){Zt=Vt;break}}if(kt>J&&!qt){const ut=Bt.baseFontFull;ut!==U&&(e.font=ut,U=ut),Ee=ru(e,Ne,z.sourceIndex,je,bn,yt,nt,Ie,kt,tt,Ot>0,Bt,ot??Bt.bgCell,L,O,(Zt==null?void 0:Zt.hoverAmount)??0,P,S,ne,M,Ee,D,C,X,B)}return sn&&e.restore(),Ne.style==="faded"&&(e.globalAlpha=1),ae--,Et&&(e.restore(),(Re=Ee==null?void 0:Ee.deprep)==null||Re.call(Ee,re),Ee=void 0,Mt(),U=ie,e.font=ie),ae<=0}),e.restore(),ae<=0}),fe}const Wr=[0,0],jr={x:0,y:0,width:0,height:0},ra=[void 0,()=>{}];let ia=!1;function y0(){ia=!0}function ru(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m,b,y,v,I,T,k,x,L,O){var R,P;let M,S;b!==void 0&&b[0][0]===n&&b[0][1]===o&&(M=b[1][0],S=b[1][1]);let E;Wr[0]=n,Wr[1]=o,jr.x=l,jr.y=s,jr.width=a,jr.height=c,ra[0]=x.getValue(Wr),ra[1]=B=>x.setValue(Wr,B),ia=!1;const D={ctx:e,theme:d,col:n,row:o,cell:t,rect:jr,highlighted:u,cellFillColor:f,hoverAmount:m,frameTime:v,hoverX:M,drawState:ra,hoverY:S,imageLoader:h,spriteManager:g,hyperWrapping:y,overrideCursor:M!==void 0?O:void 0,requestAnimationFrame:y0},C=wp(D,t.lastUpdated,v,T,r,i),X=L(t);if(X!==void 0){(T==null?void 0:T.renderer)!==X&&((R=T==null?void 0:T.deprep)==null||R.call(T,D),T=void 0);const B=(P=X.drawPrep)==null?void 0:P.call(X,D,T);I!==void 0&&!Po(D.cell)?I(D,()=>X.draw(D,t)):X.draw(D,t),E=B===void 0?void 0:{deprep:B==null?void 0:B.deprep,fillStyle:B==null?void 0:B.fillStyle,font:B==null?void 0:B.font,renderer:X}}return(C||ia)&&(k==null||k(Wr)),E}function la(e,t,n,o,r,i,l,s,a=-20,c=-20,u=32,d="center",f="square"){const h=Math.floor(r+l/2),g=f==="circle"?1e4:t.roundingRadius??4;let m=dc(u,l,t.cellVerticalPadding),b=m/2;const y=uc(d,o,i,t.cellHorizontalPadding,m),v=cc(y,h,m),I=hc(o+a,r+c,v);switch(n){case!0:{e.beginPath(),no(e,y-m/2,h-m/2,m,m,g),f==="circle"&&(b*=.8,m*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(y-b+m/4.23,h-b+m/1.97),e.lineTo(y-b+m/2.42,h-b+m/1.44),e.lineTo(y-b+m/1.29,h-b+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case bi:case!1:{e.beginPath(),no(e,y-m/2+.5,h-m/2+.5,m-1,m-1,g),e.lineWidth=1,e.strokeStyle=I?t.textDark:t.textMedium,e.stroke();break}case Dl:{e.beginPath(),no(e,y-m/2,h-m/2,m,m,g),e.fillStyle=I?t.textMedium:t.textLight,e.fill(),f==="circle"&&(b*=.8,m*=.8),e.beginPath(),e.moveTo(y-m/3,h),e.lineTo(y+m/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:Rr()}}function x0(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m,b,y,v){var I,T,k,x;const L=l+s;if(L<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,r,L);const O=(I=o==null?void 0:o[0])==null?void 0:I[0],R=(T=o==null?void 0:o[0])==null?void 0:T[1],P=(k=o==null?void 0:o[1])==null?void 0:k[0],M=(x=o==null?void 0:o[1])==null?void 0:x[1],S=d.headerFontFull;e.font=S,So(t,0,i,0,L,(E,D,C,X)=>{var B;if(b!==void 0&&!b.has([E.sourceIndex,-1]))return;const J=Math.max(0,X-D);e.save(),e.beginPath(),e.rect(D+J,s,E.width-J,l),e.clip();const ae=m(E.group??"").overrideTheme,ne=E.themeOverride===void 0&&ae===void 0?d:co(d,ae,E.themeOverride);ne.bgHeader!==d.bgHeader&&(e.fillStyle=ne.bgHeader,e.fill()),ne!==d&&(e.font=ne.baseFontFull);const U=u.columns.hasIndex(E.sourceIndex),re=a!==void 0||c,se=!re&&R===-1&&O===E.sourceIndex,de=re?0:((B=h.find(j=>j.item[0]===E.sourceIndex&&j.item[1]===-1))==null?void 0:B.hoverAmount)??0,fe=(u==null?void 0:u.current)!==void 0&&u.current.cell[0]===E.sourceIndex,Q=U?ne.accentColor:fe?ne.bgHeaderHasFocus:ne.bgHeader,N=n?s:0,z=E.sourceIndex===0?0:1;U?(e.fillStyle=Q,e.fillRect(D+z,N,E.width-z,l)):(fe||de>0)&&(e.beginPath(),e.rect(D+z,N,E.width-z,l),fe&&(e.fillStyle=ne.bgHeaderHasFocus,e.fill()),de>0&&(e.globalAlpha=de,e.fillStyle=ne.bgHeaderHovered,e.fill(),e.globalAlpha=1)),su(e,D,N,E.width,l,E,U,ne,se,se?P:void 0,se?M:void 0,fe,de,f,y,v),e.restore()}),n&&C0(e,t,r,i,s,o,d,f,h,g,m,b)}function C0(e,t,n,o,r,i,l,s,a,c,u,d){const[f,h]=(i==null?void 0:i[0])??[];let g=0;eu(t,n,o,r,(m,b,y,v,I,T)=>{if(d!==void 0&&!d.hasItemInRectangle({x:m[0],y:-2,width:m[1]-m[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(y,v,I,T),e.clip();const k=u(b),x=(k==null?void 0:k.overrideTheme)===void 0?l:co(l,k.overrideTheme),L=h===-2&&f!==void 0&&f>=m[0]&&f<=m[1],O=L?x.bgHeaderHovered:x.bgHeader;if(O!==l.bgHeader&&(e.fillStyle=O,e.fill()),e.fillStyle=x.textGroupHeader??x.textHeader,k!==void 0){let R=y;if(k.icon!==void 0&&(s.drawSprite(k.icon,"normal",e,R+8,(r-20)/2,20,x),R+=26),e.fillText(k.name,R+8,r/2+eo(e,l.headerFontFull)),k.actions!==void 0&&L){const P=iu({x:y,y:v,width:I,height:T},k.actions);e.beginPath();const M=P[0].x-10,S=y+I-M;e.rect(M,0,S,r);const E=e.createLinearGradient(M,0,M+S,0),D=Bo(O,0);E.addColorStop(0,D),E.addColorStop(10/S,O),E.addColorStop(1,O),e.fillStyle=E,e.fill(),e.globalAlpha=.6;const[C,X]=(i==null?void 0:i[1])??[-1,-1];for(let B=0;B<k.actions.length;B++){const J=k.actions[B],ae=P[B],ne=Wo(ae,C+y,X);ne&&(e.globalAlpha=1),s.drawSprite(J.icon,"normal",e,ae.x+ae.width/2-10,ae.y+ae.height/2-10,20,x),ne&&(e.globalAlpha=.6)}e.globalAlpha=1}}y!==0&&c(m[0])&&(e.beginPath(),e.moveTo(y+.5,0),e.lineTo(y+.5,r),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()),e.restore(),g=y+I}),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.moveTo(0,r+.5),e.lineTo(n,r+.5),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()}const Ti=30;function k0(e,t,n,o,r){return{x:e+n-Ti,y:Math.max(t,t+o/2-Ti/2),width:Ti,height:Math.min(Ti,o)}}function iu(e,t){const n=[];let o=e.x+e.width-26*t.length;const r=e.y+e.height/2-13,i=26,l=26;for(let s=0;s<t.length;s++)n.push({x:o,y:r,width:l,height:i}),o+=26;return n}function Ur(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function lu(e,t,n,o,r,i,l,s){var a;const c=l.cellHorizontalPadding,u=l.headerIconSize,d=k0(n,o,r,i);let f=n+c;const h=t.icon===void 0?void 0:{x:f,y:o+(i-u)/2,width:u,height:u},g=h===void 0||t.overlayIcon===void 0?void 0:{x:h.x+9,y:h.y+6,width:18,height:18};h!==void 0&&(f+=Math.ceil(u*1.3));const m={x:f,y:o,width:r-f,height:i};let b;if(t.indicatorIcon!==void 0){const v=e===void 0?((a=Hc(t.title,l.headerFontFull))==null?void 0:a.width)??0:$o(t.title,e,l.headerFontFull).width;m.width=v,f+=v+c,b={x:f,y:o+(i-u)/2,width:u,height:u}}const y=n+r/2;return{menuBounds:Ur(d,y,s),iconBounds:Ur(h,y,s),iconOverlayBounds:Ur(g,y,s),textBounds:Ur(m,y,s),indicatorIconBounds:Ur(b,y,s)}}function au(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const v=i.rowMarkerChecked;v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const I=i.headerRowMarkerTheme!==void 0?co(s,i.headerRowMarkerTheme):s;la(e,I,v,t,n,o,r,!1,void 0,void 0,18,"center",i.rowMarker),v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const b=l?s.textHeaderSelected:s.textHeader,y=i.hasMenu===!0&&(a||h&&l)&&m.menuBounds!==void 0;if(i.icon!==void 0&&m.iconBounds!==void 0){let v=l?"selected":"normal";i.style==="highlight"&&(v=l?"selected":"special"),f.drawSprite(i.icon,v,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,s),i.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&f.drawSprite(i.overlayIcon,l?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,s)}if(y&&o>35){const v=g?35:o-35,I=g?35*.7:o-35*.7,T=v/o,k=I/o,x=e.createLinearGradient(t,0,t+o,0),L=Bo(b,0);x.addColorStop(g?1:0,b),x.addColorStop(T,b),x.addColorStop(k,L),x.addColorStop(g?0:1,L),e.fillStyle=x}else e.fillStyle=b;if(g&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,g?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+r/2+eo(e,s.headerFontFull)),g&&(e.textAlign="left"),i.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!y||!$r(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 v=l?"selected":"normal";i.style==="highlight"&&(v=l?"selected":"special"),f.drawSprite(i.indicatorIcon,v,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,s)}if(y&&m.menuBounds!==void 0){const v=m.menuBounds,I=c!==void 0&&u!==void 0&&Wo(v,c+t,u+n);if(I||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===wi.Triangle){e.beginPath();const T=v.x+v.width/2-5.5,k=v.y+v.height/2-3;kp(e,[{x:T,y:k},{x:T+11,y:k},{x:T+5.5,y:k+6}],1),e.fillStyle=b,e.fill()}else if(i.menuIcon===wi.Dots){e.beginPath();const T=v.x+v.width/2,k=v.y+v.height/2;Cp(e,T,k),e.fillStyle=b,e.fill()}else{const T=v.x+(v.width-s.headerIconSize)/2,k=v.y+(v.height-s.headerIconSize)/2;f.drawSprite(i.menuIcon,"normal",e,T,k,s.headerIconSize,s)}I||(e.globalAlpha=1)}}function su(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m){const b=Nl(i.title)==="rtl",y=lu(e,i,t,n,o,r,s,b);g!==void 0?g({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:r},column:i,columnIndex:i.sourceIndex,isSelected:l,hoverAmount:f,isHovered:a,hasSelectedCell:d,spriteManager:h,menuBounds:(y==null?void 0:y.menuBounds)??{x:0,y:0,height:0,width:0}},()=>au(e,t,n,o,r,i,l,s,a,c,u,f,h,m,b,y)):au(e,t,n,o,r,i,l,s,a,c,u,f,h,m,b,y)}function S0(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m,b,y,v){if(y!==void 0||t[t.length-1]!==n[t.length-1])return;const I=Qc(b);So(t,a,l,s,i,(T,k,x,L,O)=>{if(T!==t[t.length-1])return;k+=T.width;const R=Math.max(k,L);R>o||(e.save(),e.beginPath(),e.rect(R,i+1,1e4,r-i-1),e.clip(),Ii(O,x,r,c,u,g,m,I,(P,M,S,E)=>{if(!E&&b.length>0&&!b.some(J=>$r(k,P,1e4,S,J.x,J.y,J.width,J.height)))return;const D=f.hasIndex(M),C=h.hasIndex(M);e.beginPath();const X=d==null?void 0:d(M),B=X===void 0?v:co(v,X);B.bgCell!==v.bgCell&&(e.fillStyle=B.bgCell,e.fillRect(k,P,1e4,S)),C&&(e.fillStyle=B.bgHeader,e.fillRect(k,P,1e4,S)),D&&(e.fillStyle=B.accentLight,e.fillRect(k,P,1e4,S))}),e.restore())})}function M0(e,t,n,o,r,i,l,s,a){let c=!1;for(const g of t)if(!g.sticky){c=l(g.sourceIndex);break}const u=a.horizontalBorderColor??a.borderColor,d=a.borderColor,f=c?rr(t):0;let h;if(f!==0&&(h=Tc(d,a.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,o),e.strokeStyle=h,e.stroke()),r>0){const g=d===u&&h!==void 0?h:Tc(u,a.bgCell),m=Vo(i,r,s);e.beginPath(),e.moveTo(0,o-m+.5),e.lineTo(n,o-m+.5),e.strokeStyle=g,e.stroke()}}const cu=(e,t,n)=>{let o=0,r=t,i=0,l=n;if(e!==void 0&&e.length>0){o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const s of e)o=Math.min(o,s.x-1),r=Math.max(r,s.x+s.width+1),i=Math.min(i,s.y-1),l=Math.max(l,s.y+s.height+1)}return{minX:o,maxX:r,minY:i,maxY:l}};function R0(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g){var m;const b=g.bgCell,{minX:y,maxX:v,minY:I,maxY:T}=cu(s,i,l),k=[],x=l-Vo(h,f,c);let L=a,O=n,R=0;for(;L+r<x;){const E=L+r,D=c(O);if(E>=I&&E<=T-1){const C=u==null?void 0:u(O),X=C==null?void 0:C.bgCell;X!==void 0&&X!==b&&O>=h-f&&k.push({x:y,y:E,w:v-y,h:D,color:X})}L+=D,O<h-f&&(R=L),O++}let P=0;const M=Math.min(x,T)-R;if(M>0)for(let E=0;E<t.length;E++){const D=t[E];if(D.width===0)continue;const C=D.sticky?P:P+o,X=(m=D.themeOverride)==null?void 0:m.bgCell;X!==void 0&&X!==b&&C>=y&&C<=v&&d(E+1)&&k.push({x:C,y:R,w:D.width,h:M,color:X}),P+=D.width}if(k.length===0)return;let S;e.beginPath();for(let E=k.length-1;E>=0;E--){const D=k[E];S===void 0?S=D.color:D.color!==S&&(e.fillStyle=S,e.fill(),e.beginPath(),S=D.color),e.rect(D.x,D.y,D.w,D.h)}S!==void 0&&(e.fillStyle=S,e.fill()),e.beginPath()}function uu(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m,b,y=!1){if(a!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,l);for(const S of a)e.rect(S.x+1,S.y+1,S.width-1,S.height-1);e.clip("evenodd")}const v=b.horizontalBorderColor??b.borderColor,I=b.borderColor,{minX:T,maxX:k,minY:x,maxY:L}=cu(s,i,l),O=[];e.beginPath();let R=.5;for(let S=0;S<t.length;S++){const E=t[S];if(E.width===0)continue;R+=E.width;const D=E.sticky?R:R+o;D>=T&&D<=k&&h(S+1)&&O.push({x1:D,y1:Math.max(c,x),x2:D,y2:Math.min(l,L),color:I})}let P=l+.5;for(let S=m-g;S<m;S++){const E=d(S);P-=E,O.push({x1:T,y1:P,x2:k,y2:P,color:v})}if(y!==!0){let S=u+.5,E=n;const D=P;for(;S+r<D;){const C=S+r;if(C>=x&&C<=L-1){const X=f==null?void 0:f(E);O.push({x1:T,y1:C,x2:k,y2:C,color:(X==null?void 0:X.horizontalBorderColor)??(X==null?void 0:X.borderColor)??v})}S+=d(E),E++}}const M=Yy(O,S=>S.color);for(const S of Object.keys(M)){e.strokeStyle=S;for(const E of M[S])e.moveTo(E.x1,E.y1),e.lineTo(E.x2,E.y2);e.stroke(),e.beginPath()}a!==void 0&&e.restore()}function E0(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m,b,y,v){const I=[];e.imageSmoothingEnabled=!1;const T=Math.min(r.cellYOffset,l),k=Math.max(r.cellYOffset,l);let x=0;if(typeof y=="number")x+=(k-T)*y;else for(let D=T;D<k;D++)x+=y(D);l>r.cellYOffset&&(x=-x),x+=a-r.translateY;const L=Math.min(r.cellXOffset,i),O=Math.max(r.cellXOffset,i);let R=0;for(let D=L;D<O;D++)R+=m[D].width;i>r.cellXOffset&&(R=-R),R+=s-r.translateX;const P=rr(b);if(R!==0&&x!==0)return{regions:[]};const M=c>0?Vo(f,c,y):0,S=u-P-Math.abs(R),E=d-h-M-Math.abs(x)-1;if(S>150&&E>150){const D={sx:0,sy:0,sw:u*g,sh:d*g,dx:0,dy:0,dw:u*g,dh:d*g};if(x>0?(D.sy=(h+1)*g,D.sh=E*g,D.dy=(x+h+1)*g,D.dh=E*g,I.push({x:0,y:h,width:u,height:x+1})):x<0&&(D.sy=(-x+h+1)*g,D.sh=E*g,D.dy=(h+1)*g,D.dh=E*g,I.push({x:0,y:d+x-M,width:u,height:-x+M})),R>0?(D.sx=P*g,D.sw=S*g,D.dx=(R+P)*g,D.dw=S*g,I.push({x:P-1,y:0,width:R+2,height:d})):R<0&&(D.sx=(P-R)*g,D.sw=S*g,D.dx=P*g,D.dw=S*g,I.push({x:u+R,y:0,width:-R,height:d})),e.setTransform(1,0,0,1,0,0),v){if(P>0&&R!==0&&x===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const C=P*g,X=d*g;e.drawImage(t,0,0,C,X,0,0,C,X)}if(M>0&&R===0&&x!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const C=(d-M)*g,X=u*g,B=M*g;e.drawImage(t,0,C,X,B,0,C,X,B)}}e.drawImage(t,D.sx,D.sy,D.sw,D.sh,D.dx,D.dy,D.dw,D.dh),e.scale(g,g)}return e.imageSmoothingEnabled=!0,{regions:I}}function I0(e,t,n,o,r,i,l,s,a,c){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||r!==e.translateY||So(a,n,o,r,s,(d,f,h,g)=>{if(d.sourceIndex===c){const m=Math.max(f,g)+1;return u.push({x:m,y:0,width:i-m,height:l}),!0}}),u}function T0(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 o=0;o<e.mappedColumns.length;o++){const r=e.mappedColumns[o],i=t.mappedColumns[o];if(tr(r,i))continue;if(n!==void 0||r.width===i.width)return!1;const{width:l,...s}=r,{width:a,...c}=i;if(!tr(s,c))return!1;n=o}return n===void 0?!0:n}return!0}function du(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m){const b=g==null?void 0:g.filter(L=>L.style!=="no-outline");if(b===void 0||b.length===0)return;const y=rr(s),v=Vo(h,f,d),I=[a,0,s.length,h-f],T=[y,0,t,n-v],k=b.map(L=>{const O=L.range,R=L.style??"dashed";return b0(O,I,t,n,T).map(P=>{const M=P.rect,S=Xl(M.x,M.y,t,n,u,c+u,o,r,i,l,h,a,f,s,d),E=M.width===1&&M.height===1?S:Xl(M.x+M.width-1,M.y+M.height-1,t,n,u,c+u,o,r,i,l,h,a,f,s,d);return M.x+M.width>=s.length&&(E.width-=1),M.y+M.height>=h&&(E.height-=1),{color:L.color,style:R,clip:P.clip,rect:v0({x:S.x,y:S.y,width:E.x+E.width-S.x,height:E.y+E.height-S.y},t,n,8)}})}),x=()=>{e.lineWidth=1;let L=!1;for(const O of k)for(const R of O)if((R==null?void 0:R.rect)!==void 0&&$r(0,0,t,n,R.rect.x,R.rect.y,R.rect.width,R.rect.height)){const P=L,M=!m0(R.clip,R.rect);M&&(e.save(),e.rect(R.clip.x,R.clip.y,R.clip.width,R.clip.height),e.clip()),R.style==="dashed"&&!L?(e.setLineDash([5,3]),L=!0):(R.style==="solid"||R.style==="solid-outline")&&L&&(e.setLineDash([]),L=!1),e.strokeStyle=R.style==="solid-outline"?Pn(Pn(R.color,m.borderColor),m.bgCell):Bo(R.color,1),e.strokeRect(R.rect.x+.5,R.rect.y+.5,R.rect.width-1,R.rect.height-1),M&&(e.restore(),L=P)}L&&e.setLineDash([])};return x(),x}function hu(e,t,n,o,r){e.beginPath(),e.moveTo(t,n),e.lineTo(t,o),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function aa(e,t,n,o,r,i,l,s,a,c,u,d,f,h,g,m,b){if(u.current===void 0)return;const y=u.current.range,v=u.current.cell,I=[y.x+y.width-1,y.y+y.height-1];if(v[1]>=b&&I[1]>=b||!l.some(E=>E.sourceIndex===v[0]||E.sourceIndex===I[0]))return;const[T,k]=u.current.cell,x=f(u.current.cell),L=x.span??[T,T],O=k>=b-h,R=h>0&&!O?Vo(b,h,d)-1:0,P=I[1];let M;if(So(l,o,r,i,c,(E,D,C,X,B)=>{if(E.sticky&&T>E.sourceIndex)return;const J=E.sourceIndex<L[0],ae=E.sourceIndex>L[1],ne=E.sourceIndex===I[0];if(!(!ne&&(J||ae)))return Ii(B,C,n,b,d,h,g,void 0,(U,re,se)=>{if(re!==k&&re!==P)return;let de=D,fe=E.width;if(x.span!==void 0){const Q=tu(x.span,D,U,E.width,se,E,s),N=E.sticky?Q[0]:Q[1];N!==void 0&&(de=N.x,fe=N.width)}return re===P&&ne&&m&&(M=()=>{var Q;X>de&&!E.sticky&&(e.beginPath(),e.rect(X,0,t-X,n),e.clip()),e.beginPath(),e.rect(de+fe-4,U+se-4,4,4),e.fillStyle=((Q=E.themeOverride)==null?void 0:Q.accentColor)??a.accentColor,e.fill()}),M!==void 0}),M!==void 0}),M===void 0)return;const S=()=>{e.save(),e.beginPath(),e.rect(0,c,t,n-c-R),e.clip(),M==null||M(),e.restore()};return S(),S}function O0(e,t,n,o,r,i,l,s,a){a===void 0||a.size===0||(e.beginPath(),eu(t,n,i,o,(c,u,d,f,h,g)=>{a.hasItemInRectangle({x:c[0],y:-2,width:c[1]-c[0]+1,height:1})&&e.rect(d,f,h,g)}),So(t,s,i,l,r,(c,u,d,f)=>{const h=Math.max(0,f-u),g=u+h+1,m=c.width-h-1;a.has([c.sourceIndex,-1])&&e.rect(g,o,m,r-o)}),e.clip())}function D0(e,t,n,o,r,i,l,s,a,c){let u=0;return So(e,i,o,r,n,(d,f,h,g,m)=>(Ii(m,h,t,l,s,a,c,void 0,(b,y,v,I)=>{I||(u=Math.max(y,u))}),!0)),u}function fu(e,t){var n;const{canvasCtx:o,headerCanvasCtx:r,width:i,height:l,cellXOffset:s,cellYOffset:a,translateX:c,translateY:u,mappedColumns:d,enableGroups:f,freezeColumns:h,dragAndDropState:g,theme:m,drawFocus:b,headerHeight:y,groupHeaderHeight:v,disabledRows:I,rowHeight:T,verticalBorder:k,overrideCursor:x,isResizing:L,selection:O,fillHandle:R,freezeTrailingRows:P,rows:M,getCellContent:S,getGroupDetails:E,getRowThemeOverride:D,isFocused:C,drawHeaderCallback:X,prelightCells:B,drawCellCallback:J,highlightRegions:ae,resizeCol:ne,imageLoader:U,lastBlitData:re,hoverValues:se,hyperWrapping:de,hoverInfo:fe,spriteManager:Q,maxScaleFactor:N,hasAppendRow:z,touchMode:j,enqueue:ge,renderStateProvider:ke,getCellRenderer:Fe,renderStrategy:xe,bufferACtx:De,bufferBCtx:_e,damage:et,minimumCellWidth:Pt,resizeIndicator:Mt}=e;if(i===0||l===0)return;const we=xe==="double-buffer",be=Math.min(N,Math.ceil(window.devicePixelRatio??1)),me=xe!=="direct"&&T0(e,t),ie=o.canvas;(ie.width!==i*be||ie.height!==l*be)&&(ie.width=i*be,ie.height=l*be,ie.style.width=i+"px",ie.style.height=l+"px");const Ee=r.canvas,Ie=f?v+y:y,je=Ie+1;(Ee.width!==i*be||Ee.height!==je*be)&&(Ee.width=i*be,Ee.height=je*be,Ee.style.width=i+"px",Ee.style.height=je+"px");const tt=De.canvas,Rt=_e.canvas;we&&(tt.width!==i*be||tt.height!==l*be)&&(tt.width=i*be,tt.height=l*be,re.current!==void 0&&(re.current.aBufferScroll=void 0)),we&&(Rt.width!==i*be||Rt.height!==l*be)&&(Rt.width=i*be,Rt.height=l*be,re.current!==void 0&&(re.current.bBufferScroll=void 0));const ce=re.current;if(me===!0&&s===(ce==null?void 0:ce.cellXOffset)&&a===(ce==null?void 0:ce.cellYOffset)&&c===(ce==null?void 0:ce.translateX)&&u===(ce==null?void 0:ce.translateY))return;let it=null;we&&(it=o);const at=r;let Re;we?et!==void 0?Re=(ce==null?void 0:ce.lastBuffer)==="b"?_e:De:Re=(ce==null?void 0:ce.lastBuffer)==="b"?De:_e:Re=o;const Tt=Re.canvas,Xt=we?Tt===tt?Rt:tt:ie,Ne=typeof T=="number"?()=>T:T;at.save(),Re.save(),at.beginPath(),Re.beginPath(),at.textBaseline="middle",Re.textBaseline="middle",be!==1&&(at.scale(be,be),Re.scale(be,be));const nt=Ul(d,s,i,g,c);let kt=[];const Et=b&&((n=O.current)==null?void 0:n.cell[1])===a&&u===0;let qt=!1;if(ae!==void 0){for(const ot of ae)if(ot.style!=="no-outline"&&ot.range.y===a&&u===0){qt=!0;break}}const un=()=>{x0(at,nt,f,fe,i,c,y,v,g,L,O,m,Q,se,k,E,et,X,j),uu(at,nt,a,c,u,i,l,void 0,void 0,v,Ie,Ne,D,k,P,M,m,!0),at.beginPath(),at.moveTo(0,je-.5),at.lineTo(i,je-.5),at.strokeStyle=Pn(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),at.stroke(),qt&&du(at,i,l,s,a,c,u,d,h,y,v,T,P,M,ae,m),Et&&aa(at,i,l,a,c,u,nt,d,m,Ie,O,Ne,S,P,z,R,M)};if(et!==void 0){const ot=nt[nt.length-1].sourceIndex+1,sn=et.hasItemInRegion([{x:s,y:-2,width:ot,height:2},{x:s,y:a,width:ot,height:300},{x:0,y:a,width:h,height:300},{x:0,y:-2,width:h,height:2},{x:s,y:M-P,width:ot,height:P,when:P>0}]),bn=yt=>{ou(yt,nt,d,l,Ie,c,u,a,M,Ne,S,E,D,I,C,b,P,z,kt,et,O,B,ae,U,Q,se,fe,J,de,m,ge,ke,Fe,x,Pt);const Zt=O.current;R&&b&&Zt!==void 0&&et.has(Dc(Zt.range))&&aa(yt,i,l,a,c,u,nt,d,m,Ie,O,Ne,S,P,z,R,M)};sn&&(bn(Re),it!==null&&(it.save(),it.scale(be,be),it.textBaseline="middle",bn(it),it.restore()),et.hasHeader()&&(O0(at,nt,i,v,Ie,c,u,a,et),un())),Re.restore(),at.restore();return}if((me!==!0||s!==(ce==null?void 0:ce.cellXOffset)||c!==(ce==null?void 0:ce.translateX)||Et!==(ce==null?void 0:ce.mustDrawFocusOnHeader)||qt!==(ce==null?void 0:ce.mustDrawHighlightRingsOnHeader))&&un(),me===!0){zn(Xt!==void 0&&ce!==void 0);const{regions:ot}=E0(Re,Xt,Xt===tt?ce.aBufferScroll:ce.bBufferScroll,Xt===tt?ce.bBufferScroll:ce.aBufferScroll,ce,s,a,c,u,P,i,l,M,Ie,be,d,nt,T,we);kt=ot}else me!==!1&&(zn(ce!==void 0),kt=I0(ce,s,a,c,u,i,l,Ie,nt,me));M0(Re,nt,i,l,P,M,k,Ne,m);const an=du(Re,i,l,s,a,c,u,d,h,y,v,T,P,M,ae,m),Bt=b?aa(Re,i,l,a,c,u,nt,d,m,Ie,O,Ne,S,P,z,R,M):void 0;if(Re.fillStyle=m.bgCell,kt.length>0){Re.beginPath();for(const ot of kt)Re.rect(ot.x,ot.y,ot.width,ot.height);Re.clip(),Re.fill(),Re.beginPath()}else Re.fillRect(0,0,i,l);const wt=ou(Re,nt,d,l,Ie,c,u,a,M,Ne,S,E,D,I,C,b,P,z,kt,et,O,B,ae,U,Q,se,fe,J,de,m,ge,ke,Fe,x,Pt);S0(Re,nt,d,i,l,Ie,c,u,a,M,Ne,D,O.rows,I,P,z,kt,et,m),R0(Re,nt,a,c,u,i,l,kt,Ie,Ne,D,k,P,M,m),uu(Re,nt,a,c,u,i,l,kt,wt,v,Ie,Ne,D,k,P,M,m),an==null||an(),Bt==null||Bt(),L&&Mt!=="none"&&So(nt,0,c,0,Ie,(ot,sn)=>ot.sourceIndex===ne?(hu(at,sn+ot.width,0,Ie+1,Pn(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),Mt==="full"&&hu(Re,sn+ot.width,Ie,l,Pn(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),it!==null&&(it.fillStyle=m.bgCell,it.fillRect(0,0,i,l),it.drawImage(Re.canvas,0,0));const Ot=D0(nt,l,Ie,c,u,a,M,Ne,P,z);U==null||U.setWindow({x:s,y:a,width:nt.length,height:Ot-a},h,Array.from({length:P},(ot,sn)=>M-1-sn));const In=ce!==void 0&&(s!==ce.cellXOffset||c!==ce.translateX),Cn=ce!==void 0&&(a!==ce.cellYOffset||u!==ce.translateY);re.current={cellXOffset:s,cellYOffset:a,translateX:c,translateY:u,mustDrawFocusOnHeader:Et,mustDrawHighlightRingsOnHeader:qt,lastBuffer:we?Tt===tt?"a":"b":void 0,aBufferScroll:Tt===tt?[In,Cn]:ce==null?void 0:ce.aBufferScroll,bBufferScroll:Tt===Rt?[In,Cn]:ce==null?void 0:ce.bBufferScroll},Re.restore(),at.restore()}const z0=80;function L0(e){const t=e-1;return t*t*t+1}class P0{constructor(t){ht(this,"callback"),ht(this,"currentHoveredItem"),ht(this,"leavingItems",[]),ht(this,"lastAnimationTime"),ht(this,"addToLeavingItems",n=>{this.leavingItems.some(o=>_r(o.item,n.item))||this.leavingItems.push(n)}),ht(this,"removeFromLeavingItems",n=>{const o=this.leavingItems.find(r=>_r(r.item,n));return this.leavingItems=this.leavingItems.filter(r=>r!==o),(o==null?void 0:o.hoverAmount)??0}),ht(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(n=>n.hoverAmount>0)}),ht(this,"shouldStep",()=>{const n=this.leavingItems.length>0,o=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return n||o}),ht(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(n=>({...n,hoverAmount:L0(n.hoverAmount)}))),ht(this,"step",n=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=n;else{const o=(n-this.lastAnimationTime)/z0;for(const i of this.leavingItems)i.hoverAmount=_n(i.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=_n(this.currentHoveredItem.hoverAmount+o,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=n,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0}),ht(this,"setHovered",n=>{var o;if(!_r((o=this.currentHoveredItem)==null?void 0:o.item,n)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),n!==void 0){const r=this.removeFromLeavingItems(n);this.currentHoveredItem={item:n,hoverAmount:r}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}),this.callback=t}}class H0{constructor(t){ht(this,"fn"),ht(this,"val"),this.fn=t}get value(){return this.val??(this.val=this.fn())}}function sa(e){return new H0(e)}const A0=sa(()=>window.navigator.userAgent.includes("Firefox")),Oi=sa(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),Di=sa(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function F0(e){const t=p.useRef([]),n=p.useRef(0),o=p.useRef(e);o.current=e;const r=p.useCallback(()=>{const i=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(ql);t.current=[],o.current(new Vr(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:l)},[]);return p.useCallback(i=>{t.current.length===0&&r();const l=Wn(i[0],i[1]);t.current.includes(l)||t.current.push(l)},[r])}const Mo="header",Nn="group-header",zi="out-of-bounds";var ir;(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"})(ir||(ir={}));function pu(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}const gu=6,_0=(e,t)=>{if(e.kind===Z.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},N0=(e,t)=>{const{width:n,height:o,accessibilityHeight:r,columns:i,cellXOffset:l,cellYOffset:s,headerHeight:a,fillHandle:c=!1,groupHeaderHeight:u,rowHeight:d,rows:f,getCellContent:h,getRowThemeOverride:g,onHeaderMenuClick:m,onHeaderIndicatorClick:b,enableGroups:y,isFilling:v,onCanvasFocused:I,onCanvasBlur:T,isFocused:k,selection:x,freezeColumns:L,onContextMenu:O,freezeTrailingRows:R,fixedShadowX:P=!0,fixedShadowY:M=!0,drawFocusRing:S,onMouseDown:E,onMouseUp:D,onMouseMoveRaw:C,onMouseMove:X,onItemHovered:B,dragAndDropState:J,firstColAccessible:ae,onKeyDown:ne,onKeyUp:U,highlightRegions:re,canvasRef:se,onDragStart:de,onDragEnd:fe,eventTargetRef:Q,isResizing:N,resizeColumn:z,isDragging:j,isDraggable:ge=!1,allowResize:ke,disabledRows:Fe,hasAppendRow:xe,getGroupDetails:De,theme:_e,prelightCells:et,headerIcons:Pt,verticalBorder:Mt,drawCell:we,drawHeader:be,onCellFocused:me,onDragOverCell:ie,onDrop:Ee,onDragLeave:Ie,imageWindowLoader:je,smoothScrollX:tt=!1,smoothScrollY:Rt=!1,experimental:ce,getCellRenderer:it,resizeIndicator:at="full"}=e,Re=e.translateX??0,Tt=e.translateY??0,Xt=Math.max(L,Math.min(i.length-1,l)),Ne=p.useRef(null),nt=p.useRef((ce==null?void 0:ce.eventTarget)??window),kt=nt.current,Et=je,qt=p.useRef(),[un,an]=p.useState(!1),Bt=p.useRef([]),wt=p.useRef(),[Ot,In]=p.useState(),[Cn,ot]=p.useState(),sn=p.useRef(null),[bn,yt]=p.useState(),[Zt,ut]=p.useState(!1),Vt=p.useRef(Zt);Vt.current=Zt;const $t=p.useMemo(()=>new p0(Pt,()=>{Dt.current=void 0,Sn.current()}),[Pt]),rn=y?u+a:a,Ft=p.useRef(-1),Jt=((ce==null?void 0:ce.enableFirefoxRescaling)??!1)&&A0.value,Ue=((ce==null?void 0:ce.enableSafariRescaling)??!1)&&Oi.value;p.useLayoutEffect(()=>{window.devicePixelRatio===1||!Jt&&!Ue||(Ft.current!==-1&&an(!0),window.clearTimeout(Ft.current),Ft.current=window.setTimeout(()=>{an(!1),Ft.current=-1},200))},[s,Xt,Re,Tt,Jt,Ue]);const Ht=up(i,L),kn=P?rr(Ht,J):0,At=p.useCallback((F,ee,Te)=>{const Se=F.getBoundingClientRect();if(ee>=Ht.length||Te>=f)return;const Pe=Se.width/n,he=Xl(ee,Te,n,o,u,rn,Xt,s,Re,Tt,f,L,R,Ht,d);return Pe!==1&&(he.x*=Pe,he.y*=Pe,he.width*=Pe,he.height*=Pe),he.x+=Se.x,he.y+=Se.y,he},[n,o,u,rn,Xt,s,Re,Tt,f,L,R,Ht,d]),Wt=p.useCallback((F,ee,Te,Se)=>{const Pe=F.getBoundingClientRect(),he=Pe.width/n,Le=(ee-Pe.left)/he,lt=(Te-Pe.top)/he,xt=5,zt=Ul(Ht,Xt,n,void 0,Re);let ye=0,ft=0;Se instanceof MouseEvent&&(ye=Se.button,ft=Se.buttons);const Ze=pp(Le,zt,Re),Ge=gp(lt,o,y,a,u,f,d,s,Tt,R),pt=(Se==null?void 0:Se.shiftKey)===!0,_t=(Se==null?void 0:Se.ctrlKey)===!0,nn=(Se==null?void 0:Se.metaKey)===!0,Un=Se!==void 0&&!(Se instanceof MouseEvent)||(Se==null?void 0:Se.pointerType)==="touch",Yn=[Le<0?-1:n<Le?1:0,lt<rn?-1:o<lt?1:0];let Kt;if(Ze===-1||lt<0||Le<0||Ge===void 0||Le>n||lt>o){const dt=Le>n?1:Le<0?-1:0,Tn=lt>o?1:lt<0?-1:0;let On=dt*2,Xn=Tn*2;dt===0&&(On=Ze===-1?ir.EndPadding:ir.Center),Tn===0&&(Xn=Ge===void 0?ir.EndPadding:ir.Center);let Gn=!1;if(Ze===-1&&Ge===-1){const Ct=At(F,Ht.length-1,-1);zn(Ct!==void 0),Gn=ee<Ct.x+Ct.width+xt}const br=Le>n&&Le<n+Bl()||lt>o&<<o+Bl();Kt={kind:zi,location:[Ze!==-1?Ze:Le<0?0:Ht.length-1,Ge??f-1],region:[On,Xn],shiftKey:pt,ctrlKey:_t,metaKey:nn,isEdge:Gn,isTouch:Un,button:ye,buttons:ft,scrollEdge:Yn,isMaybeScrollbar:br}}else if(Ge<=-1){let dt=At(F,Ze,Ge);zn(dt!==void 0);let Tn=dt!==void 0&&dt.x+dt.width-ee<=xt;const On=Ze-1;ee-dt.x<=xt&&On>=0?(Tn=!0,dt=At(F,On,Ge),zn(dt!==void 0),Kt={kind:y&&Ge===-2?Nn:Mo,location:[On,Ge],bounds:dt,group:Ht[On].group??"",isEdge:Tn,shiftKey:pt,ctrlKey:_t,metaKey:nn,isTouch:Un,localEventX:ee-dt.x,localEventY:Te-dt.y,button:ye,buttons:ft,scrollEdge:Yn}):Kt={kind:y&&Ge===-2?Nn:Mo,group:Ht[Ze].group??"",location:[Ze,Ge],bounds:dt,isEdge:Tn,shiftKey:pt,ctrlKey:_t,metaKey:nn,isTouch:Un,localEventX:ee-dt.x,localEventY:Te-dt.y,button:ye,buttons:ft,scrollEdge:Yn}}else{const dt=At(F,Ze,Ge);zn(dt!==void 0);const Tn=dt!==void 0&&dt.x+dt.width-ee<xt;let On=!1;if(c&&x.current!==void 0){const Xn=Dc(x.current.range),Gn=At(F,Xn[0],Xn[1]);if(Gn!==void 0){const br=Gn.x+Gn.width-2,Ct=Gn.y+Gn.height-2;On=Math.abs(br-ee)<gu&&Math.abs(Ct-Te)<gu}}Kt={kind:"cell",location:[Ze,Ge],bounds:dt,isEdge:Tn,shiftKey:pt,ctrlKey:_t,isFillHandle:On,metaKey:nn,isTouch:Un,localEventX:ee-dt.x,localEventY:Te-dt.y,button:ye,buttons:ft,scrollEdge:Yn}}return Kt},[n,Ht,Xt,Re,o,y,a,u,f,d,s,Tt,R,At,c,x,rn]),[jt]=Ot??[],oo=p.useRef(()=>{}),jn=p.useRef(Ot);jn.current=Ot;const[_,qe]=p.useMemo(()=>{const F=document.createElement("canvas"),ee=document.createElement("canvas");return F.style.display="none",F.style.opacity="0",F.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[F.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);p.useLayoutEffect(()=>{if(!(_===null||qe===null))return document.documentElement.append(_.canvas),document.documentElement.append(qe.canvas),()=>{_.canvas.remove(),qe.canvas.remove()}},[_,qe]);const Je=p.useMemo(()=>new Sp,[]),pe=Jt&&un?1:Ue&&un?2:5,rt=(ce==null?void 0:ce.disableMinimumCellWidth)===!0?1:10,Dt=p.useRef(),dn=p.useRef(null),en=p.useRef(null),tn=p.useCallback(()=>{var F;const ee=Ne.current,Te=sn.current;if(ee===null||Te===null||(dn.current===null&&(dn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),en.current===null&&(en.current=Te.getContext("2d",{alpha:!1}),Te.width=0,Te.height=0),dn.current===null||en.current===null||_===null||qe===null))return;let Se=!1;const Pe=lt=>{Se=!0,yt(lt)},he=Dt.current,Le={headerCanvasCtx:en.current,canvasCtx:dn.current,bufferACtx:_,bufferBCtx:qe,width:n,height:o,cellXOffset:Xt,cellYOffset:s,translateX:Math.round(Re),translateY:Math.round(Tt),mappedColumns:Ht,enableGroups:y,freezeColumns:L,dragAndDropState:J,theme:_e,headerHeight:a,groupHeaderHeight:u,disabledRows:Fe??vt.empty(),rowHeight:d,verticalBorder:Mt,isResizing:N,resizeCol:z,isFocused:k,selection:x,fillHandle:c,drawCellCallback:we,hasAppendRow:xe,overrideCursor:Pe,maxScaleFactor:pe,freezeTrailingRows:R,rows:f,drawFocus:S,getCellContent:h,getGroupDetails:De??(lt=>({name:lt})),getRowThemeOverride:g,drawHeaderCallback:be,prelightCells:et,highlightRegions:re,imageLoader:Et,lastBlitData:wt,damage:qt.current,hoverValues:Bt.current,hoverInfo:jn.current,spriteManager:$t,scrolling:un,hyperWrapping:(ce==null?void 0:ce.hyperWrapping)??!1,touchMode:Zt,enqueue:oo.current,renderStateProvider:Je,renderStrategy:(ce==null?void 0:ce.renderStrategy)??(Oi.value?"double-buffer":"single-buffer"),getCellRenderer:it,minimumCellWidth:rt,resizeIndicator:at};Le.damage===void 0?(Dt.current=Le,fu(Le,he)):fu(Le,void 0),!Se&&(Le.damage===void 0||Le.damage.has((F=jn==null?void 0:jn.current)==null?void 0:F[0]))&&yt(void 0)},[_,qe,n,o,Xt,s,Re,Tt,Ht,y,L,J,_e,a,u,Fe,d,Mt,N,xe,z,k,x,c,R,f,S,pe,h,De,g,we,be,et,re,Et,$t,un,ce==null?void 0:ce.hyperWrapping,ce==null?void 0:ce.renderStrategy,Zt,Je,it,rt,at]),Sn=p.useRef(tn);p.useLayoutEffect(()=>{tn(),Sn.current=tn},[tn]),p.useLayoutEffect(()=>{(async()=>{var F;((F=document==null?void 0:document.fonts)==null?void 0:F.ready)!==void 0&&(await document.fonts.ready,Dt.current=void 0,Sn.current())})()},[]);const wn=p.useCallback(F=>{qt.current=F,Sn.current(),qt.current=void 0},[]),ho=F0(wn);oo.current=ho;const ro=p.useCallback(F=>{wn(new Vr(F.map(ee=>ee.cell)))},[wn]);Et.setCallback(wn);const[Ga,Ka]=p.useState(!1),[sr,fo]=jt??[],qa=sr!==void 0&&fo===-1,Za=sr!==void 0&&fo===-2;let nl=!1,cr=!1,ur=bn;if(ur===void 0&&sr!==void 0&&fo!==void 0&&fo>-1&&fo<f){const F=h([sr,fo],!0);nl=F.kind===Fn.NewRow||F.kind===Fn.Marker&&F.markerKind!=="number",cr=F.kind===Z.Boolean&&zl(F),ur=F.cursor}const ti=j?"grabbing":(Cn??!1)||N?"col-resize":Ga||v?"crosshair":ur!==void 0?ur:qa||nl||cr||Za?"pointer":"default",dr=p.useMemo(()=>({contain:"strict",display:"block",cursor:ti}),[ti]),ni=p.useRef("default"),gn=Q==null?void 0:Q.current;gn!=null&&ni.current!==dr.cursor&&(gn.style.cursor=ni.current=dr.cursor);const hn=p.useCallback((F,ee,Te,Se)=>{if(De===void 0)return;const Pe=De(F);if(Pe.actions!==void 0){const he=iu(ee,Pe.actions);for(const[Le,lt]of he.entries())if(Wo(lt,Te+ee.x,Se+lt.y))return Pe.actions[Le]}},[De]),Io=p.useCallback((F,ee,Te,Se)=>{const Pe=Ht[ee];if(!j&&!N&&!(Cn??!1)){const he=At(F,ee,-1);zn(he!==void 0);const Le=lu(void 0,Pe,he.x,he.y,he.width,he.height,_e,Nl(Pe.title)==="rtl");if(Pe.hasMenu===!0&&Le.menuBounds!==void 0&&Wo(Le.menuBounds,Te,Se))return{area:"menu",bounds:Le.menuBounds};if(Pe.indicatorIcon!==void 0&&Le.indicatorIconBounds!==void 0&&Wo(Le.indicatorIconBounds,Te,Se))return{area:"indicator",bounds:Le.indicatorIconBounds}}},[Ht,At,Cn,j,N,_e]),hr=p.useRef(0),To=p.useRef(),fr=p.useRef(!1),oi=p.useCallback(F=>{const ee=Ne.current,Te=Q==null?void 0:Q.current;if(ee===null||F.target!==ee&&F.target!==Te)return;fr.current=!0;let Se,Pe;if(F instanceof MouseEvent?(Se=F.clientX,Pe=F.clientY):(Se=F.touches[0].clientX,Pe=F.touches[0].clientY),F.target===Te&&Te!==null){const Le=Te.getBoundingClientRect();if(Se>Le.right||Pe>Le.bottom)return}const he=Wt(ee,Se,Pe,F);To.current=he.location,he.isTouch&&(hr.current=Date.now()),Vt.current!==he.isTouch&&ut(he.isTouch),!(he.kind===Mo&&Io(ee,he.location[0],Se,Pe)!==void 0)&&(he.kind===Nn&&hn(he.group,he.bounds,he.localEventX,he.localEventY)!==void 0||(E==null||E(he),!he.isTouch&&ge!==!0&&ge!==he.kind&&he.button<3&&he.button!==1&&F.preventDefault()))},[Q,ge,Wt,hn,Io,E]);pn("touchstart",oi,kt,!1),pn("mousedown",oi,kt,!1);const ri=p.useRef(0),Uo=p.useCallback(F=>{var ee,Te;const Se=ri.current;ri.current=Date.now();const Pe=Ne.current;if(fr.current=!1,D===void 0||Pe===null)return;const he=Q==null?void 0:Q.current,Le=F.target!==Pe&&F.target!==he;let lt,xt,zt=!0;if(F instanceof MouseEvent){if(lt=F.clientX,xt=F.clientY,zt=F.button<3,F.pointerType==="touch")return}else lt=F.changedTouches[0].clientX,xt=F.changedTouches[0].clientY;let ye=Wt(Pe,lt,xt,F);ye.isTouch&&hr.current!==0&&Date.now()-hr.current>500&&(ye={...ye,isLongTouch:!0}),Se!==0&&Date.now()-Se<(ye.isTouch?1e3:500)&&(ye={...ye,isDoubleClick:!0}),Vt.current!==ye.isTouch&&ut(ye.isTouch),!Le&&F.cancelable&&zt&&F.preventDefault();const[ft]=ye.location,Ze=Io(Pe,ft,lt,xt);if(ye.kind===Mo&&Ze!==void 0){(ye.button!==0||((ee=To.current)==null?void 0:ee[0])!==ft||((Te=To.current)==null?void 0:Te[1])!==-1)&&D(ye,!0);return}else if(ye.kind===Nn){const Ge=hn(ye.group,ye.bounds,ye.localEventX,ye.localEventY);if(Ge!==void 0){ye.button===0&&Ge.onClick(ye);return}}D(ye,Le)},[D,Q,Wt,Io,hn]);pn("mouseup",Uo,kt,!1),pn("touchend",Uo,kt,!1);const Oo=p.useCallback(F=>{var ee,Te;const Se=Ne.current;if(Se===null)return;const Pe=Q==null?void 0:Q.current,he=F.target!==Se&&F.target!==Pe;let Le,lt,xt=!0;F instanceof MouseEvent?(Le=F.clientX,lt=F.clientY,xt=F.button<3):(Le=F.changedTouches[0].clientX,lt=F.changedTouches[0].clientY);const zt=Wt(Se,Le,lt,F);Vt.current!==zt.isTouch&&ut(zt.isTouch),!he&&F.cancelable&&xt&&F.preventDefault();const[ye]=zt.location;if(zt.kind===Mo){const ft=Io(Se,ye,Le,lt);ft!==void 0&&zt.button===0&&((ee=To.current)==null?void 0:ee[0])===ye&&((Te=To.current)==null?void 0:Te[1])===-1&&(ft.area==="menu"?m==null||m(ye,ft.bounds):ft.area==="indicator"&&(b==null||b(ye,ft.bounds)))}else if(zt.kind===Nn){const ft=hn(zt.group,zt.bounds,zt.localEventX,zt.localEventY);ft!==void 0&&zt.button===0&&ft.onClick(zt)}},[Q,Wt,Io,m,b,hn]);pn("click",Oo,kt,!1);const pr=p.useCallback(F=>{const ee=Ne.current,Te=Q==null?void 0:Q.current;if(ee===null||F.target!==ee&&F.target!==Te||O===void 0)return;const Se=Wt(ee,F.clientX,F.clientY,F);O(Se,()=>{F.cancelable&&F.preventDefault()})},[Q,Wt,O]);pn("contextmenu",pr,(Q==null?void 0:Q.current)??null,!1);const ol=p.useCallback(F=>{qt.current=new Vr(F.map(ee=>ee.item)),Bt.current=F,Sn.current(),qt.current=void 0},[]),ii=p.useMemo(()=>new P0(ol),[ol]),Ye=p.useRef(ii);Ye.current=ii,p.useLayoutEffect(()=>{const F=Ye.current;if(jt===void 0||jt[1]<0){F.setHovered(jt);return}const ee=h(jt,!0),Te=it(ee),Se=Te===void 0&&ee.kind===Z.Custom||(Te==null?void 0:Te.needsHover)!==void 0&&(typeof Te.needsHover=="boolean"?Te.needsHover:Te.needsHover(ee));F.setHovered(Se?jt:void 0)},[h,it,jt]);const li=p.useRef(),Ja=p.useCallback(F=>{var ee;const Te=Ne.current;if(Te===null)return;const Se=Q==null?void 0:Q.current,Pe=F.target!==Te&&F.target!==Se,he=Wt(Te,F.clientX,F.clientY,F);if(he.kind!=="out-of-bounds"&&Pe&&!fr.current&&!he.isTouch)return;const Le=(xt,zt)=>{In(ye=>ye===xt||(ye==null?void 0:ye[0][0])===(xt==null?void 0:xt[0][0])&&(ye==null?void 0:ye[0][1])===(xt==null?void 0:xt[0][1])&&((ye==null?void 0:ye[1][0])===(xt==null?void 0:xt[1][0])&&(ye==null?void 0:ye[1][1])===(xt==null?void 0:xt[1][1])||!zt)?ye:xt)};if(!pu(he,li.current))yt(void 0),B==null||B(he),Le(he.kind===zi?void 0:[he.location,[he.localEventX,he.localEventY]],!0),li.current=he;else if(he.kind==="cell"||he.kind===Mo||he.kind===Nn){let xt=!1,zt=!0;if(he.kind==="cell"){const ft=h(he.location);zt=((ee=it(ft))==null?void 0:ee.needsHoverPosition)??ft.kind===Z.Custom,xt=zt}else xt=!0;const ye=[he.location,[he.localEventX,he.localEventY]];Le(ye,zt),jn.current=ye,xt&&wn(new Vr([he.location]))}const lt=he.location[0]>=(ae?0:1);ot(he.kind===Mo&&he.isEdge&<&&ke===!0),Ka(he.kind==="cell"&&he.isFillHandle),C==null||C(F),X(he)},[Q,Wt,ae,ke,C,X,B,h,it,wn]);pn("mousemove",Ja,kt,!0);const po=p.useCallback(F=>{const ee=Ne.current;if(ee===null)return;let Te,Se;x.current!==void 0&&(Te=At(ee,x.current.cell[0],x.current.cell[1]),Se=x.current.cell),ne==null||ne({bounds:Te,stopPropagation:()=>F.stopPropagation(),preventDefault:()=>F.preventDefault(),cancel:()=>{},ctrlKey:F.ctrlKey,metaKey:F.metaKey,shiftKey:F.shiftKey,altKey:F.altKey,key:F.key,keyCode:F.keyCode,rawEvent:F,location:Se})},[ne,x,At]),Qa=p.useCallback(F=>{const ee=Ne.current;if(ee===null)return;let Te,Se;x.current!==void 0&&(Te=At(ee,x.current.cell[0],x.current.cell[1]),Se=x.current.cell),U==null||U({bounds:Te,stopPropagation:()=>F.stopPropagation(),preventDefault:()=>F.preventDefault(),cancel:()=>{},ctrlKey:F.ctrlKey,metaKey:F.metaKey,shiftKey:F.shiftKey,altKey:F.altKey,key:F.key,keyCode:F.keyCode,rawEvent:F,location:Se})},[U,x,At]),io=p.useCallback(F=>{if(Ne.current=F,se!==void 0&&(se.current=F),ce!=null&&ce.eventTarget)nt.current=ce.eventTarget;else if(F===null)nt.current=window;else{const ee=F.getRootNode();ee===document&&(nt.current=window),nt.current=ee}},[se,ce==null?void 0:ce.eventTarget]),ai=p.useCallback(F=>{const ee=Ne.current;if(ee===null||ge===!1||N){F.preventDefault();return}let Te,Se;const Pe=Wt(ee,F.clientX,F.clientY);if(ge!==!0&&Pe.kind!==ge){F.preventDefault();return}const he=(ft,Ze)=>{Te=ft,Se=Ze};let Le,lt,xt;const zt=(ft,Ze,Ge)=>{Le=ft,lt=Ze,xt=Ge};let ye=!1;if(de==null||de({...Pe,setData:he,setDragImage:zt,preventDefault:()=>ye=!0,defaultPrevented:()=>ye}),!ye&&Te!==void 0&&Se!==void 0&&F.dataTransfer!==null)if(F.dataTransfer.setData(Te,Se),F.dataTransfer.effectAllowed="copyLink",Le!==void 0&<!==void 0&&xt!==void 0)F.dataTransfer.setDragImage(Le,lt,xt);else{const[ft,Ze]=Pe.location;if(Ze!==void 0){const Ge=document.createElement("canvas"),pt=At(ee,ft,Ze);zn(pt!==void 0);const _t=Math.ceil(window.devicePixelRatio??1);Ge.width=pt.width*_t,Ge.height=pt.height*_t;const nn=Ge.getContext("2d");nn!==null&&(nn.scale(_t,_t),nn.textBaseline="middle",Ze===-1?(nn.font=_e.headerFontFull,nn.fillStyle=_e.bgHeader,nn.fillRect(0,0,Ge.width,Ge.height),su(nn,0,0,pt.width,pt.height,Ht[ft],!1,_e,!1,void 0,void 0,!1,0,$t,be,!1)):(nn.font=_e.baseFontFull,nn.fillStyle=_e.bgCell,nn.fillRect(0,0,Ge.width,Ge.height),ru(nn,h([ft,Ze]),0,Ze,!1,!1,0,0,pt.width,pt.height,!1,_e,_e.bgCell,Et,$t,1,void 0,!1,0,void 0,void 0,void 0,Je,it,()=>{}))),Ge.style.left="-100%",Ge.style.position="absolute",Ge.style.width=`${pt.width}px`,Ge.style.height=`${pt.height}px`,document.body.append(Ge),F.dataTransfer.setDragImage(Ge,pt.width/2,pt.height/2),window.setTimeout(()=>{Ge.remove()},0)}}else F.preventDefault()},[ge,N,Wt,de,At,_e,Ht,$t,be,h,Et,Je,it]);pn("dragstart",ai,(Q==null?void 0:Q.current)??null,!1,!1);const gr=p.useRef(),rl=p.useCallback(F=>{const ee=Ne.current;if(Ee!==void 0&&F.preventDefault(),ee===null||ie===void 0)return;const Te=Wt(ee,F.clientX,F.clientY),[Se,Pe]=Te.location,he=Se-(ae?0:1),[Le,lt]=gr.current??[];(Le!==he||lt!==Pe)&&(gr.current=[he,Pe],ie([he,Pe],F.dataTransfer))},[ae,Wt,ie,Ee]);pn("dragover",rl,(Q==null?void 0:Q.current)??null,!1,!1);const es=p.useCallback(()=>{gr.current=void 0,fe==null||fe()},[fe]);pn("dragend",es,(Q==null?void 0:Q.current)??null,!1,!1);const ts=p.useCallback(F=>{const ee=Ne.current;if(ee===null||Ee===void 0)return;F.preventDefault();const Te=Wt(ee,F.clientX,F.clientY),[Se,Pe]=Te.location,he=Se-(ae?0:1);Ee([he,Pe],F.dataTransfer)},[ae,Wt,Ee]);pn("drop",ts,(Q==null?void 0:Q.current)??null,!1,!1);const lo=p.useCallback(()=>{Ie==null||Ie()},[Ie]);pn("dragleave",lo,(Q==null?void 0:Q.current)??null,!1,!1);const go=p.useRef(x);go.current=x;const Mn=p.useRef(null),W=p.useCallback(F=>{var ee;Ne.current===null||!Ne.current.contains(document.activeElement)||(F===null&&go.current.current!==void 0?(ee=se==null?void 0:se.current)==null||ee.focus({preventScroll:!0}):F!==null&&F.focus({preventScroll:!0}),Mn.current=F)},[se]);p.useImperativeHandle(t,()=>({focus:()=>{var F;const ee=Mn.current;ee===null||!document.contains(ee)?(F=se==null?void 0:se.current)==null||F.focus({preventScroll:!0}):ee.focus({preventScroll:!0})},getBounds:(F,ee)=>{if(!(se===void 0||se.current===null))return At(se.current,F??0,ee??-1)},damage:ro}),[se,ro,At]);const Gt=p.useRef(),Yo=Tf(()=>{var F,ee,Te;if(n<50||(ce==null?void 0:ce.disableAccessibilityTree)===!0)return null;let Se=Ul(Ht,Xt,n,J,Re);const Pe=ae?0:-1;!ae&&((F=Se[0])==null?void 0:F.sourceIndex)===0&&(Se=Se.slice(1));const[he,Le]=((ee=x.current)==null?void 0:ee.cell)??[],lt=(Te=x.current)==null?void 0:Te.range,xt=Se.map(ye=>ye.sourceIndex),zt=so(s,Math.min(f,s+r));return he!==void 0&&Le!==void 0&&!(xt.includes(he)&&zt.includes(Le))&&W(null),p.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":f+1,"aria-multiselectable":"true","aria-colcount":Ht.length+Pe},p.createElement("thead",{role:"rowgroup"},p.createElement("tr",{role:"row","aria-rowindex":1},Se.map(ye=>p.createElement("th",{role:"columnheader","aria-selected":x.columns.hasIndex(ye.sourceIndex),"aria-colindex":ye.sourceIndex+1+Pe,tabIndex:-1,onFocus:ft=>{if(ft.target!==Mn.current)return me==null?void 0:me([ye.sourceIndex,-1])},key:ye.sourceIndex},ye.title)))),p.createElement("tbody",{role:"rowgroup"},zt.map(ye=>p.createElement("tr",{role:"row","aria-selected":x.rows.hasIndex(ye),key:ye,"aria-rowindex":ye+2},Se.map(ft=>{const Ze=ft.sourceIndex,Ge=Wn(Ze,ye),pt=he===Ze&&Le===ye,_t=lt!==void 0&&Ze>=lt.x&&Ze<lt.x+lt.width&&ye>=lt.y&&ye<lt.y+lt.height,nn=`glide-cell-${Ze}-${ye}`,Un=[Ze,ye],Yn=h(Un,!0);return p.createElement("td",{key:Ge,role:"gridcell","aria-colindex":Ze+1+Pe,"aria-selected":_t,"aria-readonly":Po(Yn)||!Er(Yn),id:nn,"data-testid":nn,onClick:()=>{const Kt=se==null?void 0:se.current;if(Kt!=null)return ne==null?void 0:ne({bounds:At(Kt,Ze,ye),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Un})},onFocusCapture:Kt=>{var dt,Tn;if(!(Kt.target===Mn.current||((dt=Gt.current)==null?void 0:dt[0])===Ze&&((Tn=Gt.current)==null?void 0:Tn[1])===ye))return Gt.current=Un,me==null?void 0:me(Un)},ref:pt?W:void 0,tabIndex:-1},_0(Yn,it))})))))},[n,Ht,Xt,J,Re,f,s,r,x,W,h,se,ne,At,me],200),mr=L===0||!P?0:Xt>L?1:_n(-Re/100,0,1),il=-s*32+Tt,vr=M?_n(-il/100,0,1):0,ns=p.useMemo(()=>{if(!mr&&!vr)return null;const F={position:"absolute",top:0,left:kn,width:n-kn,height:o,opacity:mr,pointerEvents:"none",transition:tt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:rn,left:0,width:n,height:o,opacity:vr,pointerEvents:"none",transition:Rt?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return p.createElement(p.Fragment,null,mr>0&&p.createElement("div",{id:"shadow-x",style:F}),vr>0&&p.createElement("div",{id:"shadow-y",style:ee}))},[mr,vr,kn,n,tt,rn,o,Rt]),K=p.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return p.createElement(p.Fragment,null,p.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:po,onKeyUp:Qa,onFocus:I,onBlur:T,ref:io,style:dr},Yo),p.createElement("canvas",{ref:sn,style:K}),ns)},B0=p.memo(p.forwardRef(N0));function Yr(e,t,n,o){return _n(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(o))}const V0=e=>{const[t,n]=p.useState(),[o,r]=p.useState(),[i,l]=p.useState(),[s,a]=p.useState(),[c,u]=p.useState(!1),[d,f]=p.useState(),[h,g]=p.useState(),[m,b]=p.useState(),[y,v]=p.useState(!1),[I,T]=p.useState(),{onHeaderMenuClick:k,onHeaderIndicatorClick:x,getCellContent:L,onColumnMoved:O,onColumnResize:R,onColumnResizeStart:P,onColumnResizeEnd:M,gridRef:S,maxColumnWidth:E,minColumnWidth:D,onRowMoved:C,lockColumns:X,onColumnProposeMove:B,onMouseDown:J,onMouseUp:ae,onItemHovered:ne,onDragStart:U,canvasRef:re}=e,se=(R??M??P)!==void 0,{columns:de,selection:fe}=e,Q=fe.columns,N=p.useCallback(we=>{const[be,me]=we.location;i!==void 0&&s!==be&&be>=X?(u(!0),a(be)):h!==void 0&&me!==void 0?(v(!0),b(Math.max(0,me))):o===void 0&&!c&&!y&&(ne==null||ne(we))},[i,h,s,ne,X,o,c,y]),z=O!==void 0,j=p.useCallback(we=>{var be;if(we.button===0){const[me,ie]=we.location;if(we.kind==="out-of-bounds"&&we.isEdge&&se){const Ee=(be=S==null?void 0:S.current)==null?void 0:be.getBounds(de.length-1,-1);Ee!==void 0&&(n(Ee.x),r(de.length-1))}else if(we.kind==="header"&&me>=X){const Ee=re==null?void 0:re.current;if(we.isEdge&&se&&Ee){n(we.bounds.x),r(me);const Ie=Ee.getBoundingClientRect().width/Ee.offsetWidth,je=we.bounds.width/Ie;P==null||P(de[me],je,me,je+(de[me].growOffset??0))}else we.kind==="header"&&z&&(f(we.bounds.x),l(me))}else we.kind==="cell"&&X>0&&me===0&&ie!==void 0&&C!==void 0&&(T(we.bounds.y),g(ie))}J==null||J(we)},[J,se,X,C,S,de,z,P,re]),ge=p.useCallback((we,be)=>{c||y||k==null||k(we,be)},[c,y,k]),ke=p.useCallback((we,be)=>{c||y||x==null||x(we,be)},[c,y,x]),Fe=p.useRef(-1),xe=p.useCallback(()=>{Fe.current=-1,g(void 0),b(void 0),T(void 0),v(!1),l(void 0),a(void 0),f(void 0),u(!1),r(void 0),n(void 0)},[]),De=p.useCallback((we,be)=>{if(we.button===0){if(o!==void 0){if((Q==null?void 0:Q.hasIndex(o))===!0)for(const ie of Q){if(ie===o)continue;const Ee=de[ie],Ie=Yr(Ee,Fe.current,D,E);R==null||R(Ee,Ie,ie,Ie+(Ee.growOffset??0))}const me=Yr(de[o],Fe.current,D,E);if(M==null||M(de[o],me,o,me+(de[o].growOffset??0)),Q.hasIndex(o))for(const ie of Q){if(ie===o)continue;const Ee=de[ie],Ie=Yr(Ee,Fe.current,D,E);M==null||M(Ee,Ie,ie,Ie+(Ee.growOffset??0))}}xe(),i!==void 0&&s!==void 0&&(O==null||O(i,s)),h!==void 0&&m!==void 0&&(C==null||C(h,m))}ae==null||ae(we,be)},[ae,o,i,s,h,m,Q,M,de,D,E,R,O,C,xe]),_e=p.useMemo(()=>{if(!(i===void 0||s===void 0)&&i!==s&&(B==null?void 0:B(i,s))!==!1)return{src:i,dest:s}},[i,s,B]),et=p.useCallback(we=>{const be=re==null?void 0:re.current;if(i!==void 0&&d!==void 0)Math.abs(we.clientX-d)>20&&u(!0);else if(h!==void 0&&I!==void 0)Math.abs(we.clientY-I)>20&&v(!0);else if(o!==void 0&&t!==void 0&&be){const me=be.getBoundingClientRect().width/be.offsetWidth,ie=(we.clientX-t)/me,Ee=de[o],Ie=Yr(Ee,ie,D,E);if(R==null||R(Ee,Ie,o,Ie+(Ee.growOffset??0)),Fe.current=ie,(Q==null?void 0:Q.first())===o)for(const je of Q){if(je===o)continue;const tt=de[je],Rt=Yr(tt,Fe.current,D,E);R==null||R(tt,Rt,je,Rt+(tt.growOffset??0))}}},[i,d,h,I,o,t,de,D,E,R,Q,re]),Pt=p.useCallback((we,be)=>{if(h===void 0||m===void 0)return L(we,be);let[me,ie]=we;return ie===m?ie=h:(ie>m&&(ie-=1),ie>=h&&(ie+=1)),L([me,ie],be)},[h,m,L]),Mt=p.useCallback(we=>{U==null||U(we),we.defaultPrevented()||xe()},[xe,U]);return p.createElement(B0,{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:o,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:Pt,isResizing:o!==void 0,onHeaderMenuClick:ge,onHeaderIndicatorClick:ke,isDragging:c,onItemHovered:N,onDragStart:Mt,onMouseDown:j,allowResize:se,onMouseUp:De,dragAndDropState:_e,onMouseMoveRaw:et,ref:S})};function $0(e){const t=p.useRef(null),[n,o]=p.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return p.useLayoutEffect(()=>{const r=l=>{for(const s of l){const{width:a,height:c}=s&&s.contentRect||{};o(u=>u.width===a&&u.height===c?u:{width:a,height:c})}},i=new window.ResizeObserver(r);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const W0=(e,t,n)=>{const o=p.useRef(null),r=p.useRef(null),i=p.useRef(null),l=p.useRef(0),s=p.useRef(t);s.current=t;const a=n.current;p.useEffect(()=>{const c=()=>{var f,h;if(r.current===!1&&a!==null){const g=[a.scrollLeft,a.scrollTop];if(((f=i.current)==null?void 0:f[0])===g[0]&&((h=i.current)==null?void 0:h[1])===g[1])if(l.current>10){i.current=null,r.current=null;return}else l.current++;else l.current=0,s.current(g[0],g[1]),i.current=g;o.current=window.setTimeout(c,8.333333333333334)}},u=()=>{r.current=!0,i.current=null,o.current!==null&&(window.clearTimeout(o.current),o.current=null)},d=f=>{f.touches.length===0&&(r.current=!1,l.current=0,o.current=window.setTimeout(c,8.333333333333334))};if(e&&a!==null){const f=a;return f.addEventListener("touchstart",u),f.addEventListener("touchend",d),()=>{f.removeEventListener("touchstart",u),f.removeEventListener("touchend",d),o.current!==null&&window.clearTimeout(o.current)}}},[e,a])},j0=()=>e=>e.isSafari?"scroll":"auto",U0=cn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[j0()]}});function Y0(e){const[t,n]=p.useState(!1),o=typeof window>"u"?null:window,r=p.useRef(0);return pn("touchstart",p.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),o,!0,!1),pn("touchend",p.useCallback(i=>{i.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),o,!0,!1),t}const X0=e=>{var t,n;const{children:o,clientHeight:r,scrollHeight:i,scrollWidth:l,update:s,draggable:a,className:c,preventDiagonalScrolling:u=!1,paddingBottom:d=0,paddingRight:f=0,rightElement:h,rightElementProps:g,kineticScrollPerfHack:m=!1,scrollRef:b,initialSize:y}=e,v=[],I=(g==null?void 0:g.sticky)??!1,T=(g==null?void 0:g.fill)??!1,k=p.useRef(0),x=p.useRef(0),L=p.useRef(null),O=typeof window>"u"?1:window.devicePixelRatio,R=p.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),P=p.useRef(null),M=Y0(200),[S,E]=p.useState(!0),D=p.useRef(0);p.useLayoutEffect(()=>{if(!S||M||R.current.lockDirection===void 0)return;const fe=L.current;if(fe===null)return;const[Q,N]=R.current.lockDirection;Q!==void 0?fe.scrollLeft=Q:N!==void 0&&(fe.scrollTop=N),R.current.lockDirection=void 0},[M,S]);const C=p.useCallback((fe,Q)=>{var N;const z=L.current;if(z===null)return;Q=Q??z.scrollTop,fe=fe??z.scrollLeft;const j=R.current.scrollTop,ge=R.current.scrollLeft,ke=fe-ge,Fe=Q-j;M&&ke!==0&&Fe!==0&&(Math.abs(ke)>3||Math.abs(Fe)>3)&&u&&R.current.lockDirection===void 0&&(R.current.lockDirection=Math.abs(ke)<Math.abs(Fe)?[ge,void 0]:[void 0,j]);const xe=R.current.lockDirection;fe=(xe==null?void 0:xe[0])??fe,Q=(xe==null?void 0:xe[1])??Q,R.current.scrollLeft=fe,R.current.scrollTop=Q;const De=z.clientWidth,_e=z.clientHeight,et=Q,Pt=x.current-et,Mt=z.scrollHeight-_e;if(x.current=et,Mt>0&&(Math.abs(Pt)>2e3||et===0||et===Mt)&&i>z.scrollHeight+5){const we=et/Mt,be=(i-_e)*we;k.current=be-et}xe!==void 0&&(window.clearTimeout(D.current),E(!1),D.current=window.setTimeout(()=>E(!0),200)),s({x:fe,y:et+k.current,width:De-f,height:_e-d,paddingRight:((N=P.current)==null?void 0:N.clientWidth)??0})},[d,f,i,s,u,M]);W0(m&&Oi.value,C,L);const X=p.useRef(C);X.current=C;const B=p.useRef(),J=p.useRef(!1);p.useLayoutEffect(()=>{J.current?C():J.current=!0},[C,d,f]);const ae=p.useCallback(fe=>{L.current=fe,b!==void 0&&(b.current=fe)},[b]);let ne=0,U=0;for(v.push(p.createElement("div",{key:ne++,style:{width:l,height:0}}));U<i;){const fe=Math.min(5e6,i-U);v.push(p.createElement("div",{key:ne++,style:{width:0,height:fe}})),U+=fe}const{ref:re,width:se,height:de}=$0(y);return typeof window<"u"&&(((t=B.current)==null?void 0:t.height)!==de||((n=B.current)==null?void 0:n.width)!==se)&&(window.setTimeout(()=>X.current(),0),B.current={width:se,height:de}),(se??0)===0||(de??0)===0?p.createElement("div",{ref:re}):p.createElement("div",{ref:re},p.createElement(U0,{isSafari:Oi.value},p.createElement("div",{className:"dvn-underlay"},o),p.createElement("div",{ref:ae,style:B.current,draggable:a,onDragStart:fe=>{a||(fe.stopPropagation(),fe.preventDefault())},className:"dvn-scroller "+(c??""),onScroll:()=>C()},p.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},p.createElement("div",{className:"dvn-stack"},v),h!==void 0&&p.createElement(p.Fragment,null,!T&&p.createElement("div",{className:"dvn-spacer"}),p.createElement("div",{ref:P,style:{height:de,maxHeight:r-Math.ceil(O%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:f,flexGrow:T?1:void 0,right:I?f??0:void 0,pointerEvents:"auto"}},h))))))},G0=e=>{const{columns:t,rows:n,rowHeight:o,headerHeight:r,groupHeaderHeight:i,enableGroups:l,freezeColumns:s,experimental:a,nonGrowWidth:c,clientSize:u,className:d,onVisibleRegionChanged:f,scrollRef:h,preventDiagonalScrolling:g,rightElement:m,rightElementProps:b,overscrollX:y,overscrollY:v,initialSize:I,smoothScrollX:T=!1,smoothScrollY:k=!1,isDraggable:x}=e,{paddingRight:L,paddingBottom:O}=a??{},[R,P]=u,M=p.useRef(),S=p.useRef(),E=p.useRef(),D=p.useRef(),C=c+Math.max(0,y??0);let X=l?r+i:r;if(typeof o=="number")X+=n*o;else for(let ne=0;ne<n;ne++)X+=o(ne);v!==void 0&&(X+=v);const B=p.useRef(),J=p.useCallback(()=>{var ne,U;if(B.current===void 0)return;const re={...B.current};let se=0,de=re.x<0?-re.x:0,fe=0,Q=0;re.x=re.x<0?0:re.x;let N=0;for(let xe=0;xe<s;xe++)N+=t[xe].width;for(const xe of t){const De=se-N;if(re.x>=De+xe.width)se+=xe.width,Q++,fe++;else if(re.x>De)se+=xe.width,T?de+=De-re.x:Q++,fe++;else if(re.x+re.width>De)se+=xe.width,fe++;else break}let z=0,j=0,ge=0;if(typeof o=="number")k?(j=Math.floor(re.y/o),z=j*o-re.y):j=Math.ceil(re.y/o),ge=Math.ceil(re.height/o)+j,z<0&&ge++;else{let xe=0;for(let De=0;De<n;De++){const _e=o(De),et=xe+(k?0:_e/2);if(re.y>=xe+_e)xe+=_e,j++,ge++;else if(re.y>et)xe+=_e,k?z+=et-re.y:j++,ge++;else if(re.y+re.height>_e/2+xe)xe+=_e,ge++;else break}}const ke={x:Q,y:j,width:fe-Q,height:ge-j},Fe=M.current;(Fe===void 0||Fe.y!==ke.y||Fe.x!==ke.x||Fe.height!==ke.height||Fe.width!==ke.width||S.current!==de||E.current!==z||re.width!==((ne=D.current)==null?void 0:ne[0])||re.height!==((U=D.current)==null?void 0:U[1]))&&(f==null||f({x:Q,y:j,width:fe-Q,height:ge-j},re.width,re.height,re.paddingRight??0,de,z),M.current=ke,S.current=de,E.current=z,D.current=[re.width,re.height])},[t,o,n,f,s,T,k]),ae=p.useCallback(ne=>{B.current=ne,J()},[J]);return p.useEffect(()=>{J()},[J]),p.createElement(X0,{scrollRef:h,className:d,kineticScrollPerfHack:a==null?void 0:a.kineticScrollPerfHack,preventDiagonalScrolling:g,draggable:x===!0||typeof x=="string",scrollWidth:C+(L??0),scrollHeight:X+(O??0),clientHeight:P,rightElement:m,paddingBottom:O,paddingRight:L,rightElementProps:b,update:ae,initialSize:I},p.createElement(V0,{eventTargetRef:h,width:R,height:P,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=cn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),q0=p.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},p.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),Z0=p.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},p.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),J0=p.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},p.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),Q0=10,eg=e=>{const{canvasRef:t,cellYOffset:n,rows:o,columns:r,searchInputRef:i,searchValue:l,searchResults:s,onSearchValueChange:a,getCellsForSelection:c,onSearchResultsChanged:u,showSearch:d=!1,onSearchClose:f}=e,[h]=p.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[g,m]=p.useState(""),b=l??g,y=p.useCallback(U=>{m(U),a==null||a(U)},[a]),[v,I]=p.useState(),T=p.useRef(v);T.current=v,p.useEffect(()=>{s!==void 0&&(s.length>0?I(U=>({rowsSearched:o,results:s.length,selectedIndex:(U==null?void 0:U.selectedIndex)??-1})):I(void 0))},[o,s]);const k=p.useRef();k.current===void 0&&(k.current=new AbortController);const x=p.useRef(),[L,O]=p.useState([]),R=s??L,P=p.useCallback(()=>{x.current!==void 0&&(window.cancelAnimationFrame(x.current),x.current=void 0,k.current.abort())},[]),M=p.useRef(n);M.current=n;const S=p.useCallback(U=>{const re=new RegExp(U.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let se=M.current,de=Math.min(10,o),fe=0;I(void 0),O([]);const Q=[],N=async()=>{var z;if(c===void 0)return;const j=performance.now(),ge=o-fe;let ke=c({x:0,y:se,width:r.length,height:Math.min(de,ge,o-se)},k.current.signal);typeof ke=="function"&&(ke=await ke());let Fe=!1;for(const[Mt,we]of ke.entries())for(const[be,me]of we.entries()){let ie;switch(me.kind){case Z.Text:case Z.Number:ie=me.displayData;break;case Z.Uri:case Z.Markdown:ie=me.data;break;case Z.Boolean:ie=typeof me.data=="boolean"?me.data.toString():void 0;break;case Z.Image:case Z.Bubble:ie=me.data.join("\u{1F433}");break;case Z.Custom:ie=me.copyData;break}ie!==void 0&&re.test(ie)&&(Q.push([be,Mt+se]),Fe=!0)}const xe=performance.now();Fe&&O([...Q]),fe+=ke.length,zn(fe<=o);const De=((z=T.current)==null?void 0:z.selectedIndex)??-1;I({results:Q.length,rowsSearched:fe,selectedIndex:De}),u==null||u(Q,De),se+de>=o?se=0:se+=de;const _e=xe-j,et=Math.max(_e,1),Pt=Q0/et;de=Math.ceil(de*Pt),fe<o&&Q.length<1e3&&(x.current=window.requestAnimationFrame(N))};P(),x.current=window.requestAnimationFrame(N)},[P,r.length,c,u,o]),E=p.useCallback(()=>{var U;f==null||f(),I(void 0),O([]),u==null||u([],-1),P(),(U=t==null?void 0:t.current)==null||U.focus()},[P,t,f,u]),D=p.useCallback(U=>{y(U.target.value),s===void 0&&(U.target.value===""?(I(void 0),O([]),P()):S(U.target.value))},[S,P,y,s]);p.useEffect(()=>{d&&i.current!==null&&(y(""),i.current.focus({preventScroll:!0}))},[d,i,y]);const C=p.useCallback(U=>{var re;if((re=U==null?void 0:U.stopPropagation)==null||re.call(U),v===void 0)return;const se=(v.selectedIndex+1)%v.results;I({...v,selectedIndex:se}),u==null||u(R,se)},[v,u,R]),X=p.useCallback(U=>{var re;if((re=U==null?void 0:U.stopPropagation)==null||re.call(U),v===void 0)return;let se=(v.selectedIndex-1)%v.results;se<0&&(se+=v.results),I({...v,selectedIndex:se}),u==null||u(R,se)},[u,R,v]),B=p.useCallback(U=>{(U.ctrlKey||U.metaKey)&&U.nativeEvent.code==="KeyF"||U.key==="Escape"?(E(),U.stopPropagation(),U.preventDefault()):U.key==="Enter"&&(U.shiftKey?X():C())},[E,C,X]);p.useEffect(()=>()=>{P()},[P]);const[J,ae]=p.useState(!1);p.useEffect(()=>{if(d)ae(!0);else{const U=setTimeout(()=>ae(!1),150);return()=>clearTimeout(U)}},[d]);const ne=p.useMemo(()=>{if(!d&&!J)return null;let U;v!==void 0&&(U=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(U=`${v.selectedIndex+1} of ${U}`));const re=de=>{de.stopPropagation()},se={width:`${Math.floor(((v==null?void 0:v.rowsSearched)??0)/o*100)}%`};return p.createElement(K0,{className:d?"":"out",onMouseDown:re,onMouseMove:re,onMouseUp:re,onClick:re},p.createElement("div",{className:"gdg-search-bar-inner"},p.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:i,onChange:D,value:b,tabIndex:d?void 0:-1,onKeyDownCapture:B}),p.createElement("button",{"aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:X,disabled:((v==null?void 0:v.results)??0)===0},q0),p.createElement("button",{"aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:C,disabled:((v==null?void 0:v.results)??0)===0},Z0),f!==void 0&&p.createElement("button",{"aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:E},J0)),v!==void 0?p.createElement(p.Fragment,null,p.createElement("div",{className:"gdg-search-status"},p.createElement("div",{"data-testid":"search-result-area"},U)),p.createElement("div",{className:"gdg-search-progress",style:se})):p.createElement("div",{className:"gdg-search-status"},p.createElement("label",{htmlFor:h},"Type to search")))},[d,J,v,o,h,i,D,b,B,X,C,f,E]);return p.createElement(p.Fragment,null,p.createElement(G0,{prelightCells:R,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}),ne)};Ss=class extends p.PureComponent{constructor(){super(...arguments),ht(this,"wrapperRef",p.createRef()),ht(this,"clickOutside",e=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(e))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(e.target)){let t=e.target;for(;t!==null;){if(t.classList.contains("click-outside-ignore"))return;t=t.parentElement}this.props.onClickOutside()}})}componentDidMount(){const e=this.props.customEventTarget??document;e.addEventListener("touchend",this.clickOutside,!0),e.addEventListener("mousedown",this.clickOutside,!0),e.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const e=this.props.customEventTarget??document;e.removeEventListener("touchend",this.clickOutside,!0),e.removeEventListener("mousedown",this.clickOutside,!0),e.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:e,isOutsideClick:t,customEventTarget:n,...o}=this.props;return p.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}};const tg=()=>e=>Math.max(16,e.targetHeight-10),ng=cn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[tg(),"px"]}}),og=e=>{const{bounds:t,group:n,onClose:o,canvasBounds:r,onFinish:i}=e,[l,s]=te.useState(n);return te.createElement(Ss,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:o},te.createElement(ng,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:o,onFocus:a=>a.target.setSelectionRange(0,l.length),onChange:a=>s(a.target.value),onKeyDown:a=>{a.key==="Enter"?i(l):a.key==="Escape"&&o()},autoFocus:!0}))};function rg(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 st(e,t,n){const o=mu(e,t);return o&&(n.didMatch=!0),o}function mu(e,t){if(e.length===0)return!1;if(e.includes("|")){const a=e.split("|");for(const c of a)if(mu(c,t))return!0;return!1}let n=!1,o=!1,r=!1,i=!1;const l=e.split("+"),s=l.pop();if(!rg(s,t))return!1;if(l[0]==="any")return!0;for(const a of l)switch(a){case"ctrl":n=!0;break;case"shift":o=!0;break;case"alt":r=!0;break;case"meta":i=!0;break;case"primary":Di.value?i=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===o&&t.metaKey===i}function ig(e,t,n,o,r,i,l){const s=te.useCallback((u,d,f,h)=>{var g;(i==="cell"||i==="multi-cell")&&u!==void 0&&(u={...u,range:{x:u.cell[0],y:u.cell[1],width:1,height:1}}),!l&&u!==void 0&&u.range.width>1&&(u={...u,range:{...u.range,width:1,x:u.cell[0]}});const m=n==="mixed"&&(f||h==="drag"),b=o==="mixed"&&m,y=r==="mixed"&&m;let v={current:u===void 0?void 0:{...u,rangeStack:h==="drag"?((g=e.current)==null?void 0:g.rangeStack)??[]:[]},columns:b?e.columns:vt.empty(),rows:y?e.rows:vt.empty()};f&&(i==="multi-rect"||i==="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)},[o,e,n,i,l,r,t]),a=te.useCallback((u,d,f)=>{u=u??e.rows,d!==void 0&&(u=u.add(d));let h;if(r==="exclusive"&&u.length>0)h={current:void 0,columns:vt.empty(),rows:u};else{const g=f&&n==="mixed",m=f&&o==="mixed";h={current:g?e.current:void 0,columns:m?e.columns:vt.empty(),rows:u}}t(h,!1)},[o,e,n,r,t]),c=te.useCallback((u,d,f)=>{u=u??e.columns,d!==void 0&&(u=u.add(d));let h;if(o==="exclusive"&&u.length>0)h={current:void 0,rows:vt.empty(),columns:u};else{const g=f&&n==="mixed",m=f&&r==="mixed";h={current:g?e.current:void 0,rows:m?e.rows:vt.empty(),columns:u}}t(h,!1)},[o,e,n,r,t]);return[s,a,c]}function lg(e,t,n,o,r){const i=p.useCallback(a=>{if(e===!0){const c=[];for(let u=a.y;u<a.y+a.height;u++){const d=[];for(let f=a.x;f<a.x+a.width;f++)f<0||u>=r?d.push({kind:Z.Loading,allowOverlay:!1}):d.push(t([f,u]));c.push(d)}return c}return(e==null?void 0:e(a,o.signal))??[]},[o.signal,t,e,r]),l=e!==void 0?i:void 0,s=p.useCallback(a=>{if(l===void 0)return[];const c={...a,x:a.x-n};if(c.x<0){c.x=0,c.width--;const u=l(c,o.signal);return typeof u=="function"?async()=>(await u()).map(d=>[{kind:Z.Loading,allowOverlay:!1},...d]):u.map(d=>[{kind:Z.Loading,allowOverlay:!1},...d])}return l(c,o.signal)},[o.signal,l,n]);return[e!==void 0?s:void 0,l]}function ag(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Dl?"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:Rr()}}function sg(e,t){return e.map((n,o)=>{const r=t[o];return n.map(i=>i.span!==void 0&&i.span[0]!==r?{formatted:"",rawValue:"",format:"string"}:ag(i))})}function vu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function cg(e){var t;const n=[];for(const o of e){const r=[];for(const i of o)i.format==="url"?r.push(((t=i.rawValue)==null?void 0:t.toString())??""):i.format==="string-array"?r.push(i.formatted.map(l=>vu(l,!0)).join(",")):r.push(vu(i.formatted,!1));n.push(r.join(" "))}return n.join(`
|
|
166
|
+
`)}function ca(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function bu(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function ug(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function dg(e){var t;const n=[];n.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const o of e){n.push("<tr>");for(const r of o){const i=`gdg-format="${r.format}"`;r.format==="url"?n.push(`<td ${i}><a href="${r.rawValue}">${ca(r.formatted)}</a></td>`):r.format==="string-array"?n.push(`<td ${i}><ol>${r.formatted.map((l,s)=>`<li gdg-raw-value=${bu(r.rawValue[s])}>`+ca(l)+"</li>").join("")}</ol></td>`):n.push(`<td gdg-raw-value=${bu(((t=r.rawValue)==null?void 0:t.toString())??"")} ${i}>${ca(r.formatted)}</td>`)}n.push("</tr>")}return n.push("</tbody></table>"),n.join("")}function hg(e,t){const n=sg(e,t),o=cg(n),r=dg(n);return{textPlain:o,textHtml:r}}function wu(e){var t;const n=document.createElement("html");n.innerHTML=e.replace(/ /g," ");const o=n.querySelector("table");if(o===null)return;const r=[o],i=[];let l;for(;r.length>0;){const s=r.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")r.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)l!==void 0&&i.push(l),l=[],r.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const a=s.cloneNode(!0),c=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,u=(c==null?void 0:c.children.length)===1&&c.children[0].nodeName==="FONT",d=a.querySelectorAll("br");for(const g of d)g.replaceWith(`
|
|
167
|
+
`);const f=a.getAttribute("gdg-raw-value"),h=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)l==null||l.push({rawValue:((t=a.querySelector("a"))==null?void 0:t.getAttribute("href"))??"",formatted:a.textContent??"",format:h});else if(a.querySelector("ol")!==null){const g=a.querySelectorAll("li");l==null||l.push({rawValue:[...g].map(m=>m.getAttribute("gdg-raw-value")??""),formatted:[...g].map(m=>m.textContent??""),format:"string-array"})}else if(f!==null)l==null||l.push({rawValue:ug(f),formatted:a.textContent??"",format:h});else{let g=a.textContent??"";u&&(g=g.replace(/\n(?!\n)/g,"")),l==null||l.push({rawValue:g??"",formatted:g??"",format:h})}}}return l!==void 0&&i.push(l),i}function fg(e,t,n,o,r){var i;const l=e;if(o==="allowPartial"||e.current===void 0||t===void 0)return e;let s=!1;do{if((e==null?void 0:e.current)===void 0)break;const a=(i=e.current)==null?void 0:i.range,c=[];if(a.width>2){const f=t({x:a.x,y:a.y,width:1,height:a.height},r.signal);if(typeof f=="function")return l;c.push(...f);const h=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},r.signal);if(typeof h=="function")return l;c.push(...h)}else{const f=t({x:a.x,y:a.y,width:a.width,height:a.height},r.signal);if(typeof f=="function")return l;c.push(...f)}let u=a.x-n,d=a.x+a.width-1-n;for(const f of c)for(const h of f)h.span!==void 0&&(u=Math.min(h.span[0],u),d=Math.max(h.span[1],d));u===a.x-n&&d===a.x+a.width-1-n?s=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:d-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!s);return e}function yu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function pg(e){let t;(function(s){s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let o=[],r=0,i=t.None;e=e.replace(/\r\n/g,`
|
|
168
|
+
`);let l=0;for(const s of e){switch(i){case t.None:s===" "||s===`
|
|
169
|
+
`?(o.push(e.slice(r,l)),r=l+1,s===`
|
|
170
|
+
`&&(n.push(o),o=[])):s==='"'&&(i=t.inString);break;case t.inString:s==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?i=t.inString:((s===" "||s===`
|
|
171
|
+
`)&&(o.push(yu(e.slice(r,l))),r=l+1,s===`
|
|
172
|
+
`&&(n.push(o),o=[])),i=t.None);break}l++}return r<e.length&&o.push(yu(e.slice(r,e.length))),n.push(o),n.map(s=>s.map(a=>({rawValue:a,formatted:a,format:"string"})))}function xu(e,t,n){var o;const r=hg(e,t),i=a=>{var c;(c=window.navigator.clipboard)==null||c.writeText(a)},l=(a,c)=>{var u;return((u=window.navigator.clipboard)==null?void 0:u.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})]),!0)},s=(a,c)=>{var u,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(u=n==null?void 0:n.clipboardData)==null||u.setData("text/plain",a),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",c)}catch{l(a,c)||i(a)}};((o=window.navigator.clipboard)==null?void 0:o.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Cu(e){return e!==!0}function ku(e){return typeof e=="string"?e:`${e}px`}const gg=()=>e=>e.innerWidth,mg=()=>e=>e.innerHeight,vg=cn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[gg()],"wmyidgi-1":[mg()]}}),bg=e=>{const{inWidth:t,inHeight:n,children:o,...r}=e;return p.createElement(vg,{innerHeight:ku(n),innerWidth:ku(t),...r},o)},wg=2,yg=1300;function xg(e,t,n){const o=te.useRef(0),[r,i]=e??[0,0];te.useEffect(()=>{if(r===0&&i===0){o.current=0;return}let l=!1,s=0;const a=c=>{var u;if(!l){if(s===0)s=c;else{const d=c-s;o.current=Math.min(1,o.current+d/yg);const f=o.current**1.618*d*wg;(u=t.current)==null||u.scrollBy(r*f,i*f),s=c,n==null||n()}window.requestAnimationFrame(a)}};return window.requestAnimationFrame(a),()=>{l=!0}},[t,r,i,n])}function Cg({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:o,overscrollX:r,overscrollY:i,scaleToRem:l,remSize:s}){const[a,c,u,d,f,h]=te.useMemo(()=>{if(!l||s===16)return[e,t,n,o,r,i];const g=s/16,m=e,b=Wc();return[typeof m=="number"?m*g:y=>Math.ceil(m(y)*g),Math.ceil(t*g),Math.ceil(n*g),{...o,headerIconSize:((o==null?void 0:o.headerIconSize)??b.headerIconSize)*g,cellHorizontalPadding:((o==null?void 0:o.cellHorizontalPadding)??b.cellHorizontalPadding)*g,cellVerticalPadding:((o==null?void 0:o.cellVerticalPadding)??b.cellVerticalPadding)*g},Math.ceil((r??0)*g),Math.ceil((i??0)*g)]},[n,t,r,i,s,e,l,o]);return{rowHeight:a,headerHeight:c,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:h}}const Ro={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 ct(e,t){return e===!0?t:e===!1?"":e}function Su(e){const t=Di.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function kg(e){const t=Pf(e);return te.useMemo(()=>{if(t===void 0)return Su(Ro);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Ro.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Ro.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Ro.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Ro.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Ro.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Ro.selectToLastCell};return Su({...Ro,...n})},[t])}function Sg(e){function t(n,o,r){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:o,path:r};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:o,path:r};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((l,s)=>t(l,o+1,[...r,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),i}return e.map((n,o)=>t(n,0,[o])).sort((n,o)=>n.headerIndex-o.headerIndex)}function ua(e,t){const n=[];function o(l,s,a=!1){let c=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(c=l.subGroups[0].headerIndex-l.headerIndex),c--,n.push({headerIndex:l.headerIndex,contentIndex:-1,skip:a,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:c}),l.subGroups)for(let u=0;u<l.subGroups.length;u++){const d=u<l.subGroups.length-1?l.subGroups[u+1].headerIndex:s;o(l.subGroups[u],d,a||l.isCollapsed)}}const r=Sg(e.groups);for(let l=0;l<r.length;l++){const s=l<r.length-1?r[l+1].headerIndex:null;o(r[l],s)}let i=0;for(const l of n)l.contentIndex=i,i+=l.rows;return n.filter(l=>l.skip===!1).map(l=>{const{skip:s,...a}=l;return a})}function Li(e,t){if(t===void 0||ua.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const o of t){if(n===0)return{path:[...o.path,-1],originalIndex:o.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:o.rows};if(n--,!o.isCollapsed){if(n<o.rows)return{path:[...o.path,n],originalIndex:o.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:o.contentIndex+n,groupRows:o.rows};n-=o.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Mg(e,t,n,o){const r=te.useMemo(()=>e===void 0?void 0:ua(e,t),[e,t]),i=te.useMemo(()=>r===void 0?t:r.reduce((c,u)=>c+(u.isCollapsed?1:u.rows+1),0),[r,t]),l=te.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>{const{isGroupHeader:u}=Li(c,r);return u?e.height:typeof n=="number"?n:n(c)},[r,e,n]),s=te.useCallback(c=>{if(r===void 0)return c;let u=c;for(const d of r){if(u===0)return;if(u--,!d.isCollapsed){if(u<d.rows)return d.contentIndex+u;u-=d.rows}}return c},[r]),a=Ao(o??(e==null?void 0:e.themeOverride),te.useCallback(c=>{if(e===void 0)return o==null?void 0:o(c,c,c);if(o===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:u,contentIndex:d,groupIndex:f}=Li(c,r);return u?e.themeOverride:o==null?void 0:o(c,f,d)},[r,o,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:a}:{rowHeight:l,rows:i,rowNumberMapper:s,getRowThemeOverride:a}}function Rg(e,t){const n=te.useMemo(()=>e===void 0?void 0:ua(e,t),[e,t]);return{getRowGroupingForPath:Ru,updateRowGroupingByPath:Mu,mapper:te.useCallback(o=>{if(typeof o=="number")return Li(o,n);const r=Li(o[1],n);return{...r,originalIndex:[o[0],r.originalIndex]}},[n])}}function Mu(e,t,n){const[o,...r]=t;return r[0]===-1?e.map((i,l)=>l===o?{...i,...n}:i):e.map((i,l)=>l===o?{...i,subGroups:Mu(i.subGroups??[],r,n)}:i)}function Ru(e,t){const[n,...o]=t;return o[0]===-1?e[n]:Ru(e[n].subGroups??[],o)}function Eg(e,t){const[n]=p.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(o){const r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}));return n.callback=t,n.facade}function Ig(e,t,n,o,r){const[i,l]=p.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=p.useMemo(()=>({x:o.current.x,y:i,width:o.current.width??1,height:o.current.height??1,ty:l}),[o,l,i]),[a,c,u]=Lf(s),d=p.useRef(r);d.current=r;const f=Eg(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(a.height??1)>1;p.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&h){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&u(),d.current()}},[t,h,u,f]);const g=(a.width??1)>1;return p.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&g){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&u(),d.current()}},[e,g,u,f]),{visibleRegion:a,setVisibleRegion:c,scrollRef:f}}const Tg=p.lazy(async()=>await vs(()=>import("./data-grid-overlay-editor-DUKLRWRf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));let Og=0;function Dg(e){return Ap(Zc(Zc(e).filter(t=>t.span!==void 0).map(t=>{var n,o;return so((((n=t.span)==null?void 0:n[0])??0)+1,(((o=t.span)==null?void 0:o[1])??0)+1)})))}function Pi(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 Hi={kind:Z.Loading,allowOverlay:!1},Ai={columns:vt.empty(),rows:vt.empty(),current:void 0},zg=(e,t)=>{var n,o,r;const[i,l]=p.useState(Ai),[s,a]=p.useState(),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(),h=p.useRef(),g=typeof window>"u"?null:window,{imageEditorOverride:m,getRowThemeOverride:b,markdownDivCreateNode:y,width:v,height:I,columns:T,rows:k,getCellContent:x,onCellClicked:L,onCellActivated:O,onFillPattern:R,onFinishedEditing:P,coercePasteValue:M,drawHeader:S,drawCell:E,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:X,rangeSelectionColumnSpanning:B=!0,spanRangeBehavior:J="default",onGroupHeaderClicked:ae,onCellContextMenu:ne,className:U,onHeaderContextMenu:re,getCellsForSelection:se,onGroupHeaderContextMenu:de,onGroupHeaderRenamed:fe,onCellEdited:Q,onCellsEdited:N,onSearchResultsChanged:z,searchResults:j,onSearchValueChange:ge,searchValue:ke,onKeyDown:Fe,onKeyUp:xe,keybindings:De,editOnType:_e=!0,onRowAppended:et,onColumnMoved:Pt,validateCell:Mt,highlightRegions:we,rangeSelect:be="rect",columnSelect:me="multi",rowSelect:ie="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:Ie="exclusive",rowSelectionBlending:je="exclusive",onDelete:tt,onDragStart:Rt,onMouseMove:ce,onPaste:it,copyHeaders:at=!1,freezeColumns:Re=0,cellActivationBehavior:Tt="second-click",rowSelectionMode:Xt="auto",onHeaderMenuClick:Ne,onHeaderIndicatorClick:nt,getGroupDetails:kt,rowGrouping:Et,onSearchClose:qt,onItemHovered:un,onSelectionCleared:an,showSearch:Bt,onVisibleRegionChanged:wt,gridSelection:Ot,onGridSelectionChange:In,minColumnWidth:Cn=50,maxColumnWidth:ot=500,maxColumnAutoWidth:sn,provideEditor:bn,trailingRowOptions:yt,freezeTrailingRows:Zt=0,allowedFillDirections:ut="orthogonal",scrollOffsetX:Vt,scrollOffsetY:$t,verticalBorder:rn,onDragOverCell:Ft,onDrop:Jt,onColumnResize:Ue,onColumnResizeEnd:Ht,onColumnResizeStart:kn,customRenderers:At,fillHandle:Wt,experimental:jt,fixedShadowX:oo,fixedShadowY:jn,headerIcons:_,imageWindowLoader:qe,initialSize:Je,isDraggable:pe,onDragLeave:rt,onRowMoved:Dt,overscrollX:dn,overscrollY:en,preventDiagonalScrolling:tn,rightElement:Sn,rightElementProps:wn,trapFocus:ho=!1,smoothScrollX:ro,smoothScrollY:Ga,scaleToRem:Ka=!1,rowHeight:sr=34,headerHeight:fo=36,groupHeaderHeight:qa=fo,theme:Za,isOutsideClick:nl,renderers:cr,resizeIndicator:ur,scrollToActiveCell:ti=!0,drawFocusRing:dr=!0}=e,ni=dr==="no-editor"?s===void 0:dr,gn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,hn=(gn==null?void 0:gn.kind)??e.rowMarkers??"none",Io=(gn==null?void 0:gn.width)??e.rowMarkerWidth,hr=(gn==null?void 0:gn.startIndex)??e.rowMarkerStartIndex??1,To=(gn==null?void 0:gn.theme)??e.rowMarkerTheme,fr=gn==null?void 0:gn.headerTheme,oi=gn==null?void 0:gn.headerAlwaysVisible,ri=ie!=="multi",Uo=(gn==null?void 0:gn.checkboxStyle)??"square",Oo=Math.max(Cn,20),pr=Math.max(ot,Oo),ol=Math.max(sn??pr,Oo),ii=p.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ye,rowNumberMapper:li,rowHeight:Ja,getRowThemeOverride:po}=Mg(Et,k,sr,b),Qa=p.useMemo(()=>Number.parseFloat(ii.fontSize),[ii]),{rowHeight:io,headerHeight:ai,groupHeaderHeight:gr,theme:rl,overscrollX:es,overscrollY:ts}=Cg({groupHeaderHeight:qa,headerHeight:fo,overscrollX:dn,overscrollY:en,remSize:Qa,rowHeight:Ja,scaleToRem:Ka,theme:Za}),lo=kg(De),go=Io??(k>1e4?48:k>1e3?44:k>100?36:32),Mn=hn!=="none",W=Mn?1:0,Gt=et!==void 0,Yo=(yt==null?void 0:yt.sticky)===!0,[mr,il]=p.useState(!1),vr=Bt??mr,ns=p.useCallback(()=>{qt!==void 0?qt():il(!1)},[qt]),K=p.useMemo(()=>Ot===void 0?void 0:Pi(Ot,W),[Ot,W])??i,F=p.useRef();F.current===void 0&&(F.current=new AbortController),p.useEffect(()=>()=>F==null?void 0:F.current.abort(),[]);const[ee,Te]=lg(se,x,W,F.current,Ye),Se=p.useCallback((w,H,$)=>{if(Mt===void 0)return!0;const G=[w[0]-W,w[1]];return Mt==null?void 0:Mt(G,H,$)},[W,Mt]),Pe=p.useRef(Ot),he=p.useCallback((w,H)=>{H&&(w=fg(w,ee,W,J,F.current)),In!==void 0?(Pe.current=Pi(w,-W),In(Pe.current)):l(w)},[In,ee,W,J]),Le=Ao(Ue,p.useCallback((w,H,$,G)=>{Ue==null||Ue(T[$-W],H,$-W,G)},[Ue,W,T])),lt=Ao(Ht,p.useCallback((w,H,$,G)=>{Ht==null||Ht(T[$-W],H,$-W,G)},[Ht,W,T])),xt=Ao(kn,p.useCallback((w,H,$,G)=>{kn==null||kn(T[$-W],H,$-W,G)},[kn,W,T])),zt=Ao(S,p.useCallback((w,H)=>(S==null?void 0:S({...w,columnIndex:w.columnIndex-W},H))??!1,[S,W])),ye=Ao(E,p.useCallback((w,H)=>(E==null?void 0:E({...w,col:w.col-W},H))??!1,[E,W])),ft=p.useCallback(w=>{if(tt!==void 0){const H=tt(Pi(w,-W));return typeof H=="boolean"?H:Pi(H,W)}return!0},[tt,W]),[Ze,Ge,pt]=ig(K,he,Ee,Ie,je,be,B),_t=p.useMemo(()=>co(Wc(),rl),[rl]),[nn,Un]=p.useState([0,0,0]),Yn=p.useMemo(()=>{if(cr===void 0)return{};const w={};for(const H of cr)w[H.kind]=H;return w},[cr]),Kt=p.useCallback(w=>w.kind!==Z.Custom?Yn[w.kind]:At==null?void 0:At.find(H=>H.isMatch(w)),[At,Yn]);let{sizedColumns:dt,nonGrowWidth:Tn}=Ep(T,Ye,Te,nn[0]-(W===0?0:go)-nn[2],Oo,ol,_t,Kt,F.current);hn!=="none"&&(Tn+=go);const On=p.useMemo(()=>dt.some(w=>w.group!==void 0),[dt]),Xn=On?ai+gr:ai,Gn=K.rows.length,br=hn==="none"?void 0:Gn===0?!1:Gn===Ye?!0:void 0,Ct=p.useMemo(()=>hn==="none"?dt:[{title:"",width:go,icon:void 0,hasMenu:!1,style:"normal",themeOverride:To,rowMarker:Uo,rowMarkerChecked:br,headerRowMarkerTheme:fr,headerRowMarkerAlwaysVisible:oi,headerRowMarkerDisabled:ri},...dt],[hn,dt,go,To,Uo,br,fr,oi,ri]),Hn=p.useRef({height:1,width:1,x:0,y:0}),ll=p.useRef(!1),{setVisibleRegion:wh,visibleRegion:Xo,scrollRef:Qt}=Ig(Vt,$t,io,Hn,()=>ll.current=!0);Hn.current=Xo;const ly=Xo.x+W,al=Xo.y,Dn=p.useRef(null),Rn=p.useCallback(w=>{var H;w===!0?(H=Dn.current)==null||H.focus():window.requestAnimationFrame(()=>{var $;($=Dn.current)==null||$.focus()})},[]),yn=Gt?Ye+1:Ye,Bn=p.useCallback(w=>{const H=W===0?w:w.map(G=>({...G,location:[G.location[0]-W,G.location[1]]})),$=N==null?void 0:N(H);if($!==!0)for(const G of H)Q==null||Q(G.location,G.value);return $},[Q,N,W]),[Go,os]=p.useState(),sl=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,cl=ni?(n=K.current)==null?void 0:n.cell:void 0,ul=cl==null?void 0:cl[0],dl=cl==null?void 0:cl[1],ay=p.useMemo(()=>{if((we===void 0||we.length===0)&&(sl??ul??dl??Go)===void 0)return;const w=[];if(we!==void 0)for(const H of we){const $=Ct.length-H.range.x-W;$>0&&w.push({color:H.color,range:{...H.range,x:H.range.x+W,width:Math.min($,H.range.width)},style:H.style})}return Go!==void 0&&w.push({color:Bo(_t.accentColor,0),range:Go,style:"dashed"}),sl!==void 0&&w.push({color:Bo(_t.accentColor,.5),range:sl,style:"solid-outline"}),ul!==void 0&&dl!==void 0&&w.push({color:_t.accentColor,range:{x:ul,y:dl,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Go,sl,ul,dl,we,Ct.length,_t.accentColor,W]),yh=p.useRef(Ct);yh.current=Ct;const An=p.useCallback(([w,H],$=!1)=>{var G,A,ue,oe,q,V,Y;const le=Gt&&H===yn-1;if(w===0&&Mn){if(le)return Hi;const Ce=li(H);return Ce===void 0?Hi:{kind:Fn.Marker,allowOverlay:!1,checkboxStyle:Uo,checked:(K==null?void 0:K.rows.hasIndex(H))===!0,markerKind:hn==="clickable-number"?"number":hn,row:hr+Ce,drawHandle:Dt!==void 0,cursor:hn==="clickable-number"?"pointer":void 0}}else if(le){const Ce=w===W?(yt==null?void 0:yt.hint)??"":"",ve=yh.current[w];if(((G=ve==null?void 0:ve.trailingRowOptions)==null?void 0:G.disabled)===!0)return Hi;{const ze=((A=ve==null?void 0:ve.trailingRowOptions)==null?void 0:A.hint)??Ce,Qe=((ue=ve==null?void 0:ve.trailingRowOptions)==null?void 0:ue.addIcon)??(yt==null?void 0:yt.addIcon);return{kind:Fn.NewRow,hint:ze,allowOverlay:!1,icon:Qe}}}else{const Ce=w-W;if($||(jt==null?void 0:jt.strict)===!0){const ze=Hn.current,Qe=ze.x>Ce||Ce>ze.x+ze.width||ze.y>H||H>ze.y+ze.height||H>=is.current,gt=Ce===((q=(oe=ze.extras)==null?void 0:oe.selected)==null?void 0:q[0])&&H===((V=ze.extras)==null?void 0:V.selected[1]);let Be=!1;if(((Y=ze.extras)==null?void 0:Y.freezeRegions)!==void 0){for(const He of ze.extras.freezeRegions)if(Wo(He,Ce,H)){Be=!0;break}}if(Qe&&!gt&&!Be)return Hi}let ve=x([Ce,H]);return W!==0&&ve.span!==void 0&&(ve={...ve,span:[ve.span[0]+W,ve.span[1]+W]}),ve}},[Gt,yn,Mn,li,Uo,K==null?void 0:K.rows,hn,hr,Dt,W,yt==null?void 0:yt.hint,yt==null?void 0:yt.addIcon,jt==null?void 0:jt.strict,x]),rs=p.useCallback(w=>{let H=(kt==null?void 0:kt(w))??{name:w};return fe!==void 0&&w!==""&&(H={icon:H.icon,name:H.name,overrideTheme:H.overrideTheme,actions:[...H.actions??[],{title:"Rename",icon:"renameIcon",onClick:$=>as({group:H.name,bounds:$.bounds})}]}),H},[kt,fe]),hl=p.useCallback(w=>{var H;const[$,G]=w.cell,A=Ct[$],ue=(A==null?void 0:A.group)!==void 0?(H=rs(A.group))==null?void 0:H.overrideTheme:void 0,oe=A==null?void 0:A.themeOverride,q=po==null?void 0:po(G);a({...w,theme:co(_t,ue,oe,q,w.content.themeOverride)})},[po,Ct,rs,_t]),wr=p.useCallback((w,H,$)=>{var G;if(K.current===void 0)return;const[A,ue]=K.current.cell,oe=An([A,ue]);if(oe.kind!==Z.Boolean&&oe.allowOverlay){let q=oe;if($!==void 0)switch(q.kind){case Z.Number:{const V=nf(()=>$==="-"?-0:Number.parseFloat($),0);q={...q,data:Number.isNaN(V)?0:V};break}case Z.Text:case Z.Markdown:case Z.Uri:q={...q,data:$};break}hl({target:w,content:q,initialValue:$,cell:[A,ue],highlight:$===void 0,forceEditMode:$!==void 0})}else oe.kind===Z.Boolean&&H&&oe.readonly!==!0&&(Bn([{location:K.current.cell,value:{...oe,data:Cu(oe.data)}}]),(G=Dn.current)==null||G.damage([{cell:K.current.cell}]))},[An,K,Bn,hl]),xh=p.useCallback((w,H)=>{var $;const G=($=Dn.current)==null?void 0:$.getBounds(w,H);if(G===void 0||Qt.current===null)return;const A=An([w,H]);A.allowOverlay&&hl({target:G,content:A,initialValue:void 0,highlight:!0,cell:[w,H],forceEditMode:!0})},[An,Qt,hl]),ln=p.useCallback((w,H,$="both",G=0,A=0,ue=void 0)=>{if(Qt.current!==null){const oe=Dn.current,q=u.current,V=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,Y=typeof H!="number"?H.unit==="cell"?H.amount:void 0:H,le=typeof w!="number"&&w.unit==="px"?w.amount:void 0,Ce=typeof H!="number"&&H.unit==="px"?H.amount:void 0;if(oe!==null&&q!==null){let ve={x:0,y:0,width:0,height:0},ze=0,Qe=0;if((V!==void 0||Y!==void 0)&&(ve=oe.getBounds((V??0)+W,Y??0)??ve,ve.width===0||ve.height===0))return;const gt=q.getBoundingClientRect(),Be=gt.width/q.offsetWidth;if(le!==void 0&&(ve={...ve,x:le-gt.left-Qt.current.scrollLeft,width:1}),Ce!==void 0&&(ve={...ve,y:Ce+gt.top-Qt.current.scrollTop,height:1}),ve!==void 0){const He={x:ve.x-G,y:ve.y-A,width:ve.width+2*G,height:ve.height+2*A};let St=0;for(let ps=0;ps<Re;ps++)St+=dt[ps].width;let mn=0;const fn=Zt+(Yo?1:0);fn>0&&(mn=Vo(yn,fn,io));let Jn=St*Be+gt.left+W*go*Be,ao=gt.right,Qn=gt.top+Xn*Be,mo=gt.bottom-mn*Be;const wl=ve.width+G*2;switch(ue==null?void 0:ue.hAlign){case"start":ao=Jn+wl;break;case"end":Jn=ao-wl;break;case"center":Jn=Math.floor((Jn+ao)/2)-wl/2,ao=Jn+wl;break}const yl=ve.height+A*2;switch(ue==null?void 0:ue.vAlign){case"start":mo=Qn+yl;break;case"end":Qn=mo-yl;break;case"center":Qn=Math.floor((Qn+mo)/2)-yl/2,mo=Qn+yl;break}Jn>He.x?ze=He.x-Jn:ao<He.x+He.width&&(ze=He.x+He.width-ao),Qn>He.y?Qe=He.y-Qn:mo<He.y+He.height&&(Qe=He.y+He.height-mo),$==="vertical"||typeof w=="number"&&w<Re?ze=0:($==="horizontal"||typeof H=="number"&&H>=yn-fn)&&(Qe=0),(ze!==0||Qe!==0)&&(Be!==1&&(ze/=Be,Qe/=Be),Qt.current.scrollTo(ze+Qt.current.scrollLeft,Qe+Qt.current.scrollTop))}}}},[W,Zt,go,Qt,Xn,Re,dt,yn,Yo,io]),Ch=p.useRef(xh),kh=p.useRef(x),is=p.useRef(Ye);Ch.current=xh,kh.current=x,is.current=Ye;const yr=p.useCallback(async(w,H=!0)=>{var $;const G=Ct[w];if((($=G==null?void 0:G.trailingRowOptions)==null?void 0:$.disabled)===!0)return;const A=et==null?void 0:et();let ue,oe=!0;A!==void 0&&(ue=await A,ue==="top"&&(oe=!1),typeof ue=="number"&&(oe=!1));let q=0;const V=()=>{if(is.current<=Ye){q<500&&window.setTimeout(V,q),q=50+q*2;return}const Y=typeof ue=="number"?ue:oe?Ye:0;bl.current(w-W,Y),Ze({cell:[w,Y],range:{x:w,y:Y,width:1,height:1}},!1,!1,"edit");const le=kh.current([w-W,Y]);le.allowOverlay&&Er(le)&&le.readonly!==!0&&H&&window.setTimeout(()=>{Ch.current(w,Y)},0)};V()},[Ct,et,W,Ye,Ze]),fl=p.useCallback(w=>{var H,$;const G=(($=(H=dt[w])==null?void 0:H.trailingRowOptions)==null?void 0:$.targetColumn)??(yt==null?void 0:yt.targetColumn);if(typeof G=="number")return G+(Mn?1:0);if(typeof G=="object"){const A=T.indexOf(G);if(A>=0)return A+(Mn?1:0)}},[dt,T,Mn,yt==null?void 0:yt.targetColumn]),Do=p.useRef(),xr=p.useRef(),si=p.useCallback((w,H)=>{var $;const[G,A]=H;return co(_t,($=Ct[G])==null?void 0:$.themeOverride,po==null?void 0:po(A),w.themeOverride)},[po,Ct,_t]),{mapper:Ko}=Rg(Et,k),Kn=Et==null?void 0:Et.navigationBehavior,ci=p.useCallback(w=>{var H,$,G;const A=Di.value?w.metaKey:w.ctrlKey,ue=A&&ie==="multi",oe=A&&me==="multi",[q,V]=w.location,Y=K.columns,le=K.rows,[Ce,ve]=((H=K.current)==null?void 0:H.cell)??[];if(w.kind==="cell"){if(xr.current=void 0,qo.current=[q,V],q===0&&Mn){if(Gt===!0&&V===Ye||hn==="number"||ie==="none")return;const ze=An(w.location);if(ze.kind!==Fn.Marker)return;if(Dt!==void 0){const Be=Kt(ze);zn((Be==null?void 0:Be.kind)===Fn.Marker);const He=($=Be==null?void 0:Be.onClick)==null?void 0:$.call(Be,{...w,cell:ze,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:si(ze,w.location),preventDefault:()=>{}});if(He===void 0||He.checked===ze.checked)return}a(void 0),Rn();const Qe=le.hasIndex(V),gt=Do.current;if(ie==="multi"&&(w.shiftKey||w.isLongTouch===!0)&>!==void 0&&le.hasIndex(gt)){const Be=[Math.min(gt,V),Math.max(gt,V)+1];ue||Xt==="multi"?Ge(void 0,Be,!0):Ge(vt.fromSingleSelection(Be),void 0,ue)}else ie==="multi"&&(ue||w.isTouch||Xt==="multi")?Qe?Ge(le.remove(V),void 0,!0):(Ge(void 0,V,!0),Do.current=V):Qe&&le.length===1?Ge(vt.empty(),void 0,A):(Ge(vt.fromSingleSelection(V),void 0,A),Do.current=V)}else if(q>=W&&Gt&&V===Ye){const ze=fl(q);yr(ze??q)}else if(Ce!==q||ve!==V){const ze=An(w.location),Qe=Kt(ze);if((Qe==null?void 0:Qe.onSelect)!==void 0){let He=!1;if(Qe.onSelect({...w,cell:ze,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>He=!0,theme:si(ze,w.location)}),He)return}if(Kn==="block"&&Ko(V).isGroupHeader)return;const gt=Yo&&V===Ye,Be=Yo&&K!==void 0&&((G=K.current)==null?void 0:G.cell[1])===Ye;if((w.shiftKey||w.isLongTouch===!0)&&Ce!==void 0&&ve!==void 0&&K.current!==void 0&&!Be){if(gt)return;const He=Math.min(q,Ce),St=Math.max(q,Ce),mn=Math.min(V,ve),fn=Math.max(V,ve);Ze({...K.current,range:{x:He,y:mn,width:St-He+1,height:fn-mn+1}},!0,A,"click"),Do.current=void 0,Rn()}else Ze({cell:[q,V],range:{x:q,y:V,width:1,height:1}},!0,A,"click"),Do.current=void 0,a(void 0),Rn()}}else if(w.kind==="header")if(qo.current=[q,V],a(void 0),Mn&&q===0)Do.current=void 0,xr.current=void 0,ie==="multi"&&(le.length!==Ye?Ge(vt.fromSingleSelection([0,Ye]),void 0,A):Ge(vt.empty(),void 0,A),Rn());else{const ze=xr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&ze!==void 0&&Y.hasIndex(ze)){const Qe=[Math.min(ze,q),Math.max(ze,q)+1];oe?pt(void 0,Qe,A):pt(vt.fromSingleSelection(Qe),void 0,A)}else oe?(Y.hasIndex(q)?pt(Y.remove(q),void 0,A):pt(void 0,q,A),xr.current=q):me!=="none"&&(pt(vt.fromSingleSelection(q),void 0,A),xr.current=q);Do.current=void 0,Rn()}else w.kind===Nn?qo.current=[q,V]:w.kind===zi&&!w.isMaybeScrollbar&&(he(Ai,!1),a(void 0),Rn(),an==null||an(),Do.current=void 0,xr.current=void 0)},[ie,me,K,Mn,W,Gt,Ye,hn,An,Dt,Rn,Xt,Kt,si,Ge,fl,yr,Kn,Ko,Yo,Ze,pt,he,an]),ui=p.useRef(!1),qo=p.useRef(),Sh=p.useRef(Xo),qn=p.useRef(),sy=p.useCallback(w=>{if(Cr.current=!1,Sh.current=Hn.current,w.button!==0&&w.button!==1){qn.current=void 0;return}const H=performance.now();qn.current={button:w.button,time:H,location:w.location},(w==null?void 0:w.kind)==="header"&&(ui.current=!0);const $=w.kind==="cell"&&w.isFillHandle;!$&&w.kind!=="cell"&&w.isEdge||(f({previousSelection:K,fillHandle:$}),qo.current=void 0,!w.isTouch&&w.button===0&&!$?ci(w):!w.isTouch&&w.button===1&&(qo.current=w.location))},[K,ci]),[ls,as]=p.useState(),Mh=p.useCallback(w=>{if(w.kind!==Nn||me!=="multi")return;const H=Di.value?w.metaKey:w.ctrlKey,[$]=w.location,G=K.columns;if($<W)return;const A=Ct[$];let ue=$,oe=$;for(let q=$-1;q>=W&&Fr(A.group,Ct[q].group);q--)ue--;for(let q=$+1;q<Ct.length&&Fr(A.group,Ct[q].group);q++)oe++;if(Rn(),H)if(G.hasAll([ue,oe+1])){let q=G;for(let V=ue;V<=oe;V++)q=q.remove(V);pt(q,void 0,H)}else pt(void 0,[ue,oe+1],H);else pt(vt.fromSingleSelection([ue,oe+1]),void 0,H)},[me,Rn,K.columns,Ct,W,pt]),Cr=p.useRef(!1),pl=p.useCallback(async w=>{if(ee!==void 0&&Le!==void 0){const H=Hn.current.y,$=Hn.current.height;let G=ee({x:w,y:H,width:1,height:Math.min($,Ye-H)},F.current.signal);typeof G!="object"&&(G=await G());const A=dt[w-W],ue=document.createElement("canvas").getContext("2d",{alpha:!1});if(ue!==null){ue.font=_t.baseFontFull;const oe=jc(ue,_t,A,0,G,Oo,pr,!1,Kt);Le==null||Le(A,oe.width,w,oe.width)}}},[dt,ee,pr,_t,Oo,Le,W,Ye,Kt]),[cy,ss]=p.useState(),kr=p.useCallback(async(w,H)=>{var $,G;const A=($=w.current)==null?void 0:$.range;if(A===void 0||ee===void 0||H.current===void 0)return;const ue=H.current.range;if(R!==void 0){let Y=!1;if(R({fillDestination:{...ue,x:ue.x-W},patternSource:{...A,x:A.x-W},preventDefault:()=>Y=!0}),Y)return}let oe=ee(A,F.current.signal);typeof oe!="object"&&(oe=await oe());const q=oe,V=[];for(let Y=0;Y<ue.width;Y++)for(let le=0;le<ue.height;le++){const Ce=[ue.x+Y,ue.y+le];if(Oc(Ce,A))continue;const ve=q[le%A.height][Y%A.width];Po(ve)||!Er(ve)||V.push({location:Ce,value:{...ve}})}Bn(V),(G=Dn.current)==null||G.damage(V.map(Y=>({cell:Y.location})))},[ee,Bn,R,W]),Rh=p.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,width:1}}};kr(w,K)},[kr,K]),Eh=p.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,height:1}}};kr(w,K)},[kr,K]),uy=p.useCallback((w,H)=>{var $,G;const A=d;if(f(void 0),os(void 0),ss(void 0),ui.current=!1,H)return;if((A==null?void 0:A.fillHandle)===!0&&K.current!==void 0&&(($=A.previousSelection)==null?void 0:$.current)!==void 0){if(Go===void 0)return;const ve={...K,current:{...K.current,range:nu(A.previousSelection.current.range,Go)}};kr(A.previousSelection,ve),he(ve,!0);return}const[ue,oe]=w.location,[q,V]=qo.current??[],Y=()=>{Cr.current=!0},le=ve=>{var ze,Qe,gt;const Be=ve.isTouch||q===ue&&V===oe;if(Be&&(L==null||L([ue-W,oe],{...ve,preventDefault:Y})),ve.button===1)return!Cr.current;if(!Cr.current){const He=An(w.location),St=Kt(He);if(St!==void 0&&St.onClick!==void 0&&Be){const fn=St.onClick({...ve,cell:He,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:si(He,w.location),preventDefault:Y});fn!==void 0&&!Po(fn)&&Ho(fn)&&(Bn([{location:ve.location,value:fn}]),(ze=Dn.current)==null||ze.damage([{cell:ve.location}]))}if(Cr.current||K.current===void 0)return!1;let mn=!1;switch(He.activationBehaviorOverride??Tt){case"double-click":case"second-click":{if(((gt=(Qe=A==null?void 0:A.previousSelection)==null?void 0:Qe.current)==null?void 0:gt.cell)===void 0)break;const[fn,Jn]=K.current.cell,[ao,Qn]=A.previousSelection.current.cell;mn=ue===fn&&ue===ao&&oe===Jn&&oe===Qn&&(ve.isDoubleClick===!0||Tt==="second-click");break}case"single-click":{mn=!0;break}}if(mn)return O==null||O([ue-W,oe]),wr(ve.bounds,!1),!0}return!1},Ce=w.location[0]-W;if(w.isTouch){const ve=Hn.current,ze=Sh.current;if(ve.x!==ze.x||ve.y!==ze.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&_r((G=K.current)==null?void 0:G.cell,w.location)){ne==null||ne([Ce,w.location[1]],{...w,preventDefault:Y});return}else if(w.kind==="header"&&K.columns.hasIndex(ue)){re==null||re(Ce,{...w,preventDefault:Y});return}else if(w.kind===Nn){if(Ce<0)return;de==null||de(Ce,{...w,preventDefault:Y});return}}w.kind==="cell"?le(w)||ci(w):w.kind===Nn?ae==null||ae(Ce,{...w,preventDefault:Y}):(w.kind===Mo&&(C==null||C(Ce,{...w,preventDefault:Y})),ci(w));return}if(w.kind==="header"){if(Ce<0)return;w.isEdge?w.isDoubleClick===!0&&pl(ue):w.button===0&&ue===q&&oe===V&&(C==null||C(Ce,{...w,preventDefault:Y}))}if(w.kind===Nn){if(Ce<0)return;w.button===0&&ue===q&&oe===V&&(ae==null||ae(Ce,{...w,preventDefault:Y}),Cr.current||Mh(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&le(w),qo.current=void 0},[d,K,W,Go,kr,he,L,An,Kt,Tt,si,Bn,O,wr,ne,re,de,ci,ae,C,pl,Mh]),dy=p.useCallback(w=>{const H={...w,location:[w.location[0]-W,w.location[1]]};ce==null||ce(H),d!==void 0&&w.buttons===0&&(f(void 0),os(void 0),ss(void 0),ui.current=!1),ss($=>{var G;return ui.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===($==null?void 0:$[0])&&w.scrollEdge[1]===$[1]?$:d===void 0||(((G=qn.current)==null?void 0:G.location[0])??0)<W?void 0:w.scrollEdge})},[d,ce,W]),hy=p.useCallback((w,H)=>{Ne==null||Ne(w-W,H)},[Ne,W]),fy=p.useCallback((w,H)=>{nt==null||nt(w-W,H)},[nt,W]),zo=(o=K==null?void 0:K.current)==null?void 0:o.cell,py=p.useCallback((w,H,$,G,A,ue)=>{ll.current=!1;let oe=zo;oe!==void 0&&(oe=[oe[0]-W,oe[1]]);const q=Re===0?void 0:{x:0,y:w.y,width:Re,height:w.height},V=[];q!==void 0&&V.push(q),Zt>0&&(V.push({x:w.x-W,y:Ye-Zt,width:w.width,height:Zt}),Re>0&&V.push({x:0,y:Ye-Zt,width:Re,height:Zt}));const Y={x:w.x-W,y:w.y,width:w.width,height:Gt&&w.y+w.height>=Ye?w.height-1:w.height,tx:A,ty:ue,extras:{selected:oe,freezeRegion:q,freezeRegions:V}};Hn.current=Y,wh(Y),Un([H,$,G]),wt==null||wt(Y,Y.tx,Y.ty,Y.extras)},[zo,W,Gt,Ye,Re,Zt,wh,wt]),gy=Ao(Pt,p.useCallback((w,H)=>{Pt==null||Pt(w-W,H-W),me!=="none"&&pt(vt.fromSingleSelection(H),void 0,!0)},[me,Pt,W,pt])),cs=p.useRef(!1),my=p.useCallback(w=>{if(w.location[0]===0&&W>0){w.preventDefault();return}Rt==null||Rt({...w,location:[w.location[0]-W,w.location[1]]}),w.defaultPrevented()||(cs.current=!0),f(void 0)},[Rt,W]),vy=p.useCallback(()=>{cs.current=!1},[]),Ih=Et==null?void 0:Et.selectionBehavior,gl=p.useCallback(w=>{if(Ih!=="block-spanning")return;const{isGroupHeader:H,path:$,groupRows:G}=Ko(w);if(H)return[w,w];const A=$[$.length-1],ue=w-A,oe=w+G-A-1;return[ue,oe]},[Ko,Ih]),us=p.useRef(),ds=p.useCallback(w=>{var H,$,G;if(!pu(w,us.current)&&(us.current=w,!(((H=qn==null?void 0:qn.current)==null?void 0:H.button)!==void 0&&qn.current.button>=1))){if(w.buttons!==0&&d!==void 0&&(($=qn.current)==null?void 0:$.location[0])===0&&w.location[0]===0&&W===1&&ie==="multi"&&d.previousSelection&&!d.previousSelection.rows.hasIndex(qn.current.location[1])&&K.rows.hasIndex(qn.current.location[1])){const A=Math.min(qn.current.location[1],w.location[1]),ue=Math.max(qn.current.location[1],w.location[1])+1;Ge(vt.fromSingleSelection([A,ue]),void 0,!1)}if(w.buttons!==0&&d!==void 0&&K.current!==void 0&&!cs.current&&!ui.current&&(be==="rect"||be==="multi-rect")){const[A,ue]=K.current.cell;let[oe,q]=w.location;if(q<0&&(q=Hn.current.y),d.fillHandle===!0&&((G=d.previousSelection)==null?void 0:G.current)!==void 0){const V=d.previousSelection.current.range;q=Math.min(q,Gt?Ye-1:Ye);const Y=g0(V,oe,q,ut);os(Y)}else{if(Gt&&ue===Ye)return;if(Gt&&q===Ye)if(w.kind===zi)q--;else return;oe=Math.max(oe,W);const V=gl(ue);q=V===void 0?q:_n(q,V[0],V[1]);const Y=oe-A,le=q-ue,Ce={x:Y>=0?A:oe,y:le>=0?ue:q,width:Math.abs(Y)+1,height:Math.abs(le)+1};Ze({...K.current,range:Ce},!0,!1,"drag")}}un==null||un({...w,location:[w.location[0]-W,w.location[1]]})}},[d,W,ie,K,be,un,Ge,Gt,Ye,ut,gl,Ze]),by=p.useCallback(()=>{var w,H;const $=us.current;if($===void 0)return;const[G,A]=$.scrollEdge;let[ue,oe]=$.location;const q=Hn.current;G===-1?ue=((H=(w=q.extras)==null?void 0:w.freezeRegion)==null?void 0:H.x)??q.x:G===1&&(ue=q.x+q.width),A===-1?oe=Math.max(0,q.y):A===1&&(oe=Math.min(Ye-1,q.y+q.height)),ue=_n(ue,0,Ct.length-1),oe=_n(oe,0,Ye-1),ds({...$,location:[ue,oe]})},[Ct.length,ds,Ye]);xg(cy,Qt,by);const Zn=p.useCallback(w=>{if(K.current===void 0)return;const[H,$]=w,[G,A]=K.current.cell,ue=K.current.range;let oe=ue.x,q=ue.x+ue.width,V=ue.y,Y=ue.y+ue.height;const[le,Ce]=gl(A)??[0,Ye-1],ve=Ce+1;if($!==0)switch($){case 2:{Y=ve,V=A,ln(0,Y,"vertical");break}case-2:{V=le,Y=A+1,ln(0,V,"vertical");break}case 1:{V<A?(V++,ln(0,V,"vertical")):(Y=Math.min(ve,Y+1),ln(0,Y,"vertical"));break}case-1:{Y>A+1?(Y--,ln(0,Y,"vertical")):(V=Math.max(le,V-1),ln(0,V,"vertical"));break}default:Rr()}if(H!==0)if(H===2)q=Ct.length,oe=G,ln(q-1-W,0,"horizontal");else if(H===-2)oe=W,q=G+1,ln(oe-W,0,"horizontal");else{let ze=[];if(ee!==void 0){const Qe=ee({x:oe,y:V,width:q-oe-W,height:Y-V},F.current.signal);typeof Qe=="object"&&(ze=Dg(Qe))}if(H===1){let Qe=!1;if(oe<G){if(ze.length>0){const gt=so(oe+1,G+1).find(Be=>!ze.includes(Be-W));gt!==void 0&&(oe=gt,Qe=!0)}else oe++,Qe=!0;Qe&&ln(oe,0,"horizontal")}Qe||(q=Math.min(Ct.length,q+1),ln(q-1-W,0,"horizontal"))}else if(H===-1){let Qe=!1;if(q>G+1){if(ze.length>0){const gt=so(q-1,G,-1).find(Be=>!ze.includes(Be-W));gt!==void 0&&(q=gt,Qe=!0)}else q--,Qe=!0;Qe&&ln(q-W,0,"horizontal")}Qe||(oe=Math.max(W,oe-1),ln(oe-W,0,"horizontal"))}else Rr()}Ze({cell:K.current.cell,range:{x:oe,y:V,width:q-oe,height:Y-V}},!0,!1,"keyboard-select")},[ee,gl,K,Ct.length,W,Ye,ln,Ze]),hs=p.useRef(ti);hs.current=ti;const Lo=p.useCallback((w,H,$,G)=>{const A=yn-($?0:1);w=_n(w,W,dt.length-1+W),H=_n(H,0,A);const ue=zo==null?void 0:zo[0],oe=zo==null?void 0:zo[1];if(w===ue&&H===oe)return!1;if(G&&K.current!==void 0){const q=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&q.push(K.current.range),he({...K,current:{cell:[w,H],range:{x:w,y:H,width:1,height:1},rangeStack:q}},!0)}else Ze({cell:[w,H],range:{x:w,y:H,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===w&&h.current[1]===H&&(h.current=void 0),hs.current&&ln(w-W,H),!0},[yn,W,dt.length,zo,K,ln,he,Ze]),wy=p.useCallback((w,H)=>{(s==null?void 0:s.cell)!==void 0&&w!==void 0&&Ho(w)&&(Bn([{location:s.cell,value:w}]),window.requestAnimationFrame(()=>{var A;(A=Dn.current)==null||A.damage([{cell:s.cell}])})),Rn(!0),a(void 0);const[$,G]=H;if(K.current!==void 0&&($!==0||G!==0)){const A=K.current.cell[1]===yn-1&&w!==void 0;Lo(_n(K.current.cell[0]+$,0,Ct.length-1),_n(K.current.cell[1]+G,0,yn-1),A,!1)}P==null||P(w,H)},[s==null?void 0:s.cell,Rn,K,P,Bn,yn,Lo,Ct.length]),yy=p.useMemo(()=>`gdg-overlay-${Og++}`,[]),Zo=p.useCallback(w=>{var H,$,G,A;Rn();const ue=[];for(let oe=w.x;oe<w.x+w.width;oe++)for(let q=w.y;q<w.y+w.height;q++){const V=x([oe-W,q]);if(!V.allowOverlay&&V.kind!==Z.Boolean)continue;let Y;if(V.kind===Z.Custom){const le=Kt(V),Ce=(H=le==null?void 0:le.provideEditor)==null?void 0:H.call(le,V);(le==null?void 0:le.onDelete)!==void 0?Y=le.onDelete(V):Ms(Ce)&&(Y=($=Ce==null?void 0:Ce.deletedValue)==null?void 0:$.call(Ce,V))}else if(Ho(V)&&V.allowOverlay||V.kind===Z.Boolean){const le=Kt(V);Y=(G=le==null?void 0:le.onDelete)==null?void 0:G.call(le,V)}Y!==void 0&&!Po(Y)&&Ho(Y)&&ue.push({location:[oe,q],value:Y})}Bn(ue),(A=Dn.current)==null||A.damage(ue.map(oe=>({cell:oe.location})))},[Rn,x,Kt,Bn,W]),di=s!==void 0,Th=p.useCallback(w=>{var H,$;const G=()=>{w.stopPropagation(),w.preventDefault()},A={didMatch:!1},{bounds:ue}=w,oe=K.columns,q=K.rows,V=lo;if(!di&&st(V.clear,w,A))he(Ai,!1),an==null||an();else if(!di&&st(V.selectAll,w,A))he({columns:vt.empty(),rows:vt.empty(),current:{cell:((H=K.current)==null?void 0:H.cell)??[W,0],range:{x:W,y:0,width:T.length,height:Ye},rangeStack:[]}},!1);else if(st(V.search,w,A))($=c==null?void 0:c.current)==null||$.focus({preventScroll:!0}),il(!0);else if(st(V.delete,w,A)){const Be=(ft==null?void 0:ft(K))??!0;if(Be!==!1){const He=Be===!0?K:Be;if(He.current!==void 0){Zo(He.current.range);for(const St of He.current.rangeStack)Zo(St)}for(const St of He.rows)Zo({x:W,y:St,width:T.length,height:1});for(const St of He.columns)Zo({x:St,y:0,width:1,height:Ye})}}if(A.didMatch)return G(),!0;if(K.current===void 0)return!1;let[Y,le]=K.current.cell;const[,Ce]=K.current.cell;let ve=!1,ze=!1;if(st(V.scrollToSelectedCell,w,A)?bl.current(Y-W,le):me!=="none"&&st(V.selectColumn,w,A)?oe.hasIndex(Y)?pt(oe.remove(Y),void 0,!0):me==="single"?pt(vt.fromSingleSelection(Y),void 0,!0):pt(void 0,Y,!0):ie!=="none"&&st(V.selectRow,w,A)?q.hasIndex(le)?Ge(q.remove(le),void 0,!0):ie==="single"?Ge(vt.fromSingleSelection(le),void 0,!0):Ge(void 0,le,!0):!di&&ue!==void 0&&st(V.activateCell,w,A)?le===Ye&&Gt?window.setTimeout(()=>{const Be=fl(Y);yr(Be??Y)},0):(O==null||O([Y-W,le]),wr(ue,!0)):K.current.range.height>1&&st(V.downFill,w,A)?Eh():K.current.range.width>1&&st(V.rightFill,w,A)?Rh():st(V.goToNextPage,w,A)?le+=Math.max(1,Hn.current.height-4):st(V.goToPreviousPage,w,A)?le-=Math.max(1,Hn.current.height-4):st(V.goToFirstCell,w,A)?(a(void 0),le=0,Y=0):st(V.goToLastCell,w,A)?(a(void 0),le=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):st(V.selectToFirstCell,w,A)?(a(void 0),Zn([-2,-2])):st(V.selectToLastCell,w,A)?(a(void 0),Zn([2,2])):di?(st(V.closeOverlay,w,A)&&a(void 0),st(V.acceptOverlayDown,w,A)&&(a(void 0),le++),st(V.acceptOverlayUp,w,A)&&(a(void 0),le--),st(V.acceptOverlayLeft,w,A)&&(a(void 0),Y--),st(V.acceptOverlayRight,w,A)&&(a(void 0),Y++)):(st(V.goDownCell,w,A)?le+=1:st(V.goUpCell,w,A)?le-=1:st(V.goRightCell,w,A)?Y+=1:st(V.goLeftCell,w,A)?Y-=1:st(V.goDownCellRetainSelection,w,A)?(le+=1,ve=!0):st(V.goUpCellRetainSelection,w,A)?(le-=1,ve=!0):st(V.goRightCellRetainSelection,w,A)?(Y+=1,ve=!0):st(V.goLeftCellRetainSelection,w,A)?(Y-=1,ve=!0):st(V.goToLastRow,w,A)?le=Ye-1:st(V.goToFirstRow,w,A)?le=Number.MIN_SAFE_INTEGER:st(V.goToLastColumn,w,A)?Y=Number.MAX_SAFE_INTEGER:st(V.goToFirstColumn,w,A)?Y=Number.MIN_SAFE_INTEGER:(be==="rect"||be==="multi-rect")&&(st(V.selectGrowDown,w,A)?Zn([0,1]):st(V.selectGrowUp,w,A)?Zn([0,-1]):st(V.selectGrowRight,w,A)?Zn([1,0]):st(V.selectGrowLeft,w,A)?Zn([-1,0]):st(V.selectToLastRow,w,A)?Zn([0,2]):st(V.selectToFirstRow,w,A)?Zn([0,-2]):st(V.selectToLastColumn,w,A)?Zn([2,0]):st(V.selectToFirstColumn,w,A)&&Zn([-2,0])),ze=A.didMatch),Kn!==void 0&&Kn!=="normal"&&le!==Ce){const Be=Kn==="skip-up"||Kn==="skip"||Kn==="block",He=Kn==="skip-down"||Kn==="skip"||Kn==="block",St=le<Ce;if(St&&Be){for(;le>=0&&Ko(le).isGroupHeader;)le--;le<0&&(le=Ce)}else if(!St&&He){for(;le<Ye&&Ko(le).isGroupHeader;)le++;le>=Ye&&(le=Ce)}}const Qe=Lo(Y,le,!1,ve),gt=A.didMatch;return gt&&(Qe||!ze||ho)&&G(),gt},[Kn,di,K,lo,me,ie,be,W,Ko,Ye,Lo,he,an,T.length,ft,ho,Zo,pt,Ge,Gt,fl,yr,O,wr,Eh,Rh,Zn]),hi=p.useCallback(w=>{let H=!1;if(Fe!==void 0&&Fe({...w,cancel:()=>{H=!0}}),H||Th(w)||K.current===void 0)return;const[$,G]=K.current.cell,A=Hn.current;if(_e&&!w.metaKey&&!w.ctrlKey&&K.current!==void 0&&w.key.length===1&&/[ -~]/g.test(w.key)&&w.bounds!==void 0&&Er(x([$-W,Math.max(0,Math.min(G,Ye-1))]))){if((!Gt||G!==Ye)&&(A.y>G||G>A.y+A.height||A.x>$||$>A.x+A.width))return;wr(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[_e,Fe,Th,K,x,W,Ye,Gt,wr]),xy=p.useCallback((w,H)=>{const $=w.location[0]-W;if(w.kind==="header"&&(re==null||re($,{...w,preventDefault:H})),w.kind===Nn){if($<0)return;de==null||de($,{...w,preventDefault:H})}if(w.kind==="cell"){const[G,A]=w.location;ne==null||ne([$,A],{...w,preventDefault:H}),dp(K,w.location)||Lo(G,A,!1,!1)}},[K,ne,de,re,W,Lo]),fs=p.useCallback(async w=>{var H,$,G;if(!lo.paste)return;function A(Y,le,Ce,ve){var ze,Qe;const gt=typeof Ce=="object"?(Ce==null?void 0:Ce.join(`
|
|
173
|
+
`))??"":(Ce==null?void 0:Ce.toString())??"";if(!Po(Y)&&Er(Y)&&Y.readonly!==!0){const Be=M==null?void 0:M(gt,Y);if(Be!==void 0&&Ho(Be))return{location:le,value:Be};const He=Kt(Y);if(He===void 0)return;if(He.kind===Z.Custom){zn(Y.kind===Z.Custom);const St=(ze=He.onPaste)==null?void 0:ze.call(He,gt,Y.data);return St===void 0?void 0:{location:le,value:{...Y,data:St}}}else{const St=(Qe=He.onPaste)==null?void 0:Qe.call(He,gt,Y,{formatted:ve,formattedString:typeof ve=="string"?ve:ve==null?void 0:ve.join(`
|
|
174
|
+
`),rawValue:Ce});return St===void 0?void 0:(zn(St.kind===Y.kind),{location:le,value:St})}}}const ue=K.columns,oe=K.rows,q=((H=Qt.current)==null?void 0:H.contains(document.activeElement))===!0||(($=u.current)==null?void 0:$.contains(document.activeElement))===!0;let V;if(K.current!==void 0?V=[K.current.range.x,K.current.range.y]:ue.length===1?V=[ue.first()??0,0]:oe.length===1&&(V=[W,oe.first()??0]),q&&V!==void 0){let Y,le;const Ce="text/plain",ve="text/html";if(navigator.clipboard.read!==void 0){const Be=await navigator.clipboard.read();for(const He of Be){if(He.types.includes(ve)){const St=await(await He.getType(ve)).text(),mn=wu(St);if(mn!==void 0){Y=mn;break}}He.types.includes(Ce)&&(le=await(await He.getType(Ce)).text())}}else if(navigator.clipboard.readText!==void 0)le=await navigator.clipboard.readText();else if(w!==void 0&&(w==null?void 0:w.clipboardData)!==null){if(w.clipboardData.types.includes(ve)){const Be=w.clipboardData.getData(ve);Y=wu(Be)}Y===void 0&&w.clipboardData.types.includes(Ce)&&(le=w.clipboardData.getData(Ce))}else return;const[ze,Qe]=V,gt=[];do{if(it===void 0){const Be=An(V),He=le??(Y==null?void 0:Y.map(mn=>mn.map(fn=>fn.rawValue).join(" ")).join(" "))??"",St=A(Be,V,He,void 0);St!==void 0&>.push(St);break}if(Y===void 0){if(le===void 0)return;Y=pg(le)}if(it===!1||typeof it=="function"&&(it==null?void 0:it([V[0]-W,V[1]],Y.map(Be=>Be.map(He=>{var St;return((St=He.rawValue)==null?void 0:St.toString())??""}))))!==!0)return;for(const[Be,He]of Y.entries()){if(Be+Qe>=Ye)break;for(const[St,mn]of He.entries()){const fn=[St+ze,Be+Qe],[Jn,ao]=fn;if(Jn>=Ct.length||ao>=yn)continue;const Qn=An(fn),mo=A(Qn,fn,mn.rawValue,mn.formatted);mo!==void 0&>.push(mo)}}}while(!1);Bn(gt),(G=Dn.current)==null||G.damage(gt.map(Be=>({cell:Be.location})))}},[M,Kt,An,K,lo.paste,Qt,Ct.length,Bn,yn,it,W,Ye]);pn("paste",fs,g,!1,!0);const fi=p.useCallback(async(w,H)=>{var $,G;if(!lo.copy)return;const A=H===!0||(($=Qt.current)==null?void 0:$.contains(document.activeElement))===!0||((G=u.current)==null?void 0:G.contains(document.activeElement))===!0,ue=K.columns,oe=K.rows,q=(V,Y)=>{if(!at)xu(V,Y,w);else{const le=Y.map(Ce=>({kind:Z.Text,data:T[Ce].title,displayData:T[Ce].title,allowOverlay:!1}));xu([le,...V],Y,w)}};if(A&&ee!==void 0){if(K.current!==void 0){let V=ee(K.current.range,F.current.signal);typeof V!="object"&&(V=await V()),q(V,so(K.current.range.x-W,K.current.range.x+K.current.range.width-W))}else if(oe!==void 0&&oe.length>0){const V=[...oe].map(Y=>{const le=ee({x:W,y:Y,width:T.length,height:1},F.current.signal);return typeof le=="object"?le[0]:le().then(Ce=>Ce[0])});if(V.some(Y=>Y instanceof Promise)){const Y=await Promise.all(V);q(Y,so(T.length))}else q(V,so(T.length))}else if(ue.length>0){const V=[],Y=[];for(const le of ue){let Ce=ee({x:le,y:0,width:1,height:Ye},F.current.signal);typeof Ce!="object"&&(Ce=await Ce()),V.push(Ce),Y.push(le-W)}if(V.length===1)q(V[0],Y);else{const le=V.reduce((Ce,ve)=>Ce.map((ze,Qe)=>[...ze,...ve[Qe]]));q(le,Y)}}}},[T,ee,K,lo.copy,W,Qt,Ye,at]);pn("copy",fi,g,!1,!1);const Cy=p.useCallback(async w=>{var H,$;if(!(!lo.cut||!(((H=Qt.current)==null?void 0:H.contains(document.activeElement))===!0||(($=u.current)==null?void 0:$.contains(document.activeElement))===!0))&&(await fi(w),K.current!==void 0)){let G={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:vt.empty(),columns:vt.empty()};const A=ft==null?void 0:ft(G);if(A===!1||(G=A===!0?G:A,G.current===void 0))return;Zo(G.current.range)}},[Zo,K,lo.cut,fi,Qt,ft]);pn("cut",Cy,g,!1,!1);const ky=p.useCallback((w,H)=>{if(z!==void 0){W!==0&&(w=w.map(A=>[A[0]-W,A[1]])),z(w,H);return}if(w.length===0||H===-1)return;const[$,G]=w[H];h.current!==void 0&&h.current[0]===$&&h.current[1]===G||(h.current=[$,G],Lo($,G,!1,!1))},[z,W,Lo]),[ml,vl]=((r=Ot==null?void 0:Ot.current)==null?void 0:r.cell)??[],bl=p.useRef(ln);bl.current=ln,p.useLayoutEffect(()=>{var w,H,$,G;hs.current&&!ll.current&&ml!==void 0&&vl!==void 0&&(ml!==((H=(w=Pe.current)==null?void 0:w.current)==null?void 0:H.cell[0])||vl!==((G=($=Pe.current)==null?void 0:$.current)==null?void 0:G.cell[1]))&&bl.current(ml,vl),ll.current=!1},[ml,vl]);const Oh=K.current!==void 0&&(K.current.cell[0]>=Ct.length||K.current.cell[1]>=yn);p.useLayoutEffect(()=>{Oh&&he(Ai,!1)},[Oh,he]);const Sy=p.useMemo(()=>Gt===!0&&(yt==null?void 0:yt.tint)===!0?vt.fromSingleSelection(yn-1):vt.empty(),[yn,Gt,yt==null?void 0:yt.tint]),My=p.useCallback(w=>typeof rn=="boolean"?rn:(rn==null?void 0:rn(w-W))??!0,[W,rn]),Ry=p.useMemo(()=>{if(ls===void 0||u.current===null)return null;const{bounds:w,group:H}=ls,$=u.current.getBoundingClientRect();return p.createElement(og,{bounds:w,group:H,canvasBounds:$,onClose:()=>as(void 0),onFinish:G=>{as(void 0),fe==null||fe(H,G)}})},[fe,ls]),Ey=Math.min(Ct.length,Re+(Mn?1:0));p.useImperativeHandle(t,()=>({appendRow:(w,H)=>yr(w+W,H),updateCells:w=>{var H;return W!==0&&(w=w.map($=>({cell:[$.cell[0]+W,$.cell[1]]}))),(H=Dn.current)==null?void 0:H.damage(w)},getBounds:(w,H)=>{var $;if(!((u==null?void 0:u.current)===null||(Qt==null?void 0:Qt.current)===null)){if(w===void 0&&H===void 0){const G=u.current.getBoundingClientRect(),A=G.width/Qt.current.clientWidth;return{x:G.x-Qt.current.scrollLeft*A,y:G.y-Qt.current.scrollTop*A,width:Qt.current.scrollWidth*A,height:Qt.current.scrollHeight*A}}return($=Dn.current)==null?void 0:$.getBounds((w??0)+W,H)}},focus:()=>{var w;return(w=Dn.current)==null?void 0:w.focus()},emit:async w=>{switch(w){case"delete":hi({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":hi({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":hi({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 fi(void 0,!0);break;case"paste":await fs();break}},scrollTo:ln,remeasureColumns:w=>{for(const H of w)pl(H+W)}}),[yr,pl,Qt,fi,hi,fs,W,ln]);const[Dh,zh]=zo??[],Iy=p.useCallback(w=>{const[H,$]=w;if($===-1){me!=="none"&&(pt(vt.fromSingleSelection(H),void 0,!1),Rn());return}Dh===H&&zh===$||(Ze({cell:w,range:{x:H,y:$,width:1,height:1}},!0,!1,"keyboard-nav"),ln(H,$))},[me,Rn,ln,Dh,zh,Ze,pt]),[Ty,Oy]=p.useState(!1),Lh=p.useRef(ac(w=>{Oy(w)},5)),Dy=p.useCallback(()=>{Lh.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&d===void 0&&Ze({cell:[W,al],range:{x:W,y:al,width:1,height:1}},!0,!1,"keyboard-select")},[al,K,d,W,Ze]),zy=p.useCallback(()=>{Lh.current(!1)},[]),[Ly,Py]=p.useMemo(()=>{let w;const H=(jt==null?void 0:jt.scrollbarWidthOverride)??Bl(),$=Ye+(Gt?1:0);if(typeof io=="number")w=Xn+$*io;else{let A=0;const ue=Math.min($,10);for(let oe=0;oe<ue;oe++)A+=io(oe);A=Math.floor(A/ue),w=Xn+$*A}w+=H;const G=Ct.reduce((A,ue)=>ue.width+A,0)+H;return[`${Math.min(1e5,G)}px`,`${Math.min(1e5,w)}px`]},[Ct,jt==null?void 0:jt.scrollbarWidthOverride,io,Ye,Gt,Xn]),Hy=p.useMemo(()=>Rs(_t),[_t]);return p.createElement(El.Provider,{value:_t},p.createElement(bg,{style:Hy,className:U,inWidth:v??Ly,inHeight:I??Py},p.createElement(eg,{fillHandle:Wt,drawFocusRing:ni,experimental:jt,fixedShadowX:oo,fixedShadowY:jn,getRowThemeOverride:po,headerIcons:_,imageWindowLoader:qe,initialSize:Je,isDraggable:pe,onDragLeave:rt,onRowMoved:Dt,overscrollX:es,overscrollY:ts,preventDiagonalScrolling:tn,rightElement:Sn,rightElementProps:wn,smoothScrollX:ro,smoothScrollY:Ga,className:U,enableGroups:On,onCanvasFocused:Dy,onCanvasBlur:zy,canvasRef:u,onContextMenu:xy,theme:_t,cellXOffset:ly,cellYOffset:al,accessibilityHeight:Xo.height,onDragEnd:vy,columns:Ct,nonGrowWidth:Tn,drawHeader:zt,onColumnProposeMove:X,drawCell:ye,disabledRows:Sy,freezeColumns:Ey,lockColumns:W,firstColAccessible:W===0,getCellContent:An,minColumnWidth:Oo,maxColumnWidth:pr,searchInputRef:c,showSearch:vr,onSearchClose:ns,highlightRegions:ay,getCellsForSelection:ee,getGroupDetails:rs,headerHeight:ai,isFocused:Ty,groupHeaderHeight:On?gr:0,freezeTrailingRows:Zt+(Gt&&(yt==null?void 0:yt.sticky)===!0?1:0),hasAppendRow:Gt,onColumnResize:Le,onColumnResizeEnd:lt,onColumnResizeStart:xt,onCellFocused:Iy,onColumnMoved:gy,onDragStart:my,onHeaderMenuClick:hy,onHeaderIndicatorClick:fy,onItemHovered:ds,isFilling:(d==null?void 0:d.fillHandle)===!0,onMouseMove:dy,onKeyDown:hi,onKeyUp:xe,onMouseDown:sy,onMouseUp:uy,onDragOverCell:Ft,onDrop:Jt,onSearchResultsChanged:ky,onVisibleRegionChanged:py,clientSize:nn,rowHeight:io,searchResults:j,searchValue:ke,onSearchValueChange:ge,rows:yn,scrollRef:Qt,selection:K,translateX:Xo.tx,translateY:Xo.ty,verticalBorder:My,gridRef:Dn,getCellRenderer:Kt,resizeIndicator:ur}),Ry,s!==void 0&&p.createElement(p.Suspense,{fallback:null},p.createElement(Tg,{...s,validateCell:Se,bloom:D,id:yy,getCellRenderer:Kt,className:(jt==null?void 0:jt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:bn,imageEditorOverride:m,onFinishEditing:wy,markdownDivCreateNode:y,isOutsideClick:nl,customEventTarget:jt==null?void 0:jt.eventTarget}))))},Lg=p.forwardRef(zg),Eu=20;function Iu(e){const{cell:t,posX:n,posY:o,bounds:r,theme:i}=e,{width:l,height:s,x:a,y:c}=r,u=t.maxSize??Eu,d=Math.floor(r.y+s/2),f=dc(u,s,i.cellVerticalPadding),h=uc(t.contentAlign??"center",a,l,i.cellHorizontalPadding,f),g=cc(h,d,f),m=hc(a+n,c+o,g);return zl(t)&&m}const Pg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Hg(e,e.cell.data,zl(e.cell),e.cell.maxSize??Eu,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Iu(e)&&e.preventDefault()},onClick:e=>{if(Iu(e))return{...e.cell,data:Cu(e.cell.data)}},onPaste:(e,t)=>{let n=bi;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Dl),n===t.data?void 0:{...t,data:n}}};function Hg(e,t,n,o,r){if(!n&&t===bi)return;const{ctx:i,hoverAmount:l,theme:s,rect:a,highlighted:c,hoverX:u,hoverY:d,cell:{contentAlign:f}}=e,{x:h,y:g,width:m,height:b}=a;let y=!1;if(r>0){let v=n?1-r+r*l:.4;if(t===bi&&(v*=l),v===0)return;v<1&&(y=!0,i.globalAlpha=v)}la(i,s,t,h,g,m,b,c,u,d,o,f),y&&(i.globalAlpha=1)}const Ag=cn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Fg=e=>{const{bubbles:t}=e;return p.createElement(Ag,null,t.map((n,o)=>p.createElement("div",{key:o,className:"boe-bubble"},n)),p.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},_g={getAccessibilityString:e=>fc(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,r)=>e.measureText(r).width+o+20,0)+2*n.cellHorizontalPadding-4,draw:e=>Bg(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return p.createElement(Fg,{bubbles:t.data})},onPaste:()=>{}},Ng=4;function Bg(e,t){const{rect:n,theme:o,ctx:r,highlighted:i}=e,{x:l,y:s,width:a,height:c}=n,u=20,d=8,f=Ng;let h=l+o.cellHorizontalPadding;const g=[];for(const m of t){if(h>l+a)break;const b=$o(m,r,o.baseFontFull).width;g.push({x:h,width:b}),h+=b+d*2+f}r.beginPath();for(const m of g)no(r,m.x,s+(c-u)/2,m.width+d*2,u,o.roundingRadius??u/2);r.fillStyle=i?o.bgBubbleSelected:o.bgBubble,r.fill();for(const[m,b]of g.entries())r.beginPath(),r.fillStyle=o.textBubble,r.fillText(t[m],b.x+d,s+c/2+eo(r,o))}const Vg=cn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),$g=e=>{const{drilldowns:t}=e;return p.createElement(Vg,null,t.map((n,o)=>p.createElement("div",{key:o,className:"doe-bubble"},n.img!==void 0&&p.createElement("img",{src:n.img}),p.createElement("div",null,n.text))))},Wg={getAccessibilityString:e=>fc(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,r)=>e.measureText(r.text).width+o+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Yg(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return p.createElement($g,{drilldowns:t.data})},onPaste:()=>{}},jg=4,da={};function Ug(e,t,n,o){const r=Math.ceil(window.devicePixelRatio),i=5,l=n-i*2,s=4,a=n*r,c=o+i,u=o*3,d=(u+i*2)*r,f=`${e},${t},${r},${n}`;if(da[f]!==void 0)return{el:da[f],height:a,width:d,middleWidth:s*r,sideWidth:c*r,padding:i*r,dpr:r};const h=document.createElement("canvas"),g=h.getContext("2d");return g===null?null:(h.width=d,h.height=a,g.scale(r,r),da[f]=h,g.beginPath(),no(g,i,i,u,l,o),g.shadowColor="rgba(24, 25, 34, 0.4)",g.shadowBlur=1,g.fillStyle=e,g.fill(),g.shadowColor="rgba(24, 25, 34, 0.3)",g.shadowOffsetY=1,g.shadowBlur=5,g.fillStyle=e,g.fill(),g.shadowOffsetY=0,g.shadowBlur=0,g.shadowBlur=0,g.beginPath(),no(g,i+.5,i+.5,u,l,o),g.strokeStyle=t,g.lineWidth=1,g.stroke(),{el:h,height:a,width:d,sideWidth:c*r,middleWidth:o*r,padding:i*r,dpr:r})}function Yg(e,t){const{rect:n,theme:o,ctx:r,imageLoader:i,col:l,row:s}=e,{x:a,width:c}=n,u=o.baseFontFull,d=Nc(r,u),f=Math.min(n.height,Math.max(16,Math.ceil(d*o.lineHeight)*2)),h=Math.floor(n.y+(n.height-f)/2),g=f-10,m=8,b=jg;let y=a+o.cellHorizontalPadding;const v=o.roundingRadius??6,I=Ug(o.bgCell,o.drilldownBorder,f,v),T=[];for(const k of t){if(y>a+c)break;const x=$o(k.text,r,u).width;let L=0;k.img!==void 0&&i.loadOrGetImage(k.img,l,s)!==void 0&&(L=g-8+4);const O=x+L+m*2;T.push({x:y,width:O}),y+=O+b}if(I!==null){const{el:k,height:x,middleWidth:L,sideWidth:O,width:R,dpr:P,padding:M}=I,S=O/P,E=M/P;for(const D of T){const C=Math.floor(D.x),X=Math.floor(D.width),B=X-(S-E)*2;r.imageSmoothingEnabled=!1,r.drawImage(k,0,0,O,x,C-E,h,S,f),B>0&&r.drawImage(k,O,0,L,x,C+(S-E),h,B,f),r.drawImage(k,R-O,0,O,x,C+X-(S-E),h,S,f),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[k,x]of T.entries()){const L=t[k];let O=x.x+m;if(L.img!==void 0){const R=i.loadOrGetImage(L.img,l,s);if(R!==void 0){const P=g-8;let M=0,S=0,E=R.width,D=R.height;E>D?(M+=(E-D)/2,E=D):D>E&&(S+=(D-E)/2,D=E),r.beginPath(),no(r,O,h+f/2-P/2,P,P,o.roundingRadius??3),r.save(),r.clip(),r.drawImage(R,M,S,E,D,O,h+f/2-P/2,P,P),r.restore(),O+=P+4}}r.beginPath(),r.fillStyle=o.textBubble,r.fillText(L.text,O,h+f/2+eo(r,o))}}const Xg={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Gg(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:o}=e,r=o??Hf;return p.createElement(r,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const n=e.split(",").map(o=>{try{return new URL(o),o}catch{return}}).filter(o=>o!==void 0);if(!(n.length===t.data.length&&n.every((o,r)=>o===t.data[r])))return{...t,data:n}}},ha=4;function Gg(e,t,n,o){const{rect:r,col:i,row:l,theme:s,ctx:a,imageLoader:c}=e,{x:u,y:d,height:f,width:h}=r,g=f-s.cellVerticalPadding*2,m=[];let b=0;for(let v=0;v<t.length;v++){const I=t[v];if(I.length===0)continue;const T=c.loadOrGetImage(I,i,l);if(T!==void 0){m[v]=T;const k=T.width*(g/T.height);b+=k+ha}}if(b===0)return;b-=ha;let y=u+s.cellHorizontalPadding;o==="right"?y=Math.floor(u+h-s.cellHorizontalPadding-b):o==="center"&&(y=Math.floor(u+h/2-b/2));for(const v of m){if(v===void 0)continue;const I=v.width*(g/v.height);n>0&&(a.beginPath(),no(a,y,d+s.cellVerticalPadding,I,g,n),a.save(),a.clip()),a.drawImage(v,y,d+s.cellVerticalPadding,I,g),n>0&&a.restore(),y+=I+ha}}function Kg(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const qg={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:o,ctx:r,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Kg(n,o)*t.skeletonWidthVariability));const a=l.cellHorizontalPadding;s+a*2>=i.width&&(s=i.width-a*2-1);const c=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);no(r,i.x+a,i.y+(i.height-c)/2,s,c,l.roundingRadius??3),r.fillStyle=Bo(l.textDark,.1),r.fill()},onPaste:()=>{}},Zg=()=>e=>e.targetWidth,Tu=cn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Zg(),"px"]}}),Jg=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:r,targetRect:i,onFinish:l,validatedSelection:s}=e,a=t.data,c=t.readonly===!0,[u,d]=p.useState(a===""||o),f=p.useCallback(()=>{d(g=>!g)},[]),h=a?"gdg-ml-6":"";return u?p.createElement(Tu,{targetWidth:i.width-20},p.createElement(No,{autoFocus:!0,highlight:!1,validatedSelection:s,value:a,onKeyDown:g=>{g.key==="Enter"&&g.stopPropagation()},onChange:n}),p.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t)},p.createElement(If,null))):p.createElement(Tu,{targetWidth:i.width},p.createElement(ep,{contents:a,createNode:r}),!c&&p.createElement(p.Fragment,null,p.createElement("div",{className:"spacer"}),p.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:f},p.createElement(_l,null))),p.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Qg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Br,measure:(e,t,n)=>{const o=t.data.split(`
|
|
175
|
+
`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>to(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:o,onFinishedEditing:r,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:s}=e;return p.createElement(Jg,{onFinish:r,targetRect:o,value:n,validatedSelection:s,onChange:a=>t({...n,data:a.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},em={getAccessibilityString:e=>e.row.toString(),kind:Fn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:tm,measure:()=>44,draw:e=>om(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:o,posY:r}=e,{width:i,height:l}=t,s=n.drawHandle?7+(i-7)/2:i/2,a=l/2;if(Math.abs(o-s)<=10&&Math.abs(r-a)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function tm(e,t){const{ctx:n,theme:o}=e,r=o.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==r&&(n.font=r,i.font=r),i.deprep=nm,n.textAlign="center",i}function nm(e){const{ctx:t}=e;t.textAlign="start"}function om(e,t,n,o,r,i){const{ctx:l,rect:s,hoverAmount:a,theme:c}=e,{x:u,y:d,width:f,height:h}=s,g=n?1:o==="checkbox-visible"?.6+.4*a:a;if(o!=="number"&&g>0){l.globalAlpha=g;const m=7*(n?a:1);if(la(l,c,n,r?u+m:u,d,r?f-m:f,h,!0,void 0,void 0,18,"center",i),r){l.globalAlpha=a,l.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])l.rect(u+b,d+h/2+y,2,2);l.fillStyle=c.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(o==="number"||o==="both"&&!n){const m=t.toString(),b=c.markerFontFull,y=u+f/2;o==="both"&&a!==0&&(l.globalAlpha=1-a),l.fillStyle=c.textLight,l.font=b,l.fillText(m,y,d+h/2+eo(l,b)),a!==0&&(l.globalAlpha=1)}}const rm={getAccessibilityString:()=>"",kind:Fn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>im(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function im(e,t,n){const{ctx:o,rect:r,hoverAmount:i,theme:l,spriteManager:s}=e,{x:a,y:c,width:u,height:d}=r;o.beginPath(),o.globalAlpha=i,o.rect(a+1,c+1,u,d-2),o.fillStyle=l.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const f=t!=="";let h=0;if(n!==void 0){const g=d-8,m=a+8/2,b=c+8/2;s.drawSprite(n,"normal",o,m,b,g,l,f?1:i),h=g}else{h=24;const g=12,m=f?g:i*g,b=f?0:(1-i)*g*.5,y=l.cellHorizontalPadding+4;m>0&&(o.moveTo(a+y+b,c+d/2),o.lineTo(a+y+b+m,c+d/2),o.moveTo(a+y+b+m*.5,c+d/2-m*.5),o.lineTo(a+y+b+m*.5,c+d/2+m*.5),o.lineWidth=2,o.strokeStyle=l.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=l.textMedium,o.fillText(t,h+a+l.cellHorizontalPadding+.5,c+d/2+eo(o,l)),o.beginPath()}function Ou(e,t,n,o,r,i,l){e.textBaseline="alphabetic";const s=lm(e,r,o,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),no(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Bo(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}function lm(e,t,n,o,r){const i=o.cellHorizontalPadding,l=o.cellVerticalPadding;if(r)return{x:t.x+i/2,y:t.y+l/2+1,width:t.width-i,height:t.height-l-1};const s=$o(n,e,o.baseFontFull,"alphabetic"),a=t.height-l,c=Math.min(a,s.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:s.width+i*3,height:c-1}}const am=p.lazy(async()=>await vs(()=>import("./number-overlay-editor-DmP64vrs.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]))),sm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Br,draw:e=>{const{hoverAmount:t,cell:n,ctx:o,theme:r,rect:i,overrideCursor:l}=e,{hoverEffect:s,displayData:a,hoverEffectTheme:c}=n;s===!0&&t>0&&Ou(o,r,c,a,i,t,l),to(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:o,validatedSelection:r}=e;return p.createElement(p.Suspense,{fallback:null},p.createElement(am,{highlight:t,disabled:o.readonly===!0,value:o.data,fixedDecimals:o.fixedDecimals,allowNegative:o.allowNegative,thousandSeparator:o.thousandSeparator,decimalSeparator:o.decimalSeparator,validatedSelection:r,onChange:i=>n({...o,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const o=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(o)||t.data===o))return{...t,data:o,displayData:n.formattedString??t.displayData}}},cm={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:um,onPaste:()=>{}};function um(e){const{ctx:t,theme:n,rect:o}=e,{x:r,y:i,height:l}=o;t.beginPath();const s=2.5;let a=r+n.cellHorizontalPadding+s;const c=i+l/2,u=Math.cos(sc(30))*s,d=Math.sin(sc(30))*s;for(let f=0;f<12;f++)t.moveTo(a,c-s),t.lineTo(a,c+s),t.moveTo(a+u,c-d),t.lineTo(a-u,c+d),t.moveTo(a-u,c-d),t.lineTo(a+u,c+d),a+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const dm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Br(e,t,e.theme.textLight),draw:e=>to(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:o,validatedSelection:r}=e;return te.createElement(No,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:r,onChange:i=>n({...o,data:i.target.value})})},onPaste:()=>{}},hm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Br,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:o,ctx:r,rect:i,theme:l,overrideCursor:s}=e,{displayData:a,contentAlign:c,hoverEffect:u,allowWrapping:d,hoverEffectTheme:f}=t;u===!0&&n>0&&Ou(r,l,f,a,i,n,s),to(e,a,c,d,o)},measure:(e,t,n)=>{const o=t.displayData.split(`
|
|
176
|
+
`,t.allowWrapping===!0?void 0:1);let r=0;for(const i of o)r=Math.max(r,e.measureText(i).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:o,value:r,validatedSelection:i}=t;return p.createElement(No,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:i,onChange:l=>o({...r,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},fm=cn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),pm=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:r,validatedSelection:i,preview:l}=e,[s,a]=p.useState(!r&&(t===""||o)),c=p.useCallback(()=>{a(!0)},[]);return s?p.createElement(No,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):p.createElement(fm,null,p.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!r&&p.createElement("div",{className:"gdg-edit-icon",onClick:c},p.createElement(_l,null)),p.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Du(e,t,n,o){let r=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,s=e.actualBoundingBoxAscent;return o==="right"?r=t.width-l-n.cellHorizontalPadding:o==="center"&&(r=t.width/2-l/2),{x:r,y:i,width:l,height:s}}function zu(e){const{cell:t,bounds:n,posX:o,posY:r,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const s=Hc(l,i.baseFontFull);if(s===void 0)return!1;const a=Du(s,n,i,t.contentAlign);return Wo({x:a.x-4,y:a.y-4,width:a.width+8,height:a.height+8},o,r)}const gm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Br,draw:e=>{const{cell:t,theme:n,overrideCursor:o,hoverX:r,hoverY:i,rect:l,ctx:s}=e,a=t.displayData??t.data,c=t.hoverEffect===!0;if(o!==void 0&&c&&r!==void 0&&i!==void 0){const u=$o(a,s,n.baseFontFull),d=Du(u,l,n,t.contentAlign),{x:f,y:h,width:g,height:m}=d;if(r>=f-4&&r<=f-4+g+8&&i>=h-4&&i<=h-4+m+8){const b=eo(s,n.baseFontFull);o("pointer");const y=5,v=h-b;s.beginPath(),s.moveTo(l.x+f,Math.floor(l.y+v+m+y)+.5),s.lineTo(l.x+f+g,Math.floor(l.y+v+m+y)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,to({...e,rect:{...l,x:l.x-1}},a,t.contentAlign),to({...e,rect:{...l,x:l.x-2}},a,t.contentAlign),to({...e,rect:{...l,x:l.x+1}},a,t.contentAlign),to({...e,rect:{...l,x:l.x+2}},a,t.contentAlign),s.restore()}}s.fillStyle=c?n.linkColor:n.textDark,to(e,a,t.contentAlign)},onSelect:e=>{zu(e)&&e.preventDefault()},onClick:e=>{var t;const{cell:n}=e;zu(e)&&((t=n.onClickUri)==null||t.call(n,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:o,forceEditMode:r,validatedSelection:i}=t;return p.createElement(pm,{forceEditMode:o.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:o.data,preview:o.displayData??o.data,validatedSelection:i,readonly:o.readonly===!0,onChange:l=>n({...o,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},mm=[em,rm,Pg,_g,Wg,Xg,qg,Qg,sm,cm,dm,hm,gm];var fa,Lu;function vm(){if(Lu)return fa;Lu=1;var e=lc(),t=Ph(),n="Expected a function";function o(r,i,l){var s=!0,a=!0;if(typeof r!="function")throw new TypeError(n);return t(l)&&(s="leading"in l?!!l.leading:s,a="trailing"in l?!!l.trailing:a),e(r,i,{leading:s,maxWait:i,trailing:a})}return fa=o,fa}var bm=vm();const wm=vo(bm),pa=[];class ym extends Vc{constructor(){super(...arguments),ht(this,"imageLoaded",()=>{}),ht(this,"loadedLocations",[]),ht(this,"cache",{}),ht(this,"sendLoaded",wm(()=>{this.imageLoaded(new Vr(this.loadedLocations)),this.loadedLocations=[]},20)),ht(this,"clearOutOfWindow",()=>{const t=Object.keys(this.cache);for(const n of t){const o=this.cache[n];let r=!1;for(let i=0;i<o.cells.length;i++){const l=o.cells[i];if(this.isInWindow(l)){r=!0;break}}r?o.cells=o.cells.filter(this.isInWindow):(o.cancel(),delete this.cache[n])}})}setCallback(t){this.imageLoaded=t}loadImage(t,n,o,r){let i=!1;const l=pa.pop()??new Image;let s=!1;const a={img:void 0,cells:[Wn(n,o)],url:t,cancel:()=>{s||(s=!0,pa.length<12?pa.unshift(l):i||(l.src=""))}},c=new Promise(u=>l.addEventListener("load",()=>u(null)));requestAnimationFrame(async()=>{try{l.src=t,await c,await l.decode();const u=this.cache[r];if(u!==void 0&&!s){u.img=l;for(const d of u.cells)this.loadedLocations.push(ql(d));i=!0,this.sendLoaded()}}catch{a.cancel()}}),this.cache[r]=a}loadOrGetImage(t,n,o){const r=t,i=this.cache[r];if(i!==void 0){const l=Wn(n,o);return i.cells.includes(l)||i.cells.push(l),i.img}else this.loadImage(t,n,o,r)}}const xm=(e,t)=>{const n=p.useMemo(()=>({...h0,...e.headerIcons}),[e.headerIcons]),o=p.useMemo(()=>e.imageWindowLoader??new ym,[e.imageWindowLoader]);return p.createElement(Lg,{...e,renderers:mm,headerIcons:n,ref:t,imageWindowLoader:o})},Cm=p.forwardRef(xm);function Pu(e,t){const n=p.useRef(null),o=p.useRef(),r=p.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return p.useEffect(()=>r,[r]),{debouncedCallback:p.useCallback((...i)=>{o.current=i,r(),n.current=setTimeout(()=>{o.current&&(e(...o.current),o.current=void 0)},t)},[e,t,r]),cancel:r}}const Hu=Sr("div",{target:"e1hnsd042"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),Eo=Sr("div",{target:"e1hnsd041"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}}),""),km=Sr("div",{target:"e1hnsd040"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),Au=[{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:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],Sm={number:Au,progress:Au,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 Mm({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:o,onChangeFormat:r,onCloseMenu:i,children:l}){const s=Jo(),{colors:a,fontSizes:c,radii:u,fontWeights:d}=s,f=Sm[e]||[];return f.length===0?Oe.jsx(Oe.Fragment,{}):Oe.jsx(xl,{triggerType:Fh.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:o,ignoreBoundary:!0,content:Oe.jsx(Hu,{role:"menu",children:f.map(h=>Oe.jsxs(Eo,{onClick:()=>{r(h.format),i()},role:"menuitem",children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:Cl.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},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",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:kl(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:c.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:l})}const Rm=p.memo(Mm);function Em({top:e,left:t,isColumnPinned:n,onPinColumn:o,onUnpinColumn:r,onCloseMenu:i,onSortColumn:l,onHideColumn:s,columnKind:a,onChangeFormat:c,onAutosize:u}){const d=Jo(),[f,h]=p.useState(!1),{colors:g,fontSizes:m,radii:b,fontWeights:y}=d;p.useEffect(()=>{function I(T){T.preventDefault()}return document.addEventListener("wheel",I,{passive:!1}),document.addEventListener("touchmove",I,{passive:!1}),()=>{document.removeEventListener("wheel",I),document.removeEventListener("touchmove",I)}},[]);const v=te.useCallback(()=>{i()},[i]);return Oe.jsx(xl,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Oe.jsxs(Hu,{children:[l&&Oe.jsxs(Oe.Fragment,{children:[Oe.jsxs(Eo,{onClick:()=>{l("asc"),v()},role:"menuitem",children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Oe.jsxs(Eo,{onClick:()=>{l("desc"),v()},role:"menuitem",children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Oe.jsx(km,{})]}),c&&Oe.jsx(Rm,{columnKind:a,isOpen:f,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:c,onCloseMenu:v,children:Oe.jsxs(Eo,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:f,hasSubmenu:!0,children:[Oe.jsxs("div",{children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),u&&Oe.jsxs(Eo,{onClick:()=>{u(),v()},children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&Oe.jsxs(Eo,{onClick:()=>{r(),v()},children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Oe.jsxs(Eo,{onClick:()=>{o(),v()},children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),s&&Oe.jsxs(Eo,{onClick:()=>{s(),v()},children:[Oe.jsx(bo,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Cl.bottomRight,accessibilityType:_h.menu,showArrow:!1,popoverMargin:Vn("0.375rem"),onClickOutside:f?void 0:v,onEsc:v,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:kl(d)?g.bgColor:g.secondaryBg,color:g.bodyText,fontSize:m.sm,fontWeight:y.normal,borderTopLeftRadius:b.default,borderTopRightRadius:b.default,borderBottomLeftRadius:b.default,borderBottomRightRadius:b.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:Oe.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Im=p.memo(Em),Tm="(index)",Om=({label:e,initialValue:t,onChange:n})=>{const o=Jo();return Oe.jsx(eC,{checked:t,onChange:r=>{n(r.target.checked)},"aria-label":e,checkmarkType:nC.default,labelPlacement:tC.right,overrides:{Root:{style:({$isFocusVisible:r})=>({marginBottom:o.spacing.none,marginTop:o.spacing.none,paddingLeft:o.spacing.md,paddingRight:o.spacing.md,paddingTop:o.spacing.twoXS,paddingBottom:o.spacing.twoXS,backgroundColor:r?o.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:r,$checked:i})=>{const l=i?o.colors.primary:o.colors.fadedText40;return{outline:0,width:o.sizes.checkbox,height:o.sizes.checkbox,marginTop:o.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:r&&i?`0 0 0 0.2rem ${Sl(o.colors.primary,.5)}`:"",borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:o.lineHeights.small,paddingLeft:o.spacing.sm,position:"relative",color:o.colors.bodyText,fontSize:o.fontSizes.sm,fontWeight:o.fontWeights.normal}}},children:e})},Dm=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:o,showColumn:r,children:i,isOpen:l,onClose:s})=>{const a=Jo();return Oe.jsx(xl,{triggerType:Fh.click,placement:Cl.bottomRight,autoFocus:!0,focusLock:!0,content:()=>Oe.jsx("div",{style:{paddingTop:a.spacing.sm,paddingBottom:a.spacing.sm},children:e.map(c=>{const u=t.length&&!c.isIndex?!t.includes(c.id)&&!t.includes(c.name):!1;return Oe.jsx(Om,{label:!c.title&&c.isIndex?Tm:c.title,initialValue:!(c.isHidden===!0||u),onChange:d=>{d?(r(c.id),u&&n(f=>[...f,c.id])):o(c.id)}},c.id)})}),isOpen:l,onClickOutside:s,onClick:()=>l?s():void 0,onEsc:s,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:a.radii.default,borderTopRightRadius:a.radii.default,borderBottomLeftRadius:a.radii.default,borderBottomRightRadius:a.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:kl(a)?a.colors.bgColor:a.colors.secondaryBg,color:a.colors.bodyText,fontSize:a.fontSizes.sm,fontWeight:a.fontWeights.normal,minWidth:a.sizes.minMenuWidth,maxWidth:`calc(${a.sizes.minMenuWidth} * 2)`,maxHeight:a.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:Oe.jsx("div",{children:i})})},zm=p.memo(Dm);var Lm=Xy();const Pm=vo(Lm);var ga={exports:{}},Hm=ga.exports,Fu;function Am(){return Fu||(Fu=1,function(e,t){(function(n,o){try{e.exports=o(Gy)}catch{e.exports=o}n&&(n.momentDurationFormatSetup=n.moment?o(n.moment):o)})(Hm,function(n){var o=!1,r=!1,i=!1,l=!1,s="escape years months weeks days hours minutes seconds milliseconds general".split(" "),a=[{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 c(N,z){return z.length>N.length?!1:N.indexOf(z)!==-1}function u(N){for(var z="";N;)z+="0",N-=1;return z}function d(N){for(var z=N.split("").reverse(),j=0,ge=!0;ge&&j<z.length;)j?z[j]==="9"?z[j]="0":(z[j]=(parseInt(z[j],10)+1).toString(),ge=!1):(parseInt(z[j],10)<5&&(ge=!1),z[j]="0"),j+=1;return ge&&z.push("1"),z.reverse().join("")}function f(N,z){var j=L(C(z).sort(),function(ke){return ke+":"+z[ke]}).join(","),ge=N+"+"+j;return f.cache[ge]||(f.cache[ge]=Intl.NumberFormat(N,z)),f.cache[ge]}f.cache={};function h(N,z,j){var ge=z.useToLocaleString,ke=z.useGrouping,Fe=ke&&z.grouping.slice(),xe=z.maximumSignificantDigits,De=z.minimumIntegerDigits||1,_e=z.fractionDigits||0,et=z.groupingSeparator,Pt=z.decimalSeparator;if(ge&&j){var Mt={minimumIntegerDigits:De,useGrouping:ke};if(_e&&(Mt.maximumFractionDigits=_e,Mt.minimumFractionDigits=_e),xe&&N>0&&(Mt.maximumSignificantDigits=xe),i){if(!l){var we=D({},z);we.useGrouping=!1,we.decimalSeparator=".",N=parseFloat(h(N,we),10)}return f(j,Mt).format(N)}else{if(!r){var we=D({},z);we.useGrouping=!1,we.decimalSeparator=".",N=parseFloat(h(N,we),10)}return N.toLocaleString(j,Mt)}}var be;xe?be=N.toPrecision(xe+1):be=N.toFixed(_e+1);var me,ie,Ee,Ie=be.split("e");Ee=Ie[1]||"",Ie=Ie[0].split("."),ie=Ie[1]||"",me=Ie[0]||"";var je=me.length,tt=ie.length,Rt=je+tt,ce=me+ie;(xe&&Rt===xe+1||!xe&&tt===_e+1)&&(ce=d(ce),ce.length===Rt+1&&(je=je+1),tt&&(ce=ce.slice(0,-1)),me=ce.slice(0,je),ie=ce.slice(je)),xe&&(ie=ie.replace(/0*$/,""));var it=parseInt(Ee,10);it>0?ie.length<=it?(ie=ie+u(it-ie.length),me=me+ie,ie=""):(me=me+ie.slice(0,it),ie=ie.slice(it)):it<0&&(ie=u(Math.abs(it)-me.length)+me+ie,me="0"),xe||(ie=ie.slice(0,_e),ie.length<_e&&(ie=ie+u(_e-ie.length)),me.length<De&&(me=u(De-me.length)+me));var at="";if(ke){Ie=me;for(var Re;Ie.length;)Fe.length&&(Re=Fe.shift()),at&&(at=et+at),at=Ie.slice(-Re)+at,Ie=Ie.slice(0,-Re)}else at=me;return ie&&(at=at+Pt+ie),at}function g(N,z){return N.label.length>z.label.length?-1:N.label.length<z.label.length?1:0}function m(N,z){var j=[];return x(C(z),function(ge){if(ge.slice(0,15)==="_durationLabels"){var ke=ge.slice(15).toLowerCase();x(C(z[ge]),function(Fe){Fe.slice(0,1)===N&&j.push({type:ke,key:Fe,label:z[ge][Fe]})})}}),j}function b(N,z,j){return z===1&&j===null?N:N+N}var y={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"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:b};function v(N){return Object.prototype.toString.call(N)==="[object Array]"}function I(N){return Object.prototype.toString.call(N)==="[object Object]"}function T(N,z){for(var j=N.length;j-=1;)if(z(N[j]))return N[j]}function k(N,z){var j=0,ge=N&&N.length||0,ke;for(typeof z!="function"&&(ke=z,z=function(Fe){return Fe===ke});j<ge;){if(z(N[j]))return N[j];j+=1}}function x(N,z){var j=0,ge=N.length;if(!(!N||!ge))for(;j<ge;){if(z(N[j],j)===!1)return;j+=1}}function L(N,z){var j=0,ge=N.length,ke=[];if(!N||!ge)return ke;for(;j<ge;)ke[j]=z(N[j],j),j+=1;return ke}function O(N,z){return L(N,function(j){return j[z]})}function R(N){var z=[];return x(N,function(j){j&&z.push(j)}),z}function P(N){var z=[];return x(N,function(j){k(z,j)||z.push(j)}),z}function M(N,z){var j=[];return x(N,function(ge){x(z,function(ke){ge===ke&&j.push(ge)})}),P(j)}function S(N,z){var j=[];return x(N,function(ge,ke){if(!z(ge))return j=N.slice(ke),!1}),j}function E(N,z){var j=N.slice().reverse();return S(j,z).reverse()}function D(N,z){for(var j in z)z.hasOwnProperty(j)&&(N[j]=z[j]);return N}function C(N){var z=[];for(var j in N)N.hasOwnProperty(j)&&z.push(j);return z}function X(N,z){var j=0,ge=N.length;if(!N||!ge)return!1;for(;j<ge;){if(z(N[j],j)===!0)return!0;j+=1}return!1}function B(N){var z=[];return x(N,function(j){z=z.concat(j)}),z}function J(){var N=0;try{N.toLocaleString("i")}catch(z){return z.name==="RangeError"}return!1}function ae(N){return N(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ne(N){var z=!0;return z=z&&N(1,"en",{minimumIntegerDigits:1})==="1",z=z&&N(1,"en",{minimumIntegerDigits:2})==="01",z=z&&N(1,"en",{minimumIntegerDigits:3})==="001",!(!z||(z=z&&N(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",z=z&&N(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",z=z&&N(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",z=z&&N(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!z)||(z=z&&N(99.99,"en",{maximumSignificantDigits:1})==="100",z=z&&N(99.99,"en",{maximumSignificantDigits:2})==="100",z=z&&N(99.99,"en",{maximumSignificantDigits:3})==="100",z=z&&N(99.99,"en",{maximumSignificantDigits:4})==="99.99",z=z&&N(99.99,"en",{maximumSignificantDigits:5})==="99.99",!z)||(z=z&&N(1e3,"en",{useGrouping:!0})==="1,000",z=z&&N(1e3,"en",{useGrouping:!1})==="1000",!z))}function U(){var N=[].slice.call(arguments),z={},j;if(x(N,function(xe,De){if(!De){if(!v(xe))throw"Expected array as the first argument to durationsFormat.";j=xe}if(typeof xe=="string"||typeof xe=="function"){z.template=xe;return}if(typeof xe=="number"){z.precision=xe;return}I(xe)&&D(z,xe)}),!j||!j.length)return[];z.returnMomentTypes=!0;var ge=L(j,function(xe){return xe.format(z)}),ke=M(s,P(O(B(ge),"type"))),Fe=z.largest;return Fe&&(ke=ke.slice(0,Fe)),z.returnMomentTypes=!1,z.outputTypes=ke,L(j,function(xe){return xe.format(z)})}function re(){var N=[].slice.call(arguments),z=D({},this.format.defaults),j=this.asMilliseconds(),ge=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(j=0,ge=0);var ke=j<0,Fe=n.duration(Math.abs(j),"milliseconds"),xe=n.duration(Math.abs(ge),"months");x(N,function(_){if(typeof _=="string"||typeof _=="function"){z.template=_;return}if(typeof _=="number"){z.precision=_;return}I(_)&&D(z,_)});var De={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},_e={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};z.types=s;var et=function(_){return k(s,function(qe){return _e[qe].test(_)})},Pt=new RegExp(L(s,function(_){return _e[_].source}).join("|"),"g");z.duration=this;var Mt=typeof z.template=="function"?z.template.apply(z):z.template,we=z.outputTypes,be=z.returnMomentTypes,me=z.largest,ie=[];we||(v(z.stopTrim)&&(z.stopTrim=z.stopTrim.join("")),z.stopTrim&&x(z.stopTrim.match(Pt),function(_){var qe=et(_);qe==="escape"||qe==="general"||ie.push(qe)}));var Ee=n.localeData();Ee||(Ee={}),x(C(y),function(_){if(typeof y[_]=="function"){Ee[_]||(Ee[_]=y[_]);return}Ee["_"+_]||(Ee["_"+_]=y[_])}),x(C(Ee._durationTimeTemplates),function(_){Mt=Mt.replace("_"+_+"_",Ee._durationTimeTemplates[_])});var Ie=z.userLocale||n.locale(),je=z.useLeftUnits,tt=z.usePlural,Rt=z.precision,ce=z.forceLength,it=z.useGrouping,at=z.trunc,Re=z.useSignificantDigits&&Rt>0,Tt=Re?z.precision:0,Xt=Tt,Ne=z.minValue,nt=!1,kt=z.maxValue,Et=!1,qt=z.useToLocaleString,un=z.groupingSeparator,an=z.decimalSeparator,Bt=z.grouping;qt=qt&&(o||i);var wt=z.trim;v(wt)&&(wt=wt.join(" ")),wt===null&&(me||kt||Re)&&(wt="all"),(wt===null||wt===!0||wt==="left"||wt==="right")&&(wt="large"),wt===!1&&(wt="");var Ot=function(_){return _.test(wt)},In=/large/,Cn=/small/,ot=/both/,sn=/mid/,bn=/^all|[^sm]all/,yt=/final/,Zt=me>0||X([In,ot,bn],Ot),ut=X([Cn,ot,bn],Ot),Vt=X([sn,bn],Ot),$t=X([yt,bn],Ot),rn=L(Mt.match(Pt),function(_,qe){var Je=et(_);return _.slice(0,1)==="*"&&(_=_.slice(1),Je!=="escape"&&Je!=="general"&&ie.push(Je)),{index:qe,length:_.length,text:"",token:Je==="escape"?_.replace(_e.escape,"$1"):_,type:Je==="escape"||Je==="general"?null:Je}}),Ft={index:0,length:0,token:"",text:"",type:null},Jt=[];je&&rn.reverse(),x(rn,function(_){if(_.type){(Ft.type||Ft.text)&&Jt.push(Ft),Ft=_;return}je?Ft.text=_.token+Ft.text:Ft.text+=_.token}),(Ft.type||Ft.text)&&Jt.push(Ft),je&&Jt.reverse();var Ue=M(s,P(R(O(Jt,"type"))));if(!Ue.length)return O(Jt,"text").join("");Ue=L(Ue,function(_,qe){var Je=qe+1===Ue.length,pe=!qe,rt;_==="years"||_==="months"?rt=xe.as(_):rt=Fe.as(_);var Dt=Math.floor(rt),dn=rt-Dt,en=k(Jt,function(tn){return _===tn.type});return pe&&kt&&rt>kt&&(Et=!0),Je&&Ne&&Math.abs(z.duration.as(_))<Ne&&(nt=!0),pe&&ce===null&&en.length>1&&(ce=!0),Fe.subtract(Dt,_),xe.subtract(Dt,_),{rawValue:rt,wholeValue:Dt,decimalValue:Je?dn:0,isSmallest:Je,isLargest:pe,type:_,tokenLength:en.length}});var Ht=at?Math.floor:Math.round,kn=function(_,qe){var Je=Math.pow(10,qe);return Ht(_*Je)/Je},At=!1,Wt=!1,jt=function(_,qe){var Je={useGrouping:it,groupingSeparator:un,decimalSeparator:an,grouping:Bt,useToLocaleString:qt};return Re&&(Tt<=0?(_.rawValue=0,_.wholeValue=0,_.decimalValue=0):(Je.maximumSignificantDigits=Tt,_.significantDigits=Tt)),Et&&!Wt&&(_.isLargest?(_.wholeValue=kt,_.decimalValue=0):(_.wholeValue=0,_.decimalValue=0)),nt&&!Wt&&(_.isSmallest?(_.wholeValue=Ne,_.decimalValue=0):(_.wholeValue=0,_.decimalValue=0)),_.isSmallest||_.significantDigits&&_.significantDigits-_.wholeValue.toString().length<=0?Rt<0?_.value=kn(_.wholeValue,Rt):Rt===0?_.value=Ht(_.wholeValue+_.decimalValue):Re?(at?_.value=kn(_.rawValue,Tt-_.wholeValue.toString().length):_.value=_.rawValue,_.wholeValue&&(Tt-=_.wholeValue.toString().length)):(Je.fractionDigits=Rt,at?_.value=_.wholeValue+kn(_.decimalValue,Rt):_.value=_.wholeValue+_.decimalValue):Re&&_.wholeValue?(_.value=Math.round(kn(_.wholeValue,_.significantDigits-_.wholeValue.toString().length)),Tt-=_.wholeValue.toString().length):_.value=_.wholeValue,_.tokenLength>1&&(ce||At)&&(Je.minimumIntegerDigits=_.tokenLength,Wt&&Je.maximumSignificantDigits<_.tokenLength&&delete Je.maximumSignificantDigits),!At&&(_.value>0||wt===""||k(ie,_.type)||k(we,_.type))&&(At=!0),_.formattedValue=h(_.value,Je,Ie),Je.useGrouping=!1,Je.decimalSeparator=".",_.formattedValueEn=h(_.value,Je,"en"),_.tokenLength===2&&_.type==="milliseconds"&&(_.formattedValueMS=h(_.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),_};if(Ue=L(Ue,jt),Ue=R(Ue),Ue.length>1){var oo=function(_){return k(Ue,function(qe){return qe.type===_})},jn=function(_){var qe=oo(_.type);qe&&x(_.targets,function(Je){var pe=oo(Je.type);pe&&parseInt(qe.formattedValueEn,10)===Je.value&&(qe.rawValue=0,qe.wholeValue=0,qe.decimalValue=0,pe.rawValue+=1,pe.wholeValue+=1,pe.decimalValue=0,pe.formattedValueEn=pe.wholeValue.toString(),Wt=!0)})};x(a,jn)}return Wt&&(At=!1,Tt=Xt,Ue=L(Ue,jt),Ue=R(Ue)),we&&!(Et&&!z.trim)?(Ue=L(Ue,function(_){return k(we,function(qe){return _.type===qe})?_:null}),Ue=R(Ue)):(Zt&&(Ue=S(Ue,function(_){return!_.isSmallest&&!_.wholeValue&&!k(ie,_.type)})),me&&Ue.length&&(Ue=Ue.slice(0,me)),ut&&Ue.length>1&&(Ue=E(Ue,function(_){return!_.wholeValue&&!k(ie,_.type)&&!_.isLargest})),Vt&&(Ue=L(Ue,function(_,qe){return qe>0&&qe<Ue.length-1&&!_.wholeValue?null:_}),Ue=R(Ue)),$t&&Ue.length===1&&!Ue[0].wholeValue&&!(!at&&Ue[0].isSmallest&&Ue[0].rawValue<Ne)&&(Ue=[])),be?Ue:(x(Jt,function(_){var qe=De[_.type],Je=k(Ue,function(tn){return tn.type===_.type});if(!(!qe||!Je)){var pe=Je.formattedValueEn.split(".");pe[0]=parseInt(pe[0],10),pe[1]?pe[1]=parseFloat("0."+pe[1],10):pe[1]=null;var rt=Ee.durationPluralKey(qe,pe[0],pe[1]),Dt=m(qe,Ee),dn=!1,en={};x(Ee._durationLabelTypes,function(tn){var Sn=k(Dt,function(wn){return wn.type===tn.type&&wn.key===rt});Sn&&(en[Sn.type]=Sn.label,c(_.text,tn.string)&&(_.text=_.text.replace(tn.string,Sn.label),dn=!0))}),tt&&!dn&&(Dt.sort(g),x(Dt,function(tn){if(en[tn.type]===tn.label)return c(_.text,tn.label)?!1:void 0;if(c(_.text,tn.label))return _.text=_.text.replace(tn.label,en[tn.type]),!1}))}}),Jt=L(Jt,function(_){if(!_.type)return _.text;var qe=k(Ue,function(pe){return pe.type===_.type});if(!qe)return"";var Je="";return je&&(Je+=_.text),(ke&&Et||!ke&&nt)&&(Je+="< ",Et=!1,nt=!1),(ke&&nt||!ke&&Et)&&(Je+="> ",Et=!1,nt=!1),ke&&(qe.value>0||wt===""||k(ie,qe.type)||k(we,qe.type))&&(Je+="-",ke=!1),_.type==="milliseconds"&&qe.formattedValueMS?Je+=qe.formattedValueMS:Je+=qe.formattedValue,je||(Je+=_.text),Je}),Jt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function se(){var N=this.duration,z=function(ke){return N._data[ke]},j=k(this.types,z),ge=T(this.types,z);switch(j){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(j===ge)return"d __";case"weeks":return j===ge?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(j===ge)return"M __";case"years":return j===ge?"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(N){if(!N)throw"Moment Duration Format init cannot find moment instance.";N.duration.format=U,N.duration.fn.format=re,N.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:se,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},N.updateLocale("en",y)}var fe=function(N,z,j){return N.toLocaleString(z,j)};o=J()&&ne(fe),r=o&&ae(fe);var Q=function(N,z,j){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(z,j).format(N)};return i=ne(Q),l=i&&ae(Q),de(n),de})}(ga)),ga.exports}Am();const Fm=["true","t","yes","y","on","1"],_m=["false","f","no","n","off","0"];function Lt(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function lr(e){return e.hasOwnProperty("isError")&&e.isError}function Nm(e){return e.hasOwnProperty("tooltip")&&e.tooltip!==""}function Fi(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function ma(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:Z.Loading,allowOverlay:!1}}function Bm(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function va(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 Xr(e,t){return Ve(e)?t||{}:Ve(t)?e||{}:Nh(e,t)}function _u(e){if(Ve(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),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,o)=>typeof o=="bigint"?Number(o):o));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:bt(n)):[bt(t)]}catch{return[bt(e)]}}function Vm(e){return e&&e.startsWith("{")&&e.endsWith("}")}function bt(e){try{try{return Pm(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function Nu(e){if(Ve(e))return null;if(typeof e=="boolean")return e;const t=bt(e).toLowerCase().trim();if(t==="")return null;if(Fm.includes(t))return!0;if(_m.includes(t))return!1}function Gr(e){if(Ve(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=gi.unformat(e.trim());if(mt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function _i(e){if(Ve(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return bt(e)}}function $m(e){if(e===0||Math.abs(e)>=1e-4)return 4;const t=e.toExponential().split("e");return Math.abs(parseInt(t[1],10))}function Ni(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Ve(t)||t===""?mt(n)?(n===0&&(e=Math.round(e)),gi(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):gi(e).format({thousandSeparated:!1,mantissa:$m(e),trimMantissa:!0}):t==="plain"?gi(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?new Intl.NumberFormat().format(e):t==="percent"?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}).format(e):t==="dollar"?new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",maximumFractionDigits:2}).format(e):t==="euro"?new Intl.NumberFormat(void 0,{style:"currency",currency:"EUR",maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):t==="accounting"?gi(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:2,trimMantissa:!1}):rC.sprintf(t,e)}function Bu(e,t,n="datetime"){return t==="localized"?new Intl.DateTimeFormat(void 0,{dateStyle:n==="time"?void 0:"medium",timeStyle:n==="date"?void 0:"medium"}).format(e.toDate()):t==="distance"?e.fromNow():t==="calendar"?e.calendar():t==="iso8601"?n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString():e.format(t)}function Bi(e){if(Ve(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 o=Qo.unix(n).utc();if(o.isValid())return o.toDate()}if(typeof e=="string"){const n=Qo.utc(e);if(n.isValid())return n.toDate();const o=Qo.utc(e,[Qo.HTML5_FMT.TIME_MS,Qo.HTML5_FMT.TIME_SECONDS,Qo.HTML5_FMT.TIME]);if(o.isValid())return o.toDate()}}catch{return}}function Vu(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 Wm(e,t){return t===0?Math.trunc(e):Math.trunc(e*10**t)/10**t}const jm=new RegExp(/(\r\n|\n|\r)/gm);function Kr(e){return e.indexOf(`
|
|
177
|
+
`)!==-1?e.replace(jm," "):e}function Um(e,t){if(Ve(t))return"";try{const n=t.match(e);return n&&n[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const Ym=Sr("div",{target:"en99xsi0"})(({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"}}),""),ba=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?bs.parse(e):bs.parse(bs.stringify(e))}catch{n=void 0}return Ve(n)?Oe.jsx(No,{highlight:!0,autoFocus:!1,disabled:!0,value:_i(e)??"",onChange:()=>{}}):Oe.jsx(Ym,{"data-testid":"stJsonColumnViewer",children:Oe.jsx(Ky,{src:n,collapsed:2,theme:qy(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"}})})};p.memo(ba);const Xm=e=>{const t=e.theme,n=e.value.data;return Oe.jsx(ba,{jsonValue:n.value||n.displayValue,theme:t})},Gm=e=>{const t=e.theme,n=e.value;return Oe.jsx(ba,{jsonValue:n.data,theme:t})},Km={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:o}=t.data;return Yl(e,o??_i(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:o,displayValue:r}=t.data,i=r??_i(o)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Xm})},qm="line_chart",Zm="area_chart",Jm="bar_chart";function wa(e,t,n){const o=Xr({y_min:0,y_max:1},t.columnTypeOptions),r={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[o.y_min,o.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(i){if(Ve(o.y_min)||Ve(o.y_max)||Number.isNaN(o.y_min)||Number.isNaN(o.y_max)||o.y_min>=o.y_max)return Lt("Invalid min/max y-axis configuration",`The y_min (${o.y_min}) and y_max (${o.y_max}) configuration options must be valid numbers.`);if(Ve(i))return ma();const l=_u(i),s=[];let a=[];if(l.length===0)return ma();let c=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER;for(let d=0;d<l.length;d++){const f=Gr(l[d]);if(Number.isNaN(f)||Ve(f))return Lt(bt(l),`The value cannot be interpreted as a numeric array. ${bt(f)} is not a number.`);f>c&&(c=f),f<u&&(u=f),s.push(f)}return s.length>0&&(c>o.y_max||u<o.y_min)?a=s.map(d=>c-u===0?c>(o.y_max||1)?o.y_max||1:o.y_min||0:((o.y_max||1)-(o.y_min||0))*((d-u)/(c-u))+(o.y_min||0)):a=s,{...r,copyData:s.join(","),data:{...r.data,values:a,displayValues:s.map(d=>Ni(d))},isMissingValue:Ve(i)}},getCellValue(i){var l,s;return i.kind===Z.Loading||((l=i.data)==null?void 0:l.values)===void 0?null:(s=i.data)==null?void 0:s.values}}}function $u(e){return wa(qm,e,"line")}$u.isEditableType=!1;function Wu(e){return wa(Jm,e,"bar")}Wu.isEditableType=!1;function ju(e){return wa(Zm,e,"area")}ju.isEditableType=!1;function ya(e){const t={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(n){let o=null;return o=Nu(n),o===void 0?Lt(bt(n),"The value cannot be interpreted as boolean."):{...t,data:o,isMissingValue:Ve(o)}},getCellValue(n){return n.data===void 0?null:n.data}}}ya.isEditableType=!0;function Uu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function xa(e,t,n,o,r,i,l){var s,a;const c=Xr({format:n,step:o,timezone:l},t.columnTypeOptions);let u;if(mt(c.timezone))try{u=((s=Uu(Bh(),c.timezone))==null?void 0:s.utcOffset())||void 0}catch{}let d;mt(c.min_value)&&(d=Bi(c.min_value)||void 0);let f;mt(c.max_value)&&(f=Bi(c.max_value)||void 0);const h={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=c.step)==null?void 0:a.toString())||"1",format:r,min:d,max:f}},g=m=>{const b=Bi(m);return b===null?!t.isRequired:!(b===void 0||mt(d)&&i(b)<i(d)||mt(f)&&i(b)>i(f))};return{...t,kind:e,sortMode:"default",validateInput:g,getCell(m,b){if(b===!0){const k=g(m);if(k===!1)return Lt(bt(m),"Invalid input.");k instanceof Date&&(m=k)}const y=Bi(m);let v="",I="",T=u;if(y===void 0)return Lt(bt(m),"The value cannot be interpreted as a datetime object.");if(y!==null){let k=Bh.utc(y);if(!k.isValid())return Lt(bt(y),`Invalid moment date. This should never happen. Please report this bug.
|
|
178
|
+
Error: ${k.toString()}`);if(c.timezone){try{k=Uu(k,c.timezone)}catch(x){return Lt(k.toISOString(),`Failed to adjust to the provided timezone: ${c.timezone}.
|
|
179
|
+
Error: ${x}`)}T=k.utcOffset()}try{I=Bu(k,c.format||n,e)}catch(x){return Lt(k.toISOString(),`Failed to format the date for rendering with: ${c.format}.
|
|
180
|
+
Error: ${x}`)}v=Bu(k,n,e)}return{...h,copyData:v,isMissingValue:Ve(y),data:{...h.data,date:y,displayDate:I,timezoneOffset:T}}},getCellValue(m){var b;return Ve((b=m==null?void 0:m.data)==null?void 0:b.date)?null:i(m.data.date)}}}function Ca(e){var t,n,o;let r="YYYY-MM-DD HH:mm:ss";((t=e.columnTypeOptions)==null?void 0:t.step)>=60?r="YYYY-MM-DD HH:mm":((n=e.columnTypeOptions)==null?void 0:n.step)<1&&(r="YYYY-MM-DD HH:mm:ss.SSS");const i=Zy(e.arrowType),l=mt(i)||mt((o=e==null?void 0:e.columnTypeOptions)==null?void 0:o.timezone);return xa("datetime",e,l?r+"Z":r,1,"datetime-local",s=>l?s.toISOString():s.toISOString().replace("Z",""),i)}Ca.isEditableType=!0;function ka(e){var t,n;let o="HH:mm:ss";return((t=e.columnTypeOptions)==null?void 0:t.step)>=60?o="HH:mm":((n=e.columnTypeOptions)==null?void 0:n.step)<1&&(o="HH:mm:ss.SSS"),xa("time",e,o,1,"time",r=>r.toISOString().split("T")[1].replace("Z",""))}ka.isEditableType=!0;function Sa(e){return xa("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}Sa.isEditableType=!0;function Yu(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(n){const o=mt(n)?[bt(n)]:[];return{...t,data:o,isMissingValue:!mt(n),displayData:o}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}Yu.isEditableType=!1;function Xu(e){const t={kind:Z.Custom,allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",sortMode:"default",isEditable:!1,getCell(n){try{const o=mt(n)?Kr(_i(n)):"";return{...t,copyData:o,isMissingValue:Ve(n),data:{...t.data,value:n,displayValue:o}}}catch(o){return Lt(bt(n),`The value cannot be interpreted as a JSON string. Error: ${o}`)}},getCellValue(n){var o;return((o=n.data)==null?void 0:o.value)??null}}}Xu.isEditableType=!1;function Gu(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n=`Invalid validate regex: ${t.validate}.
|
|
181
|
+
Error: ${l}`}let o;if(!Ve(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{o=new RegExp(t.display_text,"us")}catch{o=void 0}const r={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},i=l=>{if(Ve(l))return!e.isRequired;const s=bt(l);return!(t.max_chars&&s.length>t.max_chars||n instanceof RegExp&&n.test(s)===!1)};return{...e,kind:"link",sortMode:"default",validateInput:i,getCell(l,s){if(Ve(l))return{...r,data:null,isMissingValue:!0,onClickUri:()=>{}};const a=l;if(typeof n=="string")return Lt(bt(a),n);if(s&&i(a)===!1)return Lt(bt(a),"Invalid input.");let c="";return a&&(o!==void 0?c=Um(o,a):c=t.display_text||a),{...r,data:a,displayData:c,isMissingValue:Ve(a),onClickUri:u=>{window.open(a.startsWith("www.")?`https://${a}`:a,"_blank","noopener,noreferrer"),u.preventDefault()},copyData:a}},getCellValue(l){return Ve(l.data)?null:l.data}}}Gu.isEditableType=!0;function Ma(e){const t={kind:Z.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(n){const o=Ve(n)?[]:_u(n);return{...t,data:o,isMissingValue:Ve(n),copyData:Ve(n)?"":bt(o.map(r=>typeof r=="string"&&r.includes(",")?r.replace(/,/g," "):r))}},getCellValue(n){return Ve(n.data)||Fi(n)?null:n.data}}}Ma.isEditableType=!1;function Ra(e){const t=Xr({step:Vh(e.arrowType)?1:void 0,min_value:Jy(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Qy(e.arrowType)||ex(e.arrowType)),o=Ve(t.min_value)||t.min_value<0,r=mt(t.step)&&!Number.isNaN(t.step)?Vu(t.step):void 0,i={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:o,fixedDecimals:r,thousandSeparator:""},l=s=>{let a=Gr(s);if(Ve(a))return!e.isRequired;if(Number.isNaN(a))return!1;let c=!1;return mt(t.max_value)&&a>t.max_value&&(a=t.max_value,c=!0),mt(t.min_value)&&a<t.min_value?!1:c?a:!0};return{...e,kind:"number",sortMode:"smart",validateInput:l,getCell(s,a){if(a===!0){const d=l(s);if(d===!1)return Lt(bt(s),"Invalid input.");typeof d=="number"&&(s=d)}let c=Gr(s),u="";if(mt(c)){if(Number.isNaN(c))return Lt(bt(s),"The value cannot be interpreted as a number.");if(mt(r)&&(c=Wm(c,r)),Number.isInteger(c)&&!Number.isSafeInteger(c))return Lt(bt(s),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?u=ws(c,e.arrowType):u=Ni(c,t.format,r)}catch(d){return Lt(bt(c),mt(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{...i,data:c,displayData:u,isMissingValue:Ve(c),copyData:Ve(c)?"":bt(c)}},getCellValue(s){return s.data===void 0?null:s.data}}}Ra.isEditableType=!0;function qr(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(n){try{const o=mt(n)?bt(n):null,r=mt(o)?Kr(o):"";return{...t,data:o,displayData:r,isMissingValue:Ve(n)}}catch(o){return Lt(bt(n),`The value cannot be interpreted as a string. Error: ${o}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}qr.isEditableType=!1;function Ku(e){const t=Vh(e.arrowType),n=Xr({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let o;try{o=Ni(n.max_value,n.format)}catch{o=bt(n.max_value)}const r=Ve(n.step)||Number.isNaN(n.step)?void 0:Vu(n.step),i={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:o,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(l){if(Ve(l))return ma();if(Ve(n.min_value)||Ve(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Lt("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(Ve(n.step)||Number.isNaN(n.step))return Lt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const s=Gr(l);if(Number.isNaN(s)||Ve(s))return Lt(bt(l),"The value cannot be interpreted as a number.");if(Number.isInteger(s)&&!Number.isSafeInteger(s))return Lt(bt(l),"The value is larger than the maximum supported integer values in number columns (2^53).");let a="";try{a=Ni(s,n.format,r)}catch(u){return Lt(bt(s),mt(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${u}`:`Failed to format the number. Error: ${u}`)}const c=Math.min(n.max_value,Math.max(n.min_value,s));return{...i,isMissingValue:Ve(l),copyData:String(s),data:{...i.data,value:c,label:a}}},getCellValue(l){var s,a;return l.kind===Z.Loading||((s=l.data)==null?void 0:s.value)===void 0?null:(a=l.data)==null?void 0:a.value}}}Ku.isEditableType=!1;function Ea(e){let t="string";const n=Xr({options:$h(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),o=new Set(n.options.map(i=>typeof i));o.size===1&&(o.has("number")||o.has("bigint")?t="number":o.has("boolean")&&(t="boolean"));const r={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]:[],...n.options.filter(i=>i!==null&&i!=="").map(i=>bt(i))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(i,l){let s=null;return mt(i)&&i!==""&&(s=bt(i)),l&&!r.data.allowedValues.includes(s)?Lt(bt(s),"The value is not part of the allowed options."):{...r,isMissingValue:s===null,copyData:s||"",data:{...r.data,value:s}}},getCellValue(i){var l,s,a,c,u;return Ve((l=i.data)==null?void 0:l.value)||((s=i.data)==null?void 0:s.value)===""?null:t==="number"?Gr((a=i.data)==null?void 0:a.value)??null:t==="boolean"?Nu((c=i.data)==null?void 0:c.value)??null:(u=i.data)==null?void 0:u.value}}}Ea.isEditableType=!0;function Ia(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(i){n=`Invalid validate regex: ${t.validate}.
|
|
182
|
+
Error: ${i}`}const o={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},r=i=>{if(Ve(i))return!e.isRequired;let l=bt(i),s=!1;return t.max_chars&&l.length>t.max_chars&&(l=l.slice(0,t.max_chars),s=!0),n instanceof RegExp&&n.test(l)===!1?!1:s?l:!0};return{...e,kind:"text",sortMode:"default",validateInput:r,getCell(i,l){if(typeof n=="string")return Lt(bt(i),n);if(l){const s=r(i);if(s===!1)return Lt(bt(i),"Invalid input.");typeof s=="string"&&(i=s)}try{const s=mt(i)?bt(i):null,a=mt(s)?Kr(s):"";return{...o,isMissingValue:Ve(s),data:s,displayData:a}}catch(s){return Lt("Incompatible value",`The value cannot be interpreted as string. Error: ${s}`)}},getCellValue(i){return i.data===void 0?null:i.data}}}Ia.isEditableType=!0;const qu=Sr("img",{target:"e24uaba0"})({name:"6eya2z",styles:"max-width:100%;max-height:37.5rem;object-fit:scale-down"}),Qm=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?Oe.jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:Oe.jsx(qu,{src:t})}):Oe.jsx(qu,{src:t})},Zu=new Map(Object.entries({object:qr,text:Ia,checkbox:ya,selectbox:Ea,list:Ma,number:Ra,link:Gu,datetime:Ca,date:Sa,time:ka,line_chart:$u,bar_chart:Wu,area_chart:ju,image:Yu,progress:Ku,json:Xu})),ev=[Km];var tv=Wh();const nv=vo(tv);var Ta,Ju;function ov(){if(Ju)return Ta;Ju=1;var e=tx(),t=nx(),n=ox(),o=Wh(),r=rx(),i=ix(),l=lx(),s=ax(),a="[object Map]",c="[object Set]",u=Object.prototype,d=u.hasOwnProperty;function f(h){if(h==null)return!0;if(r(h)&&(o(h)||typeof h=="string"||typeof h.splice=="function"||i(h)||s(h)||n(h)))return!h.length;var g=t(h);if(g==a||g==c)return!h.size;if(l(h))return!e(h).length;for(var m in h)if(d.call(h,m))return!1;return!0}return Ta=f,Ta}var rv=ov();const iv=vo(rv);function Qu(e,t,n){const o=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const r=o.exec(n);if(r)return r[1].trim()}function lv(e,t,n){const o={},r=Qu(t,"color",n);r&&(o.textDark=r);const i=Qu(t,"background-color",n);return i&&(o.bgCell=i),i==="yellow"&&r===void 0&&(o.textDark="#31333F"),o?{...e,themeOverride:o}:e}function av(e){return fx(e)||px(e)?Ia:gx(e)?Ca:jh(e)?ka:mx(e)?Sa:vx(e)||bx(e)?qr:$h(e)?ya:wx(e)?Ra:yx(e)?Ea:xx(e)?Ma:qr}function ed(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(o=>o!=="").join(" / "):void 0;return{title:t,group:n}}function Oa(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function sv(e,t){const n=e.columnNames.map(s=>s[t]),{title:o,group:r}=ed(n),i=e.columnTypes[t];let l=!0;return hx(i)&&(l=!1),Oa({id:`_index-${t}`,indexNumber:t,name:o,title:o,group:r,isEditable:l,arrowType:i,isIndex:!0,isPinned:!0})}function cv(e,t){const n=e.columnNames.map(l=>l[t]),{title:o,group:r}=ed(n),i=e.columnTypes[t];return Oa({id:`_column-${o}-${t}`,indexNumber:t,name:o,isEditable:!0,title:o,arrowType:i,group:r})}function td(){return Oa({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Cx.INDEX,arrowField:new sx("",new cx,!0),pandasType:void 0}})}function nd(e){const t=[],{dimensions:n}=e,o=n.numIndexColumns,r=n.numDataColumns;if(o===0&&r===0)return t.push(td()),t;for(let i=0;i<o;i++)t.push(sv(e,i));for(let i=0;i<r;i++)t.push(cv(e,i+o));return t}function uv(e,t,n,o=void 0){var r,i,l,s,a,c;let u;if(e.kind==="object"||e.kind==="json")u=e.getCell(mt(t.content)?Kr(ws(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&mt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;jh(t.contentType)&&mt((i=(r=t.field)==null?void 0:r.type)==null?void 0:i.unit)?d=ux(t.content,t.field):d=Qo.utc(Number(t.content)).toDate(),u=e.getCell(d)}else if(dx(t.contentType)){const d=Ve(t.content)?null:ws(t.content,t.contentType);u=e.getCell(d)}else u=e.getCell(t.content);if(lr(u))return u;if(!e.isEditable){if(n&&mt(n==null?void 0:n.displayContent)){const d=Kr(n.displayContent);u.kind===Z.Text?u={...u,displayData:d}:u.kind===Z.Number&&Ve((l=e.columnTypeOptions)==null?void 0:l.format)?u={...u,displayData:d}:u.kind===Z.Uri&&Ve((s=e.columnTypeOptions)==null?void 0:s.display_text)?u={...u,displayData:d}:u.kind===Z.Custom&&((a=u.data)==null?void 0:a.kind)==="date-picker-cell"&&Ve((c=e.columnTypeOptions)==null?void 0:c.format)&&(u={...u,data:{...u.data,displayDate:d}})}o&&n!=null&&n.cssId&&(u=lv(u,n.cssId,o))}return u}const Vi="_index",od="_pos:",rd={small:75,medium:200,large:400},id=ys.getLogger("useColumnLoader");function dv(e){if(!Ve(e)){if(typeof e=="number")return e;if(e in rd)return rd[e]}}const $i=(e,t)=>oC(e,t,(n,o)=>{if(nv(o))return o});function ld(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(Vi)&&(n=$i(n,t.get(Vi)??{})),t.has(`${od}${e.indexNumber}`)&&(n=$i(n,t.get(`${od}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==Vi&&(n=$i(n,t.get(e.name)??{})),t.has(e.id)&&(n=$i(n,t.get(e.id)??{})),iv(n)?e:Nh({...e},{title:n.label,width:dv(n.width),isEditable:mt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function hv(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return id.error(t),new Map}}function ad(e){var t;const n=(t=e.columnTypeOptions)==null?void 0:t.type;let o;return mt(n)&&(Zu.has(n)?o=Zu.get(n):id.warn(`Unknown column type configured in column configuration: ${n}`)),Ve(o)&&(o=av(e.arrowType)),o}function fv(e,t,n,o){const r=Jo(),i=te.useMemo(()=>hv(e.columns),[e.columns]),[l,s]=te.useState(i);te.useEffect(()=>{s(i)},[i]);const a=e.useContainerWidth||mt(e.width)&&e.width>0,c=mt(e.rowHeight)&&e.rowHeight>Vn("4rem"),u=te.useMemo(()=>nd(t).map(d=>{let f={...d,...ld(d,l),isStretched:a};const h=ad(f);return(e.editingMode===En.EditingMode.READ_ONLY||n||h.isEditableType===!1)&&(f={...f,isEditable:!1}),e.editingMode!==En.EditingMode.READ_ONLY&&f.isEditable==!0&&(f={...f,icon:"editable"},f.isRequired&&e.editingMode===En.EditingMode.DYNAMIC&&(f={...f,isHidden:!1})),h(f,r)}),[t,l,a,e.editingMode,n,r]);return{columns:te.useMemo(()=>{const d=nd(t).map(m=>{let b={...m,...ld(m,l),isStretched:a,isWrappingAllowed:c};const y=ad(b);return(e.editingMode===En.EditingMode.READ_ONLY||n||y.isEditableType===!1)&&(b={...b,isEditable:!1}),e.editingMode!==En.EditingMode.READ_ONLY&&b.isEditable==!0&&(b={...b,icon:"editable"},b.isRequired&&e.editingMode===En.EditingMode.DYNAMIC&&(b={...b,isHidden:!1})),y(b,r)}).filter(m=>!m.isHidden),f=[],h=[];o!=null&&o.length?(d.forEach(m=>{m.isIndex&&!o.includes(m.name)&&!o.includes(m.id)&&m.isPinned!==!1&&f.push(m)}),o.forEach(m=>{const b=d.find(y=>y.name===m||y.id===m);b&&(b.isPinned?f.push(b):h.push(b))})):d.forEach(m=>{m.isPinned?f.push(m):h.push(m)});const g=[...f,...h];return g.length>0?g:[qr(td())]},[t,l,c,a,n,e.editingMode,o,r]),allColumns:u,setColumnConfigMapping:s}}function Zr(e){return e.isIndex?Vi:Ve(e.name)?"":e.name}class Wi{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(r=>{n.set(r.indexNumber,r)});const o={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((r,i,l)=>{const s={};r.forEach((a,c,u)=>{const d=n.get(c);d&&(s[Zr(d)]=d.getCellValue(a))}),o.edited_rows[i]=s}),this.addedRows.forEach(r=>{const i={};let l=!1;r.forEach((s,a,c)=>{const u=n.get(a);if(u){const d=u.getCellValue(s);u.isRequired&&u.isEditable&&Fi(s)&&(l=!0),mt(d)&&(i[Zr(u)]=d)}}),l||o.added_rows.push(i)}),o.deleted_rows=this.deletedRows,JSON.stringify(o,(r,i)=>i===void 0?null:i)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const o=JSON.parse(t),r=new Map;n.forEach(l=>{r.set(l.indexNumber,l)});const i=new Map;n.forEach(l=>{i.set(Zr(l),l)}),Object.keys(o.edited_rows).forEach(l=>{const s=Number(l),a=o.edited_rows[l];Object.keys(a).forEach(c=>{var u;const d=a[c],f=i.get(c);if(f){const h=f.getCell(d);h&&(this.editedCells.has(s)||this.editedCells.set(s,new Map),(u=this.editedCells.get(s))==null||u.set(f.indexNumber,h))}})}),o.added_rows.forEach(l=>{const s=new Map;n.forEach(a=>{s.set(a.indexNumber,a.getCell(null))}),Object.keys(l).forEach(a=>{const c=l[a],u=i.get(a);if(u){const d=u.getCell(c);d&&s.set(u.indexNumber,d)}}),this.addedRows.push(s)}),this.deletedRows=o.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const o=this.editedCells.get(n);if(o!==void 0)return o.get(t)}setCell(t,n,o){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,o)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,o)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,o)=>o-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Ve(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,o)=>n-o)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let o=0;o<this.deletedRows.length&&!(this.deletedRows[o]>n);o++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const Jr=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const o=new Map(t),r=o.get(e),i={...r||{},...n||{}};return(r!=null&&r.type_config||n!=null&&n.type_config)&&(i.type_config={...(r==null?void 0:r.type_config)||{},...(n==null?void 0:n.type_config)||{}}),o.set(e,i),o};function pv(e){return{changeColumnFormat:te.useCallback((t,n)=>{e(o=>Jr({columnId:t,columnConfigMapping:o,updatedProps:{type_config:{format:n}}}))},[e])}}function gv(e,t,n,o,r,i){const l=te.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,u)=>c+(u.width??o*2),0)>n*.6,[e,n,o]),s=t||l?0:e.filter(c=>c.isPinned).length,a=te.useCallback(c=>{i(u=>Jr({columnId:c,columnConfigMapping:u,updatedProps:{pinned:!1}})),r(!0,!1)},[r,i]);return{pinColumn:te.useCallback(c=>{i(u=>Jr({columnId:c,columnConfigMapping:u,updatedProps:{pinned:!0}})),r(!0,!1)},[r,i]),unpinColumn:a,freezeColumns:s}}function mv(e,t,n,o,r){return{onColumnMoved:te.useCallback((i,l)=>{const s=[...e],[a]=s.splice(i,1);s.splice(l,0,a),l<t&&!a.isPinned?n(a.id):l>=t&&a.isPinned&&o(a.id),r(s.map(c=>c.id))},[e,t,n,o,r])}}function vv(e){const[t,n]=p.useState(()=>new Map),o=te.useCallback((r,i,l,s)=>{r.id&&n(new Map(t).set(r.id,s))},[t]);return{columns:te.useMemo(()=>e.map(r=>r.id&&t.has(r.id)&&t.get(r.id)!==void 0?{...r,width:t.get(r.id),grow:0}:r),[e,t]),onColumnResize:o}}function bv(e){var t,n;switch(e.kind){case Z.Number:return((t=e.data)==null?void 0:t.toString())??"";case Z.Boolean:return((n=e.data)==null?void 0:n.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(o=>o.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function sd(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function wv(e,t){return e=sd(e),t=sd(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 yv(e,t){return e>t?1:e===t?0:-1}function xv(e){const{sort:t,rows:n,getCellContent:o}=e;let r=t===void 0?void 0:e.columns.findIndex(c=>t.column===c||c.id!==void 0&&t.column.id===c.id);r===-1&&(r=void 0);const i=(t==null?void 0:t.direction)??"asc",l=p.useMemo(()=>{if(r===void 0)return;const c=new Array(n),u=[r,0];for(let f=0;f<n;f++)u[1]=f,c[f]=bv(o(u));let d;return(t==null?void 0:t.mode)==="raw"?d=so(n).sort((f,h)=>yv(c[f],c[h])):(t==null?void 0:t.mode)==="smart"?d=so(n).sort((f,h)=>wv(c[f],c[h])):d=so(n).sort((f,h)=>c[f].localeCompare(c[h])),i==="desc"&&d.reverse(),d},[o,n,t==null?void 0:t.mode,i,r]),s=p.useCallback(c=>l===void 0?c:l[c],[l]),a=p.useCallback(([c,u])=>l===void 0?o([c,u]):(u=l[u],o([c,u])),[o,l]);return l===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:a}}function Cv(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`\u2191 ${n.title}`:`\u2193 ${n.title}`}:n)}function kv(e,t,n){const[o,r]=te.useState(),{getCellContent:i,getOriginalIndex:l}=xv({columns:t.map(c=>va(c)),getCellContent:n,rows:e,sort:o}),s=te.useMemo(()=>Cv(t,o),[t,o]),a=te.useCallback((c,u,d)=>{const f=s[c];let h;u==="auto"?(h="asc",o&&o.column.id===f.id&&(o.direction==="asc"?h="desc":h=void 0)):h=u,h===void 0||d&&h===(o==null?void 0:o.direction)?r(void 0):r({column:va(f),direction:h,mode:f.sortMode})},[o,s]);return{columns:s,sortColumn:a,getOriginalIndex:l,getCellContent:i}}function Sv(e,t){const n=te.useCallback(r=>{t(i=>Jr({columnId:r,columnConfigMapping:i,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),o=te.useCallback(r=>{t(i=>Jr({columnId:r,columnConfigMapping:i,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:o}}function Mv(){return{provideEditor:p.useCallback(e=>{if(e.kind===Z.Text&&e.readonly&&Vm(e.data))return{editor:Gm}},[])}}const Rv={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:o,rect:r,hoverAmount:i,hoverX:l}=e;let{values:s,yAxis:a,color:c,graphKind:u="area",displayValues:d,hideAxis:f}=t.data;const[h,g]=a;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-h)/(g-h))));const m=o.cellHorizontalPadding,b=m+r.x,y=r.y+3,v=r.height-6,I=r.width-m*2,T=g-h,k=g<=0?y:h>=0?y+v:y+v*(g/T);if(!f&&h<=0&&g>=0&&(n.beginPath(),n.moveTo(b,k),n.lineTo(b+I,k),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=o.textLight,n.stroke(),n.globalAlpha=1),u==="bar"){n.beginPath();const x=2,L=(s.length-1)*x,O=(I-L)/s.length;let R=b;for(const P of s){const M=y+v-P*v;n.moveTo(R,k),n.lineTo(R+O,k),n.lineTo(R+O,M),n.lineTo(R,M),R+=O+x}n.fillStyle=t.data.color??o.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),L=s.map((R,P)=>({x:b+x*P,y:y+v-R*v}));n.moveTo(L[0].x,L[0].y);let O=0;if(L.length>2)for(O=1;O<L.length-2;O++){const R=(L[O].x+L[O+1].x)/2,P=(L[O].y+L[O+1].y)/2;n.quadraticCurveTo(L[O].x,L[O].y,R,P)}if(n.quadraticCurveTo(L[O].x,L[O].y,L[O+1].x,L[O+1].y),n.strokeStyle=c??o.accentColor,n.lineWidth=1+i*.5,n.stroke(),n.lineTo(r.x+r.width-m,k),n.lineTo(r.x+m,k),n.closePath(),u==="area"){n.globalAlpha=.2+.2*i;const R=n.createLinearGradient(0,y,0,y+v*1.4);R.addColorStop(0,c??o.accentColor);const[P,M,S]=Ri(c??o.accentColor);R.addColorStop(1,`rgba(${P}, ${M}, ${S}, 0)`),n.fillStyle=R,n.fill(),n.globalAlpha=1}if(l!==void 0&&(u==="line"||u==="area")&&d!==void 0){n.beginPath();const R=Math.min(s.length-1,Math.max(0,Math.round((l-m)/x)));n.moveTo(b+R*x,r.y+1),n.lineTo(b+R*x,r.y+r.height),n.lineWidth=1,n.strokeStyle=o.textLight,n.stroke(),n.save(),n.font=`8px ${o.fontFamily}`,n.fillStyle=o.textMedium,n.textBaseline="top",n.fillText(d[R],b,r.y+o.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function cd(e,t,n,o,r,i){if(!(o<=0||r<=0)){if(typeof i=="number"&&i<=0){e.rect(t,n,o,r);return}typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.min(i.tl,r/2,o/2),tr:Math.min(i.tr,r/2,o/2),bl:Math.min(i.bl,r/2,o/2),br:Math.min(i.br,r/2,o/2)},i.tl=Math.max(0,i.tl),i.tr=Math.max(0,i.tr),i.br=Math.max(0,i.br),i.bl=Math.max(0,i.bl),e.moveTo(t+i.tl,n),e.arcTo(t+o,n,t+o,n+i.tr,i.tr),e.arcTo(t+o,n+r,t+o-i.br,n+r,i.br),e.arcTo(t,n+r,t,n+r-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}}function ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function We(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ud(Object(n),!0).forEach(function(o){mi(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ud(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}var Ev=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Iv(e){var t=e.defaultInputValue,n=t===void 0?"":t,o=e.defaultMenuIsOpen,r=o===void 0?!1:o,i=e.defaultValue,l=i===void 0?null:i,s=e.inputValue,a=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,h=e.value,g=wo(e,Ev),m=p.useState(s!==void 0?s:n),b=yo(m,2),y=b[0],v=b[1],I=p.useState(a!==void 0?a:r),T=yo(I,2),k=T[0],x=T[1],L=p.useState(h!==void 0?h:l),O=yo(L,2),R=O[0],P=O[1],M=p.useCallback(function(J,ae){typeof c=="function"&&c(J,ae),P(J)},[c]),S=p.useCallback(function(J,ae){var ne;typeof u=="function"&&(ne=u(J,ae)),v(ne!==void 0?ne:J)},[u]),E=p.useCallback(function(){typeof f=="function"&&f(),x(!0)},[f]),D=p.useCallback(function(){typeof d=="function"&&d(),x(!1)},[d]),C=s!==void 0?s:y,X=a!==void 0?a:k,B=h!==void 0?h:R;return We(We({},g),{},{inputValue:C,menuIsOpen:X,onChange:M,onInputChange:S,onMenuClose:D,onMenuOpen:E,value:B})}function Tv(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Ov(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Dv=function(){function e(n){var o=this;this._insertTag=function(r){var i;o.tags.length===0?o.insertionPoint?i=o.insertionPoint.nextSibling:o.prepend?i=o.container.firstChild:i=o.before:i=o.tags[o.tags.length-1].nextSibling,o.container.insertBefore(r,i),o.tags.push(r)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Ov(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var r=Tv(o);try{r.insertRule(n,r.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}(),zv=function(e,t,n){for(var o=0,r=0;o=r,r=xs(),o===38&&r===12&&(t[n]=1),!Gh(r);)Xh();return Ax(e,Kh)},Lv=function(e,t){var n=-1,o=44;do switch(Gh(o)){case 0:o===38&&xs()===12&&(t[n]=1),e[n]+=zv(Kh-1,t,n);break;case 2:e[n]+=Hx(o);break;case 4:if(o===44){e[++n]=xs()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Px(o)}while(o=Xh());return e},Pv=function(e,t){return Ox(Lv(Dx(e),t))},dd=new WeakMap,Hv=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!dd.get(n))&&!o){dd.set(e,!0);for(var r=[],i=Pv(t,r),l=n.props,s=0,a=0;s<i.length;s++)for(var c=0;c<l.length;c++,a++)e.props[a]=r[s]?i[s].replace(/&\f/g,l[c]):l[c]+" "+i[s]}}},Av=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function hd(e,t){switch(zx(e,t)){case 5103:return It+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return It+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return It+e+Rl+e+xn+e+e;case 6828:case 4268:return It+e+xn+e+e;case 6165:return It+e+xn+"flex-"+e+e;case 5187:return It+e+Ut(e,/(\w+).+(:[^]+)/,It+"box-$1$2"+xn+"flex-$1$2")+e;case 5443:return It+e+xn+"flex-item-"+Ut(e,/flex-|-self/,"")+e;case 4675:return It+e+xn+"flex-line-pack"+Ut(e,/align-content|flex-|-self/,"")+e;case 5548:return It+e+xn+Ut(e,"shrink","negative")+e;case 5292:return It+e+xn+Ut(e,"basis","preferred-size")+e;case 6060:return It+"box-"+Ut(e,"-grow","")+It+e+xn+Ut(e,"grow","positive")+e;case 4554:return It+Ut(e,/([^-])(transform)/g,"$1"+It+"$2")+e;case 6187:return Ut(Ut(Ut(e,/(zoom-|grab)/,It+"$1"),/(image-set)/,It+"$1"),e,"")+e;case 5495:case 3959:return Ut(e,/(image-set\([^]*)/,It+"$1$`$1");case 4968:return Ut(Ut(e,/(.+:)(flex-)?(.*)/,It+"box-pack:$3"+xn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+It+e+e;case 4095:case 3583:case 4068:case 2532:return Ut(e,/(.+)-inline(.+)/,It+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Uh(e)-1-t>6)switch(er(e,t+1)){case 109:if(er(e,t+4)!==45)break;case 102:return Ut(e,/(.+:)(.+)-([^]+)/,"$1"+It+"$2-$3$1"+Rl+(er(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Yh(e,"stretch")?hd(Ut(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(er(e,t+1)!==115)break;case 6444:switch(er(e,Uh(e)-3-(~Yh(e,"!important")&&10))){case 107:return Ut(e,":",":"+It)+e;case 101:return Ut(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+It+(er(e,14)===45?"inline-":"")+"box$3$1"+It+"$2$3$1"+xn+"$2box$3")+e}break;case 5936:switch(er(e,t+11)){case 114:return It+e+xn+Ut(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return It+e+xn+Ut(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return It+e+xn+Ut(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return It+e+xn+e+e}return e}var Fv=function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case Tx:e.return=hd(e.value,e.length);break;case Ix:return Ml([vi(e,{value:Ut(e.value,"@","@"+It)})],o);case Rx:if(e.length)return Ex(e.props,function(r){switch(Lx(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ml([vi(e,{props:[Ut(r,/:(read-\w+)/,":"+Rl+"$1")]})],o);case"::placeholder":return Ml([vi(e,{props:[Ut(r,/:(plac\w+)/,":"+It+"input-$1")]}),vi(e,{props:[Ut(r,/:(plac\w+)/,":"+Rl+"$1")]}),vi(e,{props:[Ut(r,/:(plac\w+)/,xn+"input-$1")]})],o)}return""})}},_v=[Fv],Nv=function(e){var t=e.key;if(t==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=e.stylisPlugins||_v,r={},i,l=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),b=1;b<m.length;b++)r[m[b]]=!0;l.push(g)});var s,a=[Hv,Av];{var c,u=[Sx,Mx(function(g){c.insert(g)})],d=kx(a.concat(o,u)),f=function(g){return Ml(Fx(g),d)};s=function(g,m,b,y){c=b,f(g?g+"{"+m.styles+"}":m.styles),y&&(h.inserted[m.name]=!0)}}var h={key:t,sheet:new Dv({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:r,registered:{},insert:s};return h.sheet.hydrate(l),h},Bv=function(e){return e()},Vv=qh.useInsertionEffect?qh.useInsertionEffect:!1,$v=Vv||Bv,Da={}.hasOwnProperty,fd=p.createContext(typeof HTMLElement<"u"?Nv({key:"css"}):null);fd.Provider;var Wv=function(e){return p.forwardRef(function(t,n){var o=p.useContext(fd);return e(t,o,n)})},jv=p.createContext({}),za="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Uv=function(e,t){var n={};for(var o in t)Da.call(t,o)&&(n[o]=t[o]);return n[za]=e,n},Yv=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Nx(t,n,o),$v(function(){return Bx(t,n,o)}),null},Xv=Wv(function(e,t,n){var o=e.css;typeof o=="string"&&t.registered[o]!==void 0&&(o=t.registered[o]);var r=e[za],i=[o],l="";typeof e.className=="string"?l=_x(t.registered,i,e.className):e.className!=null&&(l=e.className+" ");var s=Zh(i,void 0,p.useContext(jv));l+=t.key+"-"+s.name;var a={};for(var c in e)Da.call(e,c)&&c!=="css"&&c!==za&&(a[c]=e[c]);return a.ref=n,a.className=l,p.createElement(p.Fragment,null,p.createElement(Yv,{cache:t,serialized:s,isStringTag:typeof r=="string"}),p.createElement(r,a))}),Gv=Xv,Ae=function(e,t){var n=arguments;if(t==null||!Da.call(t,"css"))return p.createElement.apply(void 0,n);var o=n.length,r=new Array(o);r[0]=Gv,r[1]=Uv(e,t);for(var i=2;i<o;i++)r[i]=n[i];return p.createElement.apply(null,r)};function La(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Zh(t)}var Kv=function(){var e=La.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function qv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Zv=Math.min,Jv=Math.max,ji=Math.round,Ui=Math.floor,Yi=e=>({x:e,y:e});function Qv(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function pd(e){return md(e)?(e.nodeName||"").toLowerCase():"#document"}function uo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gd(e){var t;return(t=(md(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function md(e){return e instanceof Node||e instanceof uo(e).Node}function e1(e){return e instanceof Element||e instanceof uo(e).Element}function Pa(e){return e instanceof HTMLElement||e instanceof uo(e).HTMLElement}function vd(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof uo(e).ShadowRoot}function bd(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function t1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function n1(e){return["html","body","#document"].includes(pd(e))}function Ha(e){return uo(e).getComputedStyle(e)}function o1(e){if(pd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vd(e)&&e.host||gd(e);return vd(t)?t.host:t}function wd(e){const t=o1(e);return n1(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pa(t)&&bd(t)?t:wd(t)}function Xi(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=wd(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=uo(r);return i?t.concat(l,l.visualViewport||[],bd(r)?r:[],l.frameElement&&n?Xi(l.frameElement):[]):t.concat(r,Xi(r,[],n))}function r1(e){const t=Ha(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Pa(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,s=ji(n)!==i||ji(o)!==l;return s&&(n=i,o=l),{width:n,height:o,$:s}}function Aa(e){return e1(e)?e:e.contextElement}function yd(e){const t=Aa(e);if(!Pa(t))return Yi(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=r1(t);let l=(i?ji(n.width):n.width)/o,s=(i?ji(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const i1=Yi(0);function l1(e){const t=uo(e);return!t1()||!t.visualViewport?i1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function a1(e,t,n){return!1}function xd(e,t,n,o){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Aa(e);let l=Yi(1);t&&(l=yd(e));const s=a1()?l1(i):Yi(0);let a=(r.left+s.x)/l.x,c=(r.top+s.y)/l.y,u=r.width/l.x,d=r.height/l.y;if(i){const f=uo(i),h=o;let g=f.frameElement;for(;g&&o&&h!==f;){const m=yd(g),b=g.getBoundingClientRect(),y=Ha(g),v=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,I=b.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;a*=m.x,c*=m.y,u*=m.x,d*=m.y,a+=v,c+=I,g=uo(g).frameElement}}return Qv({width:u,height:d,x:a,y:c})}function s1(e,t){let n=null,o;const r=gd(e);function i(){clearTimeout(o),n&&n.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=Ui(u),g=Ui(r.clientWidth-(c+d)),m=Ui(r.clientHeight-(u+f)),b=Ui(c),y={rootMargin:-h+"px "+-g+"px "+-m+"px "+-b+"px",threshold:Jv(0,Zv(1,a))||1};let v=!0;function I(T){const k=T[0].intersectionRatio;if(k!==a){if(!v)return l();k?l(!1,k):o=setTimeout(()=>{l(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(I,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(I,y)}n.observe(e)}return l(!0),i}function c1(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,c=Aa(e),u=r||i?[...c?Xi(c):[],...Xi(t)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&s?s1(c,n):null;let f=-1,h=null;l&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{h&&h.observe(t)})),n()}),c&&!a&&h.observe(c),h.observe(t));let g,m=a?xd(e):null;a&&b();function b(){const y=xd(e);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&n(),m=y,g=requestAnimationFrame(b)}return n(),()=>{u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d&&d(),h&&h.disconnect(),h=null,a&&cancelAnimationFrame(g)}}var Fa=p.useLayoutEffect,u1=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Gi=function(){};function d1(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function h1(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];var i=[].concat(o);if(t&&e)for(var l in t)t.hasOwnProperty(l)&&t[l]&&i.push("".concat(d1(e,l)));return i.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var Cd=function(e){return x1(e)?e.filter(Boolean):Vx(e)==="object"&&e!==null?[e]:[]},kd=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=wo(e,u1);return We({},t)},on=function(e,t,n){var o=e.cx,r=e.getStyles,i=e.getClassNames,l=e.className;return{css:r(t,e),className:o(n??{},i(t,e),l)}};function Ki(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function f1(e){return Ki(e)?window.innerHeight:e.clientHeight}function Sd(e){return Ki(e)?window.pageYOffset:e.scrollTop}function qi(e,t){if(Ki(e)){window.scrollTo(0,t);return}e.scrollTop=t}function p1(e){var t=getComputedStyle(e),n=t.position==="absolute",o=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&o.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function g1(e,t,n,o){return n*((e=e/o-1)*e*e+1)+t}function Zi(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Gi,r=Sd(e),i=t-r,l=10,s=0;function a(){s+=l;var c=g1(s,r,i,n);qi(e,c),s<n?window.requestAnimationFrame(a):o(e)}a()}function Md(e,t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=t.offsetHeight/3;o.bottom+r>n.bottom?qi(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):o.top-r<n.top&&qi(e,Math.max(t.offsetTop-r,0))}function m1(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 Rd(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function v1(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ed=!1,b1={get passive(){return Ed=!0}},Ji=typeof window<"u"?window:{};Ji.addEventListener&&Ji.removeEventListener&&(Ji.addEventListener("p",Gi,b1),Ji.removeEventListener("p",Gi,!1));var w1=Ed;function y1(e){return e!=null}function x1(e){return Array.isArray(e)}function Qi(e,t,n){return e?t:n}var C1=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=Object.entries(e).filter(function(i){var l=yo(i,1),s=l[0];return!n.includes(s)});return r.reduce(function(i,l){var s=yo(l,2),a=s[0],c=s[1];return i[a]=c,i},{})},k1=["children","innerProps"],S1=["children","innerProps"];function M1(e){var t=e.maxHeight,n=e.menuEl,o=e.minHeight,r=e.placement,i=e.shouldScroll,l=e.isFixedPosition,s=e.controlHeight,a=p1(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u=a.getBoundingClientRect(),d=u.height,f=n.getBoundingClientRect(),h=f.bottom,g=f.height,m=f.top,b=n.offsetParent.getBoundingClientRect(),y=b.top,v=l?window.innerHeight:f1(a),I=Sd(a),T=parseInt(getComputedStyle(n).marginBottom,10),k=parseInt(getComputedStyle(n).marginTop,10),x=y-k,L=v-m,O=x+I,R=d-I-m,P=h-v+I+T,M=I+m-k,S=160;switch(r){case"auto":case"bottom":if(L>=g)return{placement:"bottom",maxHeight:t};if(R>=g&&!l)return i&&Zi(a,P,S),{placement:"bottom",maxHeight:t};if(!l&&R>=o||l&&L>=o){i&&Zi(a,P,S);var E=l?L-T:R-T;return{placement:"bottom",maxHeight:E}}if(r==="auto"||l){var D=t,C=l?x:O;return C>=o&&(D=Math.min(C-T-s,t)),{placement:"top",maxHeight:D}}if(r==="bottom")return i&&qi(a,P),{placement:"bottom",maxHeight:t};break;case"top":if(x>=g)return{placement:"top",maxHeight:t};if(O>=g&&!l)return i&&Zi(a,M,S),{placement:"top",maxHeight:t};if(!l&&O>=o||l&&x>=o){var X=t;return(!l&&O>=o||l&&x>=o)&&(X=l?x-k:O-k),i&&Zi(a,M,S),{placement:"top",maxHeight:X}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function R1(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Id=function(e){return e==="auto"?"bottom":e},E1=function(e,t){var n,o=e.placement,r=e.theme,i=r.borderRadius,l=r.spacing,s=r.colors;return We((n={label:"menu"},mi(n,R1(o),"100%"),mi(n,"position","absolute"),mi(n,"width","100%"),mi(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},Td=p.createContext(null),I1=function(e){var t=e.children,n=e.minMenuHeight,o=e.maxMenuHeight,r=e.menuPlacement,i=e.menuPosition,l=e.menuShouldScrollIntoView,s=e.theme,a=p.useContext(Td)||{},c=a.setPortalPlacement,u=p.useRef(null),d=p.useState(o),f=yo(d,2),h=f[0],g=f[1],m=p.useState(null),b=yo(m,2),y=b[0],v=b[1],I=s.spacing.controlHeight;return Fa(function(){var T=u.current;if(T){var k=i==="fixed",x=l&&!k,L=M1({maxHeight:o,menuEl:T,minHeight:n,placement:r,shouldScroll:x,isFixedPosition:k,controlHeight:I});g(L.maxHeight),v(L.placement),c==null||c(L.placement)}},[o,r,i,l,n,c,I]),t({ref:u,placerProps:We(We({},e),{},{placement:y||Id(r),maxHeight:h})})},T1=function(e){var t=e.children,n=e.innerRef,o=e.innerProps;return Ae("div",Ke({},on(e,"menu",{menu:!0}),{ref:n},o),t)},O1=T1,D1=function(e,t){var n=e.maxHeight,o=e.theme.spacing.baseUnit;return We({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:o,paddingTop:o})},z1=function(e){var t=e.children,n=e.innerProps,o=e.innerRef,r=e.isMulti;return Ae("div",Ke({},on(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:o},n),t)},Od=function(e,t){var n=e.theme,o=n.spacing.baseUnit,r=n.colors;return We({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(o*2,"px ").concat(o*3,"px")})},L1=Od,P1=Od,H1=function(e){var t=e.children,n=t===void 0?"No options":t,o=e.innerProps,r=wo(e,k1);return Ae("div",Ke({},on(We(We({},r),{},{children:n,innerProps:o}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),o),n)},A1=function(e){var t=e.children,n=t===void 0?"Loading...":t,o=e.innerProps,r=wo(e,S1);return Ae("div",Ke({},on(We(We({},r),{},{children:n,innerProps:o}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),o),n)},F1=function(e){var t=e.rect,n=e.offset,o=e.position;return{left:t.left,position:o,top:n,width:t.width,zIndex:1}},_1=function(e){var t=e.appendTo,n=e.children,o=e.controlElement,r=e.innerProps,i=e.menuPlacement,l=e.menuPosition,s=p.useRef(null),a=p.useRef(null),c=p.useState(Id(i)),u=yo(c,2),d=u[0],f=u[1],h=p.useMemo(function(){return{setPortalPlacement:f}},[]),g=p.useState(null),m=yo(g,2),b=m[0],y=m[1],v=p.useCallback(function(){if(o){var x=m1(o),L=l==="fixed"?0:window.pageYOffset,O=x[d]+L;(O!==(b==null?void 0:b.offset)||x.left!==(b==null?void 0:b.rect.left)||x.width!==(b==null?void 0:b.rect.width))&&y({offset:O,rect:x})}},[o,l,d,b==null?void 0:b.offset,b==null?void 0:b.rect.left,b==null?void 0:b.rect.width]);Fa(function(){v()},[v]);var I=p.useCallback(function(){typeof a.current=="function"&&(a.current(),a.current=null),o&&s.current&&(a.current=c1(o,s.current,v,{elementResize:"ResizeObserver"in window}))},[o,v]);Fa(function(){I()},[I]);var T=p.useCallback(function(x){s.current=x,I()},[I]);if(!t&&l!=="fixed"||!b)return null;var k=Ae("div",Ke({ref:T},on(We(We({},e),{},{offset:b.offset,position:l,rect:b.rect}),"menuPortal",{"menu-portal":!0}),r),n);return Ae(Td.Provider,{value:h},t?Jh.createPortal(k,t):k)},N1=function(e){var t=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},B1=function(e){var t=e.children,n=e.innerProps,o=e.isDisabled,r=e.isRtl;return Ae("div",Ke({},on(e,"container",{"--is-disabled":o,"--is-rtl":r}),n),t)},V1=function(e,t){var n=e.theme.spacing,o=e.isMulti,r=e.hasValue,i=e.selectProps.controlShouldRenderValue;return We({alignItems:"center",display:o&&r&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(n.baseUnit*2,"px")})},$1=function(e){var t=e.children,n=e.innerProps,o=e.isMulti,r=e.hasValue;return Ae("div",Ke({},on(e,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":r}),n),t)},W1=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},j1=function(e){var t=e.children,n=e.innerProps;return Ae("div",Ke({},on(e,"indicatorsContainer",{indicators:!0}),n),t)},Dd,U1=["size"],Y1=["innerProps","isRtl","size"],X1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},zd=function(e){var t=e.size,n=wo(e,U1);return Ae("svg",Ke({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:X1},n))},_a=function(e){return Ae(zd,Ke({size:20},e),Ae("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"}))},Ld=function(e){return Ae(zd,Ke({size:20},e),Ae("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"}))},Pd=function(e,t){var n=e.isFocused,o=e.theme,r=o.spacing.baseUnit,i=o.colors;return We({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:r*2,":hover":{color:n?i.neutral80:i.neutral40}})},G1=Pd,K1=function(e){var t=e.children,n=e.innerProps;return Ae("div",Ke({},on(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Ae(Ld,null))},q1=Pd,Z1=function(e){var t=e.children,n=e.innerProps;return Ae("div",Ke({},on(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Ae(_a,null))},J1=function(e,t){var n=e.isDisabled,o=e.theme,r=o.spacing.baseUnit,i=o.colors;return We({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:r*2,marginTop:r*2})},Q1=function(e){var t=e.innerProps;return Ae("span",Ke({},t,on(e,"indicatorSeparator",{"indicator-separator":!0})))},eb=Kv(Dd||(Dd=qv([`
|
|
183
|
+
0%, 80%, 100% { opacity: 0; }
|
|
184
|
+
40% { opacity: 1; }
|
|
185
|
+
`]))),tb=function(e,t){var n=e.isFocused,o=e.size,r=e.theme,i=r.colors,l=r.spacing.baseUnit;return We({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:o,lineHeight:1,marginRight:o,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:l*2})},Na=function(e){var t=e.delay,n=e.offset;return Ae("span",{css:La({animation:"".concat(eb," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},nb=function(e){var t=e.innerProps,n=e.isRtl,o=e.size,r=o===void 0?4:o,i=wo(e,Y1);return Ae("div",Ke({},on(We(We({},i),{},{innerProps:t,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Ae(Na,{delay:0,offset:n}),Ae(Na,{delay:160,offset:!0}),Ae(Na,{delay:320,offset:!n}))},ob=function(e,t){var n=e.isDisabled,o=e.isFocused,r=e.theme,i=r.colors,l=r.borderRadius,s=r.spacing;return We({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:o?i.primary:i.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:o?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:o?i.primary:i.neutral30}})},rb=function(e){var t=e.children,n=e.isDisabled,o=e.isFocused,r=e.innerRef,i=e.innerProps,l=e.menuIsOpen;return Ae("div",Ke({ref:r},on(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":o,"control--menu-is-open":l}),i,{"aria-disabled":n||void 0}),t)},ib=rb,lb=["data"],ab=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},sb=function(e){var t=e.children,n=e.cx,o=e.getStyles,r=e.getClassNames,i=e.Heading,l=e.headingProps,s=e.innerProps,a=e.label,c=e.theme,u=e.selectProps;return Ae("div",Ke({},on(e,"group",{group:!0}),s),Ae(i,Ke({},l,{selectProps:u,theme:c,getStyles:o,getClassNames:r,cx:n}),a),Ae("div",null,t))},cb=function(e,t){var n=e.theme,o=n.colors,r=n.spacing;return We({label:"group",cursor:"default",display:"block"},t?{}:{color:o.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:r.baseUnit*3,paddingRight:r.baseUnit*3,textTransform:"uppercase"})},ub=function(e){var t=kd(e);t.data;var n=wo(t,lb);return Ae("div",Ke({},on(e,"groupHeading",{"group-heading":!0}),n))},db=sb,hb=["innerRef","isDisabled","isHidden","inputClassName"],fb=function(e,t){var n=e.isDisabled,o=e.value,r=e.theme,i=r.spacing,l=r.colors;return We(We({visibility:n?"hidden":"visible",transform:o?"translateZ(0)":""},pb),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:l.neutral80})},Hd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},pb={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":We({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Hd)},gb=function(e){return We({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Hd)},mb=function(e){var t=e.cx,n=e.value,o=kd(e),r=o.innerRef,i=o.isDisabled,l=o.isHidden,s=o.inputClassName,a=wo(o,hb);return Ae("div",Ke({},on(e,"input",{"input-container":!0}),{"data-value":n||""}),Ae("input",Ke({className:t({input:!0},s),ref:r,style:gb(l),disabled:i},a)))},vb=mb,bb=function(e,t){var n=e.theme,o=n.spacing,r=n.borderRadius,i=n.colors;return We({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:r/2,margin:o.baseUnit/2})},wb=function(e,t){var n=e.theme,o=n.borderRadius,r=n.colors,i=e.cropWithEllipsis;return We({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:o/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},yb=function(e,t){var n=e.theme,o=n.spacing,r=n.borderRadius,i=n.colors,l=e.isFocused;return We({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:l?i.dangerLight:void 0,paddingLeft:o.baseUnit,paddingRight:o.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Ad=function(e){var t=e.children,n=e.innerProps;return Ae("div",n,t)},xb=Ad,Cb=Ad;function kb(e){var t=e.children,n=e.innerProps;return Ae("div",Ke({role:"button"},n),t||Ae(_a,{size:14}))}var Sb=function(e){var t=e.children,n=e.components,o=e.data,r=e.innerProps,i=e.isDisabled,l=e.removeProps,s=e.selectProps,a=n.Container,c=n.Label,u=n.Remove;return Ae(a,{data:o,innerProps:We(We({},on(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),r),selectProps:s},Ae(c,{data:o,innerProps:We({},on(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Ae(u,{data:o,innerProps:We(We({},on(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},l),selectProps:s}))},Mb=Sb,Rb=function(e,t){var n=e.isDisabled,o=e.isFocused,r=e.isSelected,i=e.theme,l=i.spacing,s=i.colors;return We({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?s.primary:o?s.primary25:"transparent",color:n?s.neutral20:r?s.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:r?s.primary:s.primary50}})},Eb=function(e){var t=e.children,n=e.isDisabled,o=e.isFocused,r=e.isSelected,i=e.innerRef,l=e.innerProps;return Ae("div",Ke({},on(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":o,"option--is-selected":r}),{ref:i,"aria-disabled":n},l),t)},Ib=Eb,Tb=function(e,t){var n=e.theme,o=n.spacing,r=n.colors;return We({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Ob=function(e){var t=e.children,n=e.innerProps;return Ae("div",Ke({},on(e,"placeholder",{placeholder:!0}),n),t)},Db=Ob,zb=function(e,t){var n=e.isDisabled,o=e.theme,r=o.spacing,i=o.colors;return We({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Lb=function(e){var t=e.children,n=e.isDisabled,o=e.innerProps;return Ae("div",Ke({},on(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),o),t)},Pb=Lb,Fd={ClearIndicator:Z1,Control:ib,DropdownIndicator:K1,DownChevron:Ld,CrossIcon:_a,Group:db,GroupHeading:ub,IndicatorsContainer:j1,IndicatorSeparator:Q1,Input:vb,LoadingIndicator:nb,Menu:O1,MenuList:z1,MenuPortal:_1,LoadingMessage:A1,NoOptionsMessage:H1,MultiValue:Mb,MultiValueContainer:xb,MultiValueLabel:Cb,MultiValueRemove:kb,Option:Ib,Placeholder:Db,SelectContainer:B1,SingleValue:Pb,ValueContainer:$1},Hb=function(e){return We(We({},Fd),e.components)},_d=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ab(e,t){return!!(e===t||_d(e)&&_d(t))}function Fb(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Ab(e[n],t[n]))return!1;return!0}function _b(e,t){t===void 0&&(t=Fb);var n=null;function o(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var l=e.apply(this,r);return n={lastResult:l,lastArgs:r,lastThis:this},l}return o.clear=function(){n=null},o}for(var Nb={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"},Bb=function(e){return Ae("span",Ke({css:Nb},e))},Nd=Bb,Vb={guidance:function(e){var t=e.isSearchable,n=e.isMulti,o=e.tabSelectsValue,r=e.context,i=e.isInitialFocus;switch(r){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(o?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" 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(e){var t=e.action,n=e.label,o=n===void 0?"":n,r=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(o,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(r.length>1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return i?"option ".concat(o," is disabled. Select another option."):"option ".concat(o,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,o=e.options,r=e.label,i=r===void 0?"":r,l=e.selectValue,s=e.isDisabled,a=e.isSelected,c=e.isAppleDevice,u=function(h,g){return h&&h.length?"".concat(h.indexOf(g)+1," of ").concat(h.length):""};if(t==="value"&&l)return"value ".concat(i," focused, ").concat(u(l,n),".");if(t==="menu"&&c){var d=s?" disabled":"",f="".concat(a?" selected":"").concat(d);return"".concat(i).concat(f,", ").concat(u(o,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},$b=function(e){var t=e.ariaSelection,n=e.focusedOption,o=e.focusedValue,r=e.focusableOptions,i=e.isFocused,l=e.selectValue,s=e.selectProps,a=e.id,c=e.isAppleDevice,u=s.ariaLiveMessages,d=s.getOptionLabel,f=s.inputValue,h=s.isMulti,g=s.isOptionDisabled,m=s.isSearchable,b=s.menuIsOpen,y=s.options,v=s.screenReaderStatus,I=s.tabSelectsValue,T=s.isLoading,k=s["aria-label"],x=s["aria-live"],L=p.useMemo(function(){return We(We({},Vb),u||{})},[u]),O=p.useMemo(function(){var D="";if(t&&L.onChange){var C=t.option,X=t.options,B=t.removedValue,J=t.removedValues,ae=t.value,ne=function(Q){return Array.isArray(Q)?null:Q},U=B||C||ne(ae),re=U?d(U):"",se=X||J||void 0,de=se?se.map(d):[],fe=We({isDisabled:U&&g(U,l),label:re,labels:de},t);D=L.onChange(fe)}return D},[t,L,g,l,d]),R=p.useMemo(function(){var D="",C=n||o,X=!!(n&&l&&l.includes(n));if(C&&L.onFocus){var B={focused:C,label:d(C),isDisabled:g(C,l),isSelected:X,options:r,context:C===n?"menu":"value",selectValue:l,isAppleDevice:c};D=L.onFocus(B)}return D},[n,o,d,g,L,r,l,c]),P=p.useMemo(function(){var D="";if(b&&y.length&&!T&&L.onFilter){var C=v({count:r.length});D=L.onFilter({inputValue:f,resultsMessage:C})}return D},[r,f,b,L,y,v,T]),M=(t==null?void 0:t.action)==="initial-input-focus",S=p.useMemo(function(){var D="";if(L.guidance){var C=o?"value":b?"menu":"input";D=L.guidance({"aria-label":k,context:C,isDisabled:n&&g(n,l),isMulti:h,isSearchable:m,tabSelectsValue:I,isInitialFocus:M})}return D},[k,n,o,h,g,m,b,L,l,I,M]),E=Ae(p.Fragment,null,Ae("span",{id:"aria-selection"},O),Ae("span",{id:"aria-focused"},R),Ae("span",{id:"aria-results"},P),Ae("span",{id:"aria-guidance"},S));return Ae(p.Fragment,null,Ae(Nd,{id:a},M&&E),Ae(Nd,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!M&&E))},Wb=$b,Ba=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],jb=new RegExp("["+Ba.map(function(e){return e.letters}).join("")+"]","g"),Bd={},Va=0;Va<Ba.length;Va++)for(var $a=Ba[Va],Wa=0;Wa<$a.letters.length;Wa++)Bd[$a.letters[Wa]]=$a.base;var Vd=function(e){return e.replace(jb,function(t){return Bd[t]})},Ub=_b(Vd),$d=function(e){return e.replace(/^\s+|\s+$/g,"")},Yb=function(e){return"".concat(e.label," ").concat(e.value)},Xb=function(e){return function(t,n){if(t.data.__isNew__)return!0;var o=We({ignoreCase:!0,ignoreAccents:!0,stringify:Yb,trim:!0,matchFrom:"any"},e),r=o.ignoreCase,i=o.ignoreAccents,l=o.stringify,s=o.trim,a=o.matchFrom,c=s?$d(n):n,u=s?$d(l(t)):l(t);return r&&(c=c.toLowerCase(),u=u.toLowerCase()),i&&(c=Ub(c),u=Vd(u)),a==="start"?u.substr(0,c.length)===c:u.indexOf(c)>-1}},Gb=["innerRef"];function Kb(e){var t=e.innerRef,n=wo(e,Gb),o=C1(n,"onExited","in","enter","exit","appear");return Ae("input",Ke({ref:t},o,{css:La({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 qb=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Zb(e){var t=e.isEnabled,n=e.onBottomArrive,o=e.onBottomLeave,r=e.onTopArrive,i=e.onTopLeave,l=p.useRef(!1),s=p.useRef(!1),a=p.useRef(0),c=p.useRef(null),u=p.useCallback(function(b,y){if(c.current!==null){var v=c.current,I=v.scrollTop,T=v.scrollHeight,k=v.clientHeight,x=c.current,L=y>0,O=T-k-I,R=!1;O>y&&l.current&&(o&&o(b),l.current=!1),L&&s.current&&(i&&i(b),s.current=!1),L&&y>O?(n&&!l.current&&n(b),x.scrollTop=T,R=!0,l.current=!0):!L&&-y>I&&(r&&!s.current&&r(b),x.scrollTop=0,R=!0,s.current=!0),R&&qb(b)}},[n,o,r,i]),d=p.useCallback(function(b){u(b,b.deltaY)},[u]),f=p.useCallback(function(b){a.current=b.changedTouches[0].clientY},[]),h=p.useCallback(function(b){var y=a.current-b.changedTouches[0].clientY;u(b,y)},[u]),g=p.useCallback(function(b){if(b){var y=w1?{passive:!1}:!1;b.addEventListener("wheel",d,y),b.addEventListener("touchstart",f,y),b.addEventListener("touchmove",h,y)}},[h,f,d]),m=p.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",f,!1),b.removeEventListener("touchmove",h,!1))},[h,f,d]);return p.useEffect(function(){if(t){var b=c.current;return g(b),function(){m(b)}}},[t,g,m]),function(b){c.current=b}}var Wd=["boxSizing","height","overflow","paddingRight","position"],jd={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Ud(e){e.preventDefault()}function Yd(e){e.stopPropagation()}function Xd(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Gd(){return"ontouchstart"in window||navigator.maxTouchPoints}var Kd=!!(typeof window<"u"&&window.document&&window.document.createElement),Qr=0,ar={capture:!1,passive:!1};function Jb(e){var t=e.isEnabled,n=e.accountForScrollbars,o=n===void 0?!0:n,r=p.useRef({}),i=p.useRef(null),l=p.useCallback(function(a){if(Kd){var c=document.body,u=c&&c.style;if(o&&Wd.forEach(function(g){var m=u&&u[g];r.current[g]=m}),o&&Qr<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(jd).forEach(function(g){var m=jd[g];u&&(u[g]=m)}),u&&(u.paddingRight="".concat(h,"px"))}c&&Gd()&&(c.addEventListener("touchmove",Ud,ar),a&&(a.addEventListener("touchstart",Xd,ar),a.addEventListener("touchmove",Yd,ar))),Qr+=1}},[o]),s=p.useCallback(function(a){if(Kd){var c=document.body,u=c&&c.style;Qr=Math.max(Qr-1,0),o&&Qr<1&&Wd.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&Gd()&&(c.removeEventListener("touchmove",Ud,ar),a&&(a.removeEventListener("touchstart",Xd,ar),a.removeEventListener("touchmove",Yd,ar)))}},[o]);return p.useEffect(function(){if(t){var a=i.current;return l(a),function(){s(a)}}},[t,l,s]),function(a){i.current=a}}var Qb=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},ew={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function tw(e){var t=e.children,n=e.lockEnabled,o=e.captureEnabled,r=o===void 0?!0:o,i=e.onBottomArrive,l=e.onBottomLeave,s=e.onTopArrive,a=e.onTopLeave,c=Zb({isEnabled:r,onBottomArrive:i,onBottomLeave:l,onTopArrive:s,onTopLeave:a}),u=Jb({isEnabled:n}),d=function(f){c(f),u(f)};return Ae(p.Fragment,null,n&&Ae("div",{onClick:Qb,css:ew}),t(d))}var nw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},ow=function(e){var t=e.name,n=e.onFocus;return Ae("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:nw,value:"",onChange:function(){}})},rw=ow;function ja(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 iw(){return ja(/^iPhone/i)}function qd(){return ja(/^Mac/i)}function lw(){return ja(/^iPad/i)||qd()&&navigator.maxTouchPoints>1}function aw(){return iw()||lw()}function sw(){return qd()||aw()}var cw=function(e){return e.label},uw=function(e){return e.label},dw=function(e){return e.value},hw=function(e){return!!e.isDisabled},fw={clearIndicator:q1,container:N1,control:ob,dropdownIndicator:G1,group:ab,groupHeading:cb,indicatorsContainer:W1,indicatorSeparator:J1,input:fb,loadingIndicator:tb,loadingMessage:P1,menu:E1,menuList:D1,menuPortal:F1,multiValue:bb,multiValueLabel:wb,multiValueRemove:yb,noOptionsMessage:L1,option:Rb,placeholder:Tb,singleValue:zb,valueContainer:V1},pw={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%)"},gw=4,Zd=4,mw=38,vw=Zd*2,bw={baseUnit:Zd,controlHeight:mw,menuGutter:vw},Ua={borderRadius:gw,colors:pw,spacing:bw},ww={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Rd(),captureMenuScroll:!Rd(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Xb(),formatGroupLabel:cw,getOptionLabel:uw,getOptionValue:dw,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:hw,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!v1(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Jd(e,t,n,o){var r=oh(e,t,n),i=rh(e,t,n),l=nh(e,t),s=tl(e,t);return{type:"option",data:t,isDisabled:r,isSelected:i,label:l,value:s,index:o}}function el(e,t){return e.options.map(function(n,o){if("options"in n){var r=n.options.map(function(l,s){return Jd(e,l,t,s)}).filter(function(l){return th(e,l)});return r.length>0?{type:"group",data:n,options:r,index:o}:void 0}var i=Jd(e,n,t,o);return th(e,i)?i:void 0}).filter(y1)}function Qd(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Cs(n.options.map(function(o){return o.data}))):t.push(n.data),t},[])}function eh(e,t){return e.reduce(function(n,o){return o.type==="group"?n.push.apply(n,Cs(o.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(o.index,"-").concat(r.index)}}))):n.push({data:o.data,id:"".concat(t,"-").concat(o.index)}),n},[])}function yw(e,t){return Qd(el(e,t))}function th(e,t){var n=e.inputValue,o=n===void 0?"":n,r=t.data,i=t.isSelected,l=t.label,s=t.value;return(!lh(e)||!i)&&ih(e,{label:l,value:s,data:r},o)}function xw(e,t){var n=e.focusedValue,o=e.selectValue,r=o.indexOf(n);if(r>-1){var i=t.indexOf(n);if(i>-1)return n;if(r<t.length)return t[r]}return null}function Cw(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Ya=function(e,t){var n,o=(n=e.find(function(r){return r.data===t}))===null||n===void 0?void 0:n.id;return o||null},nh=function(e,t){return e.getOptionLabel(t)},tl=function(e,t){return e.getOptionValue(t)};function oh(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function rh(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var o=tl(e,t);return n.some(function(r){return tl(e,r)===o})}function ih(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var lh=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},kw=1,ah=function(e){aC(n,e);var t=uC(n);function n(o){var r;if(cC(this,n),r=t.call(this,o),r.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:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=sw(),r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(a,c),d(a,c)},r.setValue=function(a,c,u){var d=r.props,f=d.closeMenuOnSelect,h=d.isMulti,g=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:g}),f&&(r.setState({inputIsHiddenAfterUpdate:!h}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(a,{action:c,option:u})},r.selectOption=function(a){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,h=r.state.selectValue,g=d&&r.isOptionSelected(a,h),m=r.isOptionDisabled(a,h);if(g){var b=r.getOptionValue(a);r.setValue(h.filter(function(y){return r.getOptionValue(y)!==b}),"deselect-option",a)}else if(!m)d?r.setValue([].concat(Cs(h),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:f});return}u&&r.blurInput()},r.removeValue=function(a){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(a),f=u.filter(function(g){return r.getOptionValue(g)!==d}),h=Qi(c,f,f[0]||null);r.onChange(h,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(Qi(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=Qi(a,d,d[0]||null);r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(a){return Ya(r.state.focusableOptionsWithIds,a)},r.getFocusableOptionsWithIds=function(){return eh(el(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return h1.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(a){return nh(r.props,a)},r.getOptionValue=function(a){return tl(r.props,a)},r.getStyles=function(a,c){var u=r.props.unstyled,d=fw[a](c,u);d.boxSizing="border-box";var f=r.props.styles[a];return f?f(d,c):d},r.getClassNames=function(a,c){var u,d;return(u=(d=r.props.classNames)[a])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(a){return"".concat(r.state.instancePrefix,"-").concat(a)},r.getComponents=function(){return Hb(r.props)},r.buildCategorizedOptions=function(){return el(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Qd(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,c){r.setState({ariaSelection:We({value:a},c)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.button!==0)&&!r.props.isDisabled){var c=r.props,u=c.isMulti,d=c.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!u}),r.onMenuClose()):r.openMenu("first"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&Ki(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var c=a.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var c=a.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-r.initialTouchX),f=Math.abs(u.clientY-r.initialTouchY),h=5;r.userIsDragging=d>h||f>h}},r.onTouchEnd=function(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var c=r.props.inputValue,u=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){if(!(r.blockOptionHover||r.state.focusedOption===a)){var c=r.getFocusableOptions(),u=c.indexOf(a);r.setState({focusedOption:a,focusedOptionId:u>-1?r.getFocusedOptionId(a):null})}},r.shouldHideSelectedOptions=function(){return lh(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){var c=r.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,h=c.inputValue,g=c.isClearable,m=c.isDisabled,b=c.menuIsOpen,y=c.onKeyDown,v=c.tabSelectsValue,I=c.openMenuOnFocus,T=r.state,k=T.focusedOption,x=T.focusedValue,L=T.selectValue;if(!m&&!(typeof y=="function"&&(y(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.key){case"ArrowLeft":if(!u||h)return;r.focusValue("previous");break;case"ArrowRight":if(!u||h)return;r.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)r.removeValue(x);else{if(!d)return;u?r.popValue():g&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!b||!v||!k||I&&r.isOptionSelected(k,L))return;r.selectOption(k);break;case"Enter":if(a.keyCode===229)break;if(b){if(!k||r.isComposing)return;r.selectOption(k);break}return;case"Escape":b?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:h}),r.onMenuClose()):g&&f&&r.clearValue();break;case" ":if(h)return;if(!b){r.openMenu("first");break}if(!k)return;r.selectOption(k);break;case"ArrowUp":b?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":b?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!b)return;r.focusOption("pageup");break;case"PageDown":if(!b)return;r.focusOption("pagedown");break;case"Home":if(!b)return;r.focusOption("first");break;case"End":if(!b)return;r.focusOption("last");break;default:return}a.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++kw),r.state.selectValue=Cd(o.value),o.menuIsOpen&&r.state.selectValue.length){var i=r.getFocusableOptionsWithIds(),l=r.buildFocusableOptions(),s=l.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=i,r.state.focusedOption=l[s],r.state.focusedOptionId=Ya(i,l[s])}return r}return sC(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&&Md(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(o){var r=this.props,i=r.isDisabled,l=r.menuIsOpen,s=this.state.isFocused;(s&&!i&&o.isDisabled||s&&l&&!o.menuIsOpen)&&this.focusInput(),s&&i&&!o.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!i&&o.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Md(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(o,r){this.props.onInputChange(o,r)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(o){var r=this,i=this.state,l=i.selectValue,s=i.isFocused,a=this.buildFocusableOptions(),c=o==="first"?0:a.length-1;if(!this.props.isMulti){var u=a.indexOf(l[0]);u>-1&&(c=u)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:a[c],focusedOptionId:this.getFocusedOptionId(a[c])},function(){return r.onMenuOpen()})}},{key:"focusValue",value:function(o){var r=this.state,i=r.selectValue,l=r.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=i.indexOf(l);l||(s=-1);var a=i.length-1,c=-1;if(i.length){switch(o){case"previous":s===0?c=0:s===-1?c=a:c=s-1;break;case"next":s>-1&&s<a&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:i[c]})}}}},{key:"focusOption",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",r=this.props.pageSize,i=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var s=0,a=l.indexOf(i);i||(a=-1),o==="up"?s=a>0?a-1:l.length-1:o==="down"?s=(a+1)%l.length:o==="pageup"?(s=a-r,s<0&&(s=0)):o==="pagedown"?(s=a+r,s>l.length-1&&(s=l.length-1)):o==="last"&&(s=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ua):We(We({},Ua),this.props.theme):Ua}},{key:"getCommonProps",value:function(){var o=this.clearValue,r=this.cx,i=this.getStyles,l=this.getClassNames,s=this.getValue,a=this.selectOption,c=this.setValue,u=this.props,d=u.isMulti,f=u.isRtl,h=u.options,g=this.hasValue();return{clearValue:o,cx:r,getStyles:i,getClassNames:l,getValue:s,hasValue:g,isMulti:d,isRtl:f,options:h,selectOption:a,selectProps:u,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var o=this.state.selectValue;return o.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var o=this.props,r=o.isClearable,i=o.isMulti;return r===void 0?i:r}},{key:"isOptionDisabled",value:function(o,r){return oh(this.props,o,r)}},{key:"isOptionSelected",value:function(o,r){return rh(this.props,o,r)}},{key:"filterOption",value:function(o,r){return ih(this.props,o,r)}},{key:"formatOptionLabel",value:function(o,r){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(o,{context:r,inputValue:i,selectValue:l})}else return this.getOptionLabel(o)}},{key:"formatGroupLabel",value:function(o){return this.props.formatGroupLabel(o)}},{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 o=this.props,r=o.isDisabled,i=o.isSearchable,l=o.inputId,s=o.inputValue,a=o.tabIndex,c=o.form,u=o.menuIsOpen,d=o.required,f=this.getComponents(),h=f.Input,g=this.state,m=g.inputIsHidden,b=g.ariaSelection,y=this.commonProps,v=l||this.getElementId("input"),I=We(We(We({"aria-autocomplete":"list","aria-expanded":u,"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":d,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?(b==null?void 0:b.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?p.createElement(h,Ke({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:r,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:c,type:"text",value:s},I)):p.createElement(Kb,Ke({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Gi,onFocus:this.onInputFocus,disabled:r,tabIndex:a,inputMode:"none",form:c,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var o=this,r=this.getComponents(),i=r.MultiValue,l=r.MultiValueContainer,s=r.MultiValueLabel,a=r.MultiValueRemove,c=r.SingleValue,u=r.Placeholder,d=this.commonProps,f=this.props,h=f.controlShouldRenderValue,g=f.isDisabled,m=f.isMulti,b=f.inputValue,y=f.placeholder,v=this.state,I=v.selectValue,T=v.focusedValue,k=v.isFocused;if(!this.hasValue()||!h)return b?null:p.createElement(u,Ke({},d,{key:"placeholder",isDisabled:g,isFocused:k,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return I.map(function(L,O){var R=L===T,P="".concat(o.getOptionLabel(L),"-").concat(o.getOptionValue(L));return p.createElement(i,Ke({},d,{components:{Container:l,Label:s,Remove:a},isFocused:R,isDisabled:g,key:P,index:O,removeProps:{onClick:function(){return o.removeValue(L)},onTouchEnd:function(){return o.removeValue(L)},onMouseDown:function(M){M.preventDefault()}},data:L}),o.formatOptionLabel(L,"value"))});if(b)return null;var x=I[0];return p.createElement(c,Ke({},d,{data:x,isDisabled:g}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var o=this.getComponents(),r=o.ClearIndicator,i=this.commonProps,l=this.props,s=l.isDisabled,a=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!r||s||!this.hasValue()||a)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return p.createElement(r,Ke({},i,{innerProps:u,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var o=this.getComponents(),r=o.LoadingIndicator,i=this.commonProps,l=this.props,s=l.isDisabled,a=l.isLoading,c=this.state.isFocused;if(!r||!a)return null;var u={"aria-hidden":"true"};return p.createElement(r,Ke({},i,{innerProps:u,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var o=this.getComponents(),r=o.DropdownIndicator,i=o.IndicatorSeparator;if(!r||!i)return null;var l=this.commonProps,s=this.props.isDisabled,a=this.state.isFocused;return p.createElement(i,Ke({},l,{isDisabled:s,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var o=this.getComponents(),r=o.DropdownIndicator;if(!r)return null;var i=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return p.createElement(r,Ke({},i,{innerProps:a,isDisabled:l,isFocused:s}))}},{key:"renderMenu",value:function(){var o=this,r=this.getComponents(),i=r.Group,l=r.GroupHeading,s=r.Menu,a=r.MenuList,c=r.MenuPortal,u=r.LoadingMessage,d=r.NoOptionsMessage,f=r.Option,h=this.commonProps,g=this.state.focusedOption,m=this.props,b=m.captureMenuScroll,y=m.inputValue,v=m.isLoading,I=m.loadingMessage,T=m.minMenuHeight,k=m.maxMenuHeight,x=m.menuIsOpen,L=m.menuPlacement,O=m.menuPosition,R=m.menuPortalTarget,P=m.menuShouldBlockScroll,M=m.menuShouldScrollIntoView,S=m.noOptionsMessage,E=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!x)return null;var C=function(U,re){var se=U.type,de=U.data,fe=U.isDisabled,Q=U.isSelected,N=U.label,z=U.value,j=g===de,ge=fe?void 0:function(){return o.onOptionHover(de)},ke=fe?void 0:function(){return o.selectOption(de)},Fe="".concat(o.getElementId("option"),"-").concat(re),xe={id:Fe,onClick:ke,onMouseMove:ge,onMouseOver:ge,tabIndex:-1,role:"option","aria-selected":o.isAppleDevice?void 0:Q};return p.createElement(f,Ke({},h,{innerProps:xe,data:de,isDisabled:fe,isSelected:Q,key:Fe,label:N,type:se,value:z,isFocused:j,innerRef:j?o.getFocusedOptionRef:void 0}),o.formatOptionLabel(U.data,"menu"))},X;if(this.hasOptions())X=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var re=U.data,se=U.options,de=U.index,fe="".concat(o.getElementId("group"),"-").concat(de),Q="".concat(fe,"-heading");return p.createElement(i,Ke({},h,{key:fe,data:re,options:se,Heading:l,headingProps:{id:Q,data:U.data},label:o.formatGroupLabel(U.data)}),U.options.map(function(N){return C(N,"".concat(de,"-").concat(N.index))}))}else if(U.type==="option")return C(U,"".concat(U.index))});else if(v){var B=I({inputValue:y});if(B===null)return null;X=p.createElement(u,h,B)}else{var J=S({inputValue:y});if(J===null)return null;X=p.createElement(d,h,J)}var ae={minMenuHeight:T,maxMenuHeight:k,menuPlacement:L,menuPosition:O,menuShouldScrollIntoView:M},ne=p.createElement(I1,Ke({},h,ae),function(U){var re=U.ref,se=U.placerProps,de=se.placement,fe=se.maxHeight;return p.createElement(s,Ke({},h,ae,{innerRef:re,innerProps:{onMouseDown:o.onMenuMouseDown,onMouseMove:o.onMenuMouseMove},isLoading:v,placement:de}),p.createElement(tw,{captureEnabled:b,onTopArrive:E,onBottomArrive:D,lockEnabled:P},function(Q){return p.createElement(a,Ke({},h,{innerRef:function(N){o.getMenuListRef(N),Q(N)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:o.getElementId("listbox")},isLoading:v,maxHeight:fe,focusedOption:g}),X)}))});return R||O==="fixed"?p.createElement(c,Ke({},h,{appendTo:R,controlElement:this.controlRef,menuPlacement:L,menuPosition:O}),ne):ne}},{key:"renderFormField",value:function(){var o=this,r=this.props,i=r.delimiter,l=r.isDisabled,s=r.isMulti,a=r.name,c=r.required,u=this.state.selectValue;if(c&&!this.hasValue()&&!l)return p.createElement(rw,{name:a,onFocus:this.onValueInputFocus});if(!(!a||l))if(s)if(i){var d=u.map(function(g){return o.getOptionValue(g)}).join(i);return p.createElement("input",{name:a,type:"hidden",value:d})}else{var f=u.length>0?u.map(function(g,m){return p.createElement("input",{key:"i-".concat(m),name:a,type:"hidden",value:o.getOptionValue(g)})}):p.createElement("input",{name:a,type:"hidden",value:""});return p.createElement("div",null,f)}else{var h=u[0]?this.getOptionValue(u[0]):"";return p.createElement("input",{name:a,type:"hidden",value:h})}}},{key:"renderLiveRegion",value:function(){var o=this.commonProps,r=this.state,i=r.ariaSelection,l=r.focusedOption,s=r.focusedValue,a=r.isFocused,c=r.selectValue,u=this.getFocusableOptions();return p.createElement(Wb,Ke({},o,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:l,focusedValue:s,isFocused:a,selectValue:c,focusableOptions:u,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var o=this.getComponents(),r=o.Control,i=o.IndicatorsContainer,l=o.SelectContainer,s=o.ValueContainer,a=this.props,c=a.className,u=a.id,d=a.isDisabled,f=a.menuIsOpen,h=this.state.isFocused,g=this.commonProps=this.getCommonProps();return p.createElement(l,Ke({},g,{className:c,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:d,isFocused:h}),this.renderLiveRegion(),p.createElement(r,Ke({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:d,isFocused:h,menuIsOpen:f}),p.createElement(s,Ke({},g,{isDisabled:d}),this.renderPlaceholderOrValue(),this.renderInput()),p.createElement(i,Ke({},g,{isDisabled:d}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(o,r){var i=r.prevProps,l=r.clearFocusValueOnUpdate,s=r.inputIsHiddenAfterUpdate,a=r.ariaSelection,c=r.isFocused,u=r.prevWasFocused,d=r.instancePrefix,f=o.options,h=o.value,g=o.menuIsOpen,m=o.inputValue,b=o.isMulti,y=Cd(h),v={};if(i&&(h!==i.value||f!==i.options||g!==i.menuIsOpen||m!==i.inputValue)){var I=g?yw(o,y):[],T=g?eh(el(o,y),"".concat(d,"-option")):[],k=l?xw(r,y):null,x=Cw(r,I),L=Ya(T,x);v={selectValue:y,focusedOption:x,focusedOptionId:L,focusableOptionsWithIds:T,focusedValue:k,clearFocusValueOnUpdate:!1}}var O=s!=null&&o!==i?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},R=a,P=c&&u;return c&&!P&&(R={value:Qi(b,y,y[0]||null),options:y,action:"initial-input-focus"},P=!u),(a==null?void 0:a.action)==="initial-input-focus"&&(R=null),We(We(We({},v),O),{},{prevProps:o,ariaSelection:R,prevWasFocused:P})}}]),n}(p.Component);ah.defaultProps=ww;var Sw=p.forwardRef(function(e,t){var n=Iv(e);return p.createElement(ah,Ke({ref:t},n))}),Mw=Sw;const Rw=e=>{const{Menu:t}=Fd,{children:n,...o}=e;return p.createElement(t,{...o},n)},Ew=cn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Iw=cn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Tw=cn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Ow=e=>{const{value:t,onFinishedEditing:n,initialValue:o}=e,{allowedValues:r,value:i}=t.data,[l,s]=p.useState(i),[a,c]=p.useState(o??""),u=Mp(),d=p.useMemo(()=>r.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[r]);return t.readonly?p.createElement(Tw,null,p.createElement(No,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):p.createElement(Ew,null,p.createElement(Mw,{className:"glide-select",inputValue:a,onInputChange:c,menuPlacement:"auto",value:d.find(f=>f.value===l),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:h})=>({...f,fontSize:u.editorFontSize,fontFamily:u.fontFamily,cursor:h?"pointer":void 0,paddingLeft:u.cellHorizontalPadding,paddingRight:u.cellHorizontalPadding,":active":{...f[":active"],color:u.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:u.bgCell,neutral5:u.bgCell,neutral10:u.bgCell,neutral20:u.bgCellMedium,neutral30:u.bgCellMedium,neutral40:u.bgCellMedium,neutral50:u.textLight,neutral60:u.textMedium,neutral70:u.textMedium,neutral80:u.textDark,neutral90:u.textDark,neutral100:u.textDark,primary:u.accentColor,primary75:u.accentColor,primary50:u.accentColor,primary25:u.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>p.createElement(Iw,null,p.createElement(Rw,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(s(f.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:f.value}}))}}))},Dw={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:o,rect:r}=e,{value:i}=t.data,l=t.data.allowedValues.find(a=>typeof a=="string"||a===null||a===void 0?a===i:a.value===i),s=typeof l=="string"?l:(l==null?void 0:l.label)??"";return s&&(n.fillStyle=o.textDark,n.fillText(s,r.x+o.cellHorizontalPadding,r.y+r.height/2+eo(n,o))),!0},measure:(e,t,n)=>{const{value:o}=t.data;return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Ow,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},jo=6,zw={marginRight:8},Lw={display:"flex",alignItems:"center",flexGrow:1},Pw={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:o,rect:r}=e,{min:i,max:l,value:s,label:a,measureLabel:c}=t.data,u=r.x+o.cellHorizontalPadding,d=r.y+r.height/2,f=l-i,h=(s-i)/f;n.save();let g=0;a!==void 0&&(n.font=`12px ${o.fontFamily}`,g=$o(c??a,n,`12px ${o.fontFamily}`).width+o.cellHorizontalPadding);const m=r.width-o.cellHorizontalPadding*2-g;if(m>=jo){const b=n.createLinearGradient(u,d,u+m,d);b.addColorStop(0,o.accentColor),b.addColorStop(h,o.accentColor),b.addColorStop(h,o.bgBubble),b.addColorStop(1,o.bgBubble),n.beginPath(),n.fillStyle=b,cd(n,u,d-jo/2,m,jo,jo/2),n.fill(),n.beginPath(),cd(n,u+.5,d-jo/2+.5,m-1,jo-1,(jo-1)/2),n.strokeStyle=o.accentLight,n.lineWidth=1,n.stroke()}return a!==void 0&&(n.textAlign="right",n.fillStyle=o.textDark,n.fillText(a,r.x+r.width-o.cellHorizontalPadding,d+eo(n,`12px ${o.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,o=t.value.toString(),r=t.min.toString(),i=t.max.toString(),l=t.step.toString(),s=a=>{e.onChange({...e.value,data:{...t,value:Number(a.target.value)}})};return p.createElement("label",{style:Lw},p.createElement("input",{style:zw,type:"range",value:o,min:r,max:i,step:l,onChange:s,disabled:n}),o)},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}}},Hw=cn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Xa=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Aw=e=>{const t=e.value.data,{format:n,displayDate:o}=t,r=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,i=t.min instanceof Date?Xa(n,t.min):t.min,l=t.max instanceof Date?Xa(n,t.max):t.max;let s=t.date;const a=t.timezoneOffset?t.timezoneOffset*60*1e3:0;a&&s&&(s=new Date(s.getTime()+a));const c=Xa(n,s);return e.value.readonly?te.createElement(No,{highlight:!0,autoFocus:!1,disabled:!0,value:o??"",onChange:()=>{}}):te.createElement(Hw,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:c,min:i,max:l,step:r,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-a)}})}})},Fw={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Yl(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:o}=t.data;return e.measureText(o).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Aw}),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)}}},_w="None";function sh(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Nw=e=>{const{cell:t,theme:n,ctx:o}=e;Yl({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},_w,t.contentAlign),o.fillStyle=n.textDark};function Bw(e){const t=te.useCallback((o,r)=>{const{cell:i,theme:l,ctx:s,rect:a}=o,c=o.col;if(lr(i))sh(s,a,l);else if(Fi(i)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?r():Nw(o),u.isRequired&&u.isEditable&&sh(s,a,l);return}r()},[e]),n=te.useMemo(()=>[Rv,Dw,Pw,Fw,...ev],[]);return{drawCell:t,customRenderers:n}}function Vw(){const e=Jo();return te.useMemo(()=>{const t={editable:n=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${n.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:Sl(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Sl(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.darkenedBgMix15,bgHeaderHovered:e.colors.darkenedBgMix15,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${Vn(e.fontSizes.sm)}px`,baseFontStyle:`${Vn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Sl(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(Vn(e.spacing.sm)),cellVerticalPadding:Math.round(Vn("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(Vn("25rem")),minColumnWidth:Math.round(Vn("3.125rem")),maxColumnWidth:Math.round(Vn("62.5rem")),maxColumnAutoWidth:Math.round(Vn("31.25rem")),defaultRowHeight:Math.round(Vn("2.1875rem")),defaultHeaderHeight:Math.round(Vn("2.1875rem")),bgRowHovered:$x(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const $w=ys.getLogger("useDataEditor");function Ww(e,t,n,o,r,i,l,s,a){const c=te.useCallback(([m,b],y)=>{const v=e[m];if(!v.isEditable)return;const I=v.indexNumber,T=n.current.getOriginalRowIndex(r(b)),k=o([m,b]),x=v.getCellValue(k),L=v.getCellValue(y);if(!lr(k)&&L===x)return;const O=v.getCell(L,!0);lr(O)?$w.warn(`Not applying the cell edit since it causes this error:
|
|
186
|
+
${O.data}`):(n.current.setCell(I,T,{...O,lastUpdated:performance.now()}),s())},[e,n,r,o,s]),u=te.useCallback(()=>{if(t)return;const m=new Map;e.forEach(b=>{m.set(b.indexNumber,b.getCell(b.defaultValue))}),n.current.addRow(m),l()},[e,n,t,l]),d=te.useCallback(()=>{t||(u(),s())},[u,s,t]),f=te.useCallback(m=>{var b;if(m.rows.length>0){if(t)return!0;const y=m.rows.toArray().map(v=>n.current.getOriginalRowIndex(r(v)));return n.current.deleteRows(y),l(),a(),s(),!1}if((b=m.current)!=null&&b.range){const y=[],v=m.current.range;for(let I=v.y;I<v.y+v.height;I++)for(let T=v.x;T<v.x+v.width;T++){const k=e[T];k.isEditable&&!k.isRequired&&(y.push({cell:[T,I]}),c([T,I],k.getCell(null)))}return y.length>0&&(s(),i(y)),!1}return!0},[e,n,t,i,r,s,c,a,l]),h=te.useCallback((m,b)=>{const[y,v]=m,I=[];for(let T=0;T<b.length;T++){const k=b[T];if(T+v>=n.current.getNumRows()){if(t)break;u()}for(let x=0;x<k.length;x++){const L=k[x],O=T+v,R=x+y;if(R>=e.length)break;const P=e[R];if(P.isEditable){const M=P.getCell(L,!0);if(mt(M)&&!lr(M)){const S=P.indexNumber,E=n.current.getOriginalRowIndex(r(O)),D=P.getCellValue(o([R,O]));P.getCellValue(M)!==D&&(n.current.setCell(S,E,{...M,lastUpdated:performance.now()}),I.push({cell:[R,O]}))}}}I.length>0&&(s(),i(I))}return!1},[e,n,t,r,o,u,s,i]),g=te.useCallback((m,b)=>{const y=m[0];if(y>=e.length)return!0;const v=e[y];if(v.validateInput){const I=v.validateInput(v.getCellValue(b));return I===!0||I===!1?I:v.getCell(I)}return!0},[e]);return{onCellEdited:c,onPaste:h,onRowAppended:d,onDelete:f,validateCell:g}}const ch=",",ei='"',jw='"',uh=`
|
|
187
|
+
`,Uw="\uFEFF",Yw=new RegExp(`[${[ch,ei,uh].join("")}]`),dh=ys.getLogger("useDataExporter");function hh(e){return e.map(t=>Xw(t)).join(ch)+uh}function Xw(e){if(Ve(e))return"";const t=bt(e);return Yw.test(t)?`${ei}${t.replace(new RegExp(ei,"g"),jw+ei)}${ei}`:t}async function fh(e,t,n,o){const r=new TextEncoder;await e.write(r.encode(Uw));const i=n.map(l=>l.name);await e.write(r.encode(hh(i)));for(let l=0;l<o;l++){const s=[];n.forEach((a,c,u)=>{s.push(a.getCellValue(t([c,l])))}),await e.write(r.encode(hh(s)))}await e.close()}function Gw(e,t,n,o){return{exportToCsv:te.useCallback(async()=>{const r=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await vs(()=>import("./es6-CqFPgbyx.js").then(async l=>(await l.__tla,l)).then(l=>l.a),__vite__mapDeps([15,1,2]))).showSaveFilePicker({suggestedName:r,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await fh(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{dh.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let l="";const s=new WritableStream({write:async d=>{l+=new TextDecoder("utf-8").decode(d)},close:async()=>{}});await fh(s.getWriter(),e,t,n);const a=new Blob([l],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(a),u=iC({enforceDownloadInNewTab:o,url:c,filename:r});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(l){dh.error("Failed to export data as CSV",l)}}},[t,n,e,o])}}function Kw(e,t,n,o){return{getCellContent:te.useCallback(([r,i])=>{var l;if(r>t.length-1)return Lt("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Lt("Row index out of bounds","This error should never happen. Please report this bug.");try{const s=t[r],a=s.indexNumber,c=o.current.getOriginalRowIndex(i),u=o.current.isAddedRow(c);if(s.isEditable||u){const h=o.current.getCell(a,c);if(mt(h))return{...s.getCell(s.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(u)return Lt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${a}; row=${c}`)}const d=e.getCell(c,a),f=Wx(e,c,a);return uv(s,d,f,(l=e.styler)==null?void 0:l.cssStyles)}catch(s){return Lt("Error during cell creation",`This error should never happen. Please report this bug.
|
|
188
|
+
Error: ${s}`)}},[t,n,e,o])}}function qw(e){const[t,n]=te.useState(void 0),o=te.useCallback(r=>{if(r.kind!=="cell")n(void 0);else{const[,i]=r.location;n(i)}},[n]);return{getRowThemeOverride:te.useCallback(r=>{if(r===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:o}}function Zw(e,t,n,o,r){const[i,l]=te.useState({columns:vt.empty(),rows:vt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(En.SelectionMode.MULTI_ROW)||e.selectionMode.includes(En.SelectionMode.SINGLE_ROW)),a=s&&e.selectionMode.includes(En.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(En.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(En.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(En.SelectionMode.MULTI_COLUMN),d=i.rows.length>0,f=i.columns.length>0,h=i.current!==void 0,g=te.useCallback(b=>{const y=!ks(b.rows.toArray(),i.rows.toArray()),v=!ks(b.columns.toArray(),i.columns.toArray()),I=!ks(b.current,i.current);let T=s&&y||c&&v,k=b;if((s||c)&&b.current!==void 0&&I&&(k={...b,rows:i.rows,columns:i.columns},T=!1),y&&b.rows.length>0&&v&&b.columns.length===0&&(k={...k,columns:i.columns},T=!0),v&&b.columns.length>0&&y&&b.rows.length===0&&(k={...k,rows:i.rows},T=!0),v&&k.columns.length>=0){let x=k.columns;o.forEach((L,O)=>{L.isIndex&&(x=x.remove(O))}),x.length<k.columns.length&&(k={...k,columns:x})}l(k),T&&r(k)},[i,s,c,r,o]),m=te.useCallback((b=!1,y=!1)=>{const v={columns:y?i.columns:vt.empty(),rows:b?i.rows:vt.empty(),current:void 0};l(v),(!b&&s||!y&&c)&&r(v)},[i,s,c,r]);return{gridSelection:i,isRowSelectionActivated:s,isMultiRowSelectionActivated:a,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isRowSelected:d,isColumnSelected:f,isCellSelected:h,clearSelection:m,processSelectionChange:g}}function Jw(e,t,n,o,r,i,l){const s=e.rowHeight??t.defaultRowHeight,a=t.defaultHeaderHeight+s+2*t.tableBorderWidth,c=o?2:1,u=e.editingMode===En.EditingMode.DYNAMIC?1:0,d=n+u;let f=Math.max(d*s+c*t.defaultHeaderHeight+2*t.tableBorderWidth,a),h=Math.min(f,t.defaultTableHeight);e.height&&(h=Math.max(e.height,a),f=Math.max(e.height,f)),i&&(h=Math.min(h,i),f=Math.min(f,i),e.height||(h=f));const g=t.minColumnWidth+2*t.tableBorderWidth,m=Math.max(r,g);let b,y=m;e.useContainerWidth?b=m:e.width&&(b=Math.min(Math.max(e.width,g),m),y=Math.min(Math.max(e.width,y),m));const[v,I]=te.useState({width:b||"100%",height:h});return te.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&I(T=>({...T,width:m}))},[m]),te.useLayoutEffect(()=>{I(T=>({...T,width:b||"100%"}))},[b]),te.useLayoutEffect(()=>{I(T=>({...T,height:h}))},[h,n]),te.useLayoutEffect(()=>{if(l){const T=e.useContainerWidth||mt(e.width)&&e.width>0;I({width:T?y:"100%",height:f})}else I({width:b||"100%",height:h})},[l]),{minHeight:a,maxHeight:f,minWidth:g,maxWidth:y,rowHeight:s,resizableSize:v,setResizableSize:I}}const Qw=600,ey="\u26A0\uFE0F Please fill out this cell.";function ty(e,t,n=[]){const[o,r]=te.useState(),i=te.useRef(null),l=te.useCallback(a=>{if(clearTimeout(i.current),i.current=0,r(void 0),(a.kind==="header"||a.kind==="cell")&&a.location){const c=a.location[0],u=a.location[1];let d;if(c<0||c>=e.length||n.includes(u))return;const f=e[c];if(a.kind==="header"&&mt(f))d=f.help;else if(a.kind==="cell"){const h=t([c,u]);lr(h)?d=h.errorDetails:f.isRequired&&f.isEditable&&Fi(h)?d=ey:Nm(h)&&(d=h.tooltip)}d&&(i.current=setTimeout(()=>{d&&r({content:d,left:a.bounds.x+a.bounds.width/2,top:a.bounds.y})},Qw))}},[e,t,r,i,n]),s=te.useCallback(()=>{r(void 0)},[r]);return{tooltip:o,clearTooltip:s,onItemHovered:l}}function ny({top:e,left:t,content:n,clearTooltip:o}){const[r,i]=te.useState(!0),l=Jo(),{colors:s,fontSizes:a,radii:c,fontWeights:u}=l,d=te.useCallback(()=>{i(!1),o()},[o,i]);return Oe.jsx(xl,{content:Oe.jsx(jx,{"data-testid":"stDataFrameTooltipContent",children:Oe.jsx(Ux,{style:{fontSize:a.sm},source:n,allowHTML:!1})}),placement:Cl.top,accessibilityType:_h.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:kl(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:a.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:Oe.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const oy=p.memo(ny),ph=Sr("div",{target:"e1w7nams0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-seveqep":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}}),""),gh=150,ry=15e4,mh=6;function iy({element:e,data:t,disabled:n,widgetMgr:o,disableFullscreenMode:r,fragmentId:i}){const{expanded:l,expand:s,collapse:a,width:c,height:u}=Yx(Jx),d=te.useRef(null),f=te.useRef(null),h=te.useRef(null),g=Vw(),{getRowThemeOverride:m,onItemHovered:b}=qw(g),{libConfig:{enforceDownloadInNewTab:y=!1}}=te.useContext(Xx),[v,I]=te.useState(!0),[T,k]=te.useState(!1),[x,L]=te.useState(!1),[O,R]=te.useState(!1),[P,M]=te.useState(),[S,E]=te.useState(!1),D=te.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),C=te.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ve(e.editingMode)&&(e.editingMode=En.EditingMode.READ_ONLY);const{READ_ONLY:X,DYNAMIC:B}=En.EditingMode,J=t.dimensions,ae=Math.max(0,J.numDataRows),ne=ae===0&&!(e.editingMode===B&&J.numDataColumns>0),U=ae>ry,re=!U&&!ne&&e.editingMode!==B,se=!ne&&e.editingMode===B&&!n,de=te.useRef(new Wi(ae)),[fe,Q]=te.useState(de.current.getNumRows());te.useEffect(()=>{de.current=new Wi(ae),Q(de.current.getNumRows())},[ae]);const N=te.useCallback(()=>{de.current=new Wi(ae),Q(de.current.getNumRows())},[ae]),[z,j]=te.useState(e.columnOrder);te.useEffect(()=>{j(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ge,allColumns:ke,setColumnConfigMapping:Fe}=fv(e,t,n,z);te.useEffect(()=>{if(e.editingMode===X)return;const pe=o.getStringValue({id:e.id,formId:e.formId});pe&&(de.current.fromJson(pe,ge),Q(de.current.getNumRows()))},[]);const{getCellContent:xe}=Kw(t,ge,fe,de),{columns:De,sortColumn:_e,getOriginalIndex:et,getCellContent:Pt}=kv(ae,ge,xe),Mt=te.useCallback(pe=>{const rt={selection:{rows:[],columns:[]}};rt.selection.rows=pe.rows.toArray().map(en=>et(en)),rt.selection.columns=pe.columns.toArray().map(en=>Zr(De[en]));const Dt=JSON.stringify(rt),dn=o.getStringValue({id:e.id,formId:e.formId});(dn===void 0||dn!==Dt)&&o.setStringValue({id:e.id,formId:e.formId},Dt,{fromUi:!0},i)},[De,e.id,e.formId,o,i,et]),{debouncedCallback:we}=Pu(Mt,gh),{gridSelection:be,isRowSelectionActivated:me,isMultiRowSelectionActivated:ie,isColumnSelectionActivated:Ee,isMultiColumnSelectionActivated:Ie,isRowSelected:je,isColumnSelected:tt,isCellSelected:Rt,clearSelection:ce,processSelectionChange:it}=Zw(e,ne,n,De,we);te.useEffect(()=>{ce(!0,!0)},[l]);const at=te.useCallback(pe=>{var rt;(rt=f.current)==null||rt.updateCells(pe)},[]);te.useEffect(()=>{var pe,rt,Dt,dn;if(!me&&!Ee)return;const en=o.getStringValue({id:e.id,formId:e.formId});if(en){const tn=De.map(ro=>Zr(ro)),Sn=JSON.parse(en);let wn=vt.empty(),ho=vt.empty();(rt=(pe=Sn.selection)==null?void 0:pe.rows)==null||rt.forEach(ro=>{wn=wn.add(ro)}),(dn=(Dt=Sn.selection)==null?void 0:Dt.columns)==null||dn.forEach(ro=>{ho=ho.add(tn.indexOf(ro))}),(wn.length>0||ho.length>0)&&it({rows:wn,columns:ho,current:void 0})}},[]);const Re=te.useCallback(()=>{fe!==de.current.getNumRows()&&Q(de.current.getNumRows())},[fe]),Tt=te.useCallback(()=>{const pe=de.current.toJson(De);let rt=o.getStringValue({id:e.id,formId:e.formId});rt===void 0&&(rt=new Wi(0).toJson([])),pe!==rt&&o.setStringValue({id:e.id,formId:e.formId},pe,{fromUi:!0},i)},[De,e.id,e.formId,o,i]),{debouncedCallback:Xt}=Pu(Tt,gh),{exportToCsv:Ne}=Gw(Pt,De,fe,y),{onCellEdited:nt,onPaste:kt,onRowAppended:Et,onDelete:qt,validateCell:un}=Ww(De,e.editingMode!==B,de,Pt,et,at,Re,Xt,ce),an=te.useMemo(()=>ne?[0]:se?[fe]:[],[ne,se,fe]),{tooltip:Bt,clearTooltip:wt,onItemHovered:Ot}=ty(De,Pt,an),{drawCell:In,customRenderers:Cn}=Bw(De),{provideEditor:ot}=Mv(),sn=p.useCallback(pe=>({...pe,hasMenu:!ne}),[ne]),bn=te.useMemo(()=>De.map(pe=>sn(va(pe))),[De,sn]),{columns:yt,onColumnResize:Zt}=vv(bn),ut=t.dimensions.numHeaderRows>1,{minHeight:Vt,maxHeight:$t,minWidth:rn,maxWidth:Ft,rowHeight:Jt,resizableSize:Ue,setResizableSize:Ht}=Jw(e,g,fe,ut,c||0,u,l),kn=te.useCallback(([pe,rt])=>({...Bm(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:g.glideTheme.textLight},span:[0,Math.max(De.length-1,0)]}),[De,g.glideTheme.textLight]),At=te.useCallback(()=>{N(),ce()},[N,ce]);qx({element:e,widgetMgr:o,onFormCleared:At});const{pinColumn:Wt,unpinColumn:jt,freezeColumns:oo}=gv(De,ne,c||0,g.minColumnWidth,ce,Fe),{changeColumnFormat:jn}=pv(Fe),{hideColumn:_,showColumn:qe}=Sv(ce,Fe),{onColumnMoved:Je}=mv(De,oo,Wt,jt,j);return te.useEffect(()=>{setTimeout(()=>{var pe,rt;if(h.current&&f.current){const Dt=(rt=(pe=h.current)==null?void 0:pe.querySelector(".dvn-stack"))==null?void 0:rt.getBoundingClientRect();Dt&&(L(Dt.height>h.current.clientHeight),R(Dt.width>h.current.clientWidth))}},1)},[Ue,fe,yt]),p.useEffect(()=>{ke.length==De.length&&E(!1)},[ke.length,De.length]),Oe.jsxs(ph,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:C,ref:h,onMouseDown:pe=>{if(h.current&&C){const rt=h.current.getBoundingClientRect();O&&rt.height-(mh+1)<pe.clientY-rt.top&&pe.stopPropagation(),x&&rt.width-(mh+1)<pe.clientX-rt.left&&pe.stopPropagation()}},onBlur:pe=>{!v&&!D&&!pe.currentTarget.contains(pe.relatedTarget)&&ce(!0,!0)},children:[Oe.jsxs(Qx,{isFullScreen:l,disableFullscreenMode:r,locked:je&&!me||Rt||D&&v||S,onExpand:s,onCollapse:a,target:ph,children:[(me&&je||Ee&&tt)&&Oe.jsx(Mr,{label:"Clear selection",icon:lC,onClick:()=>{ce(),wt()}}),se&&je&&Oe.jsx(Mr,{label:"Delete row(s)",icon:dC,onClick:()=>{qt&&(qt(be),wt())}}),se&&!je&&Oe.jsx(Mr,{label:"Add row",icon:Es,onClick:()=>{var pe;Et&&(I(!0),Et(),wt(),(pe=f.current)==null||pe.scrollTo(0,fe,"vertical"))}}),!ne&&ke.length>De.length&&Oe.jsx(zm,{columns:ke,columnOrder:z,setColumnOrder:j,hideColumn:_,showColumn:qe,isOpen:S,onClose:()=>E(!1),children:Oe.jsx(Mr,{label:"Show/hide columns",icon:Ts,onClick:()=>E(!0)})}),!U&&!ne&&Oe.jsx(Mr,{label:"Download as CSV",icon:hC,onClick:()=>Ne()}),!ne&&Oe.jsx(Mr,{label:"Search",icon:Is,onClick:()=>{T?k(!1):(I(!0),k(!0)),wt()}})]}),Oe.jsx(Gx,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Ue,style:{border:`${g.tableBorderWidth}px solid ${g.glideTheme.borderColor}`,borderRadius:`${g.tableBorderRadius}`},minHeight:Vt,maxHeight:$t,minWidth:rn,maxWidth:Ft,size:Ue,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Jt],snapGap:Jt/3,onResizeStop:(pe,rt,Dt,dn)=>{if(d.current){const en=2*g.tableBorderWidth;Ht({width:d.current.size.width,height:$t-d.current.size.height===en?d.current.size.height+en:d.current.size.height})}},children:Oe.jsx(Cm,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:yt,rows:ne?1:fe,minColumnWidth:g.minColumnWidth,maxColumnWidth:g.maxColumnWidth,maxColumnAutoWidth:g.maxColumnAutoWidth,rowHeight:Jt,headerHeight:g.defaultHeaderHeight,getCellContent:ne?kn:Pt,onColumnResize:D?void 0:Zt,resizeIndicator:"header",freezeColumns:oo,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:D?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Ee?void 0:Je,onItemHovered:pe=>{b==null||b(pe),Ot==null||Ot(pe)},keybindings:{downFill:!0},onKeyDown:pe=>{(pe.ctrlKey||pe.metaKey)&&pe.key==="f"&&(k(rt=>!rt),pe.stopPropagation(),pe.preventDefault())},showSearch:T,onSearchClose:()=>{k(!1),wt()},onHeaderClicked:(pe,rt)=>{!re||Ee||(me&&je?ce():ce(!0,!0),_e(pe,"auto"))},gridSelection:be,onGridSelectionChange:pe=>{(v||D)&&(it(pe),Bt!==void 0&&wt())},theme:g.glideTheme,getRowThemeOverride:m,onMouseMove:pe=>{pe.kind==="out-of-bounds"&&v?I(!1):pe.kind!=="out-of-bounds"&&!v&&I(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...C&&{paddingBottom:O?-6:void 0,paddingRight:x?-6:void 0}},provideEditor:ot,drawCell:In,customRenderers:Cn,imageEditorOverride:Qm,headerIcons:g.headerIcons,validateCell:un,onHeaderMenuClick:(pe,rt)=>{M({columnIdx:pe,headerBounds:rt})},onPaste:!1,...me&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:g.glideTheme.bgHeader,bgCellMedium:g.glideTheme.bgHeader}},rowSelectionMode:ie?"multi":"auto",rowSelect:n?"none":ie?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Ee&&{columnSelect:n?"none":Ie?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!ne&&e.editingMode!==X&&!n&&{fillHandle:!D,onCellEdited:nt,onPaste:kt,onDelete:qt},...!ne&&e.editingMode===B&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:g.glideTheme.bgHeader,bgCellMedium:g.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:Et,onHeaderClicked:void 0}})}),Bt&&Bt.content&&Oe.jsx(oy,{top:Bt.top,left:Bt.left,content:Bt.content,clearTooltip:wt}),P&&Jh.createPortal(Oe.jsx(Im,{top:P.headerBounds.y+P.headerBounds.height,left:P.headerBounds.x+P.headerBounds.width,columnKind:ge[P.columnIdx].kind,onCloseMenu:()=>M(void 0),onSortColumn:re?pe=>{ce(!0,!0),_e(P.columnIdx,pe,!0)}:void 0,isColumnPinned:ge[P.columnIdx].isPinned,onUnpinColumn:()=>{jt(ge[P.columnIdx].id)},onPinColumn:()=>{Wt(ge[P.columnIdx].id)},onHideColumn:()=>{_(ge[P.columnIdx].id)},onChangeFormat:pe=>{jn(ge[P.columnIdx].id,pe),setTimeout(()=>{var rt;(rt=f.current)==null||rt.remeasureColumns(vt.fromSingleSelection(P.columnIdx))},100)},onAutosize:()=>{var pe;(pe=f.current)==null||pe.remeasureColumns(vt.fromSingleSelection(P.columnIdx))}}),document.querySelector("#portal"))]})}let vh,bh;vh=Zx(iy),bh=p.memo(vh),Qh=Object.freeze(Object.defineProperty({__proto__:null,default:bh},Symbol.toStringTag,{value:"Module"}))});export{Ss as C,El as T,fC as __tla,Po as a,Ms as b,Qh as c,Ho as i,Rs as m,cn as s};
|