@stlite/desktop 0.94.0 → 0.95.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/CHANGELOG.md +6 -0
- package/build/assets/{ErrorOutline.esm-DLUMN1rT-DJlX61n8.js → ErrorOutline.esm-C-dv9Xq1-skkXNqDc.js} +1 -1
- package/build/assets/{FileDownload.esm-DF2iWLBX-wR0Sqyar.js → FileDownload.esm-ORp-UC-S-BrsUfuH5.js} +1 -1
- package/build/assets/{FileHelper-e3Y3t9SK-CvhzeiBH.js → FileHelper-DQKV3o5U-qFf0CL_R.js} +1 -1
- package/build/assets/{FormClearHelper-Bzgvbizg-C4nYH9Ah.js → FormClearHelper-DtwjWakY-CxfcniD6.js} +1 -1
- package/build/assets/{InputInstructions-CVvsIG30-CnawSQ9T.js → InputInstructions-CshBE9XZ-BbegIdTI.js} +1 -1
- package/build/assets/{Particles-Be2s8q_d-CqrCI_Wv.js → Particles-DbEEaBdi-Cslh0fnd.js} +1 -1
- package/build/assets/{ProgressBar-D9RZaREA-RHxbZJ2h.js → ProgressBar-ohpf-YR2-PWD0xacp.js} +1 -1
- package/build/assets/{Toolbar-JQglDlYw-BVoZAoJb.js → Toolbar-Cc8tCeKL-JHIp2NvW.js} +1 -1
- package/build/assets/{base-input-BKMf8bDw-CV7al27L.js → base-input-DbV2D5sF-DJkpBRM1.js} +1 -1
- package/build/assets/{checkbox-COWlDD7C-C4FcqJsu.js → checkbox-CG80fxUD-CavQvTtP.js} +1 -1
- package/build/assets/{createSuper-A2N3ZqeL-BLFmYQPg.js → createSuper-BlgWzn8_-h1vcwEzv.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-ChccEKqe-B1le2p6v.js → data-grid-overlay-editor-DsmOmCoE-DU0EvyVM.js} +1 -1
- package/build/assets/{downloader-DcCTL3Wz-aWEH86Cm.js → downloader-DcCTL3Wz-CqotLrf1.js} +1 -1
- package/build/assets/{es6--XPcqeHG-DGncAuJb.js → es6--XPcqeHG-DdkxL8eW.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-DzFYQyDX-YYXCMpzY.js → iframeResizer.contentWindow-DEXh82Lp-CG3rnwWO.js} +1 -1
- package/build/assets/{index-DB9qsR4f-yf6MH9_3.js → index-3Q8l-56I-Bp9UZWPZ.js} +1 -1
- package/build/assets/{index-DothqwZV-C1n5_0yC.js → index-8FM--PX3-C2rsm2es.js} +1 -1
- package/build/assets/{index-DdGOyljS-CORoEvmn.js → index-B1y_Hrx0-DDwLQ3XW.js} +1 -1
- package/build/assets/{index-BAyifI5P-D0GyG_F4.js → index-BECG__WC-DerPiN--.js} +1 -1
- package/build/assets/{index-DnbVdm9s-Bf01xwYR.js → index-BQn4Faen-CVQ5ESXY.js} +1 -1
- package/build/assets/{index-DsC6gg9e-403VlLJ7.js → index-BReUOw2L-emeACiGh.js} +1 -1
- package/build/assets/{index-0kGpkeFl-CpoyiVYL.js → index-BiS_E3zu-CwIGZcqG.js} +1 -1
- package/build/assets/{index-CC5fS38J-4gUNHnsm.js → index-BmlZuG1z-BtaDcb9o.js} +1 -1
- package/build/assets/{index-UzH0BZ2O-DQwgk0Tm.js → index-BqCY3Zlk-mm_Bt8ZF.js} +1 -1
- package/build/assets/{index-Cx-F6ZGn.js → index-BvblFOYP.js} +4 -4
- package/build/assets/{index-DkMzG46X-DNODCduO.js → index-Bzy7yu67-C3L4ShMk.js} +1 -1
- package/build/assets/{index-C6xbAbU4-x8N_u5fg.js → index-C7cG_aL6-BWm5S1-m.js} +1 -1
- package/build/assets/{index-CfIBVPGp-BnLIrYvE.js → index-CNKtyIol-BPke8suV.js} +1 -1
- package/build/assets/{index-TR6pX8nH-B5Qwf3Y2.js → index-CO05R5cS-DHfFy15g.js} +1 -1
- package/build/assets/{index-vsSnzLDF-CYwXIqdH.js → index-CQfw52g6-BJ-a84bb.js} +1 -1
- package/build/assets/{index-C7M-Z8_R-DqgCTsJ0.js → index-CTvmRzFN-By1zFrdQ.js} +1 -1
- package/build/assets/{index-BUdRujoV-Bfg81rAj.js → index-Cb_C2vCk-DrzTyNQF.js} +5 -5
- package/build/assets/{index-CN9bcWEZ-BbIMtkvi.js → index-CiBn_-AR-CMINgD7R.js} +1 -1
- package/build/assets/{index-DSDCNpbF-BVgtNOEo.js → index-CnMc0ayy-CKIU12h5.js} +1 -1
- package/build/assets/{index-C3BOWUoD-BYG7HL0F.js → index-D0Ry9mHz-DBJluHQV.js} +1 -1
- package/build/assets/{index-CsE-EDrH-CJOeZcb2.js → index-D2j0kQLw-67iH-2yA.js} +1 -1
- package/build/assets/{index-C-JP28SD-iteBg9_9.js → index-D42P77wj-jZCT0fQL.js} +1 -1
- package/build/assets/{index-BJ2kpCS_-BaQee2_8.js → index-D7LfqMh3-DvKIa3UK.js} +1 -1
- package/build/assets/{index-BOFZKg22-C4O3MBH4.js → index-DD64_I3e-Cxdt0Oji.js} +1 -1
- package/build/assets/{index-5-cNs0Gx-CuJiW0Wp.js → index-DEYeMrzr-DP5rSRot.js} +1 -1
- package/build/assets/{index-BlgXRUCL-DT54Wcnn.js → index-DTog-cZN-vTBq72Ci.js} +1 -1
- package/build/assets/{index-DylhRo5T-jKp1cHw_.js → index-DU0kTHM_-CInhbPr8.js} +1 -1
- package/build/assets/{index-CjoF8x6G-rOfzi3h2.js → index-DeKEPgyN-DF3OyxuW.js} +1 -1
- package/build/assets/{index-D_tjqFri-C10O4DkQ.js → index-DrS8S2M--C4mGh6T8.js} +1 -1
- package/build/assets/{index-CCKLeb7c-DiCL-qAt.js → index-DxTzjSNF-B-v_CQEN.js} +1 -1
- package/build/assets/{index-BwItsjk1-BBFXlpwo.js → index-IXLMpVV4-D8dPiMEz.js} +1 -1
- package/build/assets/{index-drbPV9RO-BZ_2tUOv.js → index-Ray843Xd-CpBr9wfH.js} +1 -1
- package/build/assets/{index-CALVxRWk-OXCn3_Zb.js → index-S-A7KecP-DJ0BKtLt.js} +1 -1
- package/build/assets/{index-De80aB3n-Dk7-6mgY.js → index-SbKh1OIB-BjfuWdcF.js} +1 -1
- package/build/assets/{index-BCD3qYZm-3dUep6KP.js → index-Uvv6so0Q-Lbl8GAad.js} +1 -1
- package/build/assets/{index-dPJN2mSF-BQ3y95nd.js → index-YbT2v6Cb-CoC81Jcm.js} +1 -1
- package/build/assets/{index-BsMCHX15-DTBgOE8y.js → index-vRM8HrbM-CZbE9IiJ.js} +1 -1
- package/build/assets/{index-D2QnP1M_-DM8257jJ.js → index-y3ITDERN-Ccy-wRE2.js} +1 -1
- package/build/assets/{inherits-DfAVxMSJ-CZIIOQ8k.js → inherits-CYghrBFU-Cf4k8aUQ.js} +1 -1
- package/build/assets/{input-CbOz0FnA-Klb21A9f.js → input-DNUwcYWK-C9eVW6-S.js} +1 -1
- package/build/assets/{memory-B3L1Fctl-DKiYdOg0.js → memory-B3L1Fctl-CQ-Y_gc6.js} +1 -1
- package/build/assets/{number-overlay-editor-DNRSxPnE-BE7Xr_c1.js → number-overlay-editor-C2e7pY6x-BnC-vP7l.js} +1 -1
- package/build/assets/{sandbox-ChAzL-i--CagQkIrB.js → sandbox-ChAzL-i--DqMwo4R7.js} +1 -1
- package/build/assets/{slicedToArray-DPtlZZHF-C_Rx2ODv.js → slicedToArray-D4uL3Bzl-95JmZlNK.js} +1 -1
- package/build/assets/{timepicker-Bl5n1Hs_-CMvacYKJ.js → timepicker-CkLW19xP-CTuglWU6.js} +1 -1
- package/build/assets/{uniqueId-CY-CvtXB-CPhRY98h.js → uniqueId-C6wp_e1D-D_RnWRJW.js} +1 -1
- package/build/assets/{useBasicWidgetState-CcvdwkOI-DOgmtoFM.js → useBasicWidgetState-BTyLgyXa-DI96f9E0.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-CKzlRc94-C2SJR99z.js → useTextInputAutoExpand-YLx_K1sh-DhWKaGOV.js} +1 -1
- package/build/assets/{useUpdateUiValue-BfDOTwv7-DRnzNkty.js → useUpdateUiValue-B9j1K8e5-CIeTAxHC.js} +1 -1
- package/build/assets/{withFullScreenWrapper-mCnTzCqV-DFYwNHzE.js → withFullScreenWrapper-DqrJMIkm-BwrYir6f.js} +1 -1
- package/build/assets/{worker-B65uO5d3-CuVvmm9s.js → worker-DAN7Os1o-BP8Vk1l7.js} +8 -8
- package/build/electron/worker.js +7 -7
- package/build/index.html +1 -1
- package/build/pyodide/pyodide-lock.json +1 -1
- package/build/pyodide/pyodide.asm.js +1 -1
- package/build/pyodide/pyodide.asm.wasm +0 -0
- package/build/pyodide/pyodide.mjs +3 -3
- package/build/pyodide/python_stdlib.zip +0 -0
- package/package.json +4 -4
- package/wheels/stlite_lib-0.1.0-py3-none-any.whl +0 -0
- package/wheels/streamlit-1.51.0-cp313-none-any.whl +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-
|
|
2
|
-
import{j as ve,r as d,cm as cc,cn as nn,aC as kt,co as cp,aK as ns,c6 as up,bi as cd,l as rs,E as os,_ as Ve,cp as dp,cq as ud,cr as dd,X as vr,d as Tr,cs as hp,Q as nl,v as De,c as Qn,ct as fp,cu as pp,x as rt,cv as hd,C as gp,cw as mp,cx as vp,cy as bp,cz as wp,cA as yp,cB as xp,cC as zl,cD as fd,aB as tn,cE as Cp,cF as kp,cG as Sp,cH as Mp,cI as Ip,cJ as Rp,cK as Ep,U as si,m as Qr,bs as Da,br as Pa,cL as pd,M as Mi,F as qn,cM as Tp,bG as gd,cN as Op,H as Dp,e as uc,cO as Pp,cP as Hp,f as Lp,L as Ap,b as md,cQ as Fp,cR as zp,cS as _p,cT as $p,cU as Vp,at as vd,cV as ci,cW as dc,ao as Xr,aL as Bp,cX as Np,cY as Wp,cZ as bd,c_ as jp,c$ as Gp,d0 as Up,y as rl,d1 as Xp,c8 as ol,d2 as qp,d3 as wd,d4 as Kp,bq as Ur,d5 as Zp,d6 as Yp,d7 as Qp,d8 as Jp,D as eg,d9 as yd,da as tg,db as ng,aD as rg,dc as og,dd as ig,de as ag,A as lg,B as sg,df as cg,dg as ug,z as dg,dh as hg,di as fg,dj as pg,dk as ur,$ as To,bT as gg,dl as mg,dm as vg,dn as bg,dp as wg,dq as yg,dr as xg,ds as Cg,dt as la,du as Xo,dv as Lt,dw as Ct,dx as fa,dy as yn,dz as kg,dA as Sg,dB as Mg,dC as Ig,dD as Rg,dE as Eg,dF as Tg,dG as Wr,dH as hc,dI as fc,dJ as xd,dK as Cd,dL as Og,dM as _l,dN as Dg,dO as Pg,dP as kd,dQ as Hg}from"./index-Cx-F6ZGn.js";import{v as Lg,d as Ag}from"./withFullScreenWrapper-mCnTzCqV-DFYwNHzE.js";import{y as Fg,X as xo}from"./Toolbar-JQglDlYw-BVoZAoJb.js";import{m as zg}from"./FormClearHelper-Bzgvbizg-C4nYH9Ah.js";import{_ as _g}from"./sprintf-D5E86llw-6tzWM3a-.js";import{v as $g,y as Vg,T as Bg}from"./checkbox-COWlDD7C-C4FcqJsu.js";import{a as Ng}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{p as Wg,_ as gr}from"./slicedToArray-DPtlZZHF-C_Rx2ODv.js";import{b as jg,p as Gg,l as Ug}from"./inherits-DfAVxMSJ-CZIIOQ8k.js";import{i as Xg}from"./createSuper-A2N3ZqeL-BLFmYQPg.js";import{o as qg,i as Kg}from"./FileDownload.esm-DF2iWLBX-wR0Sqyar.js";var Sd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Sd.displayName="Add";var Md=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});Md.displayName="Search";var Id=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});Id.displayName="Visibility";var il,pc;function Zg(){if(pc)return il;pc=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return il=n,il}var al,gc;function Yg(){if(gc)return al;gc=1;var e=Zg(),t=dp();function n(r,o){return r!=null&&t(r,o,e)}return al=n,al}var Qg=Yg();const Jg=vr(Qg);function Rd(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return Rd(t)}function vi(e,t){return Rd(t??"Hell froze over")}function em(e,t){try{return e()}catch{return t}}const mc=Object.prototype.hasOwnProperty;function Do(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Do(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(mc.call(e,n)&&++r&&!mc.call(t,n)||!(n in t)||!Do(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const pa=null,is=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 vc;(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"})(vc||(vc={}));var ga;(function(e){e.Triangle="triangle",e.Dots="dots"})(ga||(ga={}));function qi(e){return"width"in e&&typeof e.width=="number"}async function bc(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Io(e){return e.kind===Wn.Marker||e.kind===Wn.NewRow}function So(e){if(!ko(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:vi(e,"A cell was passed with an invalid kind")}}function tm(e){return Jg(e,"editor")}function as(e){return!(e.readonly??!1)}var Wn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Wn||(Wn={}));const ma={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function ll(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let wc;class Ye{items;constructor(t){this.items=t}static create=t=>new Ye(ll(t));static empty=()=>wc??(wc=new Ye([]));static fromSingleSelection=t=>Ye.empty().add(t);static fromArray=t=>{if(t.length===0)return Ye.empty();const n=t.map(o=>[o,o+1]),r=ll(n);return new Ye(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Ye(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=ll([...this.items,n]);return new Ye(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new Ye(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)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 r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var nm=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},yc=nm,rm=e=>e.toUpperCase()===e,om=e=>t=>e.indexOf(t)===-1,Ed=(e,t)=>{const n={};return Object.keys(e).filter(om(t)).forEach(r=>{n[r]=e[r]}),n};function im(e,t,n){const r=Ed(t,n);if(!e){const o=typeof ol=="function"?{default:ol}:ol;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var am=(e,t)=>{};function lm(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!rm(l[0])):n.propsAsIs,u=im(c,i,["as","class"]);u.ref=a,u.className=n.atomic?yc(n.class,u.className||s):yc(u.className||s,n.class);const{vars:h}=n;if(h){const g={};for(const m in h){const w=h[m],y=w[0],v=w[1]||"",C=typeof y=="function"?y(i):y;am(C,n.name),g[`--${m}`]=`${C}${v}`}const f=u.style||{},p=Object.keys(f);p.length>0&&p.forEach(m=>{g[m]=f[m]}),u.style=g}return e.__wyw_meta&&e!==l?(u.as=l,d.createElement(e,u)):d.createElement(l,u)},o=d.forwardRef?d.forwardRef(r):(i=>{const a=Ed(i,["innerRef"]);return r(a,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var sn=lm;const sm=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var xc={},qo={},sl={},cl={},Cc;function cm(){return Cc||(Cc=1,(function(e){(function(t,n){n(e,kt,rg())})(cl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var o=a(n),i=a(r);function a(v){return v&&v.__esModule?v:{default:v}}var l=Object.assign||function(v){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(v[E]=R[E])}return v};function s(v,C){var R={};for(var E in v)C.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E]);return R}function c(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var u=(function(){function v(C,R){for(var E=0;E<R.length;E++){var M=R[E];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(C,M.key,M)}}return function(C,R,E){return R&&v(C.prototype,R),E&&v(C,E),C}})();function h(v,C){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:v}function g(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);v.prototype=Object.create(C&&C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(v,C):v.__proto__=C)}var f=!1;function p(v){f=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?v:v.capture}function w(v){if("touches"in v){var C=v.touches[0],R=C.pageX,E=C.pageY;return{x:R,y:E}}var M=v.screenX,H=v.screenY;return{x:M,y:H}}var y=(function(v){g(C,v);function C(){var R;c(this,C);for(var E=arguments.length,M=Array(E),H=0;H<E;H++)M[H]=arguments[H];var S=h(this,(R=C.__proto__||Object.getPrototypeOf(C)).call.apply(R,[this].concat(M)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return u(C,[{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(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var E=w(R),M=E.x,H=E.y;this.moveStart={x:M,y:H},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var E=w(R),M=E.x,H=E.y,S=M-this.moveStart.x,x=H-this.moveStart.y;this.moving=!0;var L=this.props.onSwipeMove({x:S,y:x},R);L&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:S,deltaY:x}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var E=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-E?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>E&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-E?this.props.onSwipeUp(1,R):this.movePosition.deltaY>E&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var E=R.className,M=R.style,H=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var S=s(R,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:E,style:M},S),H)}}]),C})(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})})(cl)),cl}var kc;function Td(){return kc||(kc=1,(function(e){(function(t,n){n(e,cm())})(sl,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(sl)),sl}var Ko={},Sc;function Od(){if(Sc)return Ko;Sc=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var e=t(Xp());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,e.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,a){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Ko.default=r,Ko}var Zo={},Yo={},Mc;function um(){if(Mc)return Yo;Mc=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Yo.outerWidth=e,Yo}var Qo={},Ic;function ls(){if(Ic)return Qo;Ic=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var e=function(t,n,r){var o=t===0?t:t+n,i=r==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+i.join(",")+")";return a+l};return Qo.default=e,Qo}var Jo={},Rc;function Dd(){if(Rc)return Jo;Rc=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(){return window};return Jo.default=e,Jo}var Ec;function Pd(){if(Ec)return Zo;Ec=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=void 0;var e=s(kt),t=a(Od()),n=um(),r=a(ls()),o=a(Td()),i=a(Dd());function a(S){return S&&S.__esModule?S:{default:S}}function l(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return l=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||c(S)!=="object"&&typeof S!="function")return{default:S};var x=l();if(x&&x.has(S))return x.get(S);var L={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in S)if(Object.prototype.hasOwnProperty.call(S,I)){var O=T?Object.getOwnPropertyDescriptor(S,I):null;O&&(O.get||O.set)?Object.defineProperty(L,I,O):L[I]=S[I]}return L.default=S,x&&x.set(S,L),L}function c(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(x){return typeof x}:c=function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},c(S)}function u(){return u=Object.assign||function(S){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var T in L)Object.prototype.hasOwnProperty.call(L,T)&&(S[T]=L[T])}return S},u.apply(this,arguments)}function h(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function g(S,x){for(var L=0;L<x.length;L++){var T=x[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}function f(S,x,L){return x&&g(S.prototype,x),S}function p(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),x&&m(S,x)}function m(S,x){return m=Object.setPrototypeOf||function(L,T){return L.__proto__=T,L},m(S,x)}function w(S){var x=C();return function(){var L=R(S),T;if(x){var I=R(this).constructor;T=Reflect.construct(L,arguments,I)}else T=L.apply(this,arguments);return y(this,T)}}function y(S,x){return x&&(c(x)==="object"||typeof x=="function")?x:v(S)}function v(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function C(){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 R(S){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},R(S)}function E(S,x,L){return x in S?Object.defineProperty(S,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):S[x]=L,S}var M=function(S){return S.hasOwnProperty("key")},H=(function(S){p(L,S);var x=w(L);function L(T){var I;return h(this,L),I=x.call(this,T),E(v(I),"itemsWrapperRef",void 0),E(v(I),"itemsListRef",void 0),E(v(I),"thumbsRef",void 0),E(v(I),"setItemsWrapperRef",function(O){I.itemsWrapperRef=O}),E(v(I),"setItemsListRef",function(O){I.itemsListRef=O}),E(v(I),"setThumbsRef",function(O,D){I.thumbsRef||(I.thumbsRef=[]),I.thumbsRef[D]=O}),E(v(I),"updateSizes",function(){if(!(!I.props.children||!I.itemsWrapperRef||!I.thumbsRef)){var O=e.Children.count(I.props.children),D=I.itemsWrapperRef.clientWidth,k=I.props.thumbWidth?I.props.thumbWidth:(0,n.outerWidth)(I.thumbsRef[0]),Q=Math.floor(D/k),N=Q<O,Y=N?O-Q:0;I.setState(function(ae,ee){return{itemSize:k,visibleItems:Q,firstItem:N?I.getFirstItem(ee.selectedItem):0,lastPosition:Y,showArrows:N}})}}),E(v(I),"handleClickItem",function(O,D,k){if(!M(k)||k.key==="Enter"){var Q=I.props.onSelectItem;typeof Q=="function"&&Q(O,D)}}),E(v(I),"onSwipeStart",function(){I.setState({swiping:!0})}),E(v(I),"onSwipeEnd",function(){I.setState({swiping:!1})}),E(v(I),"onSwipeMove",function(O){var D=O.x;if(!I.state.itemSize||!I.itemsWrapperRef||!I.state.visibleItems)return!1;var k=0,Q=e.Children.count(I.props.children),N=-(I.state.firstItem*100)/I.state.visibleItems,Y=Math.max(Q-I.state.visibleItems,0),ae=-Y*100/I.state.visibleItems;N===k&&D>0&&(D=0),N===ae&&D<0&&(D=0);var ee=I.itemsWrapperRef.clientWidth,K=N+100/(ee/D);return I.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(pe){I.itemsListRef.style[pe]=(0,r.default)(K,"%",I.props.axis)}),!0}),E(v(I),"slideRight",function(O){I.moveTo(I.state.firstItem-(typeof O=="number"?O:1))}),E(v(I),"slideLeft",function(O){I.moveTo(I.state.firstItem+(typeof O=="number"?O:1))}),E(v(I),"moveTo",function(O){O=O<0?0:O,O=O>=I.state.lastPosition?I.state.lastPosition:O,I.setState({firstItem:O})}),I.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},I}return f(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(T){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==T.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(T){var I=T;return T>=this.state.lastPosition&&(I=this.state.lastPosition),T<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),T<this.state.firstItem&&(I=T),I}},{key:"renderItems",value:function(){var T=this;return this.props.children.map(function(I,O){var D=t.default.ITEM(!1,O===T.state.selectedItem),k={key:O,ref:function(Q){return T.setThumbsRef(Q,O)},className:D,onClick:T.handleClickItem.bind(T,O,T.props.children[O]),onKeyDown:T.handleClickItem.bind(T,O,T.props.children[O]),"aria-label":"".concat(T.props.labels.item," ").concat(O+1),style:{width:T.props.thumbWidth}};return e.default.createElement("li",u({},k,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var T=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,k={},Q=-this.state.firstItem*(this.state.itemSize||0),N=(0,r.default)(Q,"px",this.props.axis),Y=this.props.transitionTime+"ms";return k={WebkitTransform:N,MozTransform:N,MsTransform:N,OTransform:N,transform:N,msTransform:N,WebkitTransitionDuration:Y,MozTransitionDuration:Y,MsTransitionDuration:Y,OTransitionDuration:Y,transitionDuration:Y,msTransitionDuration:Y},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return T.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(o.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:k,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 T.setItemsListRef(ae)},style:k},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return T.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L})(e.Component);return Zo.default=H,E(H,"displayName","Thumbs"),E(H,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Zo}var ei={},Tc;function dm(){if(Tc)return ei;Tc=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.default=void 0;var e=function(){return document};return ei.default=e,ei}var Ln={},Oc;function Hd(){if(Oc)return Ln;Oc=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=kt,t=n(ls());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};Ln.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=i;var a=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,g=u-1;return s&&(s!==g||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===g&&(h+=100-c.centerSlidePercentage),h}return-s*100};Ln.getPosition=a;var l=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return Ln.setPosition=l,Ln}var Xn={},Dc;function hm(){if(Dc)return Xn;Dc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fadeAnimationHandler=Xn.slideStopSwipingHandler=Xn.slideSwipeAnimationHandler=Xn.slideAnimationHandler=void 0;var e=kt,t=r(ls()),n=Hd();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,p)}return f}function i(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?o(Object(f),!0).forEach(function(p){a(h,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(f,p))})}return h}function a(h,g,f){return g in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}var l=function(h,g){var f={},p=g.selectedItem,m=p,w=e.Children.count(h.children)-1,y=h.infiniteLoop&&(p<0||p>w);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):m>w&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var v=(0,n.getPosition)(p,h),C=(0,t.default)(v,"%",h.axis),R=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:C,msTransform:C,OTransform:C,transform:C},g.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),f};Xn.slideAnimationHandler=l;var s=function(h,g,f,p){var m={},w=g.axis==="horizontal",y=e.Children.count(g.children),v=0,C=(0,n.getPosition)(f.selectedItem,g),R=g.infiniteLoop?(0,n.getPosition)(y-1,g)-100:(0,n.getPosition)(y-1,g),E=w?h.x:h.y,M=E;C===v&&E>0&&(M=0),C===R&&E<0&&(M=0);var H=C+100/(f.itemSize/M),S=Math.abs(E)>g.swipeScrollTolerance;return g.infiniteLoop&&S&&(f.selectedItem===0&&H>-100?H-=y*100:f.selectedItem===y-1&&H<-y*100&&(H+=y*100)),(!g.preventMovementUntilSwipeScrollTolerance||S||f.swipeMovementStarted)&&(f.swipeMovementStarted||p({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(H,g.axis)),S&&!f.cancelClick&&p({cancelClick:!0}),m};Xn.slideSwipeAnimationHandler=s;var c=function(h,g){var f=(0,n.getPosition)(g.selectedItem,h),p=(0,n.setPosition)(f,h.axis);return{itemListStyle:p}};Xn.slideStopSwipingHandler=c;var u=function(h,g){var f=h.transitionTime+"ms",p="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Xn.fadeAnimationHandler=u,Xn}var Pc;function fm(){if(Pc)return qo;Pc=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e=u(kt),t=s(Td()),n=s(Od()),r=s(Pd()),o=s(dm()),i=s(Dd()),a=Hd(),l=hm();function s(T){return T&&T.__esModule?T:{default:T}}function c(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return c=function(){return T},T}function u(T){if(T&&T.__esModule)return T;if(T===null||h(T)!=="object"&&typeof T!="function")return{default:T};var I=c();if(I&&I.has(T))return I.get(T);var O={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in T)if(Object.prototype.hasOwnProperty.call(T,k)){var Q=D?Object.getOwnPropertyDescriptor(T,k):null;Q&&(Q.get||Q.set)?Object.defineProperty(O,k,Q):O[k]=T[k]}return O.default=T,I&&I.set(T,O),O}function h(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(I){return typeof I}:h=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},h(T)}function g(){return g=Object.assign||function(T){for(var I=1;I<arguments.length;I++){var O=arguments[I];for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&(T[D]=O[D])}return T},g.apply(this,arguments)}function f(T,I){var O=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);I&&(D=D.filter(function(k){return Object.getOwnPropertyDescriptor(T,k).enumerable})),O.push.apply(O,D)}return O}function p(T){for(var I=1;I<arguments.length;I++){var O=arguments[I]!=null?arguments[I]:{};I%2?f(Object(O),!0).forEach(function(D){x(T,D,O[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(O)):f(Object(O)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(O,D))})}return T}function m(T,I){if(!(T instanceof I))throw new TypeError("Cannot call a class as a function")}function w(T,I){for(var O=0;O<I.length;O++){var D=I[O];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}function y(T,I,O){return I&&w(T.prototype,I),T}function v(T,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(I&&I.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),I&&C(T,I)}function C(T,I){return C=Object.setPrototypeOf||function(O,D){return O.__proto__=D,O},C(T,I)}function R(T){var I=H();return function(){var O=S(T),D;if(I){var k=S(this).constructor;D=Reflect.construct(O,arguments,k)}else D=O.apply(this,arguments);return E(this,D)}}function E(T,I){return I&&(h(I)==="object"||typeof I=="function")?I:M(T)}function M(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function H(){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 S(T){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},S(T)}function x(T,I,O){return I in T?Object.defineProperty(T,I,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[I]=O,T}var L=(function(T){v(O,T);var I=R(O);function O(D){var k;m(this,O),k=I.call(this,D),x(M(k),"thumbsRef",void 0),x(M(k),"carouselWrapperRef",void 0),x(M(k),"listRef",void 0),x(M(k),"itemsRef",void 0),x(M(k),"timer",void 0),x(M(k),"animationHandler",void 0),x(M(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(M(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(M(k),"setListRef",function(N){k.listRef=N}),x(M(k),"setItemsRef",function(N,Y){k.itemsRef||(k.itemsRef=[]),k.itemsRef[Y]=N}),x(M(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(M(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(M(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(M(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(M(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(M(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,o.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),x(M(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var Y=k.props.axis,ae=Y==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},K=ae?ee.ArrowRight:ee.ArrowDown,pe=ae?ee.ArrowLeft:ee.ArrowUp;K===N.keyCode?k.increment():pe===N.keyCode&&k.decrement()}}),x(M(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",Y=k.itemsRef[0];if(Y){var ae=N?Y.clientWidth:Y.clientHeight;k.setState({itemSize:ae}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(M(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(M(k),"handleClickItem",function(N,Y){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,Y),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(M(k),"handleOnChange",function(N,Y){e.Children.count(k.props.children)<=1||k.props.onChange(N,Y)}),x(M(k),"handleClickThumb",function(N,Y){k.props.onClickThumb(N,Y),k.moveTo(N)}),x(M(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(M(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(M(k),"onSwipeMove",function(N,Y){k.props.onSwipeMove(Y);var ae=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(M(k)));return k.setState(p({},ae)),!!Object.keys(ae).length}),x(M(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(M(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(M(k),"moveTo",function(N){if(typeof N=="number"){var Y=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?Y:0),N>Y&&(N=k.props.infiniteLoop?0:Y),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(M(k),"onClickNext",function(){k.increment(1)}),x(M(k),"onClickPrev",function(){k.decrement(1)}),x(M(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"changeItem",function(N){return function(Y){(!(0,a.isKeyboardEvent)(Y)||Y.key==="Enter")&&k.moveTo(N)}}),x(M(k),"selectItem",function(N){k.setState(p({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(M(k),"getInitialImage",function(){var N=k.props.selectedItem,Y=k.itemsRef&&k.itemsRef[N],ae=Y&&Y.getElementsByTagName("img")||[];return ae[0]}),x(M(k),"getVariableItemHeight",function(N){var Y=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&Y&&Y.children.length){var ae=Y.children[0].getElementsByTagName("img")||[];if(ae.length>0){var ee=ae[0];if(!ee.complete){var K=function de(){k.forceUpdate(),ee.removeEventListener("load",de)};ee.addEventListener("load",K)}}var pe=ae[0]||Y.children[0],oe=pe.clientHeight;return oe>0?oe:null}return null});var Q={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 k.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=p(p({},Q),k.animationHandler(D,Q)),k}return y(O,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,k){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),k.swiping&&!this.state.swiping&&this.setState(p({},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 k=D.getInitialImage();k&&!k.complete?k.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,o.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,o.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 k=this;return this.props.children?e.Children.map(this.props.children,function(Q,N){var Y=N===k.state.selectedItem,ae=N===k.state.previousItem,ee=Y&&k.state.selectedStyle||ae&&k.state.prevStyle||k.state.slideStyle||{};k.props.centerMode&&k.props.axis==="horizontal"&&(ee=p(p({},ee),{},{minWidth:k.props.centerSlidePercentage+"%"})),k.state.swiping&&k.state.swipeMovementStarted&&(ee=p(p({},ee),{},{pointerEvents:"none"}));var K={ref:function(pe){return k.setItemsRef(pe,N)},key:"itemKey"+N+(D?"clone":""),className:n.default.ITEM(!0,N===k.state.selectedItem,N===k.state.previousItem),onClick:k.handleClickItem.bind(k,N,Q),style:ee};return e.default.createElement("li",K,k.props.renderItem(Q,{isSelected:N===k.state.selectedItem,isPrevious:N===k.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,k=this.props,Q=k.showIndicators,N=k.labels,Y=k.renderIndicator,ae=k.children;return Q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ae,function(ee,K){return Y&&Y(D.changeItem(K),K===D.state.selectedItem,K,N.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var k=this.props.swipeable&&e.Children.count(this.props.children)>1,Q=this.props.axis==="horizontal",N=this.props.showArrows&&e.Children.count(this.props.children)>1,Y=N&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ae=N&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),K=ee.shift(),pe=ee.pop(),oe={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(Q){if(oe.onSwipeLeft=this.onSwipeForward,oe.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var he=this.getVariableItemHeight(this.state.selectedItem);de.height=he||"auto"}}else oe.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,oe.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,oe.style=p(p({},oe.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,Y,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},k?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},oe,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&pe,this.renderItems(),this.props.infiniteLoop&&K):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(se){return D.setListRef(se)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&pe,this.renderItems(),this.props.infiniteLoop&&K)),this.props.renderArrowNext(this.onClickNext,ae,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),O})(e.default.Component);return qo.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!I),onClick:T})},renderArrowNext:function(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!I),onClick:T})},renderIndicator:function(T,I,O,D){return e.default.createElement("li",{className:n.default.DOT(I),onClick:T,onKeyDown:T,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(O+1)})},renderItem:function(T){return T},renderThumbs:function(T){var I=e.Children.map(T,function(O){var D=O;if(O.type!=="img"&&(D=e.Children.toArray(O.props.children).find(function(k){return k.type==="img"})),!!D)return D});return I.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:a.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:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),qo}var pm={};function gm(){return pm}var Hc;function mm(){return Hc||(Hc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(fm()),n=gm(),r=o(Pd());function o(i){return i&&i.__esModule?i:{default:i}}})(xc)),xc}var vm=mm(),ul,Lc;function bm(){if(Lc)return ul;Lc=1;var e=zp(),t=function(){return e.Date.now()};return ul=t,ul}var dl,Ac;function Ld(){if(Ac)return dl;Ac=1;var e=ud(),t=bm(),n=dd(),r="Expected a function",o=Math.max,i=Math.min;function a(l,s,c){var u,h,g,f,p,m,w=0,y=!1,v=!1,C=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,v="maxWait"in c,g=v?o(n(c.maxWait)||0,s):g,C="trailing"in c?!!c.trailing:C);function R(O){var D=u,k=h;return u=h=void 0,w=O,f=l.apply(k,D),f}function E(O){return w=O,p=setTimeout(S,s),y?R(O):f}function M(O){var D=O-m,k=O-w,Q=s-D;return v?i(Q,g-k):Q}function H(O){var D=O-m,k=O-w;return m===void 0||D>=s||D<0||v&&k>=g}function S(){var O=t();if(H(O))return x(O);p=setTimeout(S,M(O))}function x(O){return p=void 0,C&&u?R(O):(u=h=void 0,f)}function L(){p!==void 0&&clearTimeout(p),w=0,u=m=h=p=void 0}function T(){return p===void 0?f:x(t())}function I(){var O=t(),D=H(O);if(u=arguments,h=this,m=O,D){if(p===void 0)return E(m);if(v)return clearTimeout(p),p=setTimeout(S,s),R(m)}return p===void 0&&(p=setTimeout(S,s)),f}return I.cancel=L,I.flush=T,I}return dl=a,dl}var wm=Ld();const Ad=vr(wm);function Mn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{i.current?.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Ir(e,t){return e===void 0?void 0:t}const ym=Math.PI;function Fc(e){return e*ym/180}const Fd=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),zd=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},_d=(e,t,n)=>Math.min(e,t-n*2),$d=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,ss=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.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"}),d.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"}))},xm=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Cm(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const a=d.useRef(Ad(l=>{i.current&&o(l)},n));return d.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const km="֑-߿יִ-﷽ﹰ-ﻼ",Sm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Mm=new RegExp("^[^"+Sm+"]*["+km+"]");function cs(e){return Mm.test(e)?"rtl":"not-rtl"}let Ki;function $l(){if(typeof document>"u")return 0;if(Ki!==void 0)return Ki;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Ki=n-r,Ki}const jr=Symbol();function Im(e){const t=d.useRef([jr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(l=>{const s=t.current[0];s!==jr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==jr&&o({}),r(c=>typeof l=="function"?l(s===jr?c:s):l),t.current[0]=jr)},[]),a=d.useCallback(()=>{t.current[0]=jr,o({})},[]);return[t.current[0]===jr?n:t.current[0],i,a]}function Vd(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Rm(e){const t=d.useRef(e);return Do(e,t.current)||(t.current=e),t.current}const Em=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return d.createElement(sm,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(vm.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=o?.(l)??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(ss,null)))};function us(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=us();function Bd(e){Jr=e}const Nd=/[&<>"']/,Tm=new RegExp(Nd.source,"g"),Wd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Om=new RegExp(Wd.source,"g"),Dm={"&":"&","<":"<",">":">",'"':""","'":"'"},zc=e=>Dm[e];function An(e,t){if(t){if(Nd.test(e))return e.replace(Tm,zc)}else if(Wd.test(e))return e.replace(Om,zc);return e}const Pm=/(^|[^\[])\^/g;function Ot(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Pm,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function _c(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const hi={exec:()=>null};function $c(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function ti(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function Hm(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function Vc(e,t,n,r){const o=t.href,i=t.title?An(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:An(a)}}function Lm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-DsmOmCoE-DU0EvyVM.js","assets/index-BvblFOYP.js","assets/index-DnTjZ9IR.css","assets/withFullScreenWrapper-DqrJMIkm-BwrYir6f.js","assets/Toolbar-Cc8tCeKL-JHIp2NvW.js","assets/FormClearHelper-DtwjWakY-CxfcniD6.js","assets/sprintf-D5E86llw-6tzWM3a-.js","assets/checkbox-CG80fxUD-CavQvTtP.js","assets/createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js","assets/slicedToArray-D4uL3Bzl-95JmZlNK.js","assets/inherits-CYghrBFU-Cf4k8aUQ.js","assets/createSuper-BlgWzn8_-h1vcwEzv.js","assets/FileDownload.esm-ORp-UC-S-BrsUfuH5.js","assets/number-overlay-editor-C2e7pY6x-BnC-vP7l.js","assets/es6--XPcqeHG-DdkxL8eW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as ve,r as d,cm as cc,cn as nn,aC as kt,co as cp,aK as ns,c6 as up,bi as cd,l as rs,E as os,_ as Ve,cp as dp,cq as ud,cr as dd,X as vr,d as Tr,cs as hp,Q as nl,v as De,c as Qn,ct as fp,cu as pp,x as rt,cv as hd,C as gp,cw as mp,cx as vp,cy as bp,cz as wp,cA as yp,cB as xp,cC as zl,cD as fd,aB as tn,cE as Cp,cF as kp,cG as Sp,cH as Mp,cI as Ip,cJ as Rp,cK as Ep,U as si,m as Qr,bs as Da,br as Pa,cL as pd,M as Mi,F as qn,cM as Tp,bG as gd,cN as Op,H as Dp,e as uc,cO as Pp,cP as Hp,f as Lp,L as Ap,b as md,cQ as Fp,cR as zp,cS as _p,cT as $p,cU as Vp,at as vd,cV as ci,cW as dc,ao as Xr,aL as Bp,cX as Np,cY as Wp,cZ as bd,c_ as jp,c$ as Gp,d0 as Up,y as rl,d1 as Xp,c8 as ol,d2 as qp,d3 as wd,d4 as Kp,bq as Ur,d5 as Zp,d6 as Yp,d7 as Qp,d8 as Jp,D as eg,d9 as yd,da as tg,db as ng,aD as rg,dc as og,dd as ig,de as ag,A as lg,B as sg,df as cg,dg as ug,z as dg,dh as hg,di as fg,dj as pg,dk as ur,$ as To,bT as gg,dl as mg,dm as vg,dn as bg,dp as wg,dq as yg,dr as xg,ds as Cg,dt as la,du as Xo,dv as Lt,dw as Ct,dx as fa,dy as yn,dz as kg,dA as Sg,dB as Mg,dC as Ig,dD as Rg,dE as Eg,dF as Tg,dG as Wr,dH as hc,dI as fc,dJ as xd,dK as Cd,dL as Og,dM as _l,dN as Dg,dO as Pg,dP as kd,dQ as Hg}from"./index-BvblFOYP.js";import{v as Lg,d as Ag}from"./withFullScreenWrapper-DqrJMIkm-BwrYir6f.js";import{y as Fg,X as xo}from"./Toolbar-Cc8tCeKL-JHIp2NvW.js";import{m as zg}from"./FormClearHelper-DtwjWakY-CxfcniD6.js";import{_ as _g}from"./sprintf-D5E86llw-6tzWM3a-.js";import{v as $g,y as Vg,T as Bg}from"./checkbox-CG80fxUD-CavQvTtP.js";import{a as Ng}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{p as Wg,_ as gr}from"./slicedToArray-D4uL3Bzl-95JmZlNK.js";import{b as jg,p as Gg,l as Ug}from"./inherits-CYghrBFU-Cf4k8aUQ.js";import{i as Xg}from"./createSuper-BlgWzn8_-h1vcwEzv.js";import{o as qg,i as Kg}from"./FileDownload.esm-ORp-UC-S-BrsUfuH5.js";var Sd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Sd.displayName="Add";var Md=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});Md.displayName="Search";var Id=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});Id.displayName="Visibility";var il,pc;function Zg(){if(pc)return il;pc=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return il=n,il}var al,gc;function Yg(){if(gc)return al;gc=1;var e=Zg(),t=dp();function n(r,o){return r!=null&&t(r,o,e)}return al=n,al}var Qg=Yg();const Jg=vr(Qg);function Rd(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return Rd(t)}function vi(e,t){return Rd(t??"Hell froze over")}function em(e,t){try{return e()}catch{return t}}const mc=Object.prototype.hasOwnProperty;function Do(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Do(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(mc.call(e,n)&&++r&&!mc.call(t,n)||!(n in t)||!Do(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const pa=null,is=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 vc;(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"})(vc||(vc={}));var ga;(function(e){e.Triangle="triangle",e.Dots="dots"})(ga||(ga={}));function qi(e){return"width"in e&&typeof e.width=="number"}async function bc(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Io(e){return e.kind===Wn.Marker||e.kind===Wn.NewRow}function So(e){if(!ko(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:vi(e,"A cell was passed with an invalid kind")}}function tm(e){return Jg(e,"editor")}function as(e){return!(e.readonly??!1)}var Wn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Wn||(Wn={}));const ma={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function ll(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let wc;class Ye{items;constructor(t){this.items=t}static create=t=>new Ye(ll(t));static empty=()=>wc??(wc=new Ye([]));static fromSingleSelection=t=>Ye.empty().add(t);static fromArray=t=>{if(t.length===0)return Ye.empty();const n=t.map(o=>[o,o+1]),r=ll(n);return new Ye(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Ye(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=ll([...this.items,n]);return new Ye(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new Ye(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)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 r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var nm=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},yc=nm,rm=e=>e.toUpperCase()===e,om=e=>t=>e.indexOf(t)===-1,Ed=(e,t)=>{const n={};return Object.keys(e).filter(om(t)).forEach(r=>{n[r]=e[r]}),n};function im(e,t,n){const r=Ed(t,n);if(!e){const o=typeof ol=="function"?{default:ol}:ol;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var am=(e,t)=>{};function lm(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!rm(l[0])):n.propsAsIs,u=im(c,i,["as","class"]);u.ref=a,u.className=n.atomic?yc(n.class,u.className||s):yc(u.className||s,n.class);const{vars:h}=n;if(h){const g={};for(const m in h){const w=h[m],y=w[0],v=w[1]||"",C=typeof y=="function"?y(i):y;am(C,n.name),g[`--${m}`]=`${C}${v}`}const f=u.style||{},p=Object.keys(f);p.length>0&&p.forEach(m=>{g[m]=f[m]}),u.style=g}return e.__wyw_meta&&e!==l?(u.as=l,d.createElement(e,u)):d.createElement(l,u)},o=d.forwardRef?d.forwardRef(r):(i=>{const a=Ed(i,["innerRef"]);return r(a,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var sn=lm;const sm=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var xc={},qo={},sl={},cl={},Cc;function cm(){return Cc||(Cc=1,(function(e){(function(t,n){n(e,kt,rg())})(cl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var o=a(n),i=a(r);function a(v){return v&&v.__esModule?v:{default:v}}var l=Object.assign||function(v){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(v[E]=R[E])}return v};function s(v,C){var R={};for(var E in v)C.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E]);return R}function c(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var u=(function(){function v(C,R){for(var E=0;E<R.length;E++){var M=R[E];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(C,M.key,M)}}return function(C,R,E){return R&&v(C.prototype,R),E&&v(C,E),C}})();function h(v,C){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:v}function g(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);v.prototype=Object.create(C&&C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(v,C):v.__proto__=C)}var f=!1;function p(v){f=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?v:v.capture}function w(v){if("touches"in v){var C=v.touches[0],R=C.pageX,E=C.pageY;return{x:R,y:E}}var M=v.screenX,H=v.screenY;return{x:M,y:H}}var y=(function(v){g(C,v);function C(){var R;c(this,C);for(var E=arguments.length,M=Array(E),H=0;H<E;H++)M[H]=arguments[H];var S=h(this,(R=C.__proto__||Object.getPrototypeOf(C)).call.apply(R,[this].concat(M)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return u(C,[{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(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var E=w(R),M=E.x,H=E.y;this.moveStart={x:M,y:H},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var E=w(R),M=E.x,H=E.y,S=M-this.moveStart.x,x=H-this.moveStart.y;this.moving=!0;var L=this.props.onSwipeMove({x:S,y:x},R);L&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:S,deltaY:x}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var E=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-E?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>E&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-E?this.props.onSwipeUp(1,R):this.movePosition.deltaY>E&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var E=R.className,M=R.style,H=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var S=s(R,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:E,style:M},S),H)}}]),C})(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})})(cl)),cl}var kc;function Td(){return kc||(kc=1,(function(e){(function(t,n){n(e,cm())})(sl,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(sl)),sl}var Ko={},Sc;function Od(){if(Sc)return Ko;Sc=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var e=t(Xp());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,e.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,a){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Ko.default=r,Ko}var Zo={},Yo={},Mc;function um(){if(Mc)return Yo;Mc=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Yo.outerWidth=e,Yo}var Qo={},Ic;function ls(){if(Ic)return Qo;Ic=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var e=function(t,n,r){var o=t===0?t:t+n,i=r==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+i.join(",")+")";return a+l};return Qo.default=e,Qo}var Jo={},Rc;function Dd(){if(Rc)return Jo;Rc=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(){return window};return Jo.default=e,Jo}var Ec;function Pd(){if(Ec)return Zo;Ec=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=void 0;var e=s(kt),t=a(Od()),n=um(),r=a(ls()),o=a(Td()),i=a(Dd());function a(S){return S&&S.__esModule?S:{default:S}}function l(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return l=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||c(S)!=="object"&&typeof S!="function")return{default:S};var x=l();if(x&&x.has(S))return x.get(S);var L={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in S)if(Object.prototype.hasOwnProperty.call(S,I)){var O=T?Object.getOwnPropertyDescriptor(S,I):null;O&&(O.get||O.set)?Object.defineProperty(L,I,O):L[I]=S[I]}return L.default=S,x&&x.set(S,L),L}function c(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(x){return typeof x}:c=function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},c(S)}function u(){return u=Object.assign||function(S){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var T in L)Object.prototype.hasOwnProperty.call(L,T)&&(S[T]=L[T])}return S},u.apply(this,arguments)}function h(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function g(S,x){for(var L=0;L<x.length;L++){var T=x[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}function f(S,x,L){return x&&g(S.prototype,x),S}function p(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),x&&m(S,x)}function m(S,x){return m=Object.setPrototypeOf||function(L,T){return L.__proto__=T,L},m(S,x)}function w(S){var x=C();return function(){var L=R(S),T;if(x){var I=R(this).constructor;T=Reflect.construct(L,arguments,I)}else T=L.apply(this,arguments);return y(this,T)}}function y(S,x){return x&&(c(x)==="object"||typeof x=="function")?x:v(S)}function v(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function C(){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 R(S){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},R(S)}function E(S,x,L){return x in S?Object.defineProperty(S,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):S[x]=L,S}var M=function(S){return S.hasOwnProperty("key")},H=(function(S){p(L,S);var x=w(L);function L(T){var I;return h(this,L),I=x.call(this,T),E(v(I),"itemsWrapperRef",void 0),E(v(I),"itemsListRef",void 0),E(v(I),"thumbsRef",void 0),E(v(I),"setItemsWrapperRef",function(O){I.itemsWrapperRef=O}),E(v(I),"setItemsListRef",function(O){I.itemsListRef=O}),E(v(I),"setThumbsRef",function(O,D){I.thumbsRef||(I.thumbsRef=[]),I.thumbsRef[D]=O}),E(v(I),"updateSizes",function(){if(!(!I.props.children||!I.itemsWrapperRef||!I.thumbsRef)){var O=e.Children.count(I.props.children),D=I.itemsWrapperRef.clientWidth,k=I.props.thumbWidth?I.props.thumbWidth:(0,n.outerWidth)(I.thumbsRef[0]),Q=Math.floor(D/k),N=Q<O,Y=N?O-Q:0;I.setState(function(ae,ee){return{itemSize:k,visibleItems:Q,firstItem:N?I.getFirstItem(ee.selectedItem):0,lastPosition:Y,showArrows:N}})}}),E(v(I),"handleClickItem",function(O,D,k){if(!M(k)||k.key==="Enter"){var Q=I.props.onSelectItem;typeof Q=="function"&&Q(O,D)}}),E(v(I),"onSwipeStart",function(){I.setState({swiping:!0})}),E(v(I),"onSwipeEnd",function(){I.setState({swiping:!1})}),E(v(I),"onSwipeMove",function(O){var D=O.x;if(!I.state.itemSize||!I.itemsWrapperRef||!I.state.visibleItems)return!1;var k=0,Q=e.Children.count(I.props.children),N=-(I.state.firstItem*100)/I.state.visibleItems,Y=Math.max(Q-I.state.visibleItems,0),ae=-Y*100/I.state.visibleItems;N===k&&D>0&&(D=0),N===ae&&D<0&&(D=0);var ee=I.itemsWrapperRef.clientWidth,K=N+100/(ee/D);return I.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(pe){I.itemsListRef.style[pe]=(0,r.default)(K,"%",I.props.axis)}),!0}),E(v(I),"slideRight",function(O){I.moveTo(I.state.firstItem-(typeof O=="number"?O:1))}),E(v(I),"slideLeft",function(O){I.moveTo(I.state.firstItem+(typeof O=="number"?O:1))}),E(v(I),"moveTo",function(O){O=O<0?0:O,O=O>=I.state.lastPosition?I.state.lastPosition:O,I.setState({firstItem:O})}),I.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},I}return f(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(T){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==T.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(T){var I=T;return T>=this.state.lastPosition&&(I=this.state.lastPosition),T<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),T<this.state.firstItem&&(I=T),I}},{key:"renderItems",value:function(){var T=this;return this.props.children.map(function(I,O){var D=t.default.ITEM(!1,O===T.state.selectedItem),k={key:O,ref:function(Q){return T.setThumbsRef(Q,O)},className:D,onClick:T.handleClickItem.bind(T,O,T.props.children[O]),onKeyDown:T.handleClickItem.bind(T,O,T.props.children[O]),"aria-label":"".concat(T.props.labels.item," ").concat(O+1),style:{width:T.props.thumbWidth}};return e.default.createElement("li",u({},k,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var T=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,k={},Q=-this.state.firstItem*(this.state.itemSize||0),N=(0,r.default)(Q,"px",this.props.axis),Y=this.props.transitionTime+"ms";return k={WebkitTransform:N,MozTransform:N,MsTransform:N,OTransform:N,transform:N,msTransform:N,WebkitTransitionDuration:Y,MozTransitionDuration:Y,MsTransitionDuration:Y,OTransitionDuration:Y,transitionDuration:Y,msTransitionDuration:Y},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return T.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(o.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:k,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 T.setItemsListRef(ae)},style:k},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return T.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L})(e.Component);return Zo.default=H,E(H,"displayName","Thumbs"),E(H,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Zo}var ei={},Tc;function dm(){if(Tc)return ei;Tc=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.default=void 0;var e=function(){return document};return ei.default=e,ei}var Ln={},Oc;function Hd(){if(Oc)return Ln;Oc=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=kt,t=n(ls());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};Ln.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=i;var a=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,g=u-1;return s&&(s!==g||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===g&&(h+=100-c.centerSlidePercentage),h}return-s*100};Ln.getPosition=a;var l=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return Ln.setPosition=l,Ln}var Xn={},Dc;function hm(){if(Dc)return Xn;Dc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fadeAnimationHandler=Xn.slideStopSwipingHandler=Xn.slideSwipeAnimationHandler=Xn.slideAnimationHandler=void 0;var e=kt,t=r(ls()),n=Hd();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,p)}return f}function i(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?o(Object(f),!0).forEach(function(p){a(h,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(f,p))})}return h}function a(h,g,f){return g in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}var l=function(h,g){var f={},p=g.selectedItem,m=p,w=e.Children.count(h.children)-1,y=h.infiniteLoop&&(p<0||p>w);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):m>w&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var v=(0,n.getPosition)(p,h),C=(0,t.default)(v,"%",h.axis),R=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:C,msTransform:C,OTransform:C,transform:C},g.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),f};Xn.slideAnimationHandler=l;var s=function(h,g,f,p){var m={},w=g.axis==="horizontal",y=e.Children.count(g.children),v=0,C=(0,n.getPosition)(f.selectedItem,g),R=g.infiniteLoop?(0,n.getPosition)(y-1,g)-100:(0,n.getPosition)(y-1,g),E=w?h.x:h.y,M=E;C===v&&E>0&&(M=0),C===R&&E<0&&(M=0);var H=C+100/(f.itemSize/M),S=Math.abs(E)>g.swipeScrollTolerance;return g.infiniteLoop&&S&&(f.selectedItem===0&&H>-100?H-=y*100:f.selectedItem===y-1&&H<-y*100&&(H+=y*100)),(!g.preventMovementUntilSwipeScrollTolerance||S||f.swipeMovementStarted)&&(f.swipeMovementStarted||p({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(H,g.axis)),S&&!f.cancelClick&&p({cancelClick:!0}),m};Xn.slideSwipeAnimationHandler=s;var c=function(h,g){var f=(0,n.getPosition)(g.selectedItem,h),p=(0,n.setPosition)(f,h.axis);return{itemListStyle:p}};Xn.slideStopSwipingHandler=c;var u=function(h,g){var f=h.transitionTime+"ms",p="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Xn.fadeAnimationHandler=u,Xn}var Pc;function fm(){if(Pc)return qo;Pc=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e=u(kt),t=s(Td()),n=s(Od()),r=s(Pd()),o=s(dm()),i=s(Dd()),a=Hd(),l=hm();function s(T){return T&&T.__esModule?T:{default:T}}function c(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return c=function(){return T},T}function u(T){if(T&&T.__esModule)return T;if(T===null||h(T)!=="object"&&typeof T!="function")return{default:T};var I=c();if(I&&I.has(T))return I.get(T);var O={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in T)if(Object.prototype.hasOwnProperty.call(T,k)){var Q=D?Object.getOwnPropertyDescriptor(T,k):null;Q&&(Q.get||Q.set)?Object.defineProperty(O,k,Q):O[k]=T[k]}return O.default=T,I&&I.set(T,O),O}function h(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(I){return typeof I}:h=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},h(T)}function g(){return g=Object.assign||function(T){for(var I=1;I<arguments.length;I++){var O=arguments[I];for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&(T[D]=O[D])}return T},g.apply(this,arguments)}function f(T,I){var O=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);I&&(D=D.filter(function(k){return Object.getOwnPropertyDescriptor(T,k).enumerable})),O.push.apply(O,D)}return O}function p(T){for(var I=1;I<arguments.length;I++){var O=arguments[I]!=null?arguments[I]:{};I%2?f(Object(O),!0).forEach(function(D){x(T,D,O[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(O)):f(Object(O)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(O,D))})}return T}function m(T,I){if(!(T instanceof I))throw new TypeError("Cannot call a class as a function")}function w(T,I){for(var O=0;O<I.length;O++){var D=I[O];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}function y(T,I,O){return I&&w(T.prototype,I),T}function v(T,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(I&&I.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),I&&C(T,I)}function C(T,I){return C=Object.setPrototypeOf||function(O,D){return O.__proto__=D,O},C(T,I)}function R(T){var I=H();return function(){var O=S(T),D;if(I){var k=S(this).constructor;D=Reflect.construct(O,arguments,k)}else D=O.apply(this,arguments);return E(this,D)}}function E(T,I){return I&&(h(I)==="object"||typeof I=="function")?I:M(T)}function M(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function H(){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 S(T){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},S(T)}function x(T,I,O){return I in T?Object.defineProperty(T,I,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[I]=O,T}var L=(function(T){v(O,T);var I=R(O);function O(D){var k;m(this,O),k=I.call(this,D),x(M(k),"thumbsRef",void 0),x(M(k),"carouselWrapperRef",void 0),x(M(k),"listRef",void 0),x(M(k),"itemsRef",void 0),x(M(k),"timer",void 0),x(M(k),"animationHandler",void 0),x(M(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(M(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(M(k),"setListRef",function(N){k.listRef=N}),x(M(k),"setItemsRef",function(N,Y){k.itemsRef||(k.itemsRef=[]),k.itemsRef[Y]=N}),x(M(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(M(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(M(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(M(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(M(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(M(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,o.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),x(M(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var Y=k.props.axis,ae=Y==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},K=ae?ee.ArrowRight:ee.ArrowDown,pe=ae?ee.ArrowLeft:ee.ArrowUp;K===N.keyCode?k.increment():pe===N.keyCode&&k.decrement()}}),x(M(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",Y=k.itemsRef[0];if(Y){var ae=N?Y.clientWidth:Y.clientHeight;k.setState({itemSize:ae}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(M(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(M(k),"handleClickItem",function(N,Y){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,Y),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(M(k),"handleOnChange",function(N,Y){e.Children.count(k.props.children)<=1||k.props.onChange(N,Y)}),x(M(k),"handleClickThumb",function(N,Y){k.props.onClickThumb(N,Y),k.moveTo(N)}),x(M(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(M(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(M(k),"onSwipeMove",function(N,Y){k.props.onSwipeMove(Y);var ae=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(M(k)));return k.setState(p({},ae)),!!Object.keys(ae).length}),x(M(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(M(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(M(k),"moveTo",function(N){if(typeof N=="number"){var Y=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?Y:0),N>Y&&(N=k.props.infiniteLoop?0:Y),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(M(k),"onClickNext",function(){k.increment(1)}),x(M(k),"onClickPrev",function(){k.decrement(1)}),x(M(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"changeItem",function(N){return function(Y){(!(0,a.isKeyboardEvent)(Y)||Y.key==="Enter")&&k.moveTo(N)}}),x(M(k),"selectItem",function(N){k.setState(p({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(M(k),"getInitialImage",function(){var N=k.props.selectedItem,Y=k.itemsRef&&k.itemsRef[N],ae=Y&&Y.getElementsByTagName("img")||[];return ae[0]}),x(M(k),"getVariableItemHeight",function(N){var Y=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&Y&&Y.children.length){var ae=Y.children[0].getElementsByTagName("img")||[];if(ae.length>0){var ee=ae[0];if(!ee.complete){var K=function de(){k.forceUpdate(),ee.removeEventListener("load",de)};ee.addEventListener("load",K)}}var pe=ae[0]||Y.children[0],oe=pe.clientHeight;return oe>0?oe:null}return null});var Q={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 k.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=p(p({},Q),k.animationHandler(D,Q)),k}return y(O,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,k){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),k.swiping&&!this.state.swiping&&this.setState(p({},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 k=D.getInitialImage();k&&!k.complete?k.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,o.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,o.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 k=this;return this.props.children?e.Children.map(this.props.children,function(Q,N){var Y=N===k.state.selectedItem,ae=N===k.state.previousItem,ee=Y&&k.state.selectedStyle||ae&&k.state.prevStyle||k.state.slideStyle||{};k.props.centerMode&&k.props.axis==="horizontal"&&(ee=p(p({},ee),{},{minWidth:k.props.centerSlidePercentage+"%"})),k.state.swiping&&k.state.swipeMovementStarted&&(ee=p(p({},ee),{},{pointerEvents:"none"}));var K={ref:function(pe){return k.setItemsRef(pe,N)},key:"itemKey"+N+(D?"clone":""),className:n.default.ITEM(!0,N===k.state.selectedItem,N===k.state.previousItem),onClick:k.handleClickItem.bind(k,N,Q),style:ee};return e.default.createElement("li",K,k.props.renderItem(Q,{isSelected:N===k.state.selectedItem,isPrevious:N===k.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,k=this.props,Q=k.showIndicators,N=k.labels,Y=k.renderIndicator,ae=k.children;return Q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ae,function(ee,K){return Y&&Y(D.changeItem(K),K===D.state.selectedItem,K,N.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var k=this.props.swipeable&&e.Children.count(this.props.children)>1,Q=this.props.axis==="horizontal",N=this.props.showArrows&&e.Children.count(this.props.children)>1,Y=N&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ae=N&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),K=ee.shift(),pe=ee.pop(),oe={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(Q){if(oe.onSwipeLeft=this.onSwipeForward,oe.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var he=this.getVariableItemHeight(this.state.selectedItem);de.height=he||"auto"}}else oe.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,oe.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,oe.style=p(p({},oe.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,Y,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},k?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},oe,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&pe,this.renderItems(),this.props.infiniteLoop&&K):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(se){return D.setListRef(se)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&pe,this.renderItems(),this.props.infiniteLoop&&K)),this.props.renderArrowNext(this.onClickNext,ae,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),O})(e.default.Component);return qo.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!I),onClick:T})},renderArrowNext:function(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!I),onClick:T})},renderIndicator:function(T,I,O,D){return e.default.createElement("li",{className:n.default.DOT(I),onClick:T,onKeyDown:T,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(O+1)})},renderItem:function(T){return T},renderThumbs:function(T){var I=e.Children.map(T,function(O){var D=O;if(O.type!=="img"&&(D=e.Children.toArray(O.props.children).find(function(k){return k.type==="img"})),!!D)return D});return I.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:a.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:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),qo}var pm={};function gm(){return pm}var Hc;function mm(){return Hc||(Hc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(fm()),n=gm(),r=o(Pd());function o(i){return i&&i.__esModule?i:{default:i}}})(xc)),xc}var vm=mm(),ul,Lc;function bm(){if(Lc)return ul;Lc=1;var e=zp(),t=function(){return e.Date.now()};return ul=t,ul}var dl,Ac;function Ld(){if(Ac)return dl;Ac=1;var e=ud(),t=bm(),n=dd(),r="Expected a function",o=Math.max,i=Math.min;function a(l,s,c){var u,h,g,f,p,m,w=0,y=!1,v=!1,C=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,v="maxWait"in c,g=v?o(n(c.maxWait)||0,s):g,C="trailing"in c?!!c.trailing:C);function R(O){var D=u,k=h;return u=h=void 0,w=O,f=l.apply(k,D),f}function E(O){return w=O,p=setTimeout(S,s),y?R(O):f}function M(O){var D=O-m,k=O-w,Q=s-D;return v?i(Q,g-k):Q}function H(O){var D=O-m,k=O-w;return m===void 0||D>=s||D<0||v&&k>=g}function S(){var O=t();if(H(O))return x(O);p=setTimeout(S,M(O))}function x(O){return p=void 0,C&&u?R(O):(u=h=void 0,f)}function L(){p!==void 0&&clearTimeout(p),w=0,u=m=h=p=void 0}function T(){return p===void 0?f:x(t())}function I(){var O=t(),D=H(O);if(u=arguments,h=this,m=O,D){if(p===void 0)return E(m);if(v)return clearTimeout(p),p=setTimeout(S,s),R(m)}return p===void 0&&(p=setTimeout(S,s)),f}return I.cancel=L,I.flush=T,I}return dl=a,dl}var wm=Ld();const Ad=vr(wm);function Mn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{i.current?.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Ir(e,t){return e===void 0?void 0:t}const ym=Math.PI;function Fc(e){return e*ym/180}const Fd=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),zd=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},_d=(e,t,n)=>Math.min(e,t-n*2),$d=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,ss=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.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"}),d.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"}))},xm=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Cm(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const a=d.useRef(Ad(l=>{i.current&&o(l)},n));return d.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const km="֑-߿יִ-﷽ﹰ-ﻼ",Sm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Mm=new RegExp("^[^"+Sm+"]*["+km+"]");function cs(e){return Mm.test(e)?"rtl":"not-rtl"}let Ki;function $l(){if(typeof document>"u")return 0;if(Ki!==void 0)return Ki;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Ki=n-r,Ki}const jr=Symbol();function Im(e){const t=d.useRef([jr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(l=>{const s=t.current[0];s!==jr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==jr&&o({}),r(c=>typeof l=="function"?l(s===jr?c:s):l),t.current[0]=jr)},[]),a=d.useCallback(()=>{t.current[0]=jr,o({})},[]);return[t.current[0]===jr?n:t.current[0],i,a]}function Vd(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Rm(e){const t=d.useRef(e);return Do(e,t.current)||(t.current=e),t.current}const Em=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return d.createElement(sm,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(vm.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=o?.(l)??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(ss,null)))};function us(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=us();function Bd(e){Jr=e}const Nd=/[&<>"']/,Tm=new RegExp(Nd.source,"g"),Wd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Om=new RegExp(Wd.source,"g"),Dm={"&":"&","<":"<",">":">",'"':""","'":"'"},zc=e=>Dm[e];function An(e,t){if(t){if(Nd.test(e))return e.replace(Tm,zc)}else if(Wd.test(e))return e.replace(Om,zc);return e}const Pm=/(^|[^\[])\^/g;function Ot(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Pm,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function _c(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const hi={exec:()=>null};function $c(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function ti(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function Hm(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function Vc(e,t,n,r){const o=t.href,i=t.title?An(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:An(a)}}function Lm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
3
3
|
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
|
|
4
4
|
`)}class va{options;rules;lexer;constructor(t){this.options=t||Jr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ti(r,`
|
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=Lm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=ti(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:ti(n[0],`
|
|
@@ -179,10 +179,10 @@ Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An err
|
|
|
179
179
|
`?(r.push(e.slice(o,a)),o=a+1,l===`
|
|
180
180
|
`&&(n.push(r),r=[])):l==='"'&&(i=t.inString);break;case t.inString:l==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?i=t.inString:((l===" "||l===`
|
|
181
181
|
`)&&(r.push(uu(e.slice(o,a))),o=a+1,l===`
|
|
182
|
-
`&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push(uu(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function du(e,t,n){const r=Sb(e,t),o=l=>{window.navigator.clipboard?.writeText(l)},i=(l,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),a=(l,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",l),n?.clipboardData?.setData("text/html",s)}catch{i(l,s)||o(l)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function Ch(e){return e!==!0}function hu(e){return typeof e=="string"?e:`${e}px`}const Rb=()=>e=>e.innerWidth,Eb=()=>e=>e.innerHeight,Tb=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Rb()],"wmyidgi-1":[Eb()]}}),Ob=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(Tb,{innerHeight:hu(n),innerWidth:hu(t),...o},r)},Db=2,Pb=1300;function Hb(e,t,n){const r=kt.useRef(0),[o,i]=e??[0,0];kt.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{if(!a){if(l===0)l=c;else{const u=c-l;r.current=Math.min(1,r.current+u/Pb);const h=r.current**1.618*u*Db;t.current?.scrollBy(o*h,i*h),l=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Lb({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,h,g,f]=kt.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const p=l/16,m=e,w=ah();return[typeof m=="number"?m*p:y=>Math.ceil(m(y)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*p},Math.ceil((o??0)*p),Math.ceil((i??0)*p)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:g,overscrollY:f}}const Mr={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 nt(e,t){return e===!0?t:e===!1?"":e}function fu(e){const t=xa.value;return{activateCell:nt(e.activateCell," |Enter|shift+Enter"),clear:nt(e.clear,"any+Escape"),closeOverlay:nt(e.closeOverlay,"any+Escape"),acceptOverlayDown:nt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:nt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:nt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:nt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:nt(e.delete,t?"Backspace|Delete":"Delete"),downFill:nt(e.downFill,"primary+_68"),scrollToSelectedCell:nt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:nt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:nt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:nt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:nt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:nt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:nt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:nt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:nt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:nt(e.goToFirstCell,"primary+Home"),goToFirstColumn:nt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:nt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:nt(e.goToLastCell,"primary+End"),goToLastColumn:nt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:nt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:nt(e.goToNextPage,"PageDown"),goToPreviousPage:nt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:nt(e.rightFill,"primary+_82"),search:nt(e.search,"primary+f"),selectAll:nt(e.selectAll,"primary+a"),selectColumn:nt(e.selectColumn,"ctrl+ "),selectGrowDown:nt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:nt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:nt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:nt(e.selectGrowUp,"shift+ArrowUp"),selectRow:nt(e.selectRow,"shift+ "),selectToFirstCell:nt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:nt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:nt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:nt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:nt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:nt(e.selectToLastRow,"primary+shift+ArrowDown")}}function Ab(e){const t=Rm(e);return kt.useMemo(()=>{if(t===void 0)return fu(Mr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Mr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Mr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Mr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Mr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Mr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Mr.selectToLastCell};return fu({...Mr,...n})},[t])}function Fb(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function Ss(e,t){const n=[];function r(l,s,c=!1){let u=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(u=l.subGroups[0].headerIndex-l.headerIndex),u--,n.push({rowIndex:-1,headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:u}),l.subGroups)for(let h=0;h<l.subGroups.length;h++){const g=h<l.subGroups.length-1?l.subGroups[h+1].headerIndex:s;r(l.subGroups[h],g,c||l.isCollapsed)}}const o=Fb(e.groups);for(let l=0;l<o.length;l++){const s=l<o.length-1?o[l+1].headerIndex:null;r(o[l],s)}let i=0,a=0;for(const l of n)l.contentIndex=a,a+=l.rows,l.rowIndex=i,i+=l.isCollapsed?1:l.rows+1;return n.filter(l=>l.skip===!1).map(l=>{const{skip:s,...c}=l;return c})}function Xl(e,t){if(t===void 0||Ss.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function zb(e,t,n,r){const o=kt.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]),i=kt.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),a=kt.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),l=kt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=kt.useCallback(u=>{if(o===void 0)return u;let h=u;for(const g of o){if(h===0)return;if(h--,!g.isCollapsed){if(h<g.rows)return g.contentIndex+h;h-=g.rows}}return u},[o]),c=Ir(r??e?.themeOverride,kt.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:g,groupIndex:f}=Xl(u,o);return h?e.themeOverride:r?.(u,f,g)},[o,r,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:a,rowNumberMapper:s,getRowThemeOverride:c}}function _b(e,t){const n=kt.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]);return{getRowGroupingForPath:Sh,updateRowGroupingByPath:kh,mapper:kt.useCallback(r=>{if(typeof r=="number")return Xl(r,n);const o=Xl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function kh(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:kh(i.subGroups??[],o,n)}:i)}function Sh(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Sh(e[n].subGroups??[],r)}function $b(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function Vb(e,t,n,r,o){const[i,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,c,u]=Im(l),h=d.useRef(o);h.current=o;const g=$b(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&f){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&u(),h.current()}},[t,f,u,g]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&u(),h.current()}},[e,p,u,g]),{visibleRegion:s,setVisibleRegion:c,scrollRef:g}}const Bb=d.lazy(async()=>await ns(()=>import("./data-grid-overlay-editor-ChccEKqe-B1le2p6v.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let Nb=0;function Wb(e){return G0(eu(eu(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Qi(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 Ji={kind:Z.Loading,allowOverlay:!1},ea={columns:Ye.empty(),rows:Ye.empty(),current:void 0},jb=(e,t)=>{const[n,r]=d.useState(ea),[o,i]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:f,markdownDivCreateNode:p,width:m,height:w,columns:y,rows:v,getCellContent:C,onCellClicked:R,onCellActivated:E,onFillPattern:M,onFinishedEditing:H,coercePasteValue:S,drawHeader:x,drawCell:L,editorBloom:T,onHeaderClicked:I,onColumnProposeMove:O,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:Q,onCellContextMenu:N,className:Y,onHeaderContextMenu:ae,getCellsForSelection:ee,onGroupHeaderContextMenu:K,onGroupHeaderRenamed:pe,onCellEdited:oe,onCellsEdited:de,onSearchResultsChanged:he,searchResults:se,onSearchValueChange:z,searchValue:P,onKeyDown:G,onKeyUp:le,keybindings:ce,editOnType:we=!0,onRowAppended:ge,onColumnAppended:Qe,onColumnMoved:Se,validateCell:Dt,highlightRegions:bt,rangeSelect:Te="rect",columnSelect:re="multi",rowSelect:me="multi",rangeSelectionBlending:ye="exclusive",columnSelectionBlending:ne="exclusive",rowSelectionBlending:be="exclusive",onDelete:Oe,onDragStart:Pe,onMouseMove:it,onPaste:Ae,copyHeaders:Ze=!1,freezeColumns:Ie=0,cellActivationBehavior:Me="second-click",rowSelectionMode:ze="auto",columnSelectionMode:ct="auto",onHeaderMenuClick:Je,onHeaderIndicatorClick:We,getGroupDetails:ht,rowGrouping:Wt,onSearchClose:Et,onItemHovered:ut,onSelectionCleared:qt,showSearch:Kt,onVisibleRegionChanged:On,gridSelection:St,onGridSelectionChange:ft,minColumnWidth:Dn=50,maxColumnWidth:wt=500,maxColumnAutoWidth:cn,provideEditor:pn,trailingRowOptions:Re,freezeTrailingRows:dt=0,allowedFillDirections:At="orthogonal",scrollOffsetX:dn,scrollOffsetY:$t,verticalBorder:rn,onDragOverCell:Pn,onDrop:on,onColumnResize:Zt,onColumnResizeEnd:Be,onColumnResizeStart:yt,customRenderers:In,fillHandle:Pt,experimental:pt,fixedShadowX:xn,fixedShadowY:er,headerIcons:tr,imageWindowLoader:B,initialSize:_e,isDraggable:Ne,onDragLeave:Tt,onRowMoved:an,overscrollX:hn,overscrollY:Rn,preventDiagonalScrolling:gn,rightElement:Bt,rightElementProps:En,trapFocus:Cn=!1,smoothScrollX:Lo,smoothScrollY:no,scaleToRem:Hr=!1,rowHeight:xe=34,headerHeight:mt=36,groupHeaderHeight:Ft=mt,theme:_n,isOutsideClick:Tn,renderers:Yt,resizeIndicator:jt,scrollToActiveCell:fn=!0,drawFocusRing:$n=!0,portalElementRef:Ao}=e,Fo=$n==="no-editor"?o===void 0:$n,jn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,mn=jn?.kind??e.rowMarkers??"none",br=jn?.width??e.rowMarkerWidth,ro=jn?.startIndex??e.rowMarkerStartIndex??1,wr=jn?.theme??e.rowMarkerTheme,oo=jn?.headerTheme,Ti=jn?.headerAlwaysVisible,Lr=me!=="multi"||jn?.headerDisabled===!0,io=jn?.checkboxStyle??"square",yr=Math.max(Dn,20),ao=Math.max(wt,yr),Oi=Math.max(cn??ao,yr),zo=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:$e,rowNumberMapper:_o,rowHeight:za,getRowThemeOverride:Ar}=zb(Wt,v,xe,f),_a=d.useMemo(()=>Number.parseFloat(zo.fontSize),[zo]),{rowHeight:nr,headerHeight:$o,groupHeaderHeight:lo,theme:Di,overscrollX:$a,overscrollY:Va}=Lb({groupHeaderHeight:Ft,headerHeight:mt,overscrollX:hn,overscrollY:Rn,remSize:_a,rowHeight:za,scaleToRem:Hr,theme:_n}),rr=Ab(ce),dr=br??(v>1e4?48:v>1e3?44:v>100?36:32),kn=mn!=="none",j=kn?1:0,zt=Re!==void 0,Fr=Re?.sticky===!0,[so,Pi]=d.useState(!1),co=Kt??so,Ba=d.useCallback(()=>{Et!==void 0?Et():Pi(!1)},[Et]),X=d.useMemo(()=>St===void 0?void 0:Qi(St,j),[St,j])??n,$=d.useRef();$.current===void 0&&($.current=new AbortController),d.useEffect(()=>()=>$?.current.abort(),[]);const[te,Ce]=bb(ee,C,j,$.current,$e),Ee=d.useCallback((b,A,F)=>{if(Dt===void 0)return!0;const V=[b[0]-j,b[1]];return Dt?.(V,A,F)},[j,Dt]),ue=d.useRef(St),fe=d.useCallback((b,A)=>{A&&(b=Mb(b,te,j,k,$.current)),ft!==void 0?(ue.current=Qi(b,-j),ft(ue.current)):r(b)},[ft,te,j,k]),je=Ir(Zt,d.useCallback((b,A,F,V)=>{Zt?.(y[F-j],A,F-j,V)},[Zt,j,y])),ke=Ir(Be,d.useCallback((b,A,F,V)=>{Be?.(y[F-j],A,F-j,V)},[Be,j,y])),qe=Ir(yt,d.useCallback((b,A,F,V)=>{yt?.(y[F-j],A,F-j,V)},[yt,j,y])),gt=Ir(x,d.useCallback((b,A)=>x?.({...b,columnIndex:b.columnIndex-j},A)??!1,[x,j])),un=Ir(L,d.useCallback((b,A)=>L?.({...b,col:b.col-j},A)??!1,[L,j])),Gt=d.useCallback(b=>{if(Oe!==void 0){const A=Oe(Qi(b,-j));return typeof A=="boolean"?A:Qi(A,j)}return!0},[Oe,j]),[xt,at,Ge]=vb(X,fe,ye,ne,be,Te,D),st=d.useMemo(()=>mr(ah(),Di),[Di]),[Vt,uo]=d.useState([0,0,0]),zr=d.useMemo(()=>{if(Yt===void 0)return{};const b={};for(const A of Yt)b[A.kind]=A;return b},[Yt]),Qt=d.useCallback(b=>b.kind!==Z.Custom?zr[b.kind]:In?.find(A=>A.isMatch(b)),[In,zr]);let{sizedColumns:ln,nonGrowWidth:Ht}=F0(y,$e,Ce,Vt[0]-(j===0?0:dr)-Vt[2],yr,Oi,st,Qt,$.current);mn!=="none"&&(Ht+=dr);const Vn=d.useMemo(()=>ln.some(b=>b.group!==void 0),[ln]),vn=Vn?$o+lo:$o,hr=X.rows.length,fr=mn==="none"?void 0:hr===0?!1:hr===$e?!0:void 0,lt=d.useMemo(()=>mn==="none"?ln:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:wr,rowMarker:io,rowMarkerChecked:fr,headerRowMarkerTheme:oo,headerRowMarkerAlwaysVisible:Ti,headerRowMarkerDisabled:Lr},...ln],[mn,ln,dr,wr,io,fr,oo,Ti,Lr]),Jt=d.useRef({height:1,width:1,x:0,y:0}),or=d.useRef(!1),{setVisibleRegion:Hi,visibleRegion:pr,scrollRef:Nt}=Vb(dn,$t,nr,Jt,()=>or.current=!0);Jt.current=pr;const Pf=pr.x+j,Li=pr.y,bn=d.useRef(null),Sn=d.useCallback(b=>{b===!0?bn.current?.focus():window.requestAnimationFrame(()=>{bn.current?.focus()})},[]),wn=zt?$e+1:$e,Bn=d.useCallback(b=>{const A=j===0?b:b.map(V=>({...V,location:[V.location[0]-j,V.location[1]]})),F=de?.(A);if(F!==!0)for(const V of A)oe?.(V.location,V.value);return F},[oe,de,j]),[_r,Na]=d.useState(),Ai=X.current!==void 0&&X.current.range.width*X.current.range.height>1?X.current.range:void 0,Ks=Fo?X.current?.cell:void 0,Fi=Ks?.[0],zi=Ks?.[1],Hf=d.useMemo(()=>{if((bt===void 0||bt.length===0)&&(Ai??Fi??zi??_r)===void 0)return;const b=[];if(bt!==void 0)for(const A of bt){const F=lt.length-A.range.x-j;F>0&&b.push({color:A.color,range:{...A.range,x:A.range.x+j,width:Math.min(F,A.range.width)},style:A.style})}return _r!==void 0&&b.push({color:Yr(st.accentColor,0),range:_r,style:"dashed"}),Ai!==void 0&&b.push({color:Yr(st.accentColor,.5),range:Ai,style:"solid-outline"}),Fi!==void 0&&zi!==void 0&&b.push({color:st.accentColor,range:{x:Fi,y:zi,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[_r,Ai,Fi,zi,bt,lt.length,st.accentColor,j]),Zs=d.useRef(lt);Zs.current=lt;const Hn=d.useCallback(([b,A],F=!1)=>{const V=zt&&A===wn-1;if(b===0&&kn){if(V)return Ji;const W=_o(A);return W===void 0?Ji:{kind:Wn.Marker,allowOverlay:!1,checkboxStyle:io,checked:X?.rows.hasIndex(A)===!0,markerKind:mn==="clickable-number"?"number":mn,row:ro+W,drawHandle:an!==void 0,cursor:mn==="clickable-number"?"pointer":void 0}}else if(V){const W=b===j?Re?.hint??"":"",q=Zs.current[b];if(q?.trailingRowOptions?.disabled===!0)return Ji;{const _=q?.trailingRowOptions?.hint??W,U=q?.trailingRowOptions?.addIcon??Re?.addIcon;return{kind:Wn.NewRow,hint:_,allowOverlay:!1,icon:U}}}else{const W=b-j;if(F||pt?.strict===!0){const _=Jt.current,U=_.x>W||W>_.x+_.width||_.y>A||A>_.y+_.height||A>=Ua.current,J=W===_.extras?.selected?.[0]&&A===_.extras?.selected[1];let ie=!1;if(_.extras?.freezeRegions!==void 0){for(const He of _.extras.freezeRegions)if(Kr(He,W,A)){ie=!0;break}}if(U&&!J&&!ie)return Ji}let q=C([W,A]);return j!==0&&q.span!==void 0&&(q={...q,span:[q.span[0]+j,q.span[1]+j]}),q}},[zt,wn,kn,_o,io,X?.rows,mn,ro,an,j,Re?.hint,Re?.addIcon,pt?.strict,C]),Wa=d.useCallback(b=>{let A=ht?.(b)??{name:b};return pe!==void 0&&b!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>qa({group:A.name,bounds:F.bounds})}]}),A},[ht,pe]),_i=d.useCallback(b=>{const[A,F]=b.cell,V=lt[A],W=V?.group!==void 0?Wa(V.group)?.overrideTheme:void 0,q=V?.themeOverride,_=Ar?.(F);i({...b,theme:mr(st,W,q,_,b.content.themeOverride)})},[Ar,lt,Wa,st]),ho=d.useCallback((b,A,F)=>{if(X.current===void 0)return;const[V,W]=X.current.cell,q=Hn([V,W]);if(q.kind!==Z.Boolean&&q.allowOverlay){let _=q;if(F!==void 0)switch(_.kind){case Z.Number:{const U=em(()=>F==="-"?-0:Number.parseFloat(F),0);_={..._,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:_={..._,data:F};break}_i({target:b,content:_,initialValue:F,cell:[V,W],highlight:F===void 0,forceEditMode:F!==void 0,activation:A})}else q.kind===Z.Boolean&&A.inputType==="keyboard"&&q.readonly!==!0&&(Bn([{location:X.current.cell,value:{...q,data:Ch(q.data)}}]),bn.current?.damage([{cell:X.current.cell}]))},[Hn,X,Bn,_i]),Ys=d.useCallback((b,A)=>{const F=bn.current?.getBounds(b,A);if(F===void 0||Nt.current===null)return;const V=Hn([b,A]);V.allowOverlay&&_i({target:F,content:V,initialValue:void 0,highlight:!0,cell:[b,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Hn,Nt,_i]),Ut=d.useCallback((b,A,F="both",V=0,W=0,q=void 0)=>{if(Nt.current!==null){const _=bn.current,U=l.current,J=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,ie=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,He=typeof b!="number"&&b.unit==="px"?b.amount:void 0,It=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(_!==null&&U!==null){let Ke={x:0,y:0,width:0,height:0},Ue=0,Xe=0;if((J!==void 0||ie!==void 0)&&(Ke=_.getBounds((J??0)+j,ie??0)??Ke,Ke.width===0||Ke.height===0))return;const et=U.getBoundingClientRect(),vt=et.width/U.offsetWidth;if(He!==void 0&&(Ke={...Ke,x:He-et.left-Nt.current.scrollLeft,width:1}),It!==void 0&&(Ke={...Ke,y:It+et.top-Nt.current.scrollTop,height:1}),Ke!==void 0){const en={x:Ke.x-V,y:Ke.y-W,width:Ke.width+2*V,height:Ke.height+2*W};let bo=0;for(let tl=0;tl<Ie;tl++)bo+=ln[tl].width;let Gi=0;const Uo=dt+(Fr?1:0);Uo>0&&(Gi=to(wn,Uo,nr));let ar=bo*vt+et.left+j*dr*vt,wo=et.right,Nr=et.top+vn*vt,yo=et.bottom-Gi*vt;const Ui=Ke.width+V*2;switch(q?.hAlign){case"start":wo=ar+Ui;break;case"end":ar=wo-Ui;break;case"center":ar=Math.floor((ar+wo)/2)-Ui/2,wo=ar+Ui;break}const Xi=Ke.height+W*2;switch(q?.vAlign){case"start":yo=Nr+Xi;break;case"end":Nr=yo-Xi;break;case"center":Nr=Math.floor((Nr+yo)/2)-Xi/2,yo=Nr+Xi;break}ar>en.x?Ue=en.x-ar:wo<en.x+en.width&&(Ue=en.x+en.width-wo),Nr>en.y?Xe=en.y-Nr:yo<en.y+en.height&&(Xe=en.y+en.height-yo),F==="vertical"||typeof b=="number"&&b<Ie?Ue=0:(F==="horizontal"||typeof A=="number"&&A>=wn-Uo)&&(Xe=0),(Ue!==0||Xe!==0)&&(vt!==1&&(Ue/=vt,Xe/=vt),Nt.current.scrollTo({left:Ue+Nt.current.scrollLeft,top:Xe+Nt.current.scrollTop,behavior:q?.behavior??"auto"}))}}}},[j,dt,dr,Nt,vn,Ie,ln,wn,Fr,nr]),ja=d.useRef(Ys),Ga=d.useRef(C);ja.current=Ys,Ga.current=C;const Ua=d.useRef($e);Ua.current=$e;const Qs=d.useRef(lt.length);Qs.current=lt.length;const xr=d.useCallback(async(b,A=!0,F)=>{if(lt[b]?.trailingRowOptions?.disabled===!0)return;const V=ge?.();let W,q=!0;V!==void 0&&(W=await V,W==="top"&&(q=!1),typeof W=="number"&&(q=!1));let _=0;const U=()=>{if(Ua.current<=$e){_<500&&window.setTimeout(U,_),_=50+_*2;return}const J=typeof W=="number"?W:q?$e:0;ji.current(b-j,J,"both",0,0,F?{behavior:F}:void 0),xt({cell:[b,J],range:{x:b,y:J,width:1,height:1}},!1,!1,"edit");const ie=Ga.current([b-j,J]);ie.allowOverlay&&So(ie)&&ie.readonly!==!0&&A&&window.setTimeout(()=>{ja.current(b,J)},0)};U()},[lt,ge,j,$e,xt]),$i=d.useCallback(async(b,A=!0)=>{const F=Qe?.();let V,W=!0;F!==void 0&&(V=await F,V==="left"&&(W=!1),typeof V=="number"&&(W=!1));let q=0;const _=()=>{if(Qs.current<=lt.length){q<500&&window.setTimeout(_,q),q=50+q*2;return}const U=typeof V=="number"?V:W?lt.length:0;Ut(U-j,b),xt({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const J=Ga.current([U-j,b]);J.allowOverlay&&So(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{ja.current(U,b)},0)};_()},[lt,Qe,j,Ut,xt]),fo=d.useCallback(b=>{const A=ln[b]?.trailingRowOptions?.targetColumn??Re?.targetColumn;if(typeof A=="number")return A+(kn?1:0);if(typeof A=="object"){const F=y.indexOf(A);if(F>=0)return F+(kn?1:0)}},[ln,y,kn,Re?.targetColumn]),Cr=d.useRef(),po=d.useRef(),Vo=d.useCallback((b,A)=>{const[F,V]=A;return mr(st,lt[F]?.themeOverride,Ar?.(V),b.themeOverride)},[Ar,lt,st]),{mapper:$r}=_b(Wt,v),Gn=Wt?.navigationBehavior,Bo=d.useCallback(b=>{const A=xa.value?b.metaKey:b.ctrlKey,F=A&&me==="multi",[V,W]=b.location,q=X.columns,_=X.rows,[U,J]=X.current?.cell??[];if(b.kind==="cell"){if(po.current=void 0,Vr.current=[V,W],V===0&&kn){if(zt===!0&&W===$e||mn==="number"||me==="none")return;const ie=Hn(b.location);if(ie.kind!==Wn.Marker)return;if(an!==void 0){const Ke=Qt(ie);Fn(Ke?.kind===Wn.Marker);const Ue=Ke?.onClick?.({...b,cell:ie,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:Vo(ie,b.location),preventDefault:()=>{}});if(Ue===void 0||Ue.checked===ie.checked)return}i(void 0),Sn();const He=_.hasIndex(W),It=Cr.current;if(me==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&It!==void 0&&_.hasIndex(It)){const Ke=[Math.min(It,W),Math.max(It,W)+1];F||ze==="multi"?at(void 0,Ke,!0):at(Ye.fromSingleSelection(Ke),void 0,F)}else me==="multi"&&(F||b.isTouch||ze==="multi")?He?at(_.remove(W),void 0,!0):(at(void 0,W,!0),Cr.current=W):He&&_.length===1?at(Ye.empty(),void 0,A):(at(Ye.fromSingleSelection(W),void 0,A),Cr.current=W)}else if(V>=j&&zt&&W===$e){const ie=fo(V);xr(ie??V)}else if(U!==V||J!==W){const ie=Hn(b.location),He=Qt(ie);if(He?.onSelect!==void 0){let Ue=!1;if(He.onSelect({...b,cell:ie,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>Ue=!0,theme:Vo(ie,b.location)}),Ue)return}if(Gn==="block"&&$r(W).isGroupHeader)return;const It=Fr&&W===$e,Ke=Fr&&X!==void 0&&X.current?.cell[1]===$e;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&J!==void 0&&X.current!==void 0&&!Ke){if(It)return;const Ue=Math.min(V,U),Xe=Math.max(V,U),et=Math.min(W,J),vt=Math.max(W,J);xt({...X.current,range:{x:Ue,y:et,width:Xe-Ue+1,height:vt-et+1}},!0,A,"click"),Cr.current=void 0,Sn()}else xt({cell:[V,W],range:{x:V,y:W,width:1,height:1}},!0,A,"click"),Cr.current=void 0,i(void 0),Sn()}}else if(b.kind==="header")if(Vr.current=[V,W],i(void 0),kn&&V===0)Cr.current=void 0,po.current=void 0,!Lr&&me==="multi"&&(_.length!==$e?at(Ye.fromSingleSelection([0,$e]),void 0,A):at(Ye.empty(),void 0,A),Sn());else{const ie=po.current;if(re==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&ie!==void 0&&q.hasIndex(ie)){const He=[Math.min(ie,V),Math.max(ie,V)+1];A||b.isTouch||ct==="multi"?Ge(void 0,He,A):Ge(Ye.fromSingleSelection(He),void 0,A)}else re==="multi"&&(A||b.isTouch||ct==="multi")?(q.hasIndex(V)?Ge(q.remove(V),void 0,A):Ge(void 0,V,A),po.current=V):re!=="none"&&(q.hasIndex(V)?Ge(q.remove(V),void 0,A):Ge(Ye.fromSingleSelection(V),void 0,A),po.current=V);Cr.current=void 0,Sn()}else b.kind===Kn?Vr.current=[V,W]:b.kind===Ca&&!b.isMaybeScrollbar&&(fe(ea,!1),i(void 0),Sn(),qt?.(),Cr.current=void 0,po.current=void 0)},[me,re,X,kn,j,zt,$e,mn,Hn,an,Sn,ze,ct,Qt,Vo,at,fo,xr,Gn,$r,Fr,xt,Lr,Ge,fe,qt]),No=d.useRef(!1),Vr=d.useRef(),Js=d.useRef(pr),ir=d.useRef(),Lf=d.useCallback(b=>{if(go.current=!1,Js.current=Jt.current,b.button!==0&&b.button!==1){ir.current=void 0;return}const A=performance.now();ir.current={button:b.button,time:A,location:b.location},b?.kind==="header"&&(No.current=!0);const F=b.kind==="cell"&&b.isFillHandle;!F&&b.kind!=="cell"&&b.isEdge||(c({previousSelection:X,fillHandle:F}),Vr.current=void 0,!b.isTouch&&b.button===0&&!F?Bo(b):!b.isTouch&&b.button===1&&(Vr.current=b.location))},[X,Bo]),[Xa,qa]=d.useState(),ec=d.useCallback(b=>{if(b.kind!==Kn||re!=="multi")return;const A=xa.value?b.metaKey:b.ctrlKey,[F]=b.location,V=X.columns;if(F<j)return;const W=lt[F];let q=F,_=F;for(let U=F-1;U>=j&&wi(W.group,lt[U].group);U--)q--;for(let U=F+1;U<lt.length&&wi(W.group,lt[U].group);U++)_++;if(Sn(),A||b.isTouch||ct==="multi")if(V.hasAll([q,_+1])){let U=V;for(let J=q;J<=_;J++)U=U.remove(J);Ge(U,void 0,A)}else Ge(void 0,[q,_+1],A);else Ge(Ye.fromSingleSelection([q,_+1]),void 0,A)},[re,Sn,X.columns,lt,j,Ge,ct]),go=d.useRef(!1),Vi=d.useCallback(async b=>{if(te!==void 0&&je!==void 0){const A=Jt.current.y,F=Jt.current.height;let V=te({x:b,y:A,width:1,height:Math.min(F,$e-A)},$.current.signal);typeof V!="object"&&(V=await V());const W=ln[b-j],q=document.createElement("canvas").getContext("2d",{alpha:!1});if(q!==null){q.font=st.baseFontFull;const _=ch(q,st,W,0,V,yr,ao,!1,Qt);je?.(W,_.width,b,_.width)}}},[ln,te,ao,st,yr,je,j,$e,Qt]),[Af,Ka]=d.useState(),mo=d.useCallback(async(b,A)=>{const F=b.current?.range;if(F===void 0||te===void 0||A.current===void 0)return;const V=A.current.range;if(M!==void 0){let U=!1;if(M({fillDestination:{...V,x:V.x-j},patternSource:{...F,x:F.x-j},preventDefault:()=>U=!0}),U)return}let W=te(F,$.current.signal);typeof W!="object"&&(W=await W());const q=W,_=[];for(let U=0;U<V.width;U++)for(let J=0;J<V.height;J++){const ie=[V.x+U,V.y+J];if(Yd(ie,F))continue;const He=q[J%F.height][U%F.width];Io(He)||!So(He)||_.push({location:ie,value:{...He}})}Bn(_),bn.current?.damage(_.map(U=>({cell:U.location})))},[te,Bn,M,j]),tc=d.useCallback(()=>{if(X.current===void 0||X.current.range.width<=1)return;const b={...X,current:{...X.current,range:{...X.current.range,width:1}}};mo(b,X)},[mo,X]),nc=d.useCallback(()=>{if(X.current===void 0||X.current.range.height<=1)return;const b={...X,current:{...X.current,range:{...X.current.range,height:1}}};mo(b,X)},[mo,X]),Ff=d.useCallback((b,A)=>{const F=s;if(c(void 0),Na(void 0),Ka(void 0),No.current=!1,A)return;if(F?.fillHandle===!0&&X.current!==void 0&&F.previousSelection?.current!==void 0){if(_r===void 0)return;const He={...X,current:{...X.current,range:ph(F.previousSelection.current.range,_r)}};mo(F.previousSelection,He),fe(He,!0);return}const[V,W]=b.location,[q,_]=Vr.current??[],U=()=>{go.current=!0},J=He=>{const It=He.isTouch||q===V&&_===W;if(It&&R?.([V-j,W],{...He,preventDefault:U}),He.button===1)return!go.current;if(!go.current){const Ke=Hn(b.location),Ue=Qt(Ke);if(Ue!==void 0&&Ue.onClick!==void 0&&It){const et=Ue.onClick({...He,cell:Ke,posX:He.localEventX,posY:He.localEventY,bounds:He.bounds,theme:Vo(Ke,b.location),preventDefault:U});et!==void 0&&!Io(et)&&ko(et)&&(Bn([{location:He.location,value:et}]),bn.current?.damage([{cell:He.location}]))}if(go.current||X.current===void 0)return!1;let Xe=!1;switch(Ke.activationBehaviorOverride??Me){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[et,vt]=X.current.cell,[en,bo]=F.previousSelection.current.cell;Xe=V===et&&V===en&&W===vt&&W===bo&&(He.isDoubleClick===!0||Me==="second-click");break}case"single-click":{Xe=!0;break}}if(Xe){const et={inputType:"pointer",pointerActivation:He.isDoubleClick===!0?"double-click":Ke.activationBehaviorOverride??Me,pointerType:He.isTouch?"touch":"mouse"};return E?.([V-j,W],et),ho(He.bounds,et),!0}}return!1},ie=b.location[0]-j;if(b.isTouch){const He=Jt.current,It=Js.current;if(He.x!==It.x||He.y!==It.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&pi(X.current?.cell,b.location)){N?.([ie,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&X.columns.hasIndex(V)){ae?.(ie,{...b,preventDefault:U});return}else if(b.kind===Kn){if(ie<0)return;K?.(ie,{...b,preventDefault:U});return}}b.kind==="cell"?J(b)||Bo(b):b.kind===Kn?Q?.(ie,{...b,preventDefault:U}):(b.kind===Rr&&I?.(ie,{...b,preventDefault:U}),Bo(b));return}if(b.kind==="header"){if(ie<0)return;b.isEdge?b.isDoubleClick===!0&&Vi(V):b.button===0&&V===q&&W===_&&I?.(ie,{...b,preventDefault:U})}if(b.kind===Kn){if(ie<0)return;b.button===0&&V===q&&W===_&&(Q?.(ie,{...b,preventDefault:U}),go.current||ec(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&J(b),Vr.current=void 0},[s,X,j,_r,mo,fe,R,Hn,Qt,Me,Vo,Bn,E,ho,N,ae,K,Bo,Q,I,Vi,ec]),zf=d.useCallback(b=>{const A={...b,location:[b.location[0]-j,b.location[1]]};it?.(A),s!==void 0&&b.buttons===0&&(c(void 0),Na(void 0),Ka(void 0),No.current=!1),Ka(F=>No.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===F?.[0]&&b.scrollEdge[1]===F[1]?F:s===void 0||(ir.current?.location[0]??0)<j?void 0:b.scrollEdge)},[s,it,j]),_f=d.useCallback((b,A)=>{Je?.(b-j,A)},[Je,j]),$f=d.useCallback((b,A)=>{We?.(b-j,A)},[We,j]),vo=X?.current?.cell,Vf=d.useCallback((b,A,F,V,W,q)=>{or.current=!1;let _=vo;_!==void 0&&(_=[_[0]-j,_[1]]);const U=Ie===0?void 0:{x:0,y:b.y,width:Ie,height:b.height},J=[];U!==void 0&&J.push(U),dt>0&&(J.push({x:b.x-j,y:$e-dt,width:b.width,height:dt}),Ie>0&&J.push({x:0,y:$e-dt,width:Ie,height:dt}));const ie={x:b.x-j,y:b.y,width:b.width,height:zt&&b.y+b.height>=$e?b.height-1:b.height,tx:W,ty:q,extras:{selected:_,freezeRegion:U,freezeRegions:J}};Jt.current=ie,Hi(ie),uo([A,F,V]),On?.(ie,ie.tx,ie.ty,ie.extras)},[vo,j,zt,$e,Ie,dt,Hi,On]),Bf=Ir(O,d.useCallback((b,A)=>O?.(b-j,A-j)!==!1,[O,j])),Nf=Ir(Se,d.useCallback((b,A)=>{Se?.(b-j,A-j),re!=="none"&&Ge(Ye.fromSingleSelection(A),void 0,!0)},[re,Se,j,Ge])),Za=d.useRef(!1),Wf=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}Pe?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(Za.current=!0),c(void 0)},[Pe,j]),jf=d.useCallback(()=>{Za.current=!1},[]),rc=Wt?.selectionBehavior,Bi=d.useCallback(b=>{if(rc!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:V}=$r(b);if(A)return[b,b];const W=F[F.length-1],q=b-W,_=b+V-W-1;return[q,_]},[$r,rc]),Ya=d.useRef(),Qa=d.useCallback(b=>{if(!yh(b,Ya.current)&&(Ya.current=b,!(ir?.current?.button!==void 0&&ir.current.button>=1))){if(b.buttons!==0&&s!==void 0&&ir.current?.location[0]===0&&j===1&&me==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(ir.current.location[1])&&X.rows.hasIndex(ir.current.location[1])){const A=Math.min(ir.current.location[1],b.location[1]),F=Math.max(ir.current.location[1],b.location[1])+1;at(Ye.fromSingleSelection([A,F]),void 0,!1)}else if(b.buttons!==0&&s!==void 0&&X.current!==void 0&&!Za.current&&!No.current&&(Te==="rect"||Te==="multi-rect")){const[A,F]=X.current.cell;let[V,W]=b.location;if(W<0&&(W=Jt.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const q=s.previousSelection.current.range;W=Math.min(W,zt?$e-1:$e);const _=Sv(q,V,W,At);Na(_)}else{if(zt&&F===$e)return;if(zt&&W===$e)if(b.kind===Ca)W--;else return;V=Math.max(V,j);const q=Bi(F);W=q===void 0?W:Nn(W,q[0],q[1]);const _=V-A,U=W-F,J={x:_>=0?A:V,y:U>=0?F:W,width:Math.abs(_)+1,height:Math.abs(U)+1};xt({...X.current,range:J},!0,!1,"drag")}}ut?.({...b,location:[b.location[0]-j,b.location[1]]})}},[s,j,me,X,Te,ut,at,zt,$e,At,Bi,xt]),Gf=d.useCallback(()=>{const b=Ya.current;if(b===void 0)return;const[A,F]=b.scrollEdge;let[V,W]=b.location;const q=Jt.current;A===-1?V=q.extras?.freezeRegion?.x??q.x:A===1&&(V=q.x+q.width),F===-1?W=Math.max(0,q.y):F===1&&(W=Math.min($e-1,q.y+q.height)),V=Nn(V,0,lt.length-1),W=Nn(W,0,$e-1),Qa({...b,location:[V,W]})},[lt.length,Qa,$e]);Hb(Af,Nt,Gf);const Un=d.useCallback(b=>{if(X.current===void 0)return;const[A,F]=b,[V,W]=X.current.cell,q=X.current.range;let _=q.x,U=q.x+q.width,J=q.y,ie=q.y+q.height;const[He,It]=Bi(W)??[0,$e-1],Ke=It+1;if(F!==0)switch(F){case 2:{ie=Ke,J=W,Ut(0,ie,"vertical");break}case-2:{J=He,ie=W+1,Ut(0,J,"vertical");break}case 1:{J<W?(J++,Ut(0,J,"vertical")):(ie=Math.min(Ke,ie+1),Ut(0,ie,"vertical"));break}case-1:{ie>W+1?(ie--,Ut(0,ie,"vertical")):(J=Math.max(He,J-1),Ut(0,J,"vertical"));break}default:vi()}if(A!==0)if(A===2)U=lt.length,_=V,Ut(U-1-j,0,"horizontal");else if(A===-2)_=j,U=V+1,Ut(_-j,0,"horizontal");else{let Ue=[];if(te!==void 0){const Xe=te({x:_,y:J,width:U-_-j,height:ie-J},$.current.signal);typeof Xe=="object"&&(Ue=Wb(Xe))}if(A===1){let Xe=!1;if(_<V){if(Ue.length>0){const et=Tr(_+1,V+1).find(vt=>!Ue.includes(vt-j));et!==void 0&&(_=et,Xe=!0)}else _++,Xe=!0;Xe&&Ut(_,0,"horizontal")}Xe||(U=Math.min(lt.length,U+1),Ut(U-1-j,0,"horizontal"))}else if(A===-1){let Xe=!1;if(U>V+1){if(Ue.length>0){const et=Tr(U-1,V,-1).find(vt=>!Ue.includes(vt-j));et!==void 0&&(U=et,Xe=!0)}else U--,Xe=!0;Xe&&Ut(U-j,0,"horizontal")}Xe||(_=Math.max(j,_-1),Ut(_-j,0,"horizontal"))}else vi()}xt({cell:X.current.cell,range:{x:_,y:J,width:U-_,height:ie-J}},!0,!1,"keyboard-select")},[te,Bi,X,lt.length,j,$e,Ut,xt]),Ja=d.useRef(fn);Ja.current=fn;const kr=d.useCallback((b,A,F,V)=>{const W=wn-(F?0:1);b=Nn(b,j,ln.length-1+j),A=Nn(A,0,W);const q=vo?.[0],_=vo?.[1];if(b===q&&A===_)return!1;if(V&&X.current!==void 0){const U=[...X.current.rangeStack];(X.current.range.width>1||X.current.range.height>1)&&U.push(X.current.range),fe({...X,current:{cell:[b,A],range:{x:b,y:A,width:1,height:1},rangeStack:U}},!0)}else xt({cell:[b,A],range:{x:b,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===b&&u.current[1]===A&&(u.current=void 0),Ja.current&&Ut(b-j,A),!0},[wn,j,ln.length,vo,X,Ut,fe,xt]),Uf=d.useCallback((b,A)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(Bn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{bn.current?.damage([{cell:o.cell}])})),Sn(!0),i(void 0);const[F,V]=A;if(X.current!==void 0&&(F!==0||V!==0)){const W=X.current.cell[1]===wn-1&&b!==void 0,q=X.current.cell[0]===lt.length-1&&b!==void 0;let _=!0;if(W&&V===1&&ge!==void 0){_=!1;const U=X.current.cell[0]+F,J=fo(U);xr(J??U,!1)}if(q&&F===1&&Qe!==void 0){_=!1;const U=X.current.cell[1]+V;$i(U,!1)}_&&kr(Nn(X.current.cell[0]+F,0,lt.length-1),Nn(X.current.cell[1]+V,0,wn-1),W,!1)}H?.(b,A)},[o?.cell,Sn,X,H,Bn,wn,kr,lt.length,xr,$i,ge,Qe,fo]),Xf=d.useMemo(()=>`gdg-overlay-${Nb++}`,[]),Br=d.useCallback(b=>{Sn();const A=[];for(let F=b.x;F<b.x+b.width;F++)for(let V=b.y;V<b.y+b.height;V++){const W=C([F-j,V]);if(!W.allowOverlay&&W.kind!==Z.Boolean)continue;let q;if(W.kind===Z.Custom){const _=Qt(W),U=_?.provideEditor?.({...W,location:[F-j,V]});_?.onDelete!==void 0?q=_.onDelete(W):tm(U)&&(q=U?.deletedValue?.(W))}else(ko(W)&&W.allowOverlay||W.kind===Z.Boolean)&&(q=Qt(W)?.onDelete?.(W));q!==void 0&&!Io(q)&&ko(q)&&A.push({location:[F,V],value:q})}Bn(A),bn.current?.damage(A.map(F=>({cell:F.location})))},[Sn,C,Qt,Bn,j]),Wo=o!==void 0,oc=d.useCallback(b=>{const A=()=>{b.stopPropagation(),b.preventDefault()},F={didMatch:!1},{bounds:V}=b,W=X.columns,q=X.rows,_=rr;if(!Wo&&tt(_.clear,b,F))fe(ea,!1),qt?.();else if(!Wo&&tt(_.selectAll,b,F))fe({columns:Ye.empty(),rows:Ye.empty(),current:{cell:X.current?.cell??[j,0],range:{x:j,y:0,width:y.length,height:$e},rangeStack:[]}},!1);else if(tt(_.search,b,F))a?.current?.focus({preventScroll:!0}),Pi(!0);else if(tt(_.delete,b,F)){const Xe=Gt?.(X)??!0;if(Xe!==!1){const et=Xe===!0?X:Xe;if(et.current!==void 0){Br(et.current.range);for(const vt of et.current.rangeStack)Br(vt)}for(const vt of et.rows)Br({x:j,y:vt,width:y.length,height:1});for(const vt of et.columns)Br({x:vt,y:0,width:1,height:$e})}}if(F.didMatch)return A(),!0;if(X.current===void 0)return!1;let[U,J]=X.current.cell;const[,ie]=X.current.cell;let He=!1,It=!1;if(tt(_.scrollToSelectedCell,b,F))ji.current(U-j,J);else if(re!=="none"&&tt(_.selectColumn,b,F))W.hasIndex(U)?Ge(W.remove(U),void 0,!0):re==="single"?Ge(Ye.fromSingleSelection(U),void 0,!0):Ge(void 0,U,!0);else if(me!=="none"&&tt(_.selectRow,b,F))q.hasIndex(J)?at(q.remove(J),void 0,!0):me==="single"?at(Ye.fromSingleSelection(J),void 0,!0):at(void 0,J,!0);else if(!Wo&&V!==void 0&&tt(_.activateCell,b,F))if(J===$e&&zt)window.setTimeout(()=>{const Xe=fo(U);xr(Xe??U)},0);else{const Xe={inputType:"keyboard",key:b.key};E?.([U-j,J],Xe),ho(V,Xe)}else X.current.range.height>1&&tt(_.downFill,b,F)?nc():X.current.range.width>1&&tt(_.rightFill,b,F)?tc():tt(_.goToNextPage,b,F)?J+=Math.max(1,Jt.current.height-4):tt(_.goToPreviousPage,b,F)?J-=Math.max(1,Jt.current.height-4):tt(_.goToFirstCell,b,F)?(i(void 0),J=0,U=0):tt(_.goToLastCell,b,F)?(i(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):tt(_.selectToFirstCell,b,F)?(i(void 0),Un([-2,-2])):tt(_.selectToLastCell,b,F)?(i(void 0),Un([2,2])):Wo?(tt(_.closeOverlay,b,F)&&i(void 0),tt(_.acceptOverlayDown,b,F)&&(i(void 0),J++),tt(_.acceptOverlayUp,b,F)&&(i(void 0),J--),tt(_.acceptOverlayLeft,b,F)&&(i(void 0),U--),tt(_.acceptOverlayRight,b,F)&&(i(void 0),U++)):(tt(_.goDownCell,b,F)?J+=1:tt(_.goUpCell,b,F)?J-=1:tt(_.goRightCell,b,F)?U+=1:tt(_.goLeftCell,b,F)?U-=1:tt(_.goDownCellRetainSelection,b,F)?(J+=1,He=!0):tt(_.goUpCellRetainSelection,b,F)?(J-=1,He=!0):tt(_.goRightCellRetainSelection,b,F)?(U+=1,He=!0):tt(_.goLeftCellRetainSelection,b,F)?(U-=1,He=!0):tt(_.goToLastRow,b,F)?J=$e-1:tt(_.goToFirstRow,b,F)?J=Number.MIN_SAFE_INTEGER:tt(_.goToLastColumn,b,F)?U=Number.MAX_SAFE_INTEGER:tt(_.goToFirstColumn,b,F)?U=Number.MIN_SAFE_INTEGER:(Te==="rect"||Te==="multi-rect")&&(tt(_.selectGrowDown,b,F)?Un([0,1]):tt(_.selectGrowUp,b,F)?Un([0,-1]):tt(_.selectGrowRight,b,F)?Un([1,0]):tt(_.selectGrowLeft,b,F)?Un([-1,0]):tt(_.selectToLastRow,b,F)?Un([0,2]):tt(_.selectToFirstRow,b,F)?Un([0,-2]):tt(_.selectToLastColumn,b,F)?Un([2,0]):tt(_.selectToFirstColumn,b,F)&&Un([-2,0])),It=F.didMatch);if(Gn!==void 0&&Gn!=="normal"&&J!==ie){const Xe=Gn==="skip-up"||Gn==="skip"||Gn==="block",et=Gn==="skip-down"||Gn==="skip"||Gn==="block",vt=J<ie;if(vt&&Xe){for(;J>=0&&$r(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!vt&&et){for(;J<$e&&$r(J).isGroupHeader;)J++;J>=$e&&(J=ie)}}const Ke=kr(U,J,!1,He),Ue=F.didMatch;return Ue&&(Ke||!It||Cn)&&A(),Ue},[Gn,Wo,X,rr,re,me,Te,j,$r,$e,kr,fe,qt,y.length,Gt,Cn,Br,Ge,at,zt,fo,xr,E,ho,nc,tc,Un]),jo=d.useCallback(b=>{let A=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{A=!0}}),A||oc(b)||X.current===void 0)return;const[F,V]=X.current.cell,W=Jt.current;if(we&&!b.metaKey&&!b.ctrlKey&&X.current!==void 0&&b.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(b.key)&&b.bounds!==void 0&&So(C([F-j,Math.max(0,Math.min(V,$e-1))]))){if((!zt||V!==$e)&&(W.y>V||V>W.y+W.height||W.x>F||F>W.x+W.width))return;const q={inputType:"keyboard",key:b.key};E?.([F-j,V],q),ho(b.bounds,q,b.key),b.stopPropagation(),b.preventDefault()}},[we,G,oc,X,C,j,$e,zt,E,ho]),qf=d.useCallback((b,A)=>{const F=b.location[0]-j;if(b.kind==="header"&&ae?.(F,{...b,preventDefault:A}),b.kind===Kn){if(F<0)return;K?.(F,{...b,preventDefault:A})}if(b.kind==="cell"){const[V,W]=b.location;N?.([F,W],{...b,preventDefault:A}),y0(X,b.location)||kr(V,W,!1,!1)}},[X,N,K,ae,j,kr]),el=d.useCallback(async b=>{if(!rr.paste)return;function A(_,U,J,ie){const He=typeof J=="object"?J?.join(`
|
|
182
|
+
`&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push(uu(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function du(e,t,n){const r=Sb(e,t),o=l=>{window.navigator.clipboard?.writeText(l)},i=(l,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),a=(l,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",l),n?.clipboardData?.setData("text/html",s)}catch{i(l,s)||o(l)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function Ch(e){return e!==!0}function hu(e){return typeof e=="string"?e:`${e}px`}const Rb=()=>e=>e.innerWidth,Eb=()=>e=>e.innerHeight,Tb=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Rb()],"wmyidgi-1":[Eb()]}}),Ob=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(Tb,{innerHeight:hu(n),innerWidth:hu(t),...o},r)},Db=2,Pb=1300;function Hb(e,t,n){const r=kt.useRef(0),[o,i]=e??[0,0];kt.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{if(!a){if(l===0)l=c;else{const u=c-l;r.current=Math.min(1,r.current+u/Pb);const h=r.current**1.618*u*Db;t.current?.scrollBy(o*h,i*h),l=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Lb({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,h,g,f]=kt.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const p=l/16,m=e,w=ah();return[typeof m=="number"?m*p:y=>Math.ceil(m(y)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*p},Math.ceil((o??0)*p),Math.ceil((i??0)*p)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:g,overscrollY:f}}const Mr={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 nt(e,t){return e===!0?t:e===!1?"":e}function fu(e){const t=xa.value;return{activateCell:nt(e.activateCell," |Enter|shift+Enter"),clear:nt(e.clear,"any+Escape"),closeOverlay:nt(e.closeOverlay,"any+Escape"),acceptOverlayDown:nt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:nt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:nt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:nt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:nt(e.delete,t?"Backspace|Delete":"Delete"),downFill:nt(e.downFill,"primary+_68"),scrollToSelectedCell:nt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:nt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:nt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:nt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:nt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:nt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:nt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:nt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:nt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:nt(e.goToFirstCell,"primary+Home"),goToFirstColumn:nt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:nt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:nt(e.goToLastCell,"primary+End"),goToLastColumn:nt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:nt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:nt(e.goToNextPage,"PageDown"),goToPreviousPage:nt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:nt(e.rightFill,"primary+_82"),search:nt(e.search,"primary+f"),selectAll:nt(e.selectAll,"primary+a"),selectColumn:nt(e.selectColumn,"ctrl+ "),selectGrowDown:nt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:nt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:nt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:nt(e.selectGrowUp,"shift+ArrowUp"),selectRow:nt(e.selectRow,"shift+ "),selectToFirstCell:nt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:nt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:nt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:nt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:nt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:nt(e.selectToLastRow,"primary+shift+ArrowDown")}}function Ab(e){const t=Rm(e);return kt.useMemo(()=>{if(t===void 0)return fu(Mr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Mr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Mr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Mr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Mr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Mr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Mr.selectToLastCell};return fu({...Mr,...n})},[t])}function Fb(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function Ss(e,t){const n=[];function r(l,s,c=!1){let u=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(u=l.subGroups[0].headerIndex-l.headerIndex),u--,n.push({rowIndex:-1,headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:u}),l.subGroups)for(let h=0;h<l.subGroups.length;h++){const g=h<l.subGroups.length-1?l.subGroups[h+1].headerIndex:s;r(l.subGroups[h],g,c||l.isCollapsed)}}const o=Fb(e.groups);for(let l=0;l<o.length;l++){const s=l<o.length-1?o[l+1].headerIndex:null;r(o[l],s)}let i=0,a=0;for(const l of n)l.contentIndex=a,a+=l.rows,l.rowIndex=i,i+=l.isCollapsed?1:l.rows+1;return n.filter(l=>l.skip===!1).map(l=>{const{skip:s,...c}=l;return c})}function Xl(e,t){if(t===void 0||Ss.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function zb(e,t,n,r){const o=kt.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]),i=kt.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),a=kt.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),l=kt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=kt.useCallback(u=>{if(o===void 0)return u;let h=u;for(const g of o){if(h===0)return;if(h--,!g.isCollapsed){if(h<g.rows)return g.contentIndex+h;h-=g.rows}}return u},[o]),c=Ir(r??e?.themeOverride,kt.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:g,groupIndex:f}=Xl(u,o);return h?e.themeOverride:r?.(u,f,g)},[o,r,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:a,rowNumberMapper:s,getRowThemeOverride:c}}function _b(e,t){const n=kt.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]);return{getRowGroupingForPath:Sh,updateRowGroupingByPath:kh,mapper:kt.useCallback(r=>{if(typeof r=="number")return Xl(r,n);const o=Xl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function kh(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:kh(i.subGroups??[],o,n)}:i)}function Sh(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Sh(e[n].subGroups??[],r)}function $b(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function Vb(e,t,n,r,o){const[i,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,c,u]=Im(l),h=d.useRef(o);h.current=o;const g=$b(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&f){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&u(),h.current()}},[t,f,u,g]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&u(),h.current()}},[e,p,u,g]),{visibleRegion:s,setVisibleRegion:c,scrollRef:g}}const Bb=d.lazy(async()=>await ns(()=>import("./data-grid-overlay-editor-DsmOmCoE-DU0EvyVM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let Nb=0;function Wb(e){return G0(eu(eu(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Qi(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 Ji={kind:Z.Loading,allowOverlay:!1},ea={columns:Ye.empty(),rows:Ye.empty(),current:void 0},jb=(e,t)=>{const[n,r]=d.useState(ea),[o,i]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:f,markdownDivCreateNode:p,width:m,height:w,columns:y,rows:v,getCellContent:C,onCellClicked:R,onCellActivated:E,onFillPattern:M,onFinishedEditing:H,coercePasteValue:S,drawHeader:x,drawCell:L,editorBloom:T,onHeaderClicked:I,onColumnProposeMove:O,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:Q,onCellContextMenu:N,className:Y,onHeaderContextMenu:ae,getCellsForSelection:ee,onGroupHeaderContextMenu:K,onGroupHeaderRenamed:pe,onCellEdited:oe,onCellsEdited:de,onSearchResultsChanged:he,searchResults:se,onSearchValueChange:z,searchValue:P,onKeyDown:G,onKeyUp:le,keybindings:ce,editOnType:we=!0,onRowAppended:ge,onColumnAppended:Qe,onColumnMoved:Se,validateCell:Dt,highlightRegions:bt,rangeSelect:Te="rect",columnSelect:re="multi",rowSelect:me="multi",rangeSelectionBlending:ye="exclusive",columnSelectionBlending:ne="exclusive",rowSelectionBlending:be="exclusive",onDelete:Oe,onDragStart:Pe,onMouseMove:it,onPaste:Ae,copyHeaders:Ze=!1,freezeColumns:Ie=0,cellActivationBehavior:Me="second-click",rowSelectionMode:ze="auto",columnSelectionMode:ct="auto",onHeaderMenuClick:Je,onHeaderIndicatorClick:We,getGroupDetails:ht,rowGrouping:Wt,onSearchClose:Et,onItemHovered:ut,onSelectionCleared:qt,showSearch:Kt,onVisibleRegionChanged:On,gridSelection:St,onGridSelectionChange:ft,minColumnWidth:Dn=50,maxColumnWidth:wt=500,maxColumnAutoWidth:cn,provideEditor:pn,trailingRowOptions:Re,freezeTrailingRows:dt=0,allowedFillDirections:At="orthogonal",scrollOffsetX:dn,scrollOffsetY:$t,verticalBorder:rn,onDragOverCell:Pn,onDrop:on,onColumnResize:Zt,onColumnResizeEnd:Be,onColumnResizeStart:yt,customRenderers:In,fillHandle:Pt,experimental:pt,fixedShadowX:xn,fixedShadowY:er,headerIcons:tr,imageWindowLoader:B,initialSize:_e,isDraggable:Ne,onDragLeave:Tt,onRowMoved:an,overscrollX:hn,overscrollY:Rn,preventDiagonalScrolling:gn,rightElement:Bt,rightElementProps:En,trapFocus:Cn=!1,smoothScrollX:Lo,smoothScrollY:no,scaleToRem:Hr=!1,rowHeight:xe=34,headerHeight:mt=36,groupHeaderHeight:Ft=mt,theme:_n,isOutsideClick:Tn,renderers:Yt,resizeIndicator:jt,scrollToActiveCell:fn=!0,drawFocusRing:$n=!0,portalElementRef:Ao}=e,Fo=$n==="no-editor"?o===void 0:$n,jn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,mn=jn?.kind??e.rowMarkers??"none",br=jn?.width??e.rowMarkerWidth,ro=jn?.startIndex??e.rowMarkerStartIndex??1,wr=jn?.theme??e.rowMarkerTheme,oo=jn?.headerTheme,Ti=jn?.headerAlwaysVisible,Lr=me!=="multi"||jn?.headerDisabled===!0,io=jn?.checkboxStyle??"square",yr=Math.max(Dn,20),ao=Math.max(wt,yr),Oi=Math.max(cn??ao,yr),zo=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:$e,rowNumberMapper:_o,rowHeight:za,getRowThemeOverride:Ar}=zb(Wt,v,xe,f),_a=d.useMemo(()=>Number.parseFloat(zo.fontSize),[zo]),{rowHeight:nr,headerHeight:$o,groupHeaderHeight:lo,theme:Di,overscrollX:$a,overscrollY:Va}=Lb({groupHeaderHeight:Ft,headerHeight:mt,overscrollX:hn,overscrollY:Rn,remSize:_a,rowHeight:za,scaleToRem:Hr,theme:_n}),rr=Ab(ce),dr=br??(v>1e4?48:v>1e3?44:v>100?36:32),kn=mn!=="none",j=kn?1:0,zt=Re!==void 0,Fr=Re?.sticky===!0,[so,Pi]=d.useState(!1),co=Kt??so,Ba=d.useCallback(()=>{Et!==void 0?Et():Pi(!1)},[Et]),X=d.useMemo(()=>St===void 0?void 0:Qi(St,j),[St,j])??n,$=d.useRef();$.current===void 0&&($.current=new AbortController),d.useEffect(()=>()=>$?.current.abort(),[]);const[te,Ce]=bb(ee,C,j,$.current,$e),Ee=d.useCallback((b,A,F)=>{if(Dt===void 0)return!0;const V=[b[0]-j,b[1]];return Dt?.(V,A,F)},[j,Dt]),ue=d.useRef(St),fe=d.useCallback((b,A)=>{A&&(b=Mb(b,te,j,k,$.current)),ft!==void 0?(ue.current=Qi(b,-j),ft(ue.current)):r(b)},[ft,te,j,k]),je=Ir(Zt,d.useCallback((b,A,F,V)=>{Zt?.(y[F-j],A,F-j,V)},[Zt,j,y])),ke=Ir(Be,d.useCallback((b,A,F,V)=>{Be?.(y[F-j],A,F-j,V)},[Be,j,y])),qe=Ir(yt,d.useCallback((b,A,F,V)=>{yt?.(y[F-j],A,F-j,V)},[yt,j,y])),gt=Ir(x,d.useCallback((b,A)=>x?.({...b,columnIndex:b.columnIndex-j},A)??!1,[x,j])),un=Ir(L,d.useCallback((b,A)=>L?.({...b,col:b.col-j},A)??!1,[L,j])),Gt=d.useCallback(b=>{if(Oe!==void 0){const A=Oe(Qi(b,-j));return typeof A=="boolean"?A:Qi(A,j)}return!0},[Oe,j]),[xt,at,Ge]=vb(X,fe,ye,ne,be,Te,D),st=d.useMemo(()=>mr(ah(),Di),[Di]),[Vt,uo]=d.useState([0,0,0]),zr=d.useMemo(()=>{if(Yt===void 0)return{};const b={};for(const A of Yt)b[A.kind]=A;return b},[Yt]),Qt=d.useCallback(b=>b.kind!==Z.Custom?zr[b.kind]:In?.find(A=>A.isMatch(b)),[In,zr]);let{sizedColumns:ln,nonGrowWidth:Ht}=F0(y,$e,Ce,Vt[0]-(j===0?0:dr)-Vt[2],yr,Oi,st,Qt,$.current);mn!=="none"&&(Ht+=dr);const Vn=d.useMemo(()=>ln.some(b=>b.group!==void 0),[ln]),vn=Vn?$o+lo:$o,hr=X.rows.length,fr=mn==="none"?void 0:hr===0?!1:hr===$e?!0:void 0,lt=d.useMemo(()=>mn==="none"?ln:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:wr,rowMarker:io,rowMarkerChecked:fr,headerRowMarkerTheme:oo,headerRowMarkerAlwaysVisible:Ti,headerRowMarkerDisabled:Lr},...ln],[mn,ln,dr,wr,io,fr,oo,Ti,Lr]),Jt=d.useRef({height:1,width:1,x:0,y:0}),or=d.useRef(!1),{setVisibleRegion:Hi,visibleRegion:pr,scrollRef:Nt}=Vb(dn,$t,nr,Jt,()=>or.current=!0);Jt.current=pr;const Pf=pr.x+j,Li=pr.y,bn=d.useRef(null),Sn=d.useCallback(b=>{b===!0?bn.current?.focus():window.requestAnimationFrame(()=>{bn.current?.focus()})},[]),wn=zt?$e+1:$e,Bn=d.useCallback(b=>{const A=j===0?b:b.map(V=>({...V,location:[V.location[0]-j,V.location[1]]})),F=de?.(A);if(F!==!0)for(const V of A)oe?.(V.location,V.value);return F},[oe,de,j]),[_r,Na]=d.useState(),Ai=X.current!==void 0&&X.current.range.width*X.current.range.height>1?X.current.range:void 0,Ks=Fo?X.current?.cell:void 0,Fi=Ks?.[0],zi=Ks?.[1],Hf=d.useMemo(()=>{if((bt===void 0||bt.length===0)&&(Ai??Fi??zi??_r)===void 0)return;const b=[];if(bt!==void 0)for(const A of bt){const F=lt.length-A.range.x-j;F>0&&b.push({color:A.color,range:{...A.range,x:A.range.x+j,width:Math.min(F,A.range.width)},style:A.style})}return _r!==void 0&&b.push({color:Yr(st.accentColor,0),range:_r,style:"dashed"}),Ai!==void 0&&b.push({color:Yr(st.accentColor,.5),range:Ai,style:"solid-outline"}),Fi!==void 0&&zi!==void 0&&b.push({color:st.accentColor,range:{x:Fi,y:zi,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[_r,Ai,Fi,zi,bt,lt.length,st.accentColor,j]),Zs=d.useRef(lt);Zs.current=lt;const Hn=d.useCallback(([b,A],F=!1)=>{const V=zt&&A===wn-1;if(b===0&&kn){if(V)return Ji;const W=_o(A);return W===void 0?Ji:{kind:Wn.Marker,allowOverlay:!1,checkboxStyle:io,checked:X?.rows.hasIndex(A)===!0,markerKind:mn==="clickable-number"?"number":mn,row:ro+W,drawHandle:an!==void 0,cursor:mn==="clickable-number"?"pointer":void 0}}else if(V){const W=b===j?Re?.hint??"":"",q=Zs.current[b];if(q?.trailingRowOptions?.disabled===!0)return Ji;{const _=q?.trailingRowOptions?.hint??W,U=q?.trailingRowOptions?.addIcon??Re?.addIcon;return{kind:Wn.NewRow,hint:_,allowOverlay:!1,icon:U}}}else{const W=b-j;if(F||pt?.strict===!0){const _=Jt.current,U=_.x>W||W>_.x+_.width||_.y>A||A>_.y+_.height||A>=Ua.current,J=W===_.extras?.selected?.[0]&&A===_.extras?.selected[1];let ie=!1;if(_.extras?.freezeRegions!==void 0){for(const He of _.extras.freezeRegions)if(Kr(He,W,A)){ie=!0;break}}if(U&&!J&&!ie)return Ji}let q=C([W,A]);return j!==0&&q.span!==void 0&&(q={...q,span:[q.span[0]+j,q.span[1]+j]}),q}},[zt,wn,kn,_o,io,X?.rows,mn,ro,an,j,Re?.hint,Re?.addIcon,pt?.strict,C]),Wa=d.useCallback(b=>{let A=ht?.(b)??{name:b};return pe!==void 0&&b!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>qa({group:A.name,bounds:F.bounds})}]}),A},[ht,pe]),_i=d.useCallback(b=>{const[A,F]=b.cell,V=lt[A],W=V?.group!==void 0?Wa(V.group)?.overrideTheme:void 0,q=V?.themeOverride,_=Ar?.(F);i({...b,theme:mr(st,W,q,_,b.content.themeOverride)})},[Ar,lt,Wa,st]),ho=d.useCallback((b,A,F)=>{if(X.current===void 0)return;const[V,W]=X.current.cell,q=Hn([V,W]);if(q.kind!==Z.Boolean&&q.allowOverlay){let _=q;if(F!==void 0)switch(_.kind){case Z.Number:{const U=em(()=>F==="-"?-0:Number.parseFloat(F),0);_={..._,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:_={..._,data:F};break}_i({target:b,content:_,initialValue:F,cell:[V,W],highlight:F===void 0,forceEditMode:F!==void 0,activation:A})}else q.kind===Z.Boolean&&A.inputType==="keyboard"&&q.readonly!==!0&&(Bn([{location:X.current.cell,value:{...q,data:Ch(q.data)}}]),bn.current?.damage([{cell:X.current.cell}]))},[Hn,X,Bn,_i]),Ys=d.useCallback((b,A)=>{const F=bn.current?.getBounds(b,A);if(F===void 0||Nt.current===null)return;const V=Hn([b,A]);V.allowOverlay&&_i({target:F,content:V,initialValue:void 0,highlight:!0,cell:[b,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Hn,Nt,_i]),Ut=d.useCallback((b,A,F="both",V=0,W=0,q=void 0)=>{if(Nt.current!==null){const _=bn.current,U=l.current,J=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,ie=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,He=typeof b!="number"&&b.unit==="px"?b.amount:void 0,It=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(_!==null&&U!==null){let Ke={x:0,y:0,width:0,height:0},Ue=0,Xe=0;if((J!==void 0||ie!==void 0)&&(Ke=_.getBounds((J??0)+j,ie??0)??Ke,Ke.width===0||Ke.height===0))return;const et=U.getBoundingClientRect(),vt=et.width/U.offsetWidth;if(He!==void 0&&(Ke={...Ke,x:He-et.left-Nt.current.scrollLeft,width:1}),It!==void 0&&(Ke={...Ke,y:It+et.top-Nt.current.scrollTop,height:1}),Ke!==void 0){const en={x:Ke.x-V,y:Ke.y-W,width:Ke.width+2*V,height:Ke.height+2*W};let bo=0;for(let tl=0;tl<Ie;tl++)bo+=ln[tl].width;let Gi=0;const Uo=dt+(Fr?1:0);Uo>0&&(Gi=to(wn,Uo,nr));let ar=bo*vt+et.left+j*dr*vt,wo=et.right,Nr=et.top+vn*vt,yo=et.bottom-Gi*vt;const Ui=Ke.width+V*2;switch(q?.hAlign){case"start":wo=ar+Ui;break;case"end":ar=wo-Ui;break;case"center":ar=Math.floor((ar+wo)/2)-Ui/2,wo=ar+Ui;break}const Xi=Ke.height+W*2;switch(q?.vAlign){case"start":yo=Nr+Xi;break;case"end":Nr=yo-Xi;break;case"center":Nr=Math.floor((Nr+yo)/2)-Xi/2,yo=Nr+Xi;break}ar>en.x?Ue=en.x-ar:wo<en.x+en.width&&(Ue=en.x+en.width-wo),Nr>en.y?Xe=en.y-Nr:yo<en.y+en.height&&(Xe=en.y+en.height-yo),F==="vertical"||typeof b=="number"&&b<Ie?Ue=0:(F==="horizontal"||typeof A=="number"&&A>=wn-Uo)&&(Xe=0),(Ue!==0||Xe!==0)&&(vt!==1&&(Ue/=vt,Xe/=vt),Nt.current.scrollTo({left:Ue+Nt.current.scrollLeft,top:Xe+Nt.current.scrollTop,behavior:q?.behavior??"auto"}))}}}},[j,dt,dr,Nt,vn,Ie,ln,wn,Fr,nr]),ja=d.useRef(Ys),Ga=d.useRef(C);ja.current=Ys,Ga.current=C;const Ua=d.useRef($e);Ua.current=$e;const Qs=d.useRef(lt.length);Qs.current=lt.length;const xr=d.useCallback(async(b,A=!0,F)=>{if(lt[b]?.trailingRowOptions?.disabled===!0)return;const V=ge?.();let W,q=!0;V!==void 0&&(W=await V,W==="top"&&(q=!1),typeof W=="number"&&(q=!1));let _=0;const U=()=>{if(Ua.current<=$e){_<500&&window.setTimeout(U,_),_=50+_*2;return}const J=typeof W=="number"?W:q?$e:0;ji.current(b-j,J,"both",0,0,F?{behavior:F}:void 0),xt({cell:[b,J],range:{x:b,y:J,width:1,height:1}},!1,!1,"edit");const ie=Ga.current([b-j,J]);ie.allowOverlay&&So(ie)&&ie.readonly!==!0&&A&&window.setTimeout(()=>{ja.current(b,J)},0)};U()},[lt,ge,j,$e,xt]),$i=d.useCallback(async(b,A=!0)=>{const F=Qe?.();let V,W=!0;F!==void 0&&(V=await F,V==="left"&&(W=!1),typeof V=="number"&&(W=!1));let q=0;const _=()=>{if(Qs.current<=lt.length){q<500&&window.setTimeout(_,q),q=50+q*2;return}const U=typeof V=="number"?V:W?lt.length:0;Ut(U-j,b),xt({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const J=Ga.current([U-j,b]);J.allowOverlay&&So(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{ja.current(U,b)},0)};_()},[lt,Qe,j,Ut,xt]),fo=d.useCallback(b=>{const A=ln[b]?.trailingRowOptions?.targetColumn??Re?.targetColumn;if(typeof A=="number")return A+(kn?1:0);if(typeof A=="object"){const F=y.indexOf(A);if(F>=0)return F+(kn?1:0)}},[ln,y,kn,Re?.targetColumn]),Cr=d.useRef(),po=d.useRef(),Vo=d.useCallback((b,A)=>{const[F,V]=A;return mr(st,lt[F]?.themeOverride,Ar?.(V),b.themeOverride)},[Ar,lt,st]),{mapper:$r}=_b(Wt,v),Gn=Wt?.navigationBehavior,Bo=d.useCallback(b=>{const A=xa.value?b.metaKey:b.ctrlKey,F=A&&me==="multi",[V,W]=b.location,q=X.columns,_=X.rows,[U,J]=X.current?.cell??[];if(b.kind==="cell"){if(po.current=void 0,Vr.current=[V,W],V===0&&kn){if(zt===!0&&W===$e||mn==="number"||me==="none")return;const ie=Hn(b.location);if(ie.kind!==Wn.Marker)return;if(an!==void 0){const Ke=Qt(ie);Fn(Ke?.kind===Wn.Marker);const Ue=Ke?.onClick?.({...b,cell:ie,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:Vo(ie,b.location),preventDefault:()=>{}});if(Ue===void 0||Ue.checked===ie.checked)return}i(void 0),Sn();const He=_.hasIndex(W),It=Cr.current;if(me==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&It!==void 0&&_.hasIndex(It)){const Ke=[Math.min(It,W),Math.max(It,W)+1];F||ze==="multi"?at(void 0,Ke,!0):at(Ye.fromSingleSelection(Ke),void 0,F)}else me==="multi"&&(F||b.isTouch||ze==="multi")?He?at(_.remove(W),void 0,!0):(at(void 0,W,!0),Cr.current=W):He&&_.length===1?at(Ye.empty(),void 0,A):(at(Ye.fromSingleSelection(W),void 0,A),Cr.current=W)}else if(V>=j&&zt&&W===$e){const ie=fo(V);xr(ie??V)}else if(U!==V||J!==W){const ie=Hn(b.location),He=Qt(ie);if(He?.onSelect!==void 0){let Ue=!1;if(He.onSelect({...b,cell:ie,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>Ue=!0,theme:Vo(ie,b.location)}),Ue)return}if(Gn==="block"&&$r(W).isGroupHeader)return;const It=Fr&&W===$e,Ke=Fr&&X!==void 0&&X.current?.cell[1]===$e;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&J!==void 0&&X.current!==void 0&&!Ke){if(It)return;const Ue=Math.min(V,U),Xe=Math.max(V,U),et=Math.min(W,J),vt=Math.max(W,J);xt({...X.current,range:{x:Ue,y:et,width:Xe-Ue+1,height:vt-et+1}},!0,A,"click"),Cr.current=void 0,Sn()}else xt({cell:[V,W],range:{x:V,y:W,width:1,height:1}},!0,A,"click"),Cr.current=void 0,i(void 0),Sn()}}else if(b.kind==="header")if(Vr.current=[V,W],i(void 0),kn&&V===0)Cr.current=void 0,po.current=void 0,!Lr&&me==="multi"&&(_.length!==$e?at(Ye.fromSingleSelection([0,$e]),void 0,A):at(Ye.empty(),void 0,A),Sn());else{const ie=po.current;if(re==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&ie!==void 0&&q.hasIndex(ie)){const He=[Math.min(ie,V),Math.max(ie,V)+1];A||b.isTouch||ct==="multi"?Ge(void 0,He,A):Ge(Ye.fromSingleSelection(He),void 0,A)}else re==="multi"&&(A||b.isTouch||ct==="multi")?(q.hasIndex(V)?Ge(q.remove(V),void 0,A):Ge(void 0,V,A),po.current=V):re!=="none"&&(q.hasIndex(V)?Ge(q.remove(V),void 0,A):Ge(Ye.fromSingleSelection(V),void 0,A),po.current=V);Cr.current=void 0,Sn()}else b.kind===Kn?Vr.current=[V,W]:b.kind===Ca&&!b.isMaybeScrollbar&&(fe(ea,!1),i(void 0),Sn(),qt?.(),Cr.current=void 0,po.current=void 0)},[me,re,X,kn,j,zt,$e,mn,Hn,an,Sn,ze,ct,Qt,Vo,at,fo,xr,Gn,$r,Fr,xt,Lr,Ge,fe,qt]),No=d.useRef(!1),Vr=d.useRef(),Js=d.useRef(pr),ir=d.useRef(),Lf=d.useCallback(b=>{if(go.current=!1,Js.current=Jt.current,b.button!==0&&b.button!==1){ir.current=void 0;return}const A=performance.now();ir.current={button:b.button,time:A,location:b.location},b?.kind==="header"&&(No.current=!0);const F=b.kind==="cell"&&b.isFillHandle;!F&&b.kind!=="cell"&&b.isEdge||(c({previousSelection:X,fillHandle:F}),Vr.current=void 0,!b.isTouch&&b.button===0&&!F?Bo(b):!b.isTouch&&b.button===1&&(Vr.current=b.location))},[X,Bo]),[Xa,qa]=d.useState(),ec=d.useCallback(b=>{if(b.kind!==Kn||re!=="multi")return;const A=xa.value?b.metaKey:b.ctrlKey,[F]=b.location,V=X.columns;if(F<j)return;const W=lt[F];let q=F,_=F;for(let U=F-1;U>=j&&wi(W.group,lt[U].group);U--)q--;for(let U=F+1;U<lt.length&&wi(W.group,lt[U].group);U++)_++;if(Sn(),A||b.isTouch||ct==="multi")if(V.hasAll([q,_+1])){let U=V;for(let J=q;J<=_;J++)U=U.remove(J);Ge(U,void 0,A)}else Ge(void 0,[q,_+1],A);else Ge(Ye.fromSingleSelection([q,_+1]),void 0,A)},[re,Sn,X.columns,lt,j,Ge,ct]),go=d.useRef(!1),Vi=d.useCallback(async b=>{if(te!==void 0&&je!==void 0){const A=Jt.current.y,F=Jt.current.height;let V=te({x:b,y:A,width:1,height:Math.min(F,$e-A)},$.current.signal);typeof V!="object"&&(V=await V());const W=ln[b-j],q=document.createElement("canvas").getContext("2d",{alpha:!1});if(q!==null){q.font=st.baseFontFull;const _=ch(q,st,W,0,V,yr,ao,!1,Qt);je?.(W,_.width,b,_.width)}}},[ln,te,ao,st,yr,je,j,$e,Qt]),[Af,Ka]=d.useState(),mo=d.useCallback(async(b,A)=>{const F=b.current?.range;if(F===void 0||te===void 0||A.current===void 0)return;const V=A.current.range;if(M!==void 0){let U=!1;if(M({fillDestination:{...V,x:V.x-j},patternSource:{...F,x:F.x-j},preventDefault:()=>U=!0}),U)return}let W=te(F,$.current.signal);typeof W!="object"&&(W=await W());const q=W,_=[];for(let U=0;U<V.width;U++)for(let J=0;J<V.height;J++){const ie=[V.x+U,V.y+J];if(Yd(ie,F))continue;const He=q[J%F.height][U%F.width];Io(He)||!So(He)||_.push({location:ie,value:{...He}})}Bn(_),bn.current?.damage(_.map(U=>({cell:U.location})))},[te,Bn,M,j]),tc=d.useCallback(()=>{if(X.current===void 0||X.current.range.width<=1)return;const b={...X,current:{...X.current,range:{...X.current.range,width:1}}};mo(b,X)},[mo,X]),nc=d.useCallback(()=>{if(X.current===void 0||X.current.range.height<=1)return;const b={...X,current:{...X.current,range:{...X.current.range,height:1}}};mo(b,X)},[mo,X]),Ff=d.useCallback((b,A)=>{const F=s;if(c(void 0),Na(void 0),Ka(void 0),No.current=!1,A)return;if(F?.fillHandle===!0&&X.current!==void 0&&F.previousSelection?.current!==void 0){if(_r===void 0)return;const He={...X,current:{...X.current,range:ph(F.previousSelection.current.range,_r)}};mo(F.previousSelection,He),fe(He,!0);return}const[V,W]=b.location,[q,_]=Vr.current??[],U=()=>{go.current=!0},J=He=>{const It=He.isTouch||q===V&&_===W;if(It&&R?.([V-j,W],{...He,preventDefault:U}),He.button===1)return!go.current;if(!go.current){const Ke=Hn(b.location),Ue=Qt(Ke);if(Ue!==void 0&&Ue.onClick!==void 0&&It){const et=Ue.onClick({...He,cell:Ke,posX:He.localEventX,posY:He.localEventY,bounds:He.bounds,theme:Vo(Ke,b.location),preventDefault:U});et!==void 0&&!Io(et)&&ko(et)&&(Bn([{location:He.location,value:et}]),bn.current?.damage([{cell:He.location}]))}if(go.current||X.current===void 0)return!1;let Xe=!1;switch(Ke.activationBehaviorOverride??Me){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[et,vt]=X.current.cell,[en,bo]=F.previousSelection.current.cell;Xe=V===et&&V===en&&W===vt&&W===bo&&(He.isDoubleClick===!0||Me==="second-click");break}case"single-click":{Xe=!0;break}}if(Xe){const et={inputType:"pointer",pointerActivation:He.isDoubleClick===!0?"double-click":Ke.activationBehaviorOverride??Me,pointerType:He.isTouch?"touch":"mouse"};return E?.([V-j,W],et),ho(He.bounds,et),!0}}return!1},ie=b.location[0]-j;if(b.isTouch){const He=Jt.current,It=Js.current;if(He.x!==It.x||He.y!==It.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&pi(X.current?.cell,b.location)){N?.([ie,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&X.columns.hasIndex(V)){ae?.(ie,{...b,preventDefault:U});return}else if(b.kind===Kn){if(ie<0)return;K?.(ie,{...b,preventDefault:U});return}}b.kind==="cell"?J(b)||Bo(b):b.kind===Kn?Q?.(ie,{...b,preventDefault:U}):(b.kind===Rr&&I?.(ie,{...b,preventDefault:U}),Bo(b));return}if(b.kind==="header"){if(ie<0)return;b.isEdge?b.isDoubleClick===!0&&Vi(V):b.button===0&&V===q&&W===_&&I?.(ie,{...b,preventDefault:U})}if(b.kind===Kn){if(ie<0)return;b.button===0&&V===q&&W===_&&(Q?.(ie,{...b,preventDefault:U}),go.current||ec(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&J(b),Vr.current=void 0},[s,X,j,_r,mo,fe,R,Hn,Qt,Me,Vo,Bn,E,ho,N,ae,K,Bo,Q,I,Vi,ec]),zf=d.useCallback(b=>{const A={...b,location:[b.location[0]-j,b.location[1]]};it?.(A),s!==void 0&&b.buttons===0&&(c(void 0),Na(void 0),Ka(void 0),No.current=!1),Ka(F=>No.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===F?.[0]&&b.scrollEdge[1]===F[1]?F:s===void 0||(ir.current?.location[0]??0)<j?void 0:b.scrollEdge)},[s,it,j]),_f=d.useCallback((b,A)=>{Je?.(b-j,A)},[Je,j]),$f=d.useCallback((b,A)=>{We?.(b-j,A)},[We,j]),vo=X?.current?.cell,Vf=d.useCallback((b,A,F,V,W,q)=>{or.current=!1;let _=vo;_!==void 0&&(_=[_[0]-j,_[1]]);const U=Ie===0?void 0:{x:0,y:b.y,width:Ie,height:b.height},J=[];U!==void 0&&J.push(U),dt>0&&(J.push({x:b.x-j,y:$e-dt,width:b.width,height:dt}),Ie>0&&J.push({x:0,y:$e-dt,width:Ie,height:dt}));const ie={x:b.x-j,y:b.y,width:b.width,height:zt&&b.y+b.height>=$e?b.height-1:b.height,tx:W,ty:q,extras:{selected:_,freezeRegion:U,freezeRegions:J}};Jt.current=ie,Hi(ie),uo([A,F,V]),On?.(ie,ie.tx,ie.ty,ie.extras)},[vo,j,zt,$e,Ie,dt,Hi,On]),Bf=Ir(O,d.useCallback((b,A)=>O?.(b-j,A-j)!==!1,[O,j])),Nf=Ir(Se,d.useCallback((b,A)=>{Se?.(b-j,A-j),re!=="none"&&Ge(Ye.fromSingleSelection(A),void 0,!0)},[re,Se,j,Ge])),Za=d.useRef(!1),Wf=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}Pe?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(Za.current=!0),c(void 0)},[Pe,j]),jf=d.useCallback(()=>{Za.current=!1},[]),rc=Wt?.selectionBehavior,Bi=d.useCallback(b=>{if(rc!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:V}=$r(b);if(A)return[b,b];const W=F[F.length-1],q=b-W,_=b+V-W-1;return[q,_]},[$r,rc]),Ya=d.useRef(),Qa=d.useCallback(b=>{if(!yh(b,Ya.current)&&(Ya.current=b,!(ir?.current?.button!==void 0&&ir.current.button>=1))){if(b.buttons!==0&&s!==void 0&&ir.current?.location[0]===0&&j===1&&me==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(ir.current.location[1])&&X.rows.hasIndex(ir.current.location[1])){const A=Math.min(ir.current.location[1],b.location[1]),F=Math.max(ir.current.location[1],b.location[1])+1;at(Ye.fromSingleSelection([A,F]),void 0,!1)}else if(b.buttons!==0&&s!==void 0&&X.current!==void 0&&!Za.current&&!No.current&&(Te==="rect"||Te==="multi-rect")){const[A,F]=X.current.cell;let[V,W]=b.location;if(W<0&&(W=Jt.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const q=s.previousSelection.current.range;W=Math.min(W,zt?$e-1:$e);const _=Sv(q,V,W,At);Na(_)}else{if(zt&&F===$e)return;if(zt&&W===$e)if(b.kind===Ca)W--;else return;V=Math.max(V,j);const q=Bi(F);W=q===void 0?W:Nn(W,q[0],q[1]);const _=V-A,U=W-F,J={x:_>=0?A:V,y:U>=0?F:W,width:Math.abs(_)+1,height:Math.abs(U)+1};xt({...X.current,range:J},!0,!1,"drag")}}ut?.({...b,location:[b.location[0]-j,b.location[1]]})}},[s,j,me,X,Te,ut,at,zt,$e,At,Bi,xt]),Gf=d.useCallback(()=>{const b=Ya.current;if(b===void 0)return;const[A,F]=b.scrollEdge;let[V,W]=b.location;const q=Jt.current;A===-1?V=q.extras?.freezeRegion?.x??q.x:A===1&&(V=q.x+q.width),F===-1?W=Math.max(0,q.y):F===1&&(W=Math.min($e-1,q.y+q.height)),V=Nn(V,0,lt.length-1),W=Nn(W,0,$e-1),Qa({...b,location:[V,W]})},[lt.length,Qa,$e]);Hb(Af,Nt,Gf);const Un=d.useCallback(b=>{if(X.current===void 0)return;const[A,F]=b,[V,W]=X.current.cell,q=X.current.range;let _=q.x,U=q.x+q.width,J=q.y,ie=q.y+q.height;const[He,It]=Bi(W)??[0,$e-1],Ke=It+1;if(F!==0)switch(F){case 2:{ie=Ke,J=W,Ut(0,ie,"vertical");break}case-2:{J=He,ie=W+1,Ut(0,J,"vertical");break}case 1:{J<W?(J++,Ut(0,J,"vertical")):(ie=Math.min(Ke,ie+1),Ut(0,ie,"vertical"));break}case-1:{ie>W+1?(ie--,Ut(0,ie,"vertical")):(J=Math.max(He,J-1),Ut(0,J,"vertical"));break}default:vi()}if(A!==0)if(A===2)U=lt.length,_=V,Ut(U-1-j,0,"horizontal");else if(A===-2)_=j,U=V+1,Ut(_-j,0,"horizontal");else{let Ue=[];if(te!==void 0){const Xe=te({x:_,y:J,width:U-_-j,height:ie-J},$.current.signal);typeof Xe=="object"&&(Ue=Wb(Xe))}if(A===1){let Xe=!1;if(_<V){if(Ue.length>0){const et=Tr(_+1,V+1).find(vt=>!Ue.includes(vt-j));et!==void 0&&(_=et,Xe=!0)}else _++,Xe=!0;Xe&&Ut(_,0,"horizontal")}Xe||(U=Math.min(lt.length,U+1),Ut(U-1-j,0,"horizontal"))}else if(A===-1){let Xe=!1;if(U>V+1){if(Ue.length>0){const et=Tr(U-1,V,-1).find(vt=>!Ue.includes(vt-j));et!==void 0&&(U=et,Xe=!0)}else U--,Xe=!0;Xe&&Ut(U-j,0,"horizontal")}Xe||(_=Math.max(j,_-1),Ut(_-j,0,"horizontal"))}else vi()}xt({cell:X.current.cell,range:{x:_,y:J,width:U-_,height:ie-J}},!0,!1,"keyboard-select")},[te,Bi,X,lt.length,j,$e,Ut,xt]),Ja=d.useRef(fn);Ja.current=fn;const kr=d.useCallback((b,A,F,V)=>{const W=wn-(F?0:1);b=Nn(b,j,ln.length-1+j),A=Nn(A,0,W);const q=vo?.[0],_=vo?.[1];if(b===q&&A===_)return!1;if(V&&X.current!==void 0){const U=[...X.current.rangeStack];(X.current.range.width>1||X.current.range.height>1)&&U.push(X.current.range),fe({...X,current:{cell:[b,A],range:{x:b,y:A,width:1,height:1},rangeStack:U}},!0)}else xt({cell:[b,A],range:{x:b,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===b&&u.current[1]===A&&(u.current=void 0),Ja.current&&Ut(b-j,A),!0},[wn,j,ln.length,vo,X,Ut,fe,xt]),Uf=d.useCallback((b,A)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(Bn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{bn.current?.damage([{cell:o.cell}])})),Sn(!0),i(void 0);const[F,V]=A;if(X.current!==void 0&&(F!==0||V!==0)){const W=X.current.cell[1]===wn-1&&b!==void 0,q=X.current.cell[0]===lt.length-1&&b!==void 0;let _=!0;if(W&&V===1&&ge!==void 0){_=!1;const U=X.current.cell[0]+F,J=fo(U);xr(J??U,!1)}if(q&&F===1&&Qe!==void 0){_=!1;const U=X.current.cell[1]+V;$i(U,!1)}_&&kr(Nn(X.current.cell[0]+F,0,lt.length-1),Nn(X.current.cell[1]+V,0,wn-1),W,!1)}H?.(b,A)},[o?.cell,Sn,X,H,Bn,wn,kr,lt.length,xr,$i,ge,Qe,fo]),Xf=d.useMemo(()=>`gdg-overlay-${Nb++}`,[]),Br=d.useCallback(b=>{Sn();const A=[];for(let F=b.x;F<b.x+b.width;F++)for(let V=b.y;V<b.y+b.height;V++){const W=C([F-j,V]);if(!W.allowOverlay&&W.kind!==Z.Boolean)continue;let q;if(W.kind===Z.Custom){const _=Qt(W),U=_?.provideEditor?.({...W,location:[F-j,V]});_?.onDelete!==void 0?q=_.onDelete(W):tm(U)&&(q=U?.deletedValue?.(W))}else(ko(W)&&W.allowOverlay||W.kind===Z.Boolean)&&(q=Qt(W)?.onDelete?.(W));q!==void 0&&!Io(q)&&ko(q)&&A.push({location:[F,V],value:q})}Bn(A),bn.current?.damage(A.map(F=>({cell:F.location})))},[Sn,C,Qt,Bn,j]),Wo=o!==void 0,oc=d.useCallback(b=>{const A=()=>{b.stopPropagation(),b.preventDefault()},F={didMatch:!1},{bounds:V}=b,W=X.columns,q=X.rows,_=rr;if(!Wo&&tt(_.clear,b,F))fe(ea,!1),qt?.();else if(!Wo&&tt(_.selectAll,b,F))fe({columns:Ye.empty(),rows:Ye.empty(),current:{cell:X.current?.cell??[j,0],range:{x:j,y:0,width:y.length,height:$e},rangeStack:[]}},!1);else if(tt(_.search,b,F))a?.current?.focus({preventScroll:!0}),Pi(!0);else if(tt(_.delete,b,F)){const Xe=Gt?.(X)??!0;if(Xe!==!1){const et=Xe===!0?X:Xe;if(et.current!==void 0){Br(et.current.range);for(const vt of et.current.rangeStack)Br(vt)}for(const vt of et.rows)Br({x:j,y:vt,width:y.length,height:1});for(const vt of et.columns)Br({x:vt,y:0,width:1,height:$e})}}if(F.didMatch)return A(),!0;if(X.current===void 0)return!1;let[U,J]=X.current.cell;const[,ie]=X.current.cell;let He=!1,It=!1;if(tt(_.scrollToSelectedCell,b,F))ji.current(U-j,J);else if(re!=="none"&&tt(_.selectColumn,b,F))W.hasIndex(U)?Ge(W.remove(U),void 0,!0):re==="single"?Ge(Ye.fromSingleSelection(U),void 0,!0):Ge(void 0,U,!0);else if(me!=="none"&&tt(_.selectRow,b,F))q.hasIndex(J)?at(q.remove(J),void 0,!0):me==="single"?at(Ye.fromSingleSelection(J),void 0,!0):at(void 0,J,!0);else if(!Wo&&V!==void 0&&tt(_.activateCell,b,F))if(J===$e&&zt)window.setTimeout(()=>{const Xe=fo(U);xr(Xe??U)},0);else{const Xe={inputType:"keyboard",key:b.key};E?.([U-j,J],Xe),ho(V,Xe)}else X.current.range.height>1&&tt(_.downFill,b,F)?nc():X.current.range.width>1&&tt(_.rightFill,b,F)?tc():tt(_.goToNextPage,b,F)?J+=Math.max(1,Jt.current.height-4):tt(_.goToPreviousPage,b,F)?J-=Math.max(1,Jt.current.height-4):tt(_.goToFirstCell,b,F)?(i(void 0),J=0,U=0):tt(_.goToLastCell,b,F)?(i(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):tt(_.selectToFirstCell,b,F)?(i(void 0),Un([-2,-2])):tt(_.selectToLastCell,b,F)?(i(void 0),Un([2,2])):Wo?(tt(_.closeOverlay,b,F)&&i(void 0),tt(_.acceptOverlayDown,b,F)&&(i(void 0),J++),tt(_.acceptOverlayUp,b,F)&&(i(void 0),J--),tt(_.acceptOverlayLeft,b,F)&&(i(void 0),U--),tt(_.acceptOverlayRight,b,F)&&(i(void 0),U++)):(tt(_.goDownCell,b,F)?J+=1:tt(_.goUpCell,b,F)?J-=1:tt(_.goRightCell,b,F)?U+=1:tt(_.goLeftCell,b,F)?U-=1:tt(_.goDownCellRetainSelection,b,F)?(J+=1,He=!0):tt(_.goUpCellRetainSelection,b,F)?(J-=1,He=!0):tt(_.goRightCellRetainSelection,b,F)?(U+=1,He=!0):tt(_.goLeftCellRetainSelection,b,F)?(U-=1,He=!0):tt(_.goToLastRow,b,F)?J=$e-1:tt(_.goToFirstRow,b,F)?J=Number.MIN_SAFE_INTEGER:tt(_.goToLastColumn,b,F)?U=Number.MAX_SAFE_INTEGER:tt(_.goToFirstColumn,b,F)?U=Number.MIN_SAFE_INTEGER:(Te==="rect"||Te==="multi-rect")&&(tt(_.selectGrowDown,b,F)?Un([0,1]):tt(_.selectGrowUp,b,F)?Un([0,-1]):tt(_.selectGrowRight,b,F)?Un([1,0]):tt(_.selectGrowLeft,b,F)?Un([-1,0]):tt(_.selectToLastRow,b,F)?Un([0,2]):tt(_.selectToFirstRow,b,F)?Un([0,-2]):tt(_.selectToLastColumn,b,F)?Un([2,0]):tt(_.selectToFirstColumn,b,F)&&Un([-2,0])),It=F.didMatch);if(Gn!==void 0&&Gn!=="normal"&&J!==ie){const Xe=Gn==="skip-up"||Gn==="skip"||Gn==="block",et=Gn==="skip-down"||Gn==="skip"||Gn==="block",vt=J<ie;if(vt&&Xe){for(;J>=0&&$r(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!vt&&et){for(;J<$e&&$r(J).isGroupHeader;)J++;J>=$e&&(J=ie)}}const Ke=kr(U,J,!1,He),Ue=F.didMatch;return Ue&&(Ke||!It||Cn)&&A(),Ue},[Gn,Wo,X,rr,re,me,Te,j,$r,$e,kr,fe,qt,y.length,Gt,Cn,Br,Ge,at,zt,fo,xr,E,ho,nc,tc,Un]),jo=d.useCallback(b=>{let A=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{A=!0}}),A||oc(b)||X.current===void 0)return;const[F,V]=X.current.cell,W=Jt.current;if(we&&!b.metaKey&&!b.ctrlKey&&X.current!==void 0&&b.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(b.key)&&b.bounds!==void 0&&So(C([F-j,Math.max(0,Math.min(V,$e-1))]))){if((!zt||V!==$e)&&(W.y>V||V>W.y+W.height||W.x>F||F>W.x+W.width))return;const q={inputType:"keyboard",key:b.key};E?.([F-j,V],q),ho(b.bounds,q,b.key),b.stopPropagation(),b.preventDefault()}},[we,G,oc,X,C,j,$e,zt,E,ho]),qf=d.useCallback((b,A)=>{const F=b.location[0]-j;if(b.kind==="header"&&ae?.(F,{...b,preventDefault:A}),b.kind===Kn){if(F<0)return;K?.(F,{...b,preventDefault:A})}if(b.kind==="cell"){const[V,W]=b.location;N?.([F,W],{...b,preventDefault:A}),y0(X,b.location)||kr(V,W,!1,!1)}},[X,N,K,ae,j,kr]),el=d.useCallback(async b=>{if(!rr.paste)return;function A(_,U,J,ie){const He=typeof J=="object"?J?.join(`
|
|
183
183
|
`)??"":J?.toString()??"";if(!Io(_)&&So(_)&&_.readonly!==!0){const It=S?.(He,_);if(It!==void 0&&ko(It))return{location:U,value:It};const Ke=Qt(_);if(Ke===void 0)return;if(Ke.kind===Z.Custom){Fn(_.kind===Z.Custom);const Ue=Ke.onPaste?.(He,_.data);return Ue===void 0?void 0:{location:U,value:{..._,data:Ue}}}else{const Ue=Ke.onPaste?.(He,_,{formatted:ie,formattedString:typeof ie=="string"?ie:ie?.join(`
|
|
184
184
|
`),rawValue:J});return Ue===void 0?void 0:(Fn(Ue.kind===_.kind),{location:U,value:Ue})}}}const F=X.columns,V=X.rows,W=Nt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0;let q;if(X.current!==void 0?q=[X.current.range.x,X.current.range.y]:F.length===1?q=[F.first()??0,0]:V.length===1&&(q=[j,V.first()??0]),W&&q!==void 0){let _,U;const J="text/plain",ie="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const Xe of Ue){if(Xe.types.includes(ie)){const et=await(await Xe.getType(ie)).text(),vt=cu(et);if(vt!==void 0){_=vt;break}}Xe.types.includes(J)&&(U=await(await Xe.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(b!==void 0&&b?.clipboardData!==null){if(b.clipboardData.types.includes(ie)){const Ue=b.clipboardData.getData(ie);_=cu(Ue)}_===void 0&&b.clipboardData.types.includes(J)&&(U=b.clipboardData.getData(J))}else return;const[He,It]=q,Ke=[];do{if(Ae===void 0){const Ue=Hn(q),Xe=U??_?.map(vt=>vt.map(en=>en.rawValue).join(" ")).join(" ")??"",et=A(Ue,q,Xe,void 0);et!==void 0&&Ke.push(et);break}if(_===void 0){if(U===void 0)return;_=Ib(U)}if(Ae===!1||typeof Ae=="function"&&Ae?.([q[0]-j,q[1]],_.map(Ue=>Ue.map(Xe=>Xe.rawValue?.toString()??"")))!==!0)return;for(const[Ue,Xe]of _.entries()){if(Ue+It>=$e)break;for(const[et,vt]of Xe.entries()){const en=[et+He,Ue+It],[bo,Gi]=en;if(bo>=lt.length||Gi>=wn)continue;const Uo=Hn(en),ar=A(Uo,en,vt.rawValue,vt.formatted);ar!==void 0&&Ke.push(ar)}}}while(!1);Bn(Ke),bn.current?.damage(Ke.map(Ue=>({cell:Ue.location})))}},[S,Qt,Hn,X,rr.paste,Nt,lt.length,Bn,wn,Ae,j,$e]);Mn("paste",el,h,!1,!0);const Go=d.useCallback(async(b,A)=>{if(!rr.copy)return;const F=A===!0||Nt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0,V=X.columns,W=X.rows,q=(_,U)=>{if(!Ze)du(_,U,b);else{const J=U.map(ie=>({kind:Z.Text,data:y[ie].title,displayData:y[ie].title,allowOverlay:!1}));du([J,..._],U,b)}};if(F&&te!==void 0){if(X.current!==void 0){let _=te(X.current.range,$.current.signal);typeof _!="object"&&(_=await _()),q(_,Tr(X.current.range.x-j,X.current.range.x+X.current.range.width-j))}else if(W!==void 0&&W.length>0){const _=[...W].map(U=>{const J=te({x:j,y:U,width:y.length,height:1},$.current.signal);return typeof J=="object"?J[0]:J().then(ie=>ie[0])});if(_.some(U=>U instanceof Promise)){const U=await Promise.all(_);q(U,Tr(y.length))}else q(_,Tr(y.length))}else if(V.length>0){const _=[],U=[];for(const J of V){let ie=te({x:J,y:0,width:1,height:$e},$.current.signal);typeof ie!="object"&&(ie=await ie()),_.push(ie),U.push(J-j)}if(_.length===1)q(_[0],U);else{const J=_.reduce((ie,He)=>ie.map((It,Ke)=>[...It,...He[Ke]]));q(J,U)}}}},[y,te,X,rr.copy,j,Nt,$e,Ze]);Mn("copy",Go,h,!1,!1);const Kf=d.useCallback(async b=>{if(!(!rr.cut||!(Nt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0))&&(await Go(b),X.current!==void 0)){let A={current:{cell:X.current.cell,range:X.current.range,rangeStack:[]},rows:Ye.empty(),columns:Ye.empty()};const F=Gt?.(A);if(F===!1||(A=F===!0?A:F,A.current===void 0))return;Br(A.current.range)}},[Br,X,rr.cut,Go,Nt,Gt]);Mn("cut",Kf,h,!1,!1);const Zf=d.useCallback((b,A)=>{if(he!==void 0){j!==0&&(b=b.map(W=>[W[0]-j,W[1]])),he(b,A);return}if(b.length===0||A===-1)return;const[F,V]=b[A];u.current!==void 0&&u.current[0]===F&&u.current[1]===V||(u.current=[F,V],kr(F,V,!1,!1))},[he,j,kr]),[Ni,Wi]=St?.current?.cell??[],ji=d.useRef(Ut);ji.current=Ut,d.useLayoutEffect(()=>{Ja.current&&!or.current&&Ni!==void 0&&Wi!==void 0&&(Ni!==ue.current?.current?.cell[0]||Wi!==ue.current?.current?.cell[1])&&ji.current(Ni,Wi),or.current=!1},[Ni,Wi]);const ic=X.current!==void 0&&(X.current.cell[0]>=lt.length||X.current.cell[1]>=wn);d.useLayoutEffect(()=>{ic&&fe(ea,!1)},[ic,fe]);const Yf=d.useMemo(()=>zt===!0&&Re?.tint===!0?Ye.fromSingleSelection(wn-1):Ye.empty(),[wn,zt,Re?.tint]),Qf=d.useCallback(b=>typeof rn=="boolean"?rn:rn?.(b-j)??!0,[j,rn]),Jf=d.useMemo(()=>{if(Xa===void 0||l.current===null)return null;const{bounds:b,group:A}=Xa,F=l.current.getBoundingClientRect();return d.createElement(gb,{bounds:b,group:A,canvasBounds:F,onClose:()=>qa(void 0),onFinish:V=>{qa(void 0),pe?.(A,V)}})},[pe,Xa]),ep=Math.min(lt.length,Ie+(kn?1:0));d.useImperativeHandle(t,()=>({appendRow:(b,A)=>xr(b+j,A),appendColumn:(b,A)=>$i(b,A),updateCells:b=>(j!==0&&(b=b.map(A=>({cell:[A.cell[0]+j,A.cell[1]]}))),bn.current?.damage(b)),getBounds:(b,A)=>{if(!(l?.current===null||Nt?.current===null)){if(b===void 0&&A===void 0){const F=l.current.getBoundingClientRect(),V=F.width/Nt.current.clientWidth;return{x:F.x-Nt.current.scrollLeft*V,y:F.y-Nt.current.scrollTop*V,width:Nt.current.scrollWidth*V,height:Nt.current.scrollHeight*V}}return bn.current?.getBounds((b??0)+j,A)}},focus:()=>bn.current?.focus(),emit:async b=>{switch(b){case"delete":jo({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":jo({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":jo({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 Go(void 0,!0);break;case"paste":await el();break}},scrollTo:Ut,remeasureColumns:b=>{for(const A of b)Vi(A+j)},getMouseArgsForPosition:(b,A,F)=>{if(bn?.current===null)return;const V=bn.current.getMouseArgsForPosition(b,A,F);if(V!==void 0)return{...V,location:[V.location[0]-j,V.location[1]]}}}),[xr,$i,Vi,Nt,Go,jo,el,j,Ut]);const[ac,lc]=vo??[],tp=d.useCallback(b=>{const[A,F]=b;if(F===-1){re!=="none"&&(Ge(Ye.fromSingleSelection(A),void 0,!1),Sn());return}ac===A&&lc===F||(xt({cell:b,range:{x:A,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),Ut(A,F))},[re,Sn,Ut,ac,lc,xt,Ge]),[np,rp]=d.useState(!1),sc=d.useRef(Ad(b=>{rp(b)},5)),op=d.useCallback(()=>{sc.current(!0),X.current===void 0&&X.columns.length===0&&X.rows.length===0&&s===void 0&&xt({cell:[j,Li],range:{x:j,y:Li,width:1,height:1}},!0,!1,"keyboard-select")},[Li,X,s,j,xt]),ip=d.useCallback(()=>{sc.current(!1)},[]),[ap,lp]=d.useMemo(()=>{let b;const A=pt?.scrollbarWidthOverride??$l(),F=$e+(zt?1:0);if(typeof nr=="number")b=vn+F*nr;else{let W=0;const q=Math.min(F,10);for(let _=0;_<q;_++)W+=nr(_);W=Math.floor(W/q),b=vn+F*W}b+=A;const V=lt.reduce((W,q)=>q.width+W,0)+A;return[`${Math.min(1e5,V)}px`,`${Math.min(1e5,b)}px`]},[lt,pt?.scrollbarWidthOverride,nr,$e,zt,vn]),sp=d.useMemo(()=>L0(st),[st]);return d.createElement(lh.Provider,{value:st},d.createElement(Ob,{style:sp,className:Y,inWidth:m??ap,inHeight:w??lp},d.createElement(db,{fillHandle:Pt,drawFocusRing:Fo,experimental:pt,fixedShadowX:xn,fixedShadowY:er,getRowThemeOverride:Ar,headerIcons:tr,imageWindowLoader:B,initialSize:_e,isDraggable:Ne,onDragLeave:Tt,onRowMoved:an,overscrollX:$a,overscrollY:Va,preventDiagonalScrolling:gn,rightElement:Bt,rightElementProps:En,smoothScrollX:Lo,smoothScrollY:no,className:Y,enableGroups:Vn,onCanvasFocused:op,onCanvasBlur:ip,canvasRef:l,onContextMenu:qf,theme:st,cellXOffset:Pf,cellYOffset:Li,accessibilityHeight:pr.height,onDragEnd:jf,columns:lt,nonGrowWidth:Ht,drawHeader:gt,onColumnProposeMove:Bf,drawCell:un,disabledRows:Yf,freezeColumns:ep,lockColumns:j,firstColAccessible:j===0,getCellContent:Hn,minColumnWidth:yr,maxColumnWidth:ao,searchInputRef:a,showSearch:co,onSearchClose:Ba,highlightRegions:Hf,getCellsForSelection:te,getGroupDetails:Wa,headerHeight:$o,isFocused:np,groupHeaderHeight:Vn?lo:0,freezeTrailingRows:dt+(zt&&Re?.sticky===!0?1:0),hasAppendRow:zt,onColumnResize:je,onColumnResizeEnd:ke,onColumnResizeStart:qe,onCellFocused:tp,onColumnMoved:Nf,onDragStart:Wf,onHeaderMenuClick:_f,onHeaderIndicatorClick:$f,onItemHovered:Qa,isFilling:s?.fillHandle===!0,onMouseMove:zf,onKeyDown:jo,onKeyUp:le,onMouseDown:Lf,onMouseUp:Ff,onDragOverCell:Pn,onDrop:on,onSearchResultsChanged:Zf,onVisibleRegionChanged:Vf,clientSize:Vt,rowHeight:nr,searchResults:se,searchValue:P,onSearchValueChange:z,rows:wn,scrollRef:Nt,selection:X,translateX:pr.tx,translateY:pr.ty,verticalBorder:Qf,gridRef:bn,getCellRenderer:Qt,resizeIndicator:jt}),Jf,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(Bb,{...o,validateCell:Ee,bloom:T,id:Xf,getCellRenderer:Qt,className:pt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:pn,imageEditorOverride:g,portalElementRef:Ao,onFinishEditing:Uf,markdownDivCreateNode:p,isOutsideClick:Tn,customEventTarget:pt?.eventTarget}))))},Gb=d.forwardRef(jb);function pu(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:a,height:l,x:s,y:c}=o,u=t.maxSize??i.checkboxMaxSize,h=Math.floor(o.y+l/2),g=_d(u,l,i.cellVerticalPadding),f=zd(t.contentAlign??"center",s,a,i.cellHorizontalPadding,g),p=Fd(f,h,g),m=$d(s+n,c+r,p);return as(t)&&m}const Ub={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Xb(e,e.cell.data,as(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{pu(e)&&e.preventDefault()},onClick:e=>{if(pu(e))return{...e.cell,data:Ch(e.cell.data)}},onPaste:(e,t)=>{let n=pa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=is),n===t.data?void 0:{...t,data:n}}};function Xb(e,t,n,r,o){if(!n&&t===pa)return;const{ctx:i,hoverAmount:a,theme:l,rect:s,highlighted:c,hoverX:u,hoverY:h,cell:{contentAlign:g}}=e,{x:f,y:p,width:m,height:w}=s;let y=!1;if(o>0){let v=n?1-o+o*a:.4;if(t===pa&&(v*=a),v===0)return;v<1&&(y=!0,i.globalAlpha=v)}Cs(i,l,t,f,p,m,w,c,u,h,r,g),y&&(i.globalAlpha=1)}const qb=sn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Kb=e=>{const{bubbles:t}=e;return d.createElement(qb,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Zb={getAccessibilityString:e=>Vd(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>Yb(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Kb,{bubbles:t.data})},onPaste:()=>{}};function Yb(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:a,y:l,width:s,height:c}=n;let u=a+r.cellHorizontalPadding;const h=[];for(const g of t){if(u>a+s)break;const f=Dr(g,o,r.baseFontFull).width;h.push({x:u,width:f}),u+=f+r.bubblePadding*2+r.bubbleMargin}o.beginPath();for(const g of h)Yn(o,g.x,l+(c-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);o.fillStyle=i?r.bgBubbleSelected:r.bgBubble,o.fill();for(const[g,f]of h.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[g],f.x+r.bubblePadding,l+c/2+Jn(o,r))}const Qb=sn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Jb=e=>{const{drilldowns:t}=e;return d.createElement(Qb,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},e1={getAccessibilityString:e=>Vd(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+n.bubblePadding*2+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>n1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Jb,{drilldowns:t.data})},onPaste:()=>{}},Cl={};function t1(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,l=4,s=n*o,c=r+i,u=r*3,h=(u+i*2)*o,g=`${e},${t},${o},${n}`;if(Cl[g]!==void 0)return{el:Cl[g],height:s,width:h,middleWidth:l*o,sideWidth:c*o,padding:i*o,dpr:o};const f=document.createElement("canvas"),p=f.getContext("2d");return p===null?null:(f.width=h,f.height=s,p.scale(o,o),Cl[g]=f,p.beginPath(),Yn(p,i,i,u,a,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),Yn(p,i+.5,i+.5,u,a,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:f,height:s,width:h,sideWidth:c*o,middleWidth:r*o,padding:i*o,dpr:o})}function n1(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:a,row:l}=e,{x:s,width:c}=n,u=r.baseFontFull,h=bs(o,u),g=Math.min(n.height,Math.max(16,Math.ceil(h*r.lineHeight)*2)),f=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,w=r.bubbleMargin;let y=s+r.cellHorizontalPadding;const v=r.roundingRadius??6,C=t1(r.bgCell,r.drilldownBorder,g,v),R=[];for(const E of t){if(y>s+c)break;const M=Dr(E.text,o,u).width;let H=0;E.img!==void 0&&i.loadOrGetImage(E.img,a,l)!==void 0&&(H=p-8+4);const S=M+H+m*2;R.push({x:y,width:S}),y+=S+w}if(C!==null){const{el:E,height:M,middleWidth:H,sideWidth:S,width:x,dpr:L,padding:T}=C,I=S/L,O=T/L;for(const D of R){const k=Math.floor(D.x),Q=Math.floor(D.width),N=Q-(I-O)*2;o.imageSmoothingEnabled=!1,o.drawImage(E,0,0,S,M,k-O,f,I,g),N>0&&o.drawImage(E,S,0,H,M,k+(I-O),f,N,g),o.drawImage(E,x-S,0,S,M,k+Q-(I-O),f,I,g),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[E,M]of R.entries()){const H=t[E];let S=M.x+m;if(H.img!==void 0){const x=i.loadOrGetImage(H.img,a,l);if(x!==void 0){const L=p-8;let T=0,I=0,O=x.width,D=x.height;O>D?(T+=(O-D)/2,O=D):D>O&&(I+=(D-O)/2,D=O),o.beginPath(),Yn(o,S,f+g/2-L/2,L,L,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(x,T,I,O,D,S,f+g/2-L/2,L,L),o.restore(),S+=L+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(H.text,S,f+g/2+Jn(o,r))}}const r1={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>o1(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??Em;return d.createElement(o,{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(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(n.length===t.data.length&&n.every((r,o)=>r===t.data[o])))return{...t,data:n}}},kl=4;function o1(e,t,n,r){const{rect:o,col:i,row:a,theme:l,ctx:s,imageLoader:c}=e,{x:u,y:h,height:g,width:f}=o,p=g-l.cellVerticalPadding*2,m=[];let w=0;for(let v=0;v<t.length;v++){const C=t[v];if(C.length===0)continue;const R=c.loadOrGetImage(C,i,a);if(R!==void 0){m[v]=R;const E=R.width*(p/R.height);w+=E+kl}}if(w===0)return;w-=kl;let y=u+l.cellHorizontalPadding;r==="right"?y=Math.floor(u+f-l.cellHorizontalPadding-w):r==="center"&&(y=Math.floor(u+f/2-w/2));for(const v of m){if(v===void 0)continue;const C=v.width*(p/v.height);n>0&&(s.beginPath(),Yn(s,y,h+l.cellVerticalPadding,C,p,n),s.save(),s.clip()),s.drawImage(v,y,h+l.cellVerticalPadding,C,p),n>0&&s.restore(),y+=C+kl}}function i1(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const a1={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(i1(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=i.width&&(l=i.width-s*2-1);const c=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);Yn(o,i.x+s,i.y+(i.height-c)/2,l,c,a.roundingRadius??3),o.fillStyle=Yr(a.textDark,.1),o.fill()},onPaste:()=>{}},l1=()=>e=>e.targetWidth,gu=sn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[l1(),"px"]}}),s1=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:a,validatedSelection:l}=e,s=t.data,c=t.readonly===!0,[u,h]=d.useState(s===""||r),g=d.useCallback(()=>{h(p=>!p)},[]),f=s?"gdg-ml-6":"";return u?d.createElement(gu,{targetWidth:i.width-20},d.createElement(eo,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>a(t)},d.createElement(xm,null))):d.createElement(gu,{targetWidth:i.width},d.createElement(c0,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:g},d.createElement(ss,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},c1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Ei,measure:(e,t,n)=>{const r=t.data.split(`
|
|
185
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>lr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return d.createElement(s1,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},u1={getAccessibilityString:e=>e.row.toString(),kind:Wn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:d1,measure:()=>44,draw:e=>f1(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function d1(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return i?.font!==o&&(n.font=o,i.font=o),i.deprep=h1,n.textAlign="center",i}function h1(e){const{ctx:t}=e;t.textAlign="start"}function f1(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:h,width:g,height:f}=l,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){a.globalAlpha=p;const m=7*(n?s:1);if(Cs(a,c,n,o?u+m:u,h,o?g-m:g,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){a.globalAlpha=s,a.beginPath();for(const w of[3,6])for(const y of[-5,-1,3])a.rect(u+w,h+f/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=c.markerFontFull,y=u+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=w,a.fillText(m,y,h+f/2+Jn(a,w)),s!==0&&(a.globalAlpha=1)}}const p1={getAccessibilityString:()=>"",kind:Wn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>g1(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function g1(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let f=0;if(n!==void 0){const p=h-8,m=s+8/2,w=c+8/2;l.drawSprite(n,"normal",r,m,w,p,a,g?1:i),f=p}else{f=24;const p=12,m=g?p:i*p,w=g?0:(1-i)*p*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+w,c+h/2),r.lineTo(s+y+w+m,c+h/2),r.moveTo(s+y+w+m*.5,c+h/2-m*.5),r.lineTo(s+y+w+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,c+h/2+Jn(r,a)),r.beginPath()}function Mh(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=m1(e,o,r,t,n?.fullSize??!1);e.beginPath(),Yn(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Yr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a?.("text")}function m1(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const v1=d.lazy(async()=>await ns(()=>import("./number-overlay-editor-
|
|
185
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>lr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return d.createElement(s1,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},u1={getAccessibilityString:e=>e.row.toString(),kind:Wn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:d1,measure:()=>44,draw:e=>f1(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function d1(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return i?.font!==o&&(n.font=o,i.font=o),i.deprep=h1,n.textAlign="center",i}function h1(e){const{ctx:t}=e;t.textAlign="start"}function f1(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:h,width:g,height:f}=l,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){a.globalAlpha=p;const m=7*(n?s:1);if(Cs(a,c,n,o?u+m:u,h,o?g-m:g,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){a.globalAlpha=s,a.beginPath();for(const w of[3,6])for(const y of[-5,-1,3])a.rect(u+w,h+f/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=c.markerFontFull,y=u+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=w,a.fillText(m,y,h+f/2+Jn(a,w)),s!==0&&(a.globalAlpha=1)}}const p1={getAccessibilityString:()=>"",kind:Wn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>g1(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function g1(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let f=0;if(n!==void 0){const p=h-8,m=s+8/2,w=c+8/2;l.drawSprite(n,"normal",r,m,w,p,a,g?1:i),f=p}else{f=24;const p=12,m=g?p:i*p,w=g?0:(1-i)*p*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+w,c+h/2),r.lineTo(s+y+w+m,c+h/2),r.moveTo(s+y+w+m*.5,c+h/2-m*.5),r.lineTo(s+y+w+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,c+h/2+Jn(r,a)),r.beginPath()}function Mh(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=m1(e,o,r,t,n?.fullSize??!1);e.beginPath(),Yn(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Yr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a?.("text")}function m1(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const v1=d.lazy(async()=>await ns(()=>import("./number-overlay-editor-C2e7pY6x-BnC-vP7l.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]))),b1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Ei,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:c}=n;l===!0&&t>0&&Mh(r,o,c,s,i,t,a),lr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(v1,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},w1={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:y1,onPaste:()=>{}};function y1(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:a}=r;t.beginPath();const l=2.5;let s=o+n.cellHorizontalPadding+l;const c=i+a/2,u=Math.cos(Fc(30))*l,h=Math.sin(Fc(30))*l;for(let g=0;g<12;g++)t.moveTo(s,c-l),t.lineTo(s,c+l),t.moveTo(s+u,c-h),t.lineTo(s-u,c+h),t.moveTo(s-u,c-h),t.lineTo(s+u,c+h),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const x1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Ei(e,t,e.theme.textLight),draw:e=>lr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return kt.createElement(eo,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},C1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Ei,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:c,hoverEffect:u,allowWrapping:h,hoverEffectTheme:g}=t;u===!0&&n>0&&Mh(o,a,g,s,i,n,l),lr(e,s,c,h,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
|
186
186
|
`,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(eo,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:a=>r({...o,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},k1=sn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),S1=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:a}=e,[l,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return l?d.createElement(eo,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(k1,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(ss,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Ih(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?o=t.width-a-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-a/2),{x:o,y:i,width:a,height:l}}function mu(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=th(a,i.baseFontFull);if(l===void 0)return!1;const s=Ih(l,n,i,t.contentAlign);return Kr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const M1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Ei,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:a,ctx:l}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const u=Dr(s,l,n.baseFontFull),h=Ih(u,a,n,t.contentAlign),{x:g,y:f,width:p,height:m}=h;if(o>=g-4&&o<=g-4+p+8&&i>=f-4&&i<=f-4+m+8){const w=Jn(l,n.baseFontFull);r("pointer");const y=5,v=f-w;l.beginPath(),l.moveTo(a.x+g,Math.floor(a.y+v+m+y)+.5),l.lineTo(a.x+g+p,Math.floor(a.y+v+m+y)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,lr({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=c?n.linkColor:n.textDark,lr(e,s,t.contentAlign)},onSelect:e=>{mu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;mu(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(S1,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},I1=[u1,p1,Ub,Zb,e1,r1,a1,c1,b1,w1,x1,C1,M1];var Sl,vu;function R1(){if(vu)return Sl;vu=1;var e=Ld(),t=ud(),n="Expected a function";function r(o,i,a){var l=!0,s=!0;if(typeof o!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(o,i,{leading:l,maxWait:i,trailing:s})}return Sl=r,Sl}var E1=R1();const T1=vr(E1),Ml=[];class O1 extends oh{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=T1(()=>{this.imageLoaded(new mi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let o=!1;for(let i=0;i<r.cells.length;i++){const a=r.cells[i];if(this.isInWindow(a)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,o){let i=!1;const a=Ml.pop()??new Image;let l=!1;const s={img:void 0,cells:[Zn(n,r)],url:t,cancel:()=>{l||(l=!0,Ml.length<12?Ml.unshift(a):i||(a.src=""))}},c=new Promise(u=>a.addEventListener("load",()=>u(null)));requestAnimationFrame(async()=>{try{a.src=t,await c,await a.decode();const u=this.cache[o];if(u!==void 0&&!l){u.img=a;for(const h of u.cells)this.loadedLocations.push(xs(h));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[o]=s}loadOrGetImage(t,n,r){const o=t,i=this.cache[o];if(i!==void 0){const a=Zn(n,r);return i.cells.includes(a)||i.cells.push(a),i.img}else this.loadImage(t,n,r,o)}}const D1=(e,t)=>{const n=d.useMemo(()=>({...xv,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??I1,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new O1,[e.imageWindowLoader]);return d.createElement(Gb,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})},P1=d.forwardRef(D1);function bu(e,t){const n=d.useRef(null),r=d.useRef(),o=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>o,[o]),{debouncedCallback:d.useCallback((...i)=>{r.current=i,o(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,o]),cancel:o}}var H1=up();const L1=vr(H1);var ql={exports:{}},A1=ql.exports,wu;function F1(){return wu||(wu=1,(function(e,t){(function(n,r){try{e.exports=r(hp)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(A1,function(n){var r=!1,o=!1,i=!1,a=!1,l="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function c(z,P){return P.length>z.length?!1:z.indexOf(P)!==-1}function u(z){for(var P="";z;)P+="0",z-=1;return P}function h(z){for(var P=z.split("").reverse(),G=0,le=!0;le&&G<P.length;)G?P[G]==="9"?P[G]="0":(P[G]=(parseInt(P[G],10)+1).toString(),le=!1):(parseInt(P[G],10)<5&&(le=!1),P[G]="0"),G+=1;return le&&P.push("1"),P.reverse().join("")}function g(z,P){var G=H(k(P).sort(),function(ce){return ce+":"+P[ce]}).join(","),le=z+"+"+G;return g.cache[le]||(g.cache[le]=Intl.NumberFormat(z,P)),g.cache[le]}g.cache={};function f(z,P,G){var le=P.useToLocaleString,ce=P.useGrouping,we=ce&&P.grouping.slice(),ge=P.maximumSignificantDigits,Qe=P.minimumIntegerDigits||1,Se=P.fractionDigits||0,Dt=P.groupingSeparator,bt=P.decimalSeparator;if(le&&G){var Te={minimumIntegerDigits:Qe,useGrouping:ce};if(Se&&(Te.maximumFractionDigits=Se,Te.minimumFractionDigits=Se),ge&&z>0&&(Te.maximumSignificantDigits=ge),i){if(!a){var re=D({},P);re.useGrouping=!1,re.decimalSeparator=".",z=parseFloat(f(z,re),10)}return g(G,Te).format(z)}else{if(!o){var re=D({},P);re.useGrouping=!1,re.decimalSeparator=".",z=parseFloat(f(z,re),10)}return z.toLocaleString(G,Te)}}var me;ge?me=z.toPrecision(ge+1):me=z.toFixed(Se+1);var ye,ne,be,Oe=me.split("e");be=Oe[1]||"",Oe=Oe[0].split("."),ne=Oe[1]||"",ye=Oe[0]||"";var Pe=ye.length,it=ne.length,Ae=Pe+it,Ze=ye+ne;(ge&&Ae===ge+1||!ge&&it===Se+1)&&(Ze=h(Ze),Ze.length===Ae+1&&(Pe=Pe+1),it&&(Ze=Ze.slice(0,-1)),ye=Ze.slice(0,Pe),ne=Ze.slice(Pe)),ge&&(ne=ne.replace(/0*$/,""));var Ie=parseInt(be,10);Ie>0?ne.length<=Ie?(ne=ne+u(Ie-ne.length),ye=ye+ne,ne=""):(ye=ye+ne.slice(0,Ie),ne=ne.slice(Ie)):Ie<0&&(ne=u(Math.abs(Ie)-ye.length)+ye+ne,ye="0"),ge||(ne=ne.slice(0,Se),ne.length<Se&&(ne=ne+u(Se-ne.length)),ye.length<Qe&&(ye=u(Qe-ye.length)+ye));var Me="";if(ce){Oe=ye;for(var ze;Oe.length;)we.length&&(ze=we.shift()),Me&&(Me=Dt+Me),Me=Oe.slice(-ze)+Me,Oe=Oe.slice(0,-ze)}else Me=ye;return ne&&(Me=Me+bt+ne),Me}function p(z,P){return z.label.length>P.label.length?-1:z.label.length<P.label.length?1:0}function m(z,P){var G=[];return M(k(P),function(le){if(le.slice(0,15)==="_durationLabels"){var ce=le.slice(15).toLowerCase();M(k(P[le]),function(we){we.slice(0,1)===z&&G.push({type:ce,key:we,label:P[le][we]})})}}),G}function w(z,P,G){return P===1&&G===null?z:z+z}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:w};function v(z){return Object.prototype.toString.call(z)==="[object Array]"}function C(z){return Object.prototype.toString.call(z)==="[object Object]"}function R(z,P){for(var G=z.length;G-=1;)if(P(z[G]))return z[G]}function E(z,P){var G=0,le=z&&z.length||0,ce;for(typeof P!="function"&&(ce=P,P=function(we){return we===ce});G<le;){if(P(z[G]))return z[G];G+=1}}function M(z,P){var G=0,le=z.length;if(!(!z||!le))for(;G<le;){if(P(z[G],G)===!1)return;G+=1}}function H(z,P){var G=0,le=z.length,ce=[];if(!z||!le)return ce;for(;G<le;)ce[G]=P(z[G],G),G+=1;return ce}function S(z,P){return H(z,function(G){return G[P]})}function x(z){var P=[];return M(z,function(G){G&&P.push(G)}),P}function L(z){var P=[];return M(z,function(G){E(P,G)||P.push(G)}),P}function T(z,P){var G=[];return M(z,function(le){M(P,function(ce){le===ce&&G.push(le)})}),L(G)}function I(z,P){var G=[];return M(z,function(le,ce){if(!P(le))return G=z.slice(ce),!1}),G}function O(z,P){var G=z.slice().reverse();return I(G,P).reverse()}function D(z,P){for(var G in P)P.hasOwnProperty(G)&&(z[G]=P[G]);return z}function k(z){var P=[];for(var G in z)z.hasOwnProperty(G)&&P.push(G);return P}function Q(z,P){var G=0,le=z.length;if(!z||!le)return!1;for(;G<le;){if(P(z[G],G)===!0)return!0;G+=1}return!1}function N(z){var P=[];return M(z,function(G){P=P.concat(G)}),P}function Y(){var z=0;try{z.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function ae(z){return z(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(z){var P=!0;return P=P&&z(1,"en",{minimumIntegerDigits:1})==="1",P=P&&z(1,"en",{minimumIntegerDigits:2})==="01",P=P&&z(1,"en",{minimumIntegerDigits:3})==="001",!(!P||(P=P&&z(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",P=P&&z(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",P=P&&z(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",P=P&&z(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!P)||(P=P&&z(99.99,"en",{maximumSignificantDigits:1})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:2})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:3})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:4})==="99.99",P=P&&z(99.99,"en",{maximumSignificantDigits:5})==="99.99",!P)||(P=P&&z(1e3,"en",{useGrouping:!0})==="1,000",P=P&&z(1e3,"en",{useGrouping:!1})==="1000",!P))}function K(){var z=[].slice.call(arguments),P={},G;if(M(z,function(ge,Qe){if(!Qe){if(!v(ge))throw"Expected array as the first argument to durationsFormat.";G=ge}if(typeof ge=="string"||typeof ge=="function"){P.template=ge;return}if(typeof ge=="number"){P.precision=ge;return}C(ge)&&D(P,ge)}),!G||!G.length)return[];P.returnMomentTypes=!0;var le=H(G,function(ge){return ge.format(P)}),ce=T(l,L(S(N(le),"type"))),we=P.largest;return we&&(ce=ce.slice(0,we)),P.returnMomentTypes=!1,P.outputTypes=ce,H(G,function(ge){return ge.format(P)})}function pe(){var z=[].slice.call(arguments),P=D({},this.format.defaults),G=this.asMilliseconds(),le=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,le=0);var ce=G<0,we=n.duration(Math.abs(G),"milliseconds"),ge=n.duration(Math.abs(le),"months");M(z,function(B){if(typeof B=="string"||typeof B=="function"){P.template=B;return}if(typeof B=="number"){P.precision=B;return}C(B)&&D(P,B)});var Qe={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Se={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=l;var Dt=function(B){return E(l,function(_e){return Se[_e].test(B)})},bt=new RegExp(H(l,function(B){return Se[B].source}).join("|"),"g");P.duration=this;var Te=typeof P.template=="function"?P.template.apply(P):P.template,re=P.outputTypes,me=P.returnMomentTypes,ye=P.largest,ne=[];re||(v(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&M(P.stopTrim.match(bt),function(B){var _e=Dt(B);_e==="escape"||_e==="general"||ne.push(_e)}));var be=n.localeData();be||(be={}),M(k(y),function(B){if(typeof y[B]=="function"){be[B]||(be[B]=y[B]);return}be["_"+B]||(be["_"+B]=y[B])}),M(k(be._durationTimeTemplates),function(B){Te=Te.replace("_"+B+"_",be._durationTimeTemplates[B])});var Oe=P.userLocale||n.locale(),Pe=P.useLeftUnits,it=P.usePlural,Ae=P.precision,Ze=P.forceLength,Ie=P.useGrouping,Me=P.trunc,ze=P.useSignificantDigits&&Ae>0,ct=ze?P.precision:0,Je=ct,We=P.minValue,ht=!1,Wt=P.maxValue,Et=!1,ut=P.useToLocaleString,qt=P.groupingSeparator,Kt=P.decimalSeparator,On=P.grouping;ut=ut&&(r||i);var St=P.trim;v(St)&&(St=St.join(" ")),St===null&&(ye||Wt||ze)&&(St="all"),(St===null||St===!0||St==="left"||St==="right")&&(St="large"),St===!1&&(St="");var ft=function(B){return B.test(St)},Dn=/large/,wt=/small/,cn=/both/,pn=/mid/,Re=/^all|[^sm]all/,dt=/final/,At=ye>0||Q([Dn,cn,Re],ft),dn=Q([wt,cn,Re],ft),$t=Q([pn,Re],ft),rn=Q([dt,Re],ft),Pn=H(Te.match(bt),function(B,_e){var Ne=Dt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ne!=="escape"&&Ne!=="general"&&ne.push(Ne)),{index:_e,length:B.length,text:"",token:Ne==="escape"?B.replace(Se.escape,"$1"):B,type:Ne==="escape"||Ne==="general"?null:Ne}}),on={index:0,length:0,token:"",text:"",type:null},Zt=[];Pe&&Pn.reverse(),M(Pn,function(B){if(B.type){(on.type||on.text)&&Zt.push(on),on=B;return}Pe?on.text=B.token+on.text:on.text+=B.token}),(on.type||on.text)&&Zt.push(on),Pe&&Zt.reverse();var Be=T(l,L(x(S(Zt,"type"))));if(!Be.length)return S(Zt,"text").join("");Be=H(Be,function(B,_e){var Ne=_e+1===Be.length,Tt=!_e,an;B==="years"||B==="months"?an=ge.as(B):an=we.as(B);var hn=Math.floor(an),Rn=an-hn,gn=E(Zt,function(Bt){return B===Bt.type});return Tt&&Wt&&an>Wt&&(Et=!0),Ne&&We&&Math.abs(P.duration.as(B))<We&&(ht=!0),Tt&&Ze===null&&gn.length>1&&(Ze=!0),we.subtract(hn,B),ge.subtract(hn,B),{rawValue:an,wholeValue:hn,decimalValue:Ne?Rn:0,isSmallest:Ne,isLargest:Tt,type:B,tokenLength:gn.length}});var yt=Me?Math.floor:Math.round,In=function(B,_e){var Ne=Math.pow(10,_e);return yt(B*Ne)/Ne},Pt=!1,pt=!1,xn=function(B,_e){var Ne={useGrouping:Ie,groupingSeparator:qt,decimalSeparator:Kt,grouping:On,useToLocaleString:ut};return ze&&(ct<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ne.maximumSignificantDigits=ct,B.significantDigits=ct)),Et&&!pt&&(B.isLargest?(B.wholeValue=Wt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),ht&&!pt&&(B.isSmallest?(B.wholeValue=We,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Ae<0?B.value=In(B.wholeValue,Ae):Ae===0?B.value=yt(B.wholeValue+B.decimalValue):ze?(Me?B.value=In(B.rawValue,ct-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ct-=B.wholeValue.toString().length)):(Ne.fractionDigits=Ae,Me?B.value=B.wholeValue+In(B.decimalValue,Ae):B.value=B.wholeValue+B.decimalValue):ze&&B.wholeValue?(B.value=Math.round(In(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ct-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Ze||Pt)&&(Ne.minimumIntegerDigits=B.tokenLength,pt&&Ne.maximumSignificantDigits<B.tokenLength&&delete Ne.maximumSignificantDigits),!Pt&&(B.value>0||St===""||E(ne,B.type)||E(re,B.type))&&(Pt=!0),B.formattedValue=f(B.value,Ne,Oe),Ne.useGrouping=!1,Ne.decimalSeparator=".",B.formattedValueEn=f(B.value,Ne,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=f(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Be=H(Be,xn),Be=x(Be),Be.length>1){var er=function(B){return E(Be,function(_e){return _e.type===B})},tr=function(B){var _e=er(B.type);_e&&M(B.targets,function(Ne){var Tt=er(Ne.type);Tt&&parseInt(_e.formattedValueEn,10)===Ne.value&&(_e.rawValue=0,_e.wholeValue=0,_e.decimalValue=0,Tt.rawValue+=1,Tt.wholeValue+=1,Tt.decimalValue=0,Tt.formattedValueEn=Tt.wholeValue.toString(),pt=!0)})};M(s,tr)}return pt&&(Pt=!1,ct=Je,Be=H(Be,xn),Be=x(Be)),re&&!(Et&&!P.trim)?(Be=H(Be,function(B){return E(re,function(_e){return B.type===_e})?B:null}),Be=x(Be)):(At&&(Be=I(Be,function(B){return!B.isSmallest&&!B.wholeValue&&!E(ne,B.type)})),ye&&Be.length&&(Be=Be.slice(0,ye)),dn&&Be.length>1&&(Be=O(Be,function(B){return!B.wholeValue&&!E(ne,B.type)&&!B.isLargest})),$t&&(Be=H(Be,function(B,_e){return _e>0&&_e<Be.length-1&&!B.wholeValue?null:B}),Be=x(Be)),rn&&Be.length===1&&!Be[0].wholeValue&&!(!Me&&Be[0].isSmallest&&Be[0].rawValue<We)&&(Be=[])),me?Be:(M(Zt,function(B){var _e=Qe[B.type],Ne=E(Be,function(Bt){return Bt.type===B.type});if(!(!_e||!Ne)){var Tt=Ne.formattedValueEn.split(".");Tt[0]=parseInt(Tt[0],10),Tt[1]?Tt[1]=parseFloat("0."+Tt[1],10):Tt[1]=null;var an=be.durationPluralKey(_e,Tt[0],Tt[1]),hn=m(_e,be),Rn=!1,gn={};M(be._durationLabelTypes,function(Bt){var En=E(hn,function(Cn){return Cn.type===Bt.type&&Cn.key===an});En&&(gn[En.type]=En.label,c(B.text,Bt.string)&&(B.text=B.text.replace(Bt.string,En.label),Rn=!0))}),it&&!Rn&&(hn.sort(p),M(hn,function(Bt){if(gn[Bt.type]===Bt.label)return c(B.text,Bt.label)?!1:void 0;if(c(B.text,Bt.label))return B.text=B.text.replace(Bt.label,gn[Bt.type]),!1}))}}),Zt=H(Zt,function(B){if(!B.type)return B.text;var _e=E(Be,function(Tt){return Tt.type===B.type});if(!_e)return"";var Ne="";return Pe&&(Ne+=B.text),(ce&&Et||!ce&&ht)&&(Ne+="< ",Et=!1,ht=!1),(ce&&ht||!ce&&Et)&&(Ne+="> ",Et=!1,ht=!1),ce&&(_e.value>0||St===""||E(ne,_e.type)||E(re,_e.type))&&(Ne+="-",ce=!1),B.type==="milliseconds"&&_e.formattedValueMS?Ne+=_e.formattedValueMS:Ne+=_e.formattedValue,Pe||(Ne+=B.text),Ne}),Zt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function oe(){var z=this.duration,P=function(ce){return z._data[ce]},G=E(this.types,P),le=R(this.types,P);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===le)return"d __";case"weeks":return G===le?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===le)return"M __";case"years":return G===le?"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(z){if(!z)throw"Moment Duration Format init cannot find moment instance.";z.duration.format=K,z.duration.fn.format=pe,z.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:oe,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},z.updateLocale("en",y)}var he=function(z,P,G){return z.toLocaleString(P,G)};r=Y()&&ee(he),o=r&&ae(he);var se=function(z,P,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,G).format(z)};return i=ee(se),a=i&&ae(se),de(n),de})})(ql)),ql.exports}F1();const z1=["true","t","yes","y","on","1"],_1=["false","f","no","n","off","0"];function Mt(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Oo(e){return Object.hasOwn(e,"isError")&&e.isError}function $1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Ms(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Kl(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function V1(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Zl(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 Ho(e,t){return De(e)?t||{}:De(t)?e||{}:vd(e,t)}function Is(e){if(De(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,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:ot(n)):[ot(t)]}catch{return[ot(e)]}}function Rh(e){return typeof e=="string"||e instanceof String?!0:(e instanceof Np&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function B1(e){return e?.startsWith("{")&&e.endsWith("}")}function ot(e){try{try{return L1(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function Eh(e){if(De(e))return null;if(typeof e=="boolean")return e;const t=ot(e).toLowerCase().trim();if(t==="")return null;if(z1.includes(t))return!0;if(_1.includes(t))return!1}function xi(e){if(De(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=ci.unformat(e.trim());if(rt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Th(e){return De(e)?"":ot(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ka(e){if(De(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return ot(e)}}function N1(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 Gr(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function Sa(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":De(t)||t===""?rt(n)?(n===0&&(e=Math.round(e)),ci(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):ci(e).format({thousandSeparated:!1,mantissa:N1(e),trimMantissa:!0}):t==="plain"?ci(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Gr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Gr(e,{style:"percent",minimumFractionDigits:rt(n)?Math.max(n-2,0):0,maximumFractionDigits:rt(n)?Math.max(n-2,0):2}):t==="dollar"?Gr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Gr(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Gr(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Gr(e,{notation:t}):t==="accounting"?ci(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Gr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):_g.sprintf(t,e)}function yu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,o=n==="time"?void 0:"medium",i=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:o,timeStyle:i}).format(e.toDate())}catch(a){if(a instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:o,timeStyle:i}).format(e.toDate());throw a}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function ta(e){if(De(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Ur.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Ur.utc(e);if(n.isValid())return n.toDate();const r=Ur.utc(e,[Ur.HTML5_FMT.TIME_MS,Ur.HTML5_FMT.TIME_SECONDS,Ur.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Oh(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 W1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,o=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*o)/n}const j1=new RegExp(/(\r\n|\n|\r)/gm);function Ci(e){return e.indexOf(`
|
|
187
187
|
`)!==-1?e.replace(j1," "):e}function G1(e,t){if(De(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const U1=Qn("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"}}),""),Rs=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?nl.parse(e):nl.parse(nl.stringify(e))}catch{n=void 0}return De(n)?ve.jsx(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:ka(e)??"",onChange:()=>{}}):ve.jsx(U1,{"data-testid":"stJsonColumnViewer",children:ve.jsx(fp,{src:n,collapsed:2,theme:pp(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"}})})};d.memo(Rs);const X1=e=>{const t=e.theme,n=e.value.data;return ve.jsx(Rs,{jsonValue:n.value||n.displayValue,theme:t})},q1=e=>{const t=e.theme,n=e.value;return ve.jsx(Rs,{jsonValue:n.data,theme:t})},K1={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return vs(e,r??ka(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:o}=t.data,i=o??ka(r)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:X1})},Dh="line_chart",Z1="area_chart",Ph="bar_chart",Y1=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Es(e,t,n,r){const o=Ho({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),i=Y1(r);let a;o.color==="auto"||o.color==="auto-inverse"?a=r.colors.greenColor:a=o.color?i.get(o.color)??o.color:void 0;const l={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:a,yAxis:[o.y_min??0,o.y_max??1]}};return{...t,kind:e,typeIcon:e===Dh?":material/show_chart:":e===Ph?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(s){if(De(s))return Kl();const c=Is(s),u=[];let h=[];if(c.length===0)return Kl();let g=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER;for(let y=0;y<c.length;y++){const v=xi(c[y]);if(Number.isNaN(v)||De(v))return Mt(ot(c),`The value cannot be interpreted as a numeric array. ${ot(v)} is not a number.`);v>g&&(g=v),v<f&&(f=v),u.push(v)}let p,m;if(c.length===1){let y;g<=0?y=g===0?1:0:y=g,p=o.y_max??y,m=o.y_min??(g>=0?0:g)}else p=o.y_max??g,m=o.y_min??f;if(De(m)||De(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Mt("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);u.length>0&&(g>p||f<m)?h=u.map(y=>g-f===0?g>(p||1)?p:m:(p-m)*((y-f)/(g-f))+m):h=u;let w=a;return(o.color==="auto"&&h[0]>h[h.length-1]||o.color==="auto-inverse"&&h[0]<h[h.length-1])&&(w=r.colors.redColor),{...l,copyData:u.join(","),data:{...l.data,values:h,displayValues:u.map(y=>Sa(y)),yAxis:[m,p],color:w},isMissingValue:De(s)}},getCellValue(s){return s.kind===Z.Loading||s.data?.values===void 0?null:s.data?.values}}}function Hh(e,t){return Es(Dh,e,"line",t)}Hh.isEditableType=!1;function Lh(e,t){return Es(Ph,e,"bar",t)}Lh.isEditableType=!1;function Ah(e,t){return Es(Z1,e,"area",t)}Ah.isEditableType=!1;function Ts(e,t){const n={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(tn(t.radii.md),tn(t.radii.maxCheckbox)))},getCell(r){let o=null;return o=Eh(r),o===void 0?Mt(ot(r),"The value cannot be interpreted as boolean."):{...n,data:o,isMissingValue:De(o)}},getCellValue(r){return r.data===void 0?null:r.data}}}Ts.isEditableType=!0;function xu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function Os(e,t,n,r,o,i,a){const l=Ho({format:n,step:r,timezone:a},t.columnTypeOptions);let s;if(rt(l.timezone))try{s=xu(dc(),l.timezone)?.utcOffset()||void 0}catch{}let c;rt(l.min_value)&&(c=ta(l.min_value)||void 0);let u;rt(l.max_value)&&(u=ta(l.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:l.step?.toString()||"1",format:o,min:c,max:u}},g=f=>{const p=ta(f);return p===null?!t.isRequired:!(p===void 0||rt(c)&&i(p)<i(c)||rt(u)&&i(p)>i(u))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(f,p){if(p===!0){const C=g(f);if(C===!1)return Mt(ot(f),"Invalid input.");C instanceof Date&&(f=C)}const m=ta(f);let w="",y="",v=s;if(m===void 0)return Mt(ot(f),"The value cannot be interpreted as a datetime object.");if(m!==null){let C=dc.utc(m);if(!C.isValid())return Mt(ot(m),`Invalid moment date. This should never happen. Please report this bug.
|
|
188
188
|
Error: ${C.toString()}`);if(l.timezone){try{C=xu(C,l.timezone)}catch(R){return Mt(C.toISOString(),`Failed to adjust to the provided timezone: ${l.timezone}.
|
|
@@ -194,5 +194,5 @@ Error: ${i}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,content
|
|
|
194
194
|
40% { opacity: 1; }
|
|
195
195
|
`]))),ox=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return Le({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},El=function(e){var t=e.delay,n=e.offset;return Fe("span",{css:Vs({animation:"".concat(rx," 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"},"","")})},ix=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=ur(e,Ky);return Fe("div",Ve({},Xt(Le(Le({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Fe(El,{delay:0,offset:n}),Fe(El,{delay:160,offset:!0}),Fe(El,{delay:320,offset:!n}))},ax=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return Le({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},lx=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Fe("div",Ve({ref:o},Xt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},sx=lx,cx=["data"],ux=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},dx=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return Fe("div",Ve({},Xt(e,"group",{group:!0}),l),Fe(i,Ve({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),Fe("div",null,t))},hx=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return Le({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},fx=function(e){var t=tf(e);t.data;var n=ur(t,cx);return Fe("div",Ve({},Xt(e,"groupHeading",{"group-heading":!0}),n))},px=dx,gx=["innerRef","isDisabled","isHidden","inputClassName"],mx=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return Le(Le({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},vx),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},df={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},vx={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Le({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},df)},bx=function(e){return Le({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},df)},wx=function(e){var t=e.cx,n=e.value,r=tf(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=ur(r,gx);return Fe("div",Ve({},Xt(e,"input",{"input-container":!0}),{"data-value":n||""}),Fe("input",Ve({className:t({input:!0},l),ref:o,style:bx(a),disabled:i},s)))},yx=wx,xx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return Le({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},Cx=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return Le({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},kx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return Le({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},hf=function(e){var t=e.children,n=e.innerProps;return Fe("div",n,t)},Sx=hf,Mx=hf;function Ix(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({role:"button"},n),t||Fe(js,{size:14}))}var Rx=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return Fe(s,{data:r,innerProps:Le(Le({},Xt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},Fe(c,{data:r,innerProps:Le({},Xt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),Fe(u,{data:r,innerProps:Le(Le({},Xt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},Ex=Rx,Tx=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Le({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},Ox=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return Fe("div",Ve({},Xt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Dx=Ox,Px=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return Le({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Hx=function(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({},Xt(e,"placeholder",{placeholder:!0}),n),t)},Lx=Hx,Ax=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return Le({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Fx=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Fe("div",Ve({},Xt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},zx=Fx,Gs={ClearIndicator:ex,Control:sx,DropdownIndicator:Qy,DownChevron:cf,CrossIcon:js,Group:px,GroupHeading:fx,IndicatorsContainer:Xy,IndicatorSeparator:nx,Input:yx,LoadingIndicator:ix,Menu:Hy,MenuList:Ay,MenuPortal:By,LoadingMessage:$y,NoOptionsMessage:_y,MultiValue:Ex,MultiValueContainer:Sx,MultiValueLabel:Mx,MultiValueRemove:Ix,Option:Dx,Placeholder:Lx,SelectContainer:Wy,SingleValue:zx,ValueContainer:Gy},_x=function(e){return Le(Le({},Gs),e.components)},Bu=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function $x(e,t){return!!(e===t||Bu(e)&&Bu(t))}function Vx(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!$x(e[n],t[n]))return!1;return!0}function Bx(e,t){t===void 0&&(t=Vx);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var a=e.apply(this,o);return n={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){n=null},r}var Nx={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"},Wx=function(e){return Fe("span",Ve({css:Nx},e))},Nu=Wx,jx={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", 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,r=n===void 0?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(f,p){return f&&f.length?"".concat(f.indexOf(p)+1," of ").concat(f.length):""};if(t==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if(t==="menu"&&c){var h=l?" disabled":"",g="".concat(s?" selected":"").concat(h);return"".concat(i).concat(g,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Gx=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,s=e.id,c=e.isAppleDevice,u=l.ariaLiveMessages,h=l.getOptionLabel,g=l.inputValue,f=l.isMulti,p=l.isOptionDisabled,m=l.isSearchable,w=l.menuIsOpen,y=l.options,v=l.screenReaderStatus,C=l.tabSelectsValue,R=l.isLoading,E=l["aria-label"],M=l["aria-live"],H=d.useMemo(function(){return Le(Le({},jx),u||{})},[u]),S=d.useMemo(function(){var D="";if(t&&H.onChange){var k=t.option,Q=t.options,N=t.removedValue,Y=t.removedValues,ae=t.value,ee=function(se){return Array.isArray(se)?null:se},K=N||k||ee(ae),pe=K?h(K):"",oe=Q||Y||void 0,de=oe?oe.map(h):[],he=Le({isDisabled:K&&p(K,a),label:pe,labels:de},t);D=H.onChange(he)}return D},[t,H,p,a,h]),x=d.useMemo(function(){var D="",k=n||r,Q=!!(n&&a&&a.includes(n));if(k&&H.onFocus){var N={focused:k,label:h(k),isDisabled:p(k,a),isSelected:Q,options:o,context:k===n?"menu":"value",selectValue:a,isAppleDevice:c};D=H.onFocus(N)}return D},[n,r,h,p,H,o,a,c]),L=d.useMemo(function(){var D="";if(w&&y.length&&!R&&H.onFilter){var k=v({count:o.length});D=H.onFilter({inputValue:g,resultsMessage:k})}return D},[o,g,w,H,y,v,R]),T=t?.action==="initial-input-focus",I=d.useMemo(function(){var D="";if(H.guidance){var k=r?"value":w?"menu":"input";D=H.guidance({"aria-label":E,context:k,isDisabled:n&&p(n,a),isMulti:f,isSearchable:m,tabSelectsValue:C,isInitialFocus:T})}return D},[E,n,r,f,p,m,w,H,a,C,T]),O=Fe(d.Fragment,null,Fe("span",{id:"aria-selection"},S),Fe("span",{id:"aria-focused"},x),Fe("span",{id:"aria-results"},L),Fe("span",{id:"aria-guidance"},I));return Fe(d.Fragment,null,Fe(Nu,{id:s},T&&O),Fe(Nu,{"aria-live":M,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!T&&O))},Ux=Gx,ts=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Xx=new RegExp("["+ts.map(function(e){return e.letters}).join("")+"]","g"),ff={};for(var Tl=0;Tl<ts.length;Tl++)for(var Ol=ts[Tl],Dl=0;Dl<Ol.letters.length;Dl++)ff[Ol.letters[Dl]]=Ol.base;var pf=function(e){return e.replace(Xx,function(t){return ff[t]})},qx=Bx(pf),Wu=function(e){return e.replace(/^\s+|\s+$/g,"")},Kx=function(e){return"".concat(e.label," ").concat(e.value)},Zx=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=Le({ignoreCase:!0,ignoreAccents:!0,stringify:Kx,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,s=r.matchFrom,c=l?Wu(n):n,u=l?Wu(a(t)):a(t);return o&&(c=c.toLowerCase(),u=u.toLowerCase()),i&&(c=qx(c),u=pf(u)),s==="start"?u.substr(0,c.length)===c:u.indexOf(c)>-1}},Yx=["innerRef"];function Qx(e){var t=e.innerRef,n=ur(e,Yx),r=My(n,"onExited","in","enter","exit","appear");return Fe("input",Ve({ref:t},r,{css:Vs({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 Jx=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function eC(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,a=d.useRef(!1),l=d.useRef(!1),s=d.useRef(0),c=d.useRef(null),u=d.useCallback(function(w,y){if(c.current!==null){var v=c.current,C=v.scrollTop,R=v.scrollHeight,E=v.clientHeight,M=c.current,H=y>0,S=R-E-C,x=!1;S>y&&a.current&&(r&&r(w),a.current=!1),H&&l.current&&(i&&i(w),l.current=!1),H&&y>S?(n&&!a.current&&n(w),M.scrollTop=R,x=!0,a.current=!0):!H&&-y>C&&(o&&!l.current&&o(w),M.scrollTop=0,x=!0,l.current=!0),x&&Jx(w)}},[n,r,o,i]),h=d.useCallback(function(w){u(w,w.deltaY)},[u]),g=d.useCallback(function(w){s.current=w.changedTouches[0].clientY},[]),f=d.useCallback(function(w){var y=s.current-w.changedTouches[0].clientY;u(w,y)},[u]),p=d.useCallback(function(w){if(w){var y=Cy?{passive:!1}:!1;w.addEventListener("wheel",h,y),w.addEventListener("touchstart",g,y),w.addEventListener("touchmove",f,y)}},[f,g,h]),m=d.useCallback(function(w){w&&(w.removeEventListener("wheel",h,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",f,!1))},[f,g,h]);return d.useEffect(function(){if(t){var w=c.current;return p(w),function(){m(w)}}},[t,p,m]),function(w){c.current=w}}var ju=["boxSizing","height","overflow","paddingRight","position"],Gu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Uu(e){e.cancelable&&e.preventDefault()}function Xu(e){e.stopPropagation()}function qu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ku(){return"ontouchstart"in window||navigator.maxTouchPoints}var Zu=!!(typeof window<"u"&&window.document&&window.document.createElement),li=0,Co={capture:!1,passive:!1};function tC(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=d.useRef({}),i=d.useRef(null),a=d.useCallback(function(s){if(Zu){var c=document.body,u=c&&c.style;if(r&&ju.forEach(function(p){var m=u&&u[p];o.current[p]=m}),r&&li<1){var h=parseInt(o.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,f=window.innerWidth-g+h||0;Object.keys(Gu).forEach(function(p){var m=Gu[p];u&&(u[p]=m)}),u&&(u.paddingRight="".concat(f,"px"))}c&&Ku()&&(c.addEventListener("touchmove",Uu,Co),s&&(s.addEventListener("touchstart",qu,Co),s.addEventListener("touchmove",Xu,Co))),li+=1}},[r]),l=d.useCallback(function(s){if(Zu){var c=document.body,u=c&&c.style;li=Math.max(li-1,0),r&&li<1&&ju.forEach(function(h){var g=o.current[h];u&&(u[h]=g)}),c&&Ku()&&(c.removeEventListener("touchmove",Uu,Co),s&&(s.removeEventListener("touchstart",qu,Co),s.removeEventListener("touchmove",Xu,Co)))}},[r]);return d.useEffect(function(){if(t){var s=i.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){i.current=s}}var nC=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},rC={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oC(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,c=eC({isEnabled:o,onBottomArrive:i,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),u=tC({isEnabled:n}),h=function(g){c(g),u(g)};return Fe(d.Fragment,null,n&&Fe("div",{onClick:nC,css:rC}),t(h))}var iC={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},aC=function(e){var t=e.name,n=e.onFocus;return Fe("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:iC,value:"",onChange:function(){}})},lC=aC;function Us(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 sC(){return Us(/^iPhone/i)}function gf(){return Us(/^Mac/i)}function cC(){return Us(/^iPad/i)||gf()&&navigator.maxTouchPoints>1}function uC(){return sC()||cC()}function dC(){return gf()||uC()}var hC=function(e){return e.label},mf=function(e){return e.label},vf=function(e){return e.value},fC=function(e){return!!e.isDisabled},pC={clearIndicator:Jy,container:Ny,control:ax,dropdownIndicator:Yy,group:ux,groupHeading:hx,indicatorsContainer:Uy,indicatorSeparator:tx,input:mx,loadingIndicator:ox,loadingMessage:zy,menu:Oy,menuList:Ly,menuPortal:Vy,multiValue:xx,multiValueLabel:Cx,multiValueRemove:kx,noOptionsMessage:Fy,option:Tx,placeholder:Px,singleValue:Ax,valueContainer:jy},gC={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%)"},mC=4,bf=4,vC=38,bC=bf*2,wC={baseUnit:bf,controlHeight:vC,menuGutter:bC},Pl={borderRadius:mC,colors:gC,spacing:wC},yC={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:$u(),captureMenuScroll:!$u(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Zx(),formatGroupLabel:hC,getOptionLabel:mf,getOptionValue:vf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:fC,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!yy(),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 Yu(e,t,n,r){var o=xf(e,t,n),i=Cf(e,t,n),a=yf(e,t),l=Oa(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:a,value:l,index:r}}function da(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(a,l){return Yu(e,a,t,l)}).filter(function(a){return Ju(e,a)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Yu(e,n,t,r);return Ju(e,i)?i:void 0}).filter(ky)}function wf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,To(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Qu(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,To(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function xC(e,t){return wf(da(e,t))}function Ju(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!Sf(e)||!i)&&kf(e,{label:a,value:l,data:o},r)}function CC(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o<t.length)return t[o]}return null}function kC(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Hl=function(e,t){var n,r=(n=e.find(function(o){return o.data===t}))===null||n===void 0?void 0:n.id;return r||null},yf=function(e,t){return e.getOptionLabel(t)},Oa=function(e,t){return e.getOptionValue(t)};function xf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Cf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Oa(e,t);return n.some(function(o){return Oa(e,o)===r})}function kf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Sf=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},SC=1,Xs=(function(e){jg(n,e);var t=Xg(n);function n(r){var o;if(Gg(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.controlRef=null,o.getControlRef=function(s){o.controlRef=s},o.focusedOptionRef=null,o.getFocusedOptionRef=function(s){o.focusedOptionRef=s},o.menuListRef=null,o.getMenuListRef=function(s){o.menuListRef=s},o.inputRef=null,o.getInputRef=function(s){o.inputRef=s},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(s,c){var u=o.props,h=u.onChange,g=u.name;c.name=g,o.ariaOnChange(s,c),h(s,c)},o.setValue=function(s,c,u){var h=o.props,g=h.closeMenuOnSelect,f=h.isMulti,p=h.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(o.setState({inputIsHiddenAfterUpdate:!f}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(s,{action:c,option:u})},o.selectOption=function(s){var c=o.props,u=c.blurInputOnSelect,h=c.isMulti,g=c.name,f=o.state.selectValue,p=h&&o.isOptionSelected(s,f),m=o.isOptionDisabled(s,f);if(p){var w=o.getOptionValue(s);o.setValue(f.filter(function(y){return o.getOptionValue(y)!==w}),"deselect-option",s)}else if(!m)h?o.setValue([].concat(To(f),[s]),"select-option",s):o.setValue(s,"select-option");else{o.ariaOnChange(s,{action:"select-option",option:s,name:g});return}u&&o.blurInput()},o.removeValue=function(s){var c=o.props.isMulti,u=o.state.selectValue,h=o.getOptionValue(s),g=u.filter(function(p){return o.getOptionValue(p)!==h}),f=ui(c,g,g[0]||null);o.onChange(f,{action:"remove-value",removedValue:s}),o.focusInput()},o.clearValue=function(){var s=o.state.selectValue;o.onChange(ui(o.props.isMulti,[],null),{action:"clear",removedValues:s})},o.popValue=function(){var s=o.props.isMulti,c=o.state.selectValue,u=c[c.length-1],h=c.slice(0,c.length-1),g=ui(s,h,h[0]||null);u&&o.onChange(g,{action:"pop-value",removedValue:u})},o.getFocusedOptionId=function(s){return Hl(o.state.focusableOptionsWithIds,s)},o.getFocusableOptionsWithIds=function(){return Qu(da(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return gy.apply(void 0,[o.props.classNamePrefix].concat(c))},o.getOptionLabel=function(s){return yf(o.props,s)},o.getOptionValue=function(s){return Oa(o.props,s)},o.getStyles=function(s,c){var u=o.props.unstyled,h=pC[s](c,u);h.boxSizing="border-box";var g=o.props.styles[s];return g?g(h,c):h},o.getClassNames=function(s,c){var u,h;return(u=(h=o.props.classNames)[s])===null||u===void 0?void 0:u.call(h,c)},o.getElementId=function(s){return"".concat(o.state.instancePrefix,"-").concat(s)},o.getComponents=function(){return _x(o.props)},o.buildCategorizedOptions=function(){return da(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return wf(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(s,c){o.setState({ariaSelection:Le({value:s},c)})},o.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(s){o.blockOptionHover=!1},o.onControlMouseDown=function(s){if(!s.defaultPrevented){var c=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&o.onMenuClose():c&&o.openMenu("first"):(c&&(o.openAfterFocus=!0),o.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},o.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!o.props.isDisabled){var c=o.props,u=c.isMulti,h=c.menuIsOpen;o.focusInput(),h?(o.setState({inputIsHiddenAfterUpdate:!u}),o.onMenuClose()):o.openMenu("first"),s.preventDefault()}},o.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(o.clearValue(),s.preventDefault(),o.openAfterFocus=!1,s.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(s){typeof o.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Fa(s.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(s)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(s){var c=s.touches,u=c&&c.item(0);u&&(o.initialTouchX=u.clientX,o.initialTouchY=u.clientY,o.userIsDragging=!1)},o.onTouchMove=function(s){var c=s.touches,u=c&&c.item(0);if(u){var h=Math.abs(u.clientX-o.initialTouchX),g=Math.abs(u.clientY-o.initialTouchY),f=5;o.userIsDragging=h>f||g>f}},o.onTouchEnd=function(s){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(s.target)&&o.menuListRef&&!o.menuListRef.contains(s.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(s){o.userIsDragging||o.onControlMouseDown(s)},o.onClearIndicatorTouchEnd=function(s){o.userIsDragging||o.onClearIndicatorMouseDown(s)},o.onDropdownIndicatorTouchEnd=function(s){o.userIsDragging||o.onDropdownIndicatorMouseDown(s)},o.handleInputChange=function(s){var c=o.props.inputValue,u=s.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(u,{action:"input-change",prevInputValue:c}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(s){o.props.onFocus&&o.props.onFocus(s),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(s){var c=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(s),o.onInputChange("",{action:"input-blur",prevInputValue:c}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(s){if(!(o.blockOptionHover||o.state.focusedOption===s)){var c=o.getFocusableOptions(),u=c.indexOf(s);o.setState({focusedOption:s,focusedOptionId:u>-1?o.getFocusedOptionId(s):null})}},o.shouldHideSelectedOptions=function(){return Sf(o.props)},o.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),o.focus()},o.onKeyDown=function(s){var c=o.props,u=c.isMulti,h=c.backspaceRemovesValue,g=c.escapeClearsValue,f=c.inputValue,p=c.isClearable,m=c.isDisabled,w=c.menuIsOpen,y=c.onKeyDown,v=c.tabSelectsValue,C=c.openMenuOnFocus,R=o.state,E=R.focusedOption,M=R.focusedValue,H=R.selectValue;if(!m&&!(typeof y=="function"&&(y(s),s.defaultPrevented))){switch(o.blockOptionHover=!0,s.key){case"ArrowLeft":if(!u||f)return;o.focusValue("previous");break;case"ArrowRight":if(!u||f)return;o.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(M)o.removeValue(M);else{if(!h)return;u?o.popValue():p&&o.clearValue()}break;case"Tab":if(o.isComposing||s.shiftKey||!w||!v||!E||C&&o.isOptionSelected(E,H))return;o.selectOption(E);break;case"Enter":if(s.keyCode===229)break;if(w){if(!E||o.isComposing)return;o.selectOption(E);break}return;case"Escape":w?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:f}),o.onMenuClose()):p&&g&&o.clearValue();break;case" ":if(f)return;if(!w){o.openMenu("first");break}if(!E)return;o.selectOption(E);break;case"ArrowUp":w?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":w?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!w)return;o.focusOption("pageup");break;case"PageDown":if(!w)return;o.focusOption("pagedown");break;case"Home":if(!w)return;o.focusOption("first");break;case"End":if(!w)return;o.focusOption("last");break;default:return}s.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++SC),o.state.selectValue=Ea(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),a=o.buildFocusableOptions(),l=a.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=a[l],o.state.focusedOptionId=Hl(i,a[l])}return o}return Ug(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&_u(this.menuListRef,this.focusedOptionRef),dC()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(_u(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,i=this.state,a=i.selectValue,l=i.isFocused,s=this.buildFocusableOptions(),c=r==="first"?0:s.length-1;if(!this.props.isMulti){var u=s.indexOf(a[0]);u>-1&&(c=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var s=i.length-1,c=-1;if(i.length){switch(r){case"previous":l===0?c=0:l===-1?c=s:c=l-1;break;case"next":l>-1&&l<s&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:i[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,s=a.indexOf(i);i||(s=-1),r==="up"?l=s>0?s-1:a.length-1:r==="down"?l=(s+1)%a.length:r==="pageup"?(l=s-o,l<0&&(l=0)):r==="pagedown"?(l=s+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Pl):Le(Le({},Pl),this.props.theme):Pl})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,s=this.selectOption,c=this.setValue,u=this.props,h=u.isMulti,g=u.isRtl,f=u.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:h,isRtl:g,options:f,selectOption:s,selectProps:u,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,i=r.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(r,o){return xf(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return Cf(this.props,r,o)}},{key:"filterOption",value:function(r,o){return kf(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:i,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{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 r=this.props,o=r.isDisabled,i=r.isSearchable,a=r.inputId,l=r.inputValue,s=r.tabIndex,c=r.form,u=r.menuIsOpen,h=r.required,g=this.getComponents(),f=g.Input,p=this.state,m=p.inputIsHidden,w=p.ariaSelection,y=this.commonProps,v=a||this.getElementId("input"),C=Le(Le(Le({"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":h,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?d.createElement(f,Ve({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:o,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:c,type:"text",value:l},C)):d.createElement(Qx,Ve({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ra,onFocus:this.onInputFocus,disabled:o,tabIndex:s,inputMode:"none",form:c,value:""},C))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,s=o.MultiValueRemove,c=o.SingleValue,u=o.Placeholder,h=this.commonProps,g=this.props,f=g.controlShouldRenderValue,p=g.isDisabled,m=g.isMulti,w=g.inputValue,y=g.placeholder,v=this.state,C=v.selectValue,R=v.focusedValue,E=v.isFocused;if(!this.hasValue()||!f)return w?null:d.createElement(u,Ve({},h,{key:"placeholder",isDisabled:p,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return C.map(function(H,S){var x=H===R,L="".concat(r.getOptionLabel(H),"-").concat(r.getOptionValue(H));return d.createElement(i,Ve({},h,{components:{Container:a,Label:l,Remove:s},isFocused:x,isDisabled:p,key:L,index:S,removeProps:{onClick:function(){return r.removeValue(H)},onTouchEnd:function(){return r.removeValue(H)},onMouseDown:function(T){T.preventDefault()}},data:H}),r.formatOptionLabel(H,"value"))});if(w)return null;var M=C[0];return d.createElement(c,Ve({},h,{data:M,isDisabled:p}),this.formatOptionLabel(M,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||s)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ve({},i,{innerProps:u,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!o||!s)return null;var u={"aria-hidden":"true"};return d.createElement(o,Ve({},i,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,i=r.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused;return d.createElement(i,Ve({},a,{isDisabled:l,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ve({},i,{innerProps:s,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,s=o.MenuList,c=o.MenuPortal,u=o.LoadingMessage,h=o.NoOptionsMessage,g=o.Option,f=this.commonProps,p=this.state.focusedOption,m=this.props,w=m.captureMenuScroll,y=m.inputValue,v=m.isLoading,C=m.loadingMessage,R=m.minMenuHeight,E=m.maxMenuHeight,M=m.menuIsOpen,H=m.menuPlacement,S=m.menuPosition,x=m.menuPortalTarget,L=m.menuShouldBlockScroll,T=m.menuShouldScrollIntoView,I=m.noOptionsMessage,O=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!M)return null;var k=function(K,pe){var oe=K.type,de=K.data,he=K.isDisabled,se=K.isSelected,z=K.label,P=K.value,G=p===de,le=he?void 0:function(){return r.onOptionHover(de)},ce=he?void 0:function(){return r.selectOption(de)},we="".concat(r.getElementId("option"),"-").concat(pe),ge={id:we,onClick:ce,onMouseMove:le,onMouseOver:le,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:se};return d.createElement(g,Ve({},f,{innerProps:ge,data:de,isDisabled:he,isSelected:se,key:we,label:z,type:oe,value:P,isFocused:G,innerRef:G?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(K.data,"menu"))},Q;if(this.hasOptions())Q=this.getCategorizedOptions().map(function(K){if(K.type==="group"){var pe=K.data,oe=K.options,de=K.index,he="".concat(r.getElementId("group"),"-").concat(de),se="".concat(he,"-heading");return d.createElement(i,Ve({},f,{key:he,data:pe,options:oe,Heading:a,headingProps:{id:se,data:K.data},label:r.formatGroupLabel(K.data)}),K.options.map(function(z){return k(z,"".concat(de,"-").concat(z.index))}))}else if(K.type==="option")return k(K,"".concat(K.index))});else if(v){var N=C({inputValue:y});if(N===null)return null;Q=d.createElement(u,f,N)}else{var Y=I({inputValue:y});if(Y===null)return null;Q=d.createElement(h,f,Y)}var ae={minMenuHeight:R,maxMenuHeight:E,menuPlacement:H,menuPosition:S,menuShouldScrollIntoView:T},ee=d.createElement(Dy,Ve({},f,ae),function(K){var pe=K.ref,oe=K.placerProps,de=oe.placement,he=oe.maxHeight;return d.createElement(l,Ve({},f,ae,{innerRef:pe,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:de}),d.createElement(oC,{captureEnabled:w,onTopArrive:O,onBottomArrive:D,lockEnabled:L},function(se){return d.createElement(s,Ve({},f,{innerRef:function(z){r.getMenuListRef(z),se(z)},innerProps:{role:"listbox","aria-multiselectable":f.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:he,focusedOption:p}),Q)}))});return x||S==="fixed"?d.createElement(c,Ve({},f,{appendTo:x,controlElement:this.controlRef,menuPlacement:H,menuPosition:S}),ee):ee}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,s=o.name,c=o.required,u=this.state.selectValue;if(c&&!this.hasValue()&&!a)return d.createElement(lC,{name:s,onFocus:this.onValueInputFocus});if(!(!s||a))if(l)if(i){var h=u.map(function(p){return r.getOptionValue(p)}).join(i);return d.createElement("input",{name:s,type:"hidden",value:h})}else{var g=u.length>0?u.map(function(p,m){return d.createElement("input",{key:"i-".concat(m),name:s,type:"hidden",value:r.getOptionValue(p)})}):d.createElement("input",{name:s,type:"hidden",value:""});return d.createElement("div",null,g)}else{var f=u[0]?this.getOptionValue(u[0]):"";return d.createElement("input",{name:s,type:"hidden",value:f})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,s=o.isFocused,c=o.selectValue,u=this.getFocusableOptions();return d.createElement(Ux,Ve({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:s,selectValue:c,focusableOptions:u,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,s=this.props,c=s.className,u=s.id,h=s.isDisabled,g=s.menuIsOpen,f=this.state.isFocused,p=this.commonProps=this.getCommonProps();return d.createElement(a,Ve({},p,{className:c,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:f}),this.renderLiveRegion(),d.createElement(o,Ve({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:f,menuIsOpen:g}),d.createElement(l,Ve({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(i,Ve({},p,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,s=o.ariaSelection,c=o.isFocused,u=o.prevWasFocused,h=o.instancePrefix,g=r.options,f=r.value,p=r.menuIsOpen,m=r.inputValue,w=r.isMulti,y=Ea(f),v={};if(i&&(f!==i.value||g!==i.options||p!==i.menuIsOpen||m!==i.inputValue)){var C=p?xC(r,y):[],R=p?Qu(da(r,y),"".concat(h,"-option")):[],E=a?CC(o,y):null,M=kC(o,C),H=Hl(R,M);v={selectValue:y,focusedOption:M,focusedOptionId:H,focusableOptionsWithIds:R,focusedValue:E,clearFocusValueOnUpdate:!1}}var S=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},x=s,L=c&&u;return c&&!L&&(x={value:ui(w,y,y[0]||null),options:y,action:"initial-input-focus"},L=!u),s?.action==="initial-input-focus"&&(x=null),Le(Le(Le({},v),S),{},{prevProps:r,ariaSelection:x,prevWasFocused:L})}}]),n})(d.Component);Xs.defaultProps=yC;var MC=d.forwardRef(function(e,t){var n=Uh(e);return d.createElement(Xs,Ve({ref:t},n))}),Mf=MC;const IC=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},RC=sn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),EC=sn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),TC=sn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),OC=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:o}=e,{allowedValues:i,value:a}=t.data,[l,s]=d.useState(a),[c,u]=d.useState(r??""),h=sh(),g=d.useMemo(()=>i.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:f?.toString()??""}:f),[i]);return t.readonly?d.createElement(TC,null,d.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):d.createElement(RC,null,d.createElement(Mf,{className:"glide-select",inputValue:c,onInputChange:u,menuPlacement:"auto",value:g.find(f=>f.value===l),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:p})=>({...f,fontSize:h.editorFontSize,fontFamily:h.fontFamily,cursor:p?"pointer":void 0,paddingLeft:h.cellHorizontalPadding,paddingRight:h.cellHorizontalPadding,":active":{...f[":active"],color:h.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:h.bgCell,neutral5:h.bgCell,neutral10:h.bgCell,neutral20:h.bgCellMedium,neutral30:h.bgCellMedium,neutral40:h.bgCellMedium,neutral50:h.textLight,neutral60:h.textMedium,neutral70:h.textMedium,neutral80:h.textDark,neutral90:h.textDark,neutral100:h.textDark,primary:h.accentColor,primary75:h.accentColor,primary50:h.accentColor,primary25:h.accentLight}}),menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>d.createElement(EC,null,d.createElement(IC,{className:"click-outside-ignore",...f}))},options:g,onChange:async f=>{f!==null&&(s(f.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:f.value}}))}}))},DC={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{value:i}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===i:s.value===i),l=typeof a=="string"?a:a?.label??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,o.x+r.cellHorizontalPadding,o.y+o.height/2+Jn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:OC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function PC(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const o=parseFloat(r[1]),i=r[2],a=o*t;return e.replace(n,`${Number(a.toPrecision(3))}${i}`)}return e}const HC={marginRight:8},LC={display:"flex",alignItems:"center",flexGrow:1},AC={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{min:i,max:a,value:l,label:s,measureLabel:c,color:u}=t.data,h=o.x+r.cellHorizontalPadding,g=o.y+o.height/2,f=a-i,p=(l-i)/f,m=`${PC(r.baseFontStyle,.9)} ${r.fontFamily}`,w=bs(n,m)/2;n.save();let y=0;s!==void 0&&(n.font=m,y=Dr(c??s,n,m).width+r.cellHorizontalPadding);const v=o.width-r.cellHorizontalPadding*2-y;if(v>=w){const C=n.createLinearGradient(h,g,h+v,g),R=u??r.accentColor;C.addColorStop(0,R),C.addColorStop(p,R),C.addColorStop(p,r.bgBubble),C.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=C,Pu(n,h,g-w/2,v,w,w/2),n.fill(),n.beginPath(),Pu(n,h+.5,g-w/2+.5,v-1,w-1,(w-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,o.x+o.width-r.cellHorizontalPadding,g+Jn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),o=t.min.toString(),i=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return d.createElement("label",{style:LC},d.createElement("input",{style:HC,type:"range",value:r,min:o,max:i,step:a,onChange:l,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},FC=sn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Ll=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},zC=e=>{const t=e.value.data,{format:n,displayDate:r}=t,o=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,i=t.timezoneOffset?t.timezoneOffset*60*1e3:0,a=t.min instanceof Date?Ll(n,t.min,i):t.min,l=t.max instanceof Date?Ll(n,t.max,i):t.max,s=Ll(n,t.date,i);return e.value.readonly?kt.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):kt.createElement(FC,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:a,max:l,step:o,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-i)}})}})},_C={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return vs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:zC}),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)}}};var $C=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],ed=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),o=String(n.getOptionValue(t)).toLowerCase(),i=String(n.getOptionLabel(t)).toLowerCase();return o===r||i===r},Al={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(o){return ed(e,o,r)})||n.some(function(o){return ed(e,o,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function VC(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,i=e.formatCreateLabel,a=i===void 0?Al.formatCreateLabel:i,l=e.isValidNewOption,s=l===void 0?Al.isValidNewOption:l,c=e.getNewOptionData,u=c===void 0?Al.getNewOptionData:c,h=e.onCreateOption,g=e.options,f=g===void 0?[]:g,p=e.onChange,m=ur(e,$C),w=m.getOptionValue,y=w===void 0?vf:w,v=m.getOptionLabel,C=v===void 0?mf:v,R=m.inputValue,E=m.isLoading,M=m.isMulti,H=m.value,S=m.name,x=d.useMemo(function(){return s(R,Ea(H),f,{getOptionValue:y,getOptionLabel:C})?u(R,a(R)):void 0},[a,u,C,y,R,s,f,H]),L=d.useMemo(function(){return(n||!E)&&x?o==="first"?[x].concat(To(f)):[].concat(To(f),[x]):f},[n,o,E,x,f]),T=d.useCallback(function(I,O){if(O.action!=="select-option")return p(I,O);var D=Array.isArray(I)?I:[I];if(D[D.length-1]===x){if(h)h(R);else{var k=u(R,R),Q={action:"create-option",name:S,option:k};p(ui(M,[].concat(To(Ea(H)),[k]),k),Q)}return}p(I,O)},[u,R,M,S,x,h,p,H]);return Le(Le({},m),{},{options:L,onChange:T})}var BC=d.forwardRef(function(e,t){var n=Uh(e),r=VC(n);return d.createElement(Xs,Ve({ref:t},r))}),NC=BC;const qs="__value",WC=new RegExp(`^${qs}\\d+__`),jC=sn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),GC=sn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),ha=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),If=(e,t,n)=>e==null?[]:e.map((r,o)=>{const i=n?`${qs}${o}__`:"",a=t.find(l=>l.value===r);return a?{...a,value:`${i}${a.value}`}:{value:`${i}${r}`,label:r}}),UC=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},XC=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:o,portalElementRef:i}=e,{options:a,values:l,allowCreation:s,allowDuplicates:c}=t.data,u=sh(),[h,g]=d.useState(l),[f,p]=d.useState(!0),[m,w]=d.useState(n??""),y=d.useMemo(()=>ha(a??[]),[a]),v=s&&c&&y.length===0,C=d.useCallback(S=>{f&&S.stopPropagation()},[f]),R={control:(S,x)=>({...S,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:x.isDisabled?"auto":S.pointerEvents,cursor:x.isDisabled?"default":S.cursor}),valueContainer:S=>({...S,flexWrap:S.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:S=>({...S,backgroundColor:u.bgCell}),option:(S,x)=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...x.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{},":active":{...S[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(S,{isDisabled:x})=>x?{display:"none"}:{...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:S=>({...S,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(S,{data:x})=>({...S,backgroundColor:x.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(S,{data:x,isDisabled:L})=>({...S,paddingRight:L?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:x.color?Bl(x.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(S,{data:x,isDisabled:L,isFocused:T})=>L?{display:"none"}:{...S,color:x.color?Bl(x.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:T?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},E=d.useCallback(S=>{const x=S.map(L=>c&&L.startsWith(qs)?L.replace(new RegExp(WC),""):L);g(x),r({...t,data:{...t.data,values:x}})},[t,r,c]),M=S=>{switch(S.key){case"Enter":case"Tab":if(!m){o(t,[0,1]);return}c&&s&&(w(""),E([...h??[],m]),p(!1),S.preventDefault())}},H=s?NC:Mf;return d.createElement(jC,{onKeyDown:C,"data-testid":"multi-select-cell"},d.createElement(H,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:w,options:y,placeholder:t.readonly?"":s?"Add...":void 0,noOptionsMessage:S=>s&&c&&S.inputValue?`Create "${S.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:f,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:If(h,y,c),onKeyDown:t.readonly?void 0:M,menuPlacement:"auto",menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:R,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:S=>v?null:d.createElement(GC,null,d.createElement(UC,{className:"click-outside-ignore",...S}))},onChange:async S=>{S!==null&&E(S.map(x=>x.value))}}))},qC={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o,highlighted:i}=e,{values:a,options:l}=t.data;if(a==null)return!0;const s=ha(l??[]),c={x:o.x+r.cellHorizontalPadding,y:o.y+r.cellVerticalPadding,width:o.width-2*r.cellHorizontalPadding,height:o.height-2*r.cellVerticalPadding},u=Math.max(1,Math.floor(c.height/(r.bubbleHeight+r.bubblePadding)));let{x:h}=c,g=1,f=u===1?c.y+(c.height-r.bubbleHeight)/2:c.y+(c.height-u*r.bubbleHeight-(u-1)*r.bubblePadding)/2;for(const p of a){const m=s.find(R=>R.value===p),w=m?.color??(i?r.bgBubbleSelected:r.bgBubble),y=m?.label??p,v=Dr(y,n).width+r.bubblePadding*2,C=r.bubbleHeight/2;if(h!==c.x&&h+v>c.x+c.width&&g<u&&(g++,f+=r.bubbleHeight+r.bubblePadding,h=c.x),n.fillStyle=w,n.beginPath(),Yn(n,h,f,v,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Bl(w)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(y,h+r.bubblePadding,f+C+Jn(n,r)),h+=v+r.bubbleMargin,h>c.x+c.width+r.cellHorizontalPadding&&g>=u)break}return!0},measure:(e,t,n)=>{const{values:r,options:o}=t.data;if(!r)return n.cellHorizontalPadding*2;const i=If(r,ha(o??[]),t.data.allowDuplicates).map(l=>l.label??l.value),a=i.reduce((l,s)=>e.measureText(s).width+l+n.bubblePadding*2+n.bubbleMargin,0);return i.length===0?n.cellHorizontalPadding*2:a+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:XC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,o)=>n.indexOf(r)===o)),!t.allowCreation){const r=ha(t.options??[]);n=n.filter(o=>r.find(i=>i.value===o))}if(n.length!==0)return{...t,values:n}}},KC="None";function td(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const ZC=e=>{const{cell:t,theme:n,ctx:r}=e;vs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},KC,t.contentAlign),r.fillStyle=n.textDark};function YC(e){const t=d.useCallback((r,o)=>{const{cell:i,theme:a,ctx:l,rect:s}=r,c=r.col;if(Oo(i))td(l,s,a);else if(Ms(i)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?o():ZC(r),u.isRequired&&u.isEditable&&td(l,s,a);return}o()},[e]),n=d.useMemo(()=>[Pw,DC,AC,_C,qC,...rw],[]);return{drawCell:t,customRenderers:n}}function QC(){const e=Qr();return d.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:Xr(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Xr(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:Xr(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Xr(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(tn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Xr(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(tn(e.spacing.sm)),cellVerticalPadding:Math.round(tn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Gp(e.colors.secondaryBg,.1),bubbleHeight:Math.round(tn("1.25rem")),bubblePadding:Math.round(tn(e.spacing.sm)),bubbleMargin:Math.round(tn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(tn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(tn("25rem")),minColumnWidth:Math.round(tn("3.125rem")),maxColumnWidth:Math.round(tn("62.5rem")),maxColumnAutoWidth:Math.round(tn("31.25rem")),defaultRowHeight:Math.round(tn("2.1875rem")),defaultHeaderHeight:Math.round(tn("2.1875rem")),bgRowHovered:jp(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const JC=rs.getLogger("useDataEditor");function ek(e,t,n,r,o,i,a,l,s){const c=d.useCallback(([m,w],y)=>{const v=e[m];if(!v.isEditable)return;const C=v.indexNumber,R=n.current.getOriginalRowIndex(o(w)),E=r([m,w]),M=v.getCellValue(E),H=v.getCellValue(y);if(!Oo(E)&&H===M)return;const S=v.getCell(H,!0);Oo(S)?JC.warn(`Not applying the cell edit since it causes this error:
|
|
196
196
|
${S.data}`):(n.current.setCell(C,R,{...S,lastUpdated:performance.now()}),l())},[e,n,o,r,l]),u=d.useCallback(()=>{if(t)return;const m=new Map;e.forEach(w=>{m.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(m),a()},[e,n,t,a]),h=d.useCallback(()=>{t||(u(),l())},[u,l,t]),g=d.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const w=m.rows.toArray().map(y=>n.current.getOriginalRowIndex(o(y)));return n.current.deleteRows(w),a(),s(),l(),!1}if(m.current?.range){const w=[],y=m.current.range;for(let v=y.y;v<y.y+y.height;v++)for(let C=y.x;C<y.x+y.width;C++){const R=e[C];R.isEditable&&!R.isRequired&&(w.push({cell:[C,v]}),c([C,v],R.getCell(null)))}return w.length>0&&(l(),i(w)),!1}return!0},[e,n,t,i,o,l,c,s,a]),f=d.useCallback((m,w)=>{const[y,v]=m,C=[];for(let R=0;R<w.length;R++){const E=w[R];if(R+v>=n.current.getNumRows()){if(t)break;u()}for(let M=0;M<E.length;M++){const H=E[M],S=R+v,x=M+y;if(x>=e.length)break;const L=e[x];if(L.isEditable){const T=L.getCell(H,!0);if(rt(T)&&!Oo(T)){const I=L.indexNumber,O=n.current.getOriginalRowIndex(o(S)),D=L.getCellValue(r([x,S]));L.getCellValue(T)!==D&&(n.current.setCell(I,O,{...T,lastUpdated:performance.now()}),C.push({cell:[x,S]}))}}}C.length>0&&(l(),i(C))}return!1},[e,n,t,o,r,u,l,i]),p=d.useCallback((m,w)=>{const y=m[0];if(y>=e.length)return!0;const v=e[y];if(v.validateInput){const C=v.validateInput(v.getCellValue(w));return C===!0||C===!1?C:v.getCell(C)}return!0},[e]);return{onCellEdited:c,onPaste:f,onRowAppended:h,onDelete:g,validateCell:p}}const Rf=",",di='"',tk='"',Ef=`
|
|
197
|
-
`,nk="\uFEFF",rk=new RegExp(`[${[Rf,di,Ef].join("")}]`),nd=rs.getLogger("useDataExporter");function rd(e){return e.map(t=>ok(t)).join(Rf)+Ef}function ok(e){if(De(e))return"";const t=ot(e);return rk.test(t)?`${di}${t.replace(new RegExp(di,"g"),tk+di)}${di}`:t}async function od(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(nk));const i=n.map(a=>a.name);await e.write(o.encode(rd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(rd(l)))}await e.close()}function ik(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await ns(()=>import("./es6--XPcqeHG-
|
|
197
|
+
`,nk="\uFEFF",rk=new RegExp(`[${[Rf,di,Ef].join("")}]`),nd=rs.getLogger("useDataExporter");function rd(e){return e.map(t=>ok(t)).join(Rf)+Ef}function ok(e){if(De(e))return"";const t=ot(e);return rk.test(t)?`${di}${t.replace(new RegExp(di,"g"),tk+di)}${di}`:t}async function od(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(nk));const i=n.map(a=>a.name);await e.write(o.encode(rd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(rd(l)))}await e.close()}function ik(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await ns(()=>import("./es6--XPcqeHG-DdkxL8eW.js"),__vite__mapDeps([14,1,2])).then(a=>a.a)).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await od(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{nd.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let a="";const l=new WritableStream({write:h=>{a+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await od(l.getWriter(),e,t,n);const s=new Blob([a],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),u=Ng({enforceDownloadInNewTab:r,url:c,filename:o});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(a){nd.error("Failed to export data as CSV",a)}}},[t,n,e,r])}}function ak(e,t,n,r){return{getCellContent:d.useCallback(([o,i])=>{if(o>t.length-1)return Mt("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Mt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,s=r.current.getOriginalRowIndex(i),c=r.current.isAddedRow(s);if(a.isEditable||c){const g=r.current.getCell(l,s);if(rt(g))return{...a.getCell(a.getCellValue(g),!1),lastUpdated:g.lastUpdated};if(c)return Mt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${s}`)}const u=e.getCell(s,l),h=Up(e,s,l);return fw(a,u,h,e.styler?.cssStyles)}catch(a){return Mt("Error during cell creation",`This error should never happen. Please report this bug.
|
|
198
198
|
Error: ${a}`)}},[t,n,e,r])}}function lk(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,i]=o.location;n(i)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function sk(e,t,n,r,o){const[i,a]=d.useState({columns:Ye.empty(),rows:Ye.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(nn.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(nn.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN),h=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(nn.SelectionMode.MULTI_CELL)),g=h&&e.selectionMode.includes(nn.SelectionMode.MULTI_CELL),f=i.rows.length>0,p=i.columns.length>0,m=i.current!==void 0,w=d.useCallback(v=>{const C=!rl(v.rows.toArray(),i.rows.toArray()),R=!rl(v.columns.toArray(),i.columns.toArray()),E=!rl(v.current,i.current),M=l&&C||c&&R||h&&E;let H=v;if(R&&H.columns.length>=0){let S=H.columns;r.forEach((x,L)=>{x.isIndex&&(S=S.remove(L))}),S.length<H.columns.length&&(H={...H,columns:S})}a(H),M&&o(H,h)},[i,l,c,h,o,r]),y=d.useCallback((v=!1,C=!1)=>{const R={columns:C?i.columns:Ye.empty(),rows:v?i.rows:Ye.empty(),current:void 0};a(R),(!v&&l||!C&&c||h)&&o(R,h)},[i,l,c,h,o]);return{gridSelection:i,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isCellSelectionActivated:h,isMultiCellSelectionActivated:g,isRowSelected:f,isColumnSelected:p,isCellSelected:m,clearSelection:y,processSelectionChange:w}}function ck(e,t,n,r,o,i,a,l,s,c,u){const h=e.rowHeight??t.defaultRowHeight,g=r?2:1,f=e.editingMode===nn.EditingMode.DYNAMIC?1:0,p=n+f,m=Iu({numRows:p,rowHeight:h,theme:t,numHeaderRows:g}),w=mw(e,s),y=gw(s,u),v=y?Math.max(1,Math.min(n,3)):1,C=Iu({numRows:v,rowHeight:h,theme:t});let R=Math.max(m,C),E=Math.min(R,t.defaultTableHeight);y&&c&&c>0?R=Math.max(c,R):w&&(E=Math.max(w,C),R=Math.max(E,R)),i&&(E=Math.min(E,i),R=Math.min(R,i),w||(E=R));const M=t.minColumnWidth+2*t.tableBorderWidth,H=Math.max(o,M);let S,x=H;const L=Wh(e,l),T=jh(e,l),I=pw(l);L?S=H:T?(S=Math.min(Math.max(T,M),H),x=Math.min(Math.max(T,x),H)):I&&(S=void 0);const[O,D]=d.useState({width:S||"100%",height:y?"100%":E});return d.useLayoutEffect(()=>{L&&O.width==="100%"&&D(k=>({...k,width:H}))},[H]),d.useLayoutEffect(()=>{D(k=>({...k,width:S||"100%"}))},[S]),d.useLayoutEffect(()=>{D(k=>({...k,height:y?"100%":E}))},[E,n,c,y,u]),d.useLayoutEffect(()=>{if(a){const k=L||rt(T)&&T>0;D({width:k?x:"100%",height:R})}else D({width:S||"100%",height:E})},[a]),{minHeight:C,maxHeight:R,minWidth:M,maxWidth:x,rowHeight:h,resizableSize:O,setResizableSize:D}}const uk=600,dk="⚠️ Please fill out this cell.";function hk(e,t,n=[]){const[r,o]=d.useState(),i=d.useRef(null),a=d.useCallback(s=>{if(clearTimeout(i.current),i.current=0,o(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const c=s.location[0],u=s.location[1];let h;if(c<0||c>=e.length||n.includes(u))return;const g=e[c];if(s.kind==="header"&&rt(g))h=g.help;else if(s.kind==="cell"){const f=t([c,u]);Oo(f)?h=f.errorDetails:g.isRequired&&g.isEditable&&Ms(f)?h=dk:$1(f)&&(h=f.tooltip)}h&&(i.current=setTimeout(()=>{h&&o({content:h,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},uk))}},[e,t,o,i,n]),l=d.useCallback(()=>{o(void 0)},[o]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}const Tf=Qn("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),Er=Qn("div",{target:"e1hnsd046"})(({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}}}),""),Of=Qn("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),fk=Qn("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS}),""),pk=Qn("div",{target:"e1hnsd043"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"}),""),gk=Qn("div",{target:"e1hnsd042"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"}),""),mk=Qn("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),vk=Qn("button",{target:"e1hnsd040"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}}),""),id=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],bk={number:id,progress:id,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 wk({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:o,onCloseMenu:i,children:a}){const l=Qr(),{colors:s,fontSizes:c,radii:u,fontWeights:h}=l,g=bk[e]||[];return g.length===0?ve.jsx(ve.Fragment,{}):ve.jsx(Da,{triggerType:pd.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:ve.jsx(Tf,{role:"menu",children:g.map(f=>ve.jsxs(Er,{onClick:()=>{o(f.format),i()},role:"menuitem",children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:f.icon}),f.label]},f.format))}),placement:Pa.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:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Mi(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:c.sm,fontWeight:h.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:a})}const yk=d.memo(wk);function xk({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:o,onCloseMenu:i,onSortColumn:a,onHideColumn:l,column:s,onChangeFormat:c,onAutosize:u}){const h=Qr(),[g,f]=d.useState(!1),{colors:p,fontSizes:m,radii:w,fontWeights:y}=h,{isCopied:v,copyToClipboard:C}=Tp();d.useEffect(()=>{function M(H){H.preventDefault()}return document.addEventListener("wheel",M,{passive:!1}),document.addEventListener("touchmove",M,{passive:!1}),()=>{document.removeEventListener("wheel",M),document.removeEventListener("touchmove",M)}},[]);const R=d.useCallback(()=>{i()},[i]),E=d.useCallback(()=>{C(s.title)},[s.title,C]);return ve.jsx(Da,{autoFocus:!0,"aria-label":"Dataframe column menu",content:ve.jsxs(Tf,{children:[ve.jsxs(fk,{children:[ve.jsx(pk,{title:s.kind,children:ve.jsx(qn,{iconValue:s.typeIcon||":material/notes:",size:"base",color:"inherit"})}),ve.jsxs(gk,{title:s.title,children:[ve.jsx(mk,{children:s.title}),ve.jsx(vk,{onClick:E,title:"Copy column name","aria-label":"Copy column name",children:ve.jsx(qn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),a&&ve.jsxs(ve.Fragment,{children:[ve.jsxs(Er,{onClick:()=>{a("asc"),R()},role:"menuitem",children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),ve.jsxs(Er,{onClick:()=>{a("desc"),R()},role:"menuitem",children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),ve.jsx(Of,{})]}),c&&ve.jsx(yk,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:c,onCloseMenu:R,children:ve.jsxs(Er,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:g,hasSubmenu:!0,children:[ve.jsxs("div",{children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),u&&ve.jsxs(Er,{onClick:()=>{u(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&ve.jsxs(Er,{onClick:()=>{o(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&ve.jsxs(Er,{onClick:()=>{r(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),l&&ve.jsxs(Er,{onClick:()=>{l(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Pa.bottomRight,accessibilityType:gd.menu,showArrow:!1,popoverMargin:tn("0.375rem"),onClickOutside:g?void 0:R,onEsc:R,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${h.sizes.borderWidth} solid ${h.colors.borderColor}`,backgroundColor:Mi(h)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:y.normal,borderTopLeftRadius:w.default,borderTopRightRadius:w.default,borderBottomLeftRadius:w.default,borderBottomRightRadius:w.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:ve.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Ck=d.memo(xk),kk="(index)";function Fl(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const ad=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const o=Qr();return ve.jsx($g,{isIndeterminate:n,checked:t,onChange:i=>{r(i.target.checked)},"aria-label":e,checkmarkType:Bg.default,labelPlacement:Vg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({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:i?o.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:a,$isIndeterminate:l})=>{const s=a||l?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:i&&(a||l)?`0 0 0 0.2rem ${Xr(o.colors.primary,.5)}`:"",borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},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})},Sk=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:o,children:i,isOpen:a,onClose:l})=>{const s=Qr(),c=f=>!(f.isHidden===!0||Fl(f,t)),u=e.every(c),h=e.some(c)&&!u,g=f=>{e.forEach(p=>{const m=Fl(p,t);f?(o(p.id),m&&n(w=>[...w,p.id])):r(p.id)})};return ve.jsx(Da,{triggerType:pd.click,placement:Pa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>ve.jsxs("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto"},children:[ve.jsx(ad,{label:"Select all",isIndeterminate:h,initialValue:u,onChange:f=>{g(f)}}),ve.jsx(Of,{}),ve.jsx("div",{children:e.map(f=>{const p=Fl(f,t);return ve.jsx(ad,{label:!f.title&&f.isIndex?kk:f.title,initialValue:!(f.isHidden===!0||p),onChange:m=>{m?(o(f.id),p&&n(w=>[...w,f.id])):r(f.id)}},f.id)})})]}),isOpen:a,onClickOutside:l,onClick:()=>a?l():void 0,onEsc:l,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.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:Mi(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:ve.jsx("div",{children:i})})},Mk=d.memo(Sk),ld=Qn("div",{target:"e1w7nams0"})(({theme:e,disableResize:t,minHeight:n})=>({position:"relative",display:t?"flex":"inline-block",height:"100%","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",minHeight:n,borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}),"");function Ik({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=d.useState(!0),a=Qr(),{colors:l,fontSizes:s,radii:c,fontWeights:u}=a,h=d.useCallback(()=>{i(!1),r()},[r,i]);return ve.jsx(Da,{content:ve.jsx(Op,{"data-testid":"stDataFrameTooltipContent",children:ve.jsx(Dp,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Pa.top,accessibilityType:gd.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:h,onEsc:h,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:Mi(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:ve.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const Rk=d.memo(Ik),sd=150,Ek=15e4,Tk="0.5rem";function Ok({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i,customToolbarActions:a,widthConfig:l,heightConfig:s}){const{expanded:c,expand:u,collapse:h,width:g,height:f}=uc(Ag),{isInHorizontalLayout:p,isInRoot:m}=uc(Pp),w=d.useRef(null),y=d.useRef(null),v=Hp(),{height:C,elementRef:R}=Lp(),E=QC(),{getRowThemeOverride:M,onItemHovered:H}=lk(E),{libConfig:{enforceDownloadInNewTab:S=!1}}=d.useContext(Ap),[x,L]=d.useState(!0),[T,I]=d.useState(!1),[O,D]=d.useState(!1),[k,Q]=d.useState(!1),[N,Y]=d.useState(),[ae,ee]=d.useState(!1),K=d.useCallback(()=>ee(xe=>!xe),[]),pe=d.useCallback(()=>ee(!1),[]),oe=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);De(e.editingMode)&&(e.editingMode=nn.EditingMode.READ_ONLY);const{READ_ONLY:de,DYNAMIC:he}=nn.EditingMode,se=t.dimensions,z=Math.max(0,se.numDataRows),P=z===0&&!(e.editingMode===he&&se.numDataColumns>0),G=z>Ek,le=!G&&!P&&e.editingMode!==he,ce=!P&&e.editingMode===he&&!n,we=d.useRef(new ra(z)),[ge,Qe]=d.useState(we.current.getNumRows());d.useEffect(()=>{we.current=new ra(z),Qe(we.current.getNumRows())},[z]);const Se=d.useCallback(()=>{we.current=new ra(z),Qe(we.current.getNumRows())},[z]),[Dt,bt]=d.useState(e.columnOrder);d.useEffect(()=>{bt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:Te,allColumns:re,setColumnConfigMapping:me}=ww(e,t,n,Dt,l);d.useEffect(()=>{if(e.editingMode===de||!r)return;const xe=r.getStringValue({id:e.id,formId:e.formId});xe&&(we.current.fromJson(xe,Te),Qe(we.current.getNumRows()))},[]);const{getCellContent:ye}=ak(t,Te,ge,we),{columns:ne,sortColumn:be,getOriginalIndex:Oe,getCellContent:Pe}=Tw(z,Te,ye),it=d.useCallback((xe,mt)=>{if(!r)return;const Ft={selection:{rows:[],columns:[],cells:[]}};if(Ft.selection.rows=xe.rows.toArray().map(Yt=>Oe(Yt)),Ft.selection.columns=xe.columns.toArray().map(Yt=>qr(ne[Yt])),mt&&xe.current){const{cell:Yt,range:jt}=xe.current;if(jt)for(let fn=jt.y;fn<jt.y+jt.height;fn++)for(let $n=jt.x;$n<jt.x+jt.width;$n++)ne[$n].isIndex||Ft.selection.cells.push([Oe(fn),qr(ne[$n])]);else if(Yt){const[fn,$n]=Yt;ne[fn].isIndex||Ft.selection.cells.push([Oe($n),qr(ne[fn])])}}const _n=JSON.stringify(Ft),Tn=r.getStringValue({id:e.id,formId:e.formId});(Tn===void 0||Tn!==_n)&&r.setStringValue({id:e.id,formId:e.formId},_n,{fromUi:!0},i)},[ne,e.id,e.formId,r,i,Oe]),{debouncedCallback:Ae}=bu(it,sd),{gridSelection:Ze,isRowSelectionActivated:Ie,isMultiRowSelectionActivated:Me,isColumnSelectionActivated:ze,isMultiColumnSelectionActivated:ct,isCellSelectionActivated:Je,isMultiCellSelectionActivated:We,isRowSelected:ht,isColumnSelected:Wt,isCellSelected:Et,clearSelection:ut,processSelectionChange:qt}=sk(e,P,n,ne,Ae);d.useEffect(()=>{Je||ut(!0,!0)},[c]);const Kt=d.useCallback(xe=>{y.current?.updateCells(xe)},[]);d.useEffect(()=>{if(!Ie&&!ze&&!Je||!r)return;const xe=r.getStringValue({id:e.id,formId:e.formId});if(xe){const mt=ne.map(jt=>qr(jt)),Ft=JSON.parse(xe);let _n=Ye.empty(),Tn=Ye.empty(),Yt;if(Ft.selection?.rows?.forEach(jt=>{_n=_n.add(jt)}),Ft.selection?.columns?.forEach(jt=>{Tn=Tn.add(mt.indexOf(jt))}),Je&&!We){const[jt,fn]=Ft.selection?.cells?.[0]??[];jt!==void 0&&fn!==void 0&&(Yt=[mt.indexOf(fn),jt])}if(_n.length>0||Tn.length>0||Yt!==void 0){const jt={rows:_n,columns:Tn,current:Yt?{cell:Yt,range:{x:Yt[0],y:Yt[1],width:1,height:1},rangeStack:[]}:void 0};qt(jt)}}},[]);const On=d.useCallback(()=>{ge!==we.current.getNumRows()&&Qe(we.current.getNumRows())},[ge]),St=d.useCallback(()=>{if(!r)return;const xe=we.current.toJson(ne);let mt=r.getStringValue({id:e.id,formId:e.formId});mt===void 0&&(mt=new ra(0).toJson([])),xe!==mt&&r.setStringValue({id:e.id,formId:e.formId},xe,{fromUi:!0},i)},[ne,e.id,e.formId,r,i]),{debouncedCallback:ft}=bu(St,sd),{exportToCsv:Dn}=ik(Pe,ne,ge,S),{onCellEdited:wt,onPaste:cn,onRowAppended:pn,onDelete:Re,validateCell:dt}=ek(ne,e.editingMode!==he,we,Pe,Oe,Kt,On,ft,ut),At=d.useMemo(()=>P?[0]:ce?[ge]:[],[P,ce,ge]),{tooltip:dn,clearTooltip:$t,onItemHovered:rn}=hk(ne,Pe,At),{drawCell:Pn,customRenderers:on}=YC(ne),{provideEditor:Zt}=Dw(),Be=d.useCallback(xe=>({...xe,hasMenu:!P}),[P]),yt=d.useMemo(()=>ne.map(xe=>Be(Zl(xe))),[ne,Be]),{columns:In,onColumnResize:Pt}=kw(yt),pt=t.dimensions.numHeaderRows>1,{minHeight:xn,maxHeight:er,minWidth:tr,maxWidth:B,rowHeight:_e,resizableSize:Ne,setResizableSize:Tt}=ck(e,E,ge,pt,g||0,f,c,l,s,C,m),an=d.useCallback(([xe,mt])=>({...V1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:E.glideTheme.textLight},span:[0,Math.max(ne.length-1,0)]}),[ne,E.glideTheme.textLight]),hn=d.useCallback(()=>{Se(),ut()},[Se,ut]);zg({element:e,widgetMgr:r,onFormCleared:hn});const{pinColumn:Rn,unpinColumn:gn,freezeColumns:Bt}=xw(ne,P,g||0,E.minColumnWidth,ut,me),{changeColumnFormat:En}=yw(me),{hideColumn:Cn,showColumn:Lo}=Ow(ut,me),{onColumnMoved:no}=Cw(ne,Bt,Rn,gn,bt);d.useEffect(()=>{let xe;const mt=requestAnimationFrame(()=>{xe=setTimeout(()=>{if(R.current&&y.current){const Ft=R.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Ft&&(D(Ft.height>R.current.clientHeight),Q(Ft.width>R.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(mt),xe&&clearTimeout(xe)}},[Ne,ge,In,R]),d.useEffect(()=>{re.length==ne.length&&ee(!1)},[re.length,ne.length]);const Hr=!!(p||l?.useContent&&!m);return ve.jsxs(ld,{className:"stDataFrame","data-testid":"stDataFrame",ref:R,isInHorizontalLayout:p,minHeight:xn,disableResize:Hr,onPointerDown:xe=>{if(R.current){const mt=R.current.getBoundingClientRect(),Ft=(v||Math.round(tn(Tk)))+1;k&&mt.height-Ft<xe.clientY-mt.top&&xe.stopPropagation(),O&&mt.width-Ft<xe.clientX-mt.left&&xe.stopPropagation()}},onBlur:xe=>{!x&&!oe&&!xe.currentTarget.contains(xe.relatedTarget)&&!Je&&ut(!0,!0)},children:[ve.jsxs(Fg,{isFullScreen:c,disableFullscreenMode:o,locked:ht&&!Ie||Et||oe&&x||ae,onExpand:u,onCollapse:h,target:ld,children:[a?.map(xe=>xe),(Ie&&ht||ze&&Wt||Je&&Et)&&ve.jsx(xo,{label:"Clear selection",icon:Wg,onClick:()=>{ut(),$t()}}),ce&&ht&&ve.jsx(xo,{label:"Delete row(s)",icon:qg,onClick:()=>{Re&&(Re(Ze),$t())}}),ce&&!ht&&ve.jsx(xo,{label:"Add row",icon:Sd,onClick:()=>{pn&&(L(!0),pn(),$t(),y.current?.scrollTo(0,ge,"vertical"))}}),!P&&re.length>ne.length&&ve.jsx(Mk,{columns:re,columnOrder:Dt,setColumnOrder:bt,hideColumn:Cn,showColumn:Lo,isOpen:ae,onClose:pe,children:ve.jsx(xo,{label:"Show/hide columns",icon:Id,onClick:K})}),!G&&!P&&ve.jsx(xo,{label:"Download as CSV",icon:Kg,onClick:Dn}),!P&&ve.jsx(xo,{label:"Search",icon:Md,onClick:()=>{T?I(!1):(L(!0),I(!0)),$t()}})]}),ve.jsx(Fp,{"data-testid":"stDataFrameResizable",ref:w,defaultSize:Ne,style:{border:`${E.tableBorderWidth}px solid ${E.glideTheme.borderColor}`,borderRadius:`${E.tableBorderRadius}`},minHeight:xn,maxHeight:er,minWidth:tr,maxWidth:Hr?void 0:B,size:Ne,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!Hr,bottomLeft:!1,topLeft:!1},grid:[1,_e],snapGap:_e/3,onResizeStop:(xe,mt,Ft,_n)=>{if(w.current){const Tn=2*E.tableBorderWidth;Tt({width:w.current.size.width,height:er-w.current.size.height===Tn?w.current.size.height+Tn:w.current.size.height})}},children:ve.jsx(P1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:y,columns:In,rows:P?1:ge,minColumnWidth:E.minColumnWidth,maxColumnWidth:E.maxColumnWidth,maxColumnAutoWidth:E.maxColumnAutoWidth,rowHeight:_e,headerHeight:E.defaultHeaderHeight,getCellContent:P?an:Pe,onColumnResize:oe?void 0:Pt,resizeIndicator:"header",freezeColumns:Bt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:oe?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:ze?void 0:no,onItemHovered:xe=>{H?.(xe),rn?.(xe)},keybindings:{downFill:!0,...Je||G?{selectAll:!1}:{}},onKeyDown:xe=>{(xe.ctrlKey||xe.metaKey)&&xe.key==="f"&&(I(mt=>!mt),xe.stopPropagation(),xe.preventDefault())},showSearch:T,searchResults:T?void 0:[],onSearchClose:()=>{I(!1),$t()},onHeaderClicked:(xe,mt)=>{!le||ze||(T&&I(!1),Ie&&ht?ut():ut(!0,!0),be(xe,"auto"))},gridSelection:Ze,onGridSelectionChange:xe=>{(x||oe)&&(qt(xe),dn!==void 0&&$t(),Y(void 0),ee(!1))},theme:E.glideTheme,getRowThemeOverride:M,onMouseMove:xe=>{xe.kind==="out-of-bounds"&&x?L(!1):xe.kind!=="out-of-bounds"&&!x&&L(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:k?-v:void 0,paddingRight:O?-v:void 0},provideEditor:Zt,drawCell:Pn,customRenderers:on,imageEditorOverride:nw,headerIcons:E.headerIcons,validateCell:dt,onHeaderMenuClick:(xe,mt)=>{ae||Y({columnIdx:xe,headerBounds:mt})},onPaste:!1,...Ie&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:E.glideTheme.bgHeader,bgCellMedium:E.glideTheme.bgHeader,textMedium:E.glideTheme.textLight}},rowSelectionMode:Me?"multi":"auto",rowSelect:n?"none":Me?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...ze&&{columnSelect:n?"none":ct?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:ct?"multi":"auto",rangeSelectionBlending:"additive"},...Je&&{rangeSelect:We?"rect":"cell",rangeSelectionBlending:"additive"},...!P&&e.editingMode!==de&&!n&&{fillHandle:!oe,onCellEdited:wt,onPaste:cn,onDelete:Re},...!P&&e.editingMode===he&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:E.glideTheme.bgHeader,bgCellMedium:E.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:pn,onHeaderClicked:void 0}})}),dn?.content&&ve.jsx(Rk,{top:dn.top,left:dn.left,content:dn.content,clearTooltip:$t}),N&&md.createPortal(ve.jsx(Ck,{top:N.headerBounds.y+N.headerBounds.height,left:N.headerBounds.x+N.headerBounds.width,column:Te[N.columnIdx],onCloseMenu:()=>Y(void 0),onSortColumn:le?xe=>{T&&I(!1),ut(!(Ie&&ht),!0),be(N.columnIdx,xe,!0)}:void 0,isColumnPinned:Te[N.columnIdx].isPinned,onUnpinColumn:()=>{gn(Te[N.columnIdx].id)},onPinColumn:()=>{Rn(Te[N.columnIdx].id)},onHideColumn:()=>{Cn(Te[N.columnIdx].id)},onChangeFormat:xe=>{En(Te[N.columnIdx].id,xe),setTimeout(()=>{y.current?.remeasureColumns(Ye.fromSingleSelection(N.columnIdx))},100)},onAutosize:()=>{y.current?.remeasureColumns(Ye.fromSingleSelection(N.columnIdx))}}),document.querySelector("#portal"))]})}const Dk=Lg(Ok),Df=d.memo(Dk),Pk=({data:e,height:t,width:n,customToolbarActions:r})=>ve.jsx(Df,{element:new nn({useContainerWidth:!0,editingMode:nn.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:r,widthConfig:n??new cc.WidthConfig({useStretch:!0}),heightConfig:t?new cc.HeightConfig({pixelHeight:t}):void 0}),jk=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:Pk,default:Df},Symbol.toStringTag,{value:"Module"}));export{Io as E,lh as M,tm as V,Pk as Y,hb as a,sn as f,jk as i,ko as k,L0 as u};
|