streamlit-nightly 1.47.1.dev20250717__py3-none-any.whl → 1.47.1.dev20250718__py3-none-any.whl
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.
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +218 -218
- streamlit/static/static/js/{ErrorOutline.esm.77fHhxmf.js → ErrorOutline.esm.d3Hxfdci.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.qBSGbtBF.js → FileDownload.esm.CG1f-xm1.js} +1 -1
- streamlit/static/static/js/{FileHelper.BYzZxqTl.js → FileHelper.DHMc3oD-.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.BapTKtHM.js → FormClearHelper.D-pHyCRp.js} +1 -1
- streamlit/static/static/js/{Hooks.DQUBTvpJ.js → Hooks.VSrGaVjd.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DfmDQyfZ.js → InputInstructions.WeuUTtOi.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DH8nVA3A.js → ProgressBar.BiHfCstR.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.Dc3T7qg7.js → RenderInPortalIfExists.ZyFWP5F_.js} +1 -1
- streamlit/static/static/js/{Toolbar.DoQICZLn.js → Toolbar.CyTqjPSm.js} +1 -1
- streamlit/static/static/js/{base-input.DJLL2PiI.js → base-input.BBafABfa.js} +1 -1
- streamlit/static/static/js/{checkbox.BEZCVkdu.js → checkbox.CsokueEf.js} +1 -1
- streamlit/static/static/js/{createSuper.Cd0gz3ZP.js → createSuper.DUXVSKUx.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DBCkAuJT.js → data-grid-overlay-editor.BZB3sRFz.js} +1 -1
- streamlit/static/static/js/{downloader.CNEzyeJy.js → downloader.Gc_mDZTd.js} +1 -1
- streamlit/static/static/js/{es6.Dj_qfQ-J.js → es6.D7Hpvg-Y.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DWZGbVE9.js → iframeResizer.contentWindow.Dixtb414.js} +1 -1
- streamlit/static/static/js/{index.DkYSvvUe.js → index.1I08OB5E.js} +1 -1
- streamlit/static/static/js/{index.Uzv6ooYp.js → index.1tvGeVqu.js} +1 -1
- streamlit/static/static/js/{index.CtsW3eJF.js → index.3kKm-5pK.js} +1 -1
- streamlit/static/static/js/{index.BqR_ah2P.js → index.B3jGbg7L.js} +1 -1
- streamlit/static/static/js/{index.BlsArqdU.js → index.B6FtN9Uz.js} +1 -1
- streamlit/static/static/js/{index.nKiB2Lb1.js → index.B8LI8-nN.js} +1 -1
- streamlit/static/static/js/{index.DYQbjkZY.js → index.B9nhaEsM.js} +1 -1
- streamlit/static/static/js/{index.CA4nGH2a.js → index.BAY8pFiv.js} +1 -1
- streamlit/static/static/js/{index.hExo-vs3.js → index.BCsvK19y.js} +1 -1
- streamlit/static/static/js/{index.Dj_sBWoU.js → index.BLP5te33.js} +1 -1
- streamlit/static/static/js/{index.DyKNikeb.js → index.BLUQ1EyU.js} +5 -5
- streamlit/static/static/js/{index.B5PCerES.js → index.BfZdIsq7.js} +1 -1
- streamlit/static/static/js/{index.Dy9mt1lb.js → index.BmUE95fB.js} +1 -1
- streamlit/static/static/js/index.BsHauW3Q.js +1 -0
- streamlit/static/static/js/{index.Dh4PSyeU.js → index.C7_F5agF.js} +1 -1
- streamlit/static/static/js/{index.BCYov0Z6.js → index.CCCVgWjv.js} +1 -1
- streamlit/static/static/js/{index.HTy-ykxC.js → index.CTuh86XM.js} +1 -1
- streamlit/static/static/js/{index.Bnbuv9NG.js → index.CiKcNtjp.js} +1 -1
- streamlit/static/static/js/{index.BQkb06fM.js → index.CtgnsTyx.js} +1 -1
- streamlit/static/static/js/{index.DF-6qVO2.js → index.CuR4KiW1.js} +1 -1
- streamlit/static/static/js/{index.CSEGzY5i.js → index.D55IdpUb.js} +1 -1
- streamlit/static/static/js/{index.SCzIN5SB.js → index.DDA0UPVF.js} +4 -4
- streamlit/static/static/js/{index.CHmeRQB0.js → index.DEl7hmdw.js} +1 -1
- streamlit/static/static/js/{index.r5SsG0UH.js → index.DNYk6Ms7.js} +1 -1
- streamlit/static/static/js/{index.gupvSUiZ.js → index.DNpX2mfm.js} +1 -1
- streamlit/static/static/js/{index.jtH7YSzj.js → index.DRBV5jsi.js} +1 -1
- streamlit/static/static/js/{index.DaegFwX9.js → index.Defrna5Y.js} +1 -1
- streamlit/static/static/js/{index.Dxi0xeeC.js → index.Dme1SoFq.js} +1 -1
- streamlit/static/static/js/{index.BwewuyvV.js → index.Dt7SXFxg.js} +1 -1
- streamlit/static/static/js/{index.D4efqxNs.js → index.E-RqX1S3.js} +1 -1
- streamlit/static/static/js/{index.3629iKJ_.js → index.GKoXFpUj.js} +1 -1
- streamlit/static/static/js/{index.DIxNMQxZ.js → index.N5heEhmI.js} +1 -1
- streamlit/static/static/js/{index.DcXKaleC.js → index.ZCPv8IBM.js} +1 -1
- streamlit/static/static/js/{index.9H0CGffC.js → index.cB56zRkf.js} +1 -1
- streamlit/static/static/js/{index.Bwe6rc_e.js → index.jRJFIr7D.js} +1 -1
- streamlit/static/static/js/{index.CoYP8GwB.js → index.lI9cXt6f.js} +1 -1
- streamlit/static/static/js/{index.HcR5RThE.js → index.uRM33_0H.js} +1 -1
- streamlit/static/static/js/{input.C4PKmVyq.js → input.CX92Mo3U.js} +1 -1
- streamlit/static/static/js/{memory.BlWtC9mT.js → memory.DCjnC5Gi.js} +1 -1
- streamlit/static/static/js/{mergeWith.BpStvP-d.js → mergeWith.W07c6g48.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.h2wH-G_L.js → number-overlay-editor.Db9x94os.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CU3h0WWI.js → possibleConstructorReturn.W2Lke_D1.js} +1 -1
- streamlit/static/static/js/{sandbox.BW2Eycz9.js → sandbox.C9Wil_3D.js} +1 -1
- streamlit/static/static/js/{timepicker.ASDBDZeB.js → timepicker.Cw5YvjvC.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.Dn5dJvBy.js → toConsumableArray.Cwq9qdFc.js} +1 -1
- streamlit/static/static/js/{uniqueId.8z-ePOzb.js → uniqueId.oYGC6C0n.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Bg3DrOCg.js → useBasicWidgetState.fqY6IQVh.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.SNHZF6F7.js → useOnInputChange.BcqeFBxN.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.Dm8V44AL.js → useTextInputAutoExpand.C-lpUUwe.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.Drneg2_8.js → withFullScreenWrapper.CE-2-8xF.js} +1 -1
- {streamlit_nightly-1.47.1.dev20250717.dist-info → streamlit_nightly-1.47.1.dev20250718.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.47.1.dev20250717.dist-info → streamlit_nightly-1.47.1.dev20250718.dist-info}/RECORD +74 -74
- streamlit/static/static/js/index.Co_D1bGa.js +0 -1
- {streamlit_nightly-1.47.1.dev20250717.data → streamlit_nightly-1.47.1.dev20250718.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.47.1.dev20250717.dist-info → streamlit_nightly-1.47.1.dev20250718.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.47.1.dev20250717.dist-info → streamlit_nightly-1.47.1.dev20250718.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.47.1.dev20250717.dist-info → streamlit_nightly-1.47.1.dev20250718.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.
|
2
|
-
import{r as f,E as As,_ as ze,c as fh,g as sr,i as qa,d as lo,e as hh,f as gh,h as mh,m as Tc,n as Dc,R as Vt,o as ph,p as Oc,q as vh,t as bh,u as wh,v as yh,w as Ch,x as Sh,a as xr,y as Hs,s as Un,z as Br,j as qe,F as Pc,A as pa,T as _c,B as va,C as vn,D as Bn,G as ba,l as wa,H as ln,I as Fc,J as li,K as xh,L as kh,M as Le,N as Lc,O as lt,Q as Xi,S as Vr,U as Ga,V as Mh,W as Rh,X as Ih,Y as Pl,Z as Eh,$ as Th,a0 as Dh,a1 as Oh,a2 as Ac,a3 as Ph,a4 as _h,a5 as Ss,a6 as Hc,a7 as zc,a8 as Fh,a9 as Lh,aa as Ah,ab as Hh,ac as zh,ad as Vh,ae as $h,af as Nh,ag as Bh,ah as Vc,ai as Wh,aj as Uh,ak as qh,al as Gh,am as Xh,an as Yh,ao as jh,ap as Kh,aq as Zh,ar as Jh,as as Qh,at as eg,au as tg,av as ng,aw as wn,ax as Yi,ay as lr,az as Oe,aA as rg,b as $c,aB as Nc,k as ig,aC as og,aD as ag,aE as Xa,aF as sg,aG as lg,aH as ug,aI as cg,aJ as dg}from"./index.SCzIN5SB.js";import{u as fg}from"./FormClearHelper.BapTKtHM.js";import{w as hg,E as gg}from"./withFullScreenWrapper.Drneg2_8.js";import{T as mg,a as ai}from"./Toolbar.DoQICZLn.js";import{L as pg,S as vg,a as bg}from"./checkbox.BEZCVkdu.js";import{m as wg}from"./mergeWith.BpStvP-d.js";import{s as yg}from"./sprintf.D7DtBTRn.js";import{c as Cg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as ir,a as zs,C as Sg}from"./toConsumableArray.Dn5dJvBy.js";import{_ as xg,a as kg,b as Mg}from"./possibleConstructorReturn.CU3h0WWI.js";import{_ as Rg}from"./createSuper.Cd0gz3ZP.js";import{D as Ig,F as Eg}from"./FileDownload.esm.qBSGbtBF.js";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";var Ya,_l;function Tg(){if(_l)return Ya;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ya=n,Ya}var ja,Fl;function Dg(){if(Fl)return ja;Fl=1;var e=Tg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Og=Dg();const Pg=sr(Og);function qc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return qc(t)}function to(e,t){return qc(t??"Hell froze over")}function _g(e,t){try{return e()}catch{return t}}const Ll=Object.prototype.hasOwnProperty;function pi(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--&&pi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ll.call(e,n)&&++r&&!Ll.call(t,n)||!(n in t)||!pi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ta=null,Vs=void 0;var J;(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"})(J||(J={}));var Al;(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"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function _o(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function ui(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function fi(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function ci(e){if(!ui(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:to(e,"A cell was passed with an invalid kind")}}function Fg(e){return Pg(e,"editor")}function $s(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Lg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let zl;class it{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new it([]));static fromSingleSelection=t=>it.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new it(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Lg([...this.items,n]);return new it(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new it(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var Ag=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Vl=Ag,Hg=e=>e.toUpperCase()===e,zg=e=>t=>e.indexOf(t)===-1,Gc=(e,t)=>{const n={};return Object.keys(e).filter(zg(t)).forEach(r=>{n[r]=e[r]}),n};function Vg(e,t,n){const r=Gc(t,n);if(!e){const i=typeof qa=="function"?{default:qa}:qa;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var $g=(e,t)=>{};function Ng(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Hg(a[0])):n.propsAsIs,c=Vg(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const y=d[p],b=y[0],v=y[1]||"",S=typeof b=="function"?b(o):b;$g(S,n.name),g[`--${p}`]=`${S}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=Gc(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var un=Ng;const Bg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ka={},Li={},Fo={},Lo={},$l;function Wg(){return $l||($l=1,function(e){(function(t,n){n(e,lo(),hh())})(Lo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var S=1;S<arguments.length;S++){var O=arguments[S];for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&(v[M]=O[M])}return v};function l(v,S){var O={};for(var M in v)S.indexOf(M)>=0||Object.prototype.hasOwnProperty.call(v,M)&&(O[M]=v[M]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var M=0;M<O.length;M++){var R=O[M];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(S,R.key,R)}}return function(S,O,M){return O&&v(S.prototype,O),M&&v(S,M),S}}();function d(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}var h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function y(v){if("touches"in v){var S=v.touches[0],O=S.pageX,M=S.pageY;return{x:O,y:M}}var R=v.screenX,_=v.screenY;return{x:R,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var M=arguments.length,R=Array(M),_=0;_<M;_++)R[_]=arguments[_];var I=d(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(R)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(M){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(M))}},{key:"_onMouseMove",value:function(M){this.mouseDown&&this._handleSwipeMove(M)}},{key:"_onMouseUp",value:function(M){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(M)}},{key:"_handleSwipeStart",value:function(M){var R=y(M),_=R.x,I=R.y;this.moveStart={x:_,y:I},this.props.onSwipeStart(M)}},{key:"_handleSwipeMove",value:function(M){if(this.moveStart){var R=y(M),_=R.x,I=R.y,k=_-this.moveStart.x,F=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},M);D&&M.cancelable&&M.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(M){this.props.onSwipeEnd(M);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,M):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,M),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,M):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,M)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(M){this.swiper=M,this.props.innerRef(M)}},{key:"render",value:function(){var M=this.props;M.tagName;var R=M.className,_=M.style,I=M.children;M.allowMouseEvents,M.onSwipeUp,M.onSwipeDown,M.onSwipeLeft,M.onSwipeRight,M.onSwipeStart,M.onSwipeMove,M.onSwipeEnd,M.innerRef,M.tolerance;var k=l(M,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},k),I)}}]),S}(n.Component);b.displayName="ReactSwipe",b.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},b.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=b})}(Lo)),Lo}var Nl;function Xc(){return Nl||(Nl=1,function(e){(function(t,n){n(e,Wg())})(Fo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Fo)),Fo}var Ai={},Bl;function Yc(){if(Bl)return Ai;Bl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,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 Ai.default=r,Ai}var Hi={},zi={},Wl;function Ug(){if(Wl)return zi;Wl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return zi.outerWidth=e,zi}var Vi={},Ul;function Ns(){if(Ul)return Vi;Ul=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Vi.default=e,Vi}var $i={},ql;function jc(){if(ql)return $i;ql=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(){return window};return $i.default=e,$i}var Gl;function Kc(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=l(lo()),t=s(Yc()),n=Ug(),r=s(Ns()),i=s(Xc()),o=s(jc());function s(I){return I&&I.__esModule?I:{default:I}}function a(){if(typeof WeakMap!="function")return null;var I=new WeakMap;return a=function(){return I},I}function l(I){if(I&&I.__esModule)return I;if(I===null||u(I)!=="object"&&typeof I!="function")return{default:I};var k=a();if(k&&k.has(I))return k.get(I);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in I)if(Object.prototype.hasOwnProperty.call(I,C)){var E=D?Object.getOwnPropertyDescriptor(I,C):null;E&&(E.get||E.set)?Object.defineProperty(F,C,E):F[C]=I[C]}return F.default=I,k&&k.set(I,F),F}function u(I){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(I)}function c(){return c=Object.assign||function(I){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(I[D]=F[D])}return I},c.apply(this,arguments)}function d(I,k){if(!(I instanceof k))throw new TypeError("Cannot call a class as a function")}function g(I,k){for(var F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,k,F){return k&&g(I.prototype,k),I}function m(I,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(k&&k.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),k&&p(I,k)}function p(I,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(I,k)}function y(I){var k=S();return function(){var D=O(I),C;if(k){var E=O(this).constructor;C=Reflect.construct(D,arguments,E)}else C=D.apply(this,arguments);return b(this,C)}}function b(I,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(I)}function v(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(I){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},O(I)}function M(I,k,F){return k in I?Object.defineProperty(I,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):I[k]=F,I}var R=function(k){return k.hasOwnProperty("key")},_=function(I){m(F,I);var k=y(F);function F(D){var C;return d(this,F),C=k.call(this,D),M(v(C),"itemsWrapperRef",void 0),M(v(C),"itemsListRef",void 0),M(v(C),"thumbsRef",void 0),M(v(C),"setItemsWrapperRef",function(E){C.itemsWrapperRef=E}),M(v(C),"setItemsListRef",function(E){C.itemsListRef=E}),M(v(C),"setThumbsRef",function(E,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=E}),M(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var E=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),N=Math.floor(T/x),G=N<E,j=G?E-N:0;C.setState(function(ie,ee){return{itemSize:x,visibleItems:N,firstItem:G?C.getFirstItem(ee.selectedItem):0,lastPosition:j,showArrows:G}})}}),M(v(C),"handleClickItem",function(E,T,x){if(!R(x)||x.key==="Enter"){var N=C.props.onSelectItem;typeof N=="function"&&N(E,T)}}),M(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),M(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),M(v(C),"onSwipeMove",function(E){var T=E.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,N=e.Children.count(C.props.children),G=-(C.state.firstItem*100)/C.state.visibleItems,j=Math.max(N-C.state.visibleItems,0),ie=-j*100/C.state.visibleItems;G===x&&T>0&&(T=0),G===ie&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,Q=G+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(Q,"%",C.props.axis)}),!0}),M(v(C),"slideRight",function(E){C.moveTo(C.state.firstItem-(typeof E=="number"?E:1))}),M(v(C),"slideLeft",function(E){C.moveTo(C.state.firstItem+(typeof E=="number"?E:1))}),M(v(C),"moveTo",function(E){E=E<0?0:E,E=E>=C.state.lastPosition?C.state.lastPosition:E,C.setState({firstItem:E})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var E=C;return C>=this.state.lastPosition&&(E=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(E=this.state.firstItem),C<this.state.firstItem&&(E=C),E}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(E,T){var x=t.default.ITEM(!1,T===C.state.selectedItem),N={key:T,ref:function(j){return C.setThumbsRef(j,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),E)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var E=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},G=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(G,"px",this.props.axis),ie=this.props.transitionTime+"ms";return N={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:ie,MozTransitionDuration:ie,MsTransitionDuration:ie,OTransitionDuration:ie,transitionDuration:ie,msTransitionDuration:ie},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(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),E?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(Q){return C.setItemsListRef(Q)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Hi.default=_,M(_,"displayName","Thumbs"),M(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Hi}var Ni={},Xl;function qg(){if(Xl)return Ni;Xl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return document};return Ni.default=e,Ni}var Tn={},Yl;function Zc(){if(Yl)return Tn;Yl=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.setPosition=Tn.getPosition=Tn.isKeyboardEvent=Tn.defaultStatusFormatter=Tn.noop=void 0;var e=lo(),t=n(Ns());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};Tn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Tn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Tn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Tn.getPosition=s;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Tn.setPosition=a,Tn}var Nn={},jl;function Gg(){if(jl)return Nn;jl=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.fadeAnimationHandler=Nn.slideStopSwipingHandler=Nn.slideSwipeAnimationHandler=Nn.slideAnimationHandler=void 0;var e=lo(),t=r(Ns()),n=Zc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){s(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}return d}function s(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var m={},p=h.selectedItem,y=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),M=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:M,MozTransitionDuration:M,OTransitionDuration:M,transitionDuration:M,msTransitionDuration:M})),m};Nn.slideAnimationHandler=a;var l=function(g,h,m,p){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),M=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,_=R;O===S&&R>0&&(_=0),O===M&&R<0&&(_=0);var I=O+100/(m.itemSize/_),k=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&I>-100?I-=v*100:m.selectedItem===v-1&&I<-v*100&&(I+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(I,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),y};Nn.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};Nn.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",y={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 h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Nn.fadeAnimationHandler=c,Nn}var Kl;function Xg(){if(Kl)return Li;Kl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=c(lo()),t=l(Xc()),n=l(Yc()),r=l(Kc()),i=l(qg()),o=l(jc()),s=Zc(),a=Gg();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var E={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var N=T?Object.getOwnPropertyDescriptor(D,x):null;N&&(N.get||N.set)?Object.defineProperty(E,x,N):E[x]=D[x]}return E.default=D,C&&C.set(D,E),E}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(E){return typeof E}:d=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var E=arguments[C];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(D[T]=E[T])}return D},g.apply(this,arguments)}function h(D,C){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(D,x).enumerable})),E.push.apply(E,T)}return E}function m(D){for(var C=1;C<arguments.length;C++){var E=arguments[C]!=null?arguments[C]:{};C%2?h(Object(E),!0).forEach(function(T){k(D,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(E,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function y(D,C){for(var E=0;E<C.length;E++){var T=C[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function b(D,C,E){return C&&y(D.prototype,C),D}function v(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=I(D),x;if(C){var N=I(this).constructor;x=Reflect.construct(T,arguments,N)}else x=T.apply(this,arguments);return M(this,x)}}function M(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(D){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},I(D)}function k(D,C,E){return C in D?Object.defineProperty(D,C,{value:E,enumerable:!0,configurable:!0,writable:!0}):D[C]=E,D}var F=function(D){v(E,D);var C=O(E);function E(T){var x;p(this,E),x=C.call(this,T),k(R(x),"thumbsRef",void 0),k(R(x),"carouselWrapperRef",void 0),k(R(x),"listRef",void 0),k(R(x),"itemsRef",void 0),k(R(x),"timer",void 0),k(R(x),"animationHandler",void 0),k(R(x),"setThumbsRef",function(G){x.thumbsRef=G}),k(R(x),"setCarouselWrapperRef",function(G){x.carouselWrapperRef=G}),k(R(x),"setListRef",function(G){x.listRef=G}),k(R(x),"setItemsRef",function(G,j){x.itemsRef||(x.itemsRef=[]),x.itemsRef[j]=G}),k(R(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(R(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(R(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(R(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(R(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(R(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(R(x),"navigateWithKeyboard",function(G){if(x.isFocusWithinTheCarousel()){var j=x.props.axis,ie=j==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Q=ie?ee.ArrowRight:ee.ArrowDown,te=ie?ee.ArrowLeft:ee.ArrowUp;Q===G.keyCode?x.increment():te===G.keyCode&&x.decrement()}}),k(R(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var G=x.props.axis==="horizontal",j=x.itemsRef[0];if(j){var ie=G?j.clientWidth:j.clientHeight;x.setState({itemSize:ie}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(R(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(R(x),"handleClickItem",function(G,j){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(G,j),G!==x.state.selectedItem&&x.setState({selectedItem:G})}}),k(R(x),"handleOnChange",function(G,j){e.Children.count(x.props.children)<=1||x.props.onChange(G,j)}),k(R(x),"handleClickThumb",function(G,j){x.props.onClickThumb(G,j),x.moveTo(G)}),k(R(x),"onSwipeStart",function(G){x.setState({swiping:!0}),x.props.onSwipeStart(G)}),k(R(x),"onSwipeEnd",function(G){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(G),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(R(x),"onSwipeMove",function(G,j){x.props.onSwipeMove(j);var ie=x.props.swipeAnimationHandler(G,x.props,x.state,x.setState.bind(R(x)));return x.setState(m({},ie)),!!Object.keys(ie).length}),k(R(x),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof G=="number"?G:1))}),k(R(x),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof G=="number"?G:1))}),k(R(x),"moveTo",function(G){if(typeof G=="number"){var j=e.Children.count(x.props.children)-1;G<0&&(G=x.props.infiniteLoop?j:0),G>j&&(G=x.props.infiniteLoop?0:j),x.selectItem({selectedItem:G}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(R(x),"onClickNext",function(){x.increment(1)}),k(R(x),"onClickPrev",function(){x.decrement(1)}),k(R(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(R(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(R(x),"changeItem",function(G){return function(j){(!(0,s.isKeyboardEvent)(j)||j.key==="Enter")&&x.moveTo(G)}}),k(R(x),"selectItem",function(G){x.setState(m({previousItem:x.state.selectedItem},G),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(G.selectedItem,e.Children.toArray(x.props.children)[G.selectedItem])}),k(R(x),"getInitialImage",function(){var G=x.props.selectedItem,j=x.itemsRef&&x.itemsRef[G],ie=j&&j.getElementsByTagName("img")||[];return ie[0]}),k(R(x),"getVariableItemHeight",function(G){var j=x.itemsRef&&x.itemsRef[G];if(x.state.hasMount&&j&&j.children.length){var ie=j.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var Q=function ue(){x.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",Q)}}var te=ie[0]||j.children[0],se=te.clientHeight;return se>0?se:null}return null});var N={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},N),x.animationHandler(T,N)),x}return b(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,N){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.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 x=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 N=x.getInitialImage();N&&!N.complete?N.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var N=this;return this.props.children?e.Children.map(this.props.children,function(G,j){var ie=j===N.state.selectedItem,ee=j===N.state.previousItem,Q=ie&&N.state.selectedStyle||ee&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(Q=m(m({},Q),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(Q=m(m({},Q),{},{pointerEvents:"none"}));var te={ref:function(ue){return N.setItemsRef(ue,j)},key:"itemKey"+j+(x?"clone":""),className:n.default.ITEM(!0,j===N.state.selectedItem,j===N.state.previousItem),onClick:N.handleClickItem.bind(N,j,G),style:Q};return e.default.createElement("li",te,N.props.renderItem(G,{isSelected:j===N.state.selectedItem,isPrevious:j===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,N=this.props,G=N.showIndicators,j=N.labels,ie=N.renderIndicator,ee=N.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(Q,te){return ie&&ie(x.changeItem(te),te===x.state.selectedItem,te,j.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var x=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,G=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Q=this.renderItems(!0),te=Q.shift(),se=Q.pop(),ue={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};if(G){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ie,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E}(e.default.Component);return Li.default=F,k(F,"displayName","Carousel"),k(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!E),onClick:C})},renderArrowNext:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!E),onClick:C})},renderIndicator:function(C,E,T,x){return e.default.createElement("li",{className:n.default.DOT(E),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var E=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function(N){return N.type==="img"})),!!x)return x});return E.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):E},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Li}var Zl={},Jl;function Yg(){return Jl||(Jl=1),Zl}var Ql;function jg(){return Ql||(Ql=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Xg()),n=Yg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ka)),Ka}var Kg=jg(),Za,eu;function Zg(){if(eu)return Za;eu=1;var e=mh(),t=function(){return e.Date.now()};return Za=t,Za}var Ja,tu;function Jc(){if(tu)return Ja;tu=1;var e=Tc(),t=Zg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,y=0,b=!1,v=!1,S=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,S="trailing"in u?!!u.trailing:S);function O(E){var T=c,x=d;return c=d=void 0,y=E,h=a.apply(x,T),h}function M(E){return y=E,m=setTimeout(I,l),b?O(E):h}function R(E){var T=E-p,x=E-y,N=l-T;return v?o(N,g-x):N}function _(E){var T=E-p,x=E-y;return p===void 0||T>=l||T<0||v&&x>=g}function I(){var E=t();if(_(E))return k(E);m=setTimeout(I,R(E))}function k(E){return m=void 0,S&&c?O(E):(c=d=void 0,h)}function F(){m!==void 0&&clearTimeout(m),y=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var E=t(),T=_(E);if(c=arguments,d=this,p=E,T){if(m===void 0)return M(p);if(v)return clearTimeout(m),m=setTimeout(I,l),O(p)}return m===void 0&&(m=setTimeout(I,l)),h}return C.cancel=F,C.flush=D,C}return Ja=s,Ja}var Jg=Jc();const Qc=sr(Jg);function bn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function yr(e,t){return e===void 0?void 0:t}const Qg=Math.PI;function nu(e){return e*Qg/180}const ed=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),td=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},nd=(e,t,n)=>Math.min(e,t-n*2),rd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Bs=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 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"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},em=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function tm(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Qc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const nm="֑-߿יִ-﷽ﹰ-ﻼ",rm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",im=new RegExp("^[^"+rm+"]*["+nm+"]");function Ws(e){return im.test(e)?"rtl":"not-rtl"}let Ao;function xs(){if(typeof document>"u")return 0;if(Ao!==void 0)return Ao;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(),Ao=n-r,Ao}const Hr=Symbol();function om(e){const t=f.useRef([Hr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const l=t.current[0];l!==Hr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Hr&&i({}),r(u=>typeof a=="function"?a(l===Hr?u:l):a),t.current[0]=Hr)},[]),s=f.useCallback(()=>{t.current[0]=Hr,i({})},[]);return[t.current[0]===Hr?n:t.current[0],o,s]}function id(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 am(e){const t=f.useRef(e);return pi(e,t.current)||(t.current=e),t.current}const sm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(Bg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Kg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Bs,null)))};function od(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Wr=od();function lm(e){Wr=e}const ad=/[&<>"']/,um=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cm=new RegExp(sd.source,"g"),dm={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=e=>dm[e];function gn(e,t){if(t){if(ad.test(e))return e.replace(um,ru)}else if(sd.test(e))return e.replace(cm,ru);return e}const fm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(fm,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const hm=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(hm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const gm=/[^\w:]/g,mm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(gm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!mm.test(n)&&(n=wm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ho={},pm=/^[^:]+:\/*[^/]*$/,vm=/^([^:]+:)[\s\S]*$/,bm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wm(e,t){Ho[" "+e]||(pm.test(e)?Ho[" "+e]=e+"/":Ho[" "+e]=Ko(e,"/",!0)),e=Ho[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(vm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(bm,"$1")+t:e+t}const ra={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Ko(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function ym(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Cm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?gn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:gn(s)}}function Sm(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=["./data-grid-overlay-editor.BZB3sRFz.js","./index.DDA0UPVF.js","../css/index.CJVRHjQZ.css","./FormClearHelper.D-pHyCRp.js","./withFullScreenWrapper.CE-2-8xF.js","./Toolbar.CyTqjPSm.js","./checkbox.CsokueEf.js","./mergeWith.W07c6g48.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.Cwq9qdFc.js","./possibleConstructorReturn.W2Lke_D1.js","./createSuper.DUXVSKUx.js","./FileDownload.esm.CG1f-xm1.js","./number-overlay-editor.Db9x94os.js","./es6.D7Hpvg-Y.js"])))=>i.map(i=>d[i]);
|
2
|
+
import{r as f,E as As,_ as ze,c as fh,g as sr,i as qa,d as lo,e as hh,f as gh,h as mh,m as Tc,n as Dc,R as Vt,o as ph,p as Oc,q as vh,t as bh,u as wh,v as yh,w as Ch,x as Sh,a as xr,y as Hs,s as Un,z as Br,j as qe,F as Pc,A as pa,T as _c,B as va,C as vn,D as Bn,G as ba,l as wa,H as ln,I as Fc,J as li,K as xh,L as kh,M as Le,N as Lc,O as lt,Q as Xi,S as Vr,U as Ga,V as Mh,W as Rh,X as Ih,Y as Pl,Z as Eh,$ as Th,a0 as Dh,a1 as Oh,a2 as Ac,a3 as Ph,a4 as _h,a5 as Ss,a6 as Hc,a7 as zc,a8 as Fh,a9 as Lh,aa as Ah,ab as Hh,ac as zh,ad as Vh,ae as $h,af as Nh,ag as Bh,ah as Vc,ai as Wh,aj as Uh,ak as qh,al as Gh,am as Xh,an as Yh,ao as jh,ap as Kh,aq as Zh,ar as Jh,as as Qh,at as eg,au as tg,av as ng,aw as wn,ax as Yi,ay as lr,az as Oe,aA as rg,b as $c,aB as Nc,k as ig,aC as og,aD as ag,aE as Xa,aF as sg,aG as lg,aH as ug,aI as cg,aJ as dg}from"./index.DDA0UPVF.js";import{u as fg}from"./FormClearHelper.D-pHyCRp.js";import{w as hg,E as gg}from"./withFullScreenWrapper.CE-2-8xF.js";import{T as mg,a as ai}from"./Toolbar.CyTqjPSm.js";import{L as pg,S as vg,a as bg}from"./checkbox.CsokueEf.js";import{m as wg}from"./mergeWith.W07c6g48.js";import{s as yg}from"./sprintf.D7DtBTRn.js";import{c as Cg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as ir,a as zs,C as Sg}from"./toConsumableArray.Cwq9qdFc.js";import{_ as xg,a as kg,b as Mg}from"./possibleConstructorReturn.W2Lke_D1.js";import{_ as Rg}from"./createSuper.DUXVSKUx.js";import{D as Ig,F as Eg}from"./FileDownload.esm.CG1f-xm1.js";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";var Ya,_l;function Tg(){if(_l)return Ya;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ya=n,Ya}var ja,Fl;function Dg(){if(Fl)return ja;Fl=1;var e=Tg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Og=Dg();const Pg=sr(Og);function qc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return qc(t)}function to(e,t){return qc(t??"Hell froze over")}function _g(e,t){try{return e()}catch{return t}}const Ll=Object.prototype.hasOwnProperty;function pi(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--&&pi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ll.call(e,n)&&++r&&!Ll.call(t,n)||!(n in t)||!pi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ta=null,Vs=void 0;var J;(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"})(J||(J={}));var Al;(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"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function _o(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function ui(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function fi(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function ci(e){if(!ui(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:to(e,"A cell was passed with an invalid kind")}}function Fg(e){return Pg(e,"editor")}function $s(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Lg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let zl;class it{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new it([]));static fromSingleSelection=t=>it.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new it(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Lg([...this.items,n]);return new it(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new it(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var Ag=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Vl=Ag,Hg=e=>e.toUpperCase()===e,zg=e=>t=>e.indexOf(t)===-1,Gc=(e,t)=>{const n={};return Object.keys(e).filter(zg(t)).forEach(r=>{n[r]=e[r]}),n};function Vg(e,t,n){const r=Gc(t,n);if(!e){const i=typeof qa=="function"?{default:qa}:qa;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var $g=(e,t)=>{};function Ng(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Hg(a[0])):n.propsAsIs,c=Vg(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const y=d[p],b=y[0],v=y[1]||"",S=typeof b=="function"?b(o):b;$g(S,n.name),g[`--${p}`]=`${S}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=Gc(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var un=Ng;const Bg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ka={},Li={},Fo={},Lo={},$l;function Wg(){return $l||($l=1,function(e){(function(t,n){n(e,lo(),hh())})(Lo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var S=1;S<arguments.length;S++){var O=arguments[S];for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&(v[M]=O[M])}return v};function l(v,S){var O={};for(var M in v)S.indexOf(M)>=0||Object.prototype.hasOwnProperty.call(v,M)&&(O[M]=v[M]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var M=0;M<O.length;M++){var R=O[M];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(S,R.key,R)}}return function(S,O,M){return O&&v(S.prototype,O),M&&v(S,M),S}}();function d(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}var h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function y(v){if("touches"in v){var S=v.touches[0],O=S.pageX,M=S.pageY;return{x:O,y:M}}var R=v.screenX,_=v.screenY;return{x:R,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var M=arguments.length,R=Array(M),_=0;_<M;_++)R[_]=arguments[_];var I=d(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(R)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(M){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(M))}},{key:"_onMouseMove",value:function(M){this.mouseDown&&this._handleSwipeMove(M)}},{key:"_onMouseUp",value:function(M){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(M)}},{key:"_handleSwipeStart",value:function(M){var R=y(M),_=R.x,I=R.y;this.moveStart={x:_,y:I},this.props.onSwipeStart(M)}},{key:"_handleSwipeMove",value:function(M){if(this.moveStart){var R=y(M),_=R.x,I=R.y,k=_-this.moveStart.x,F=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},M);D&&M.cancelable&&M.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(M){this.props.onSwipeEnd(M);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,M):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,M),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,M):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,M)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(M){this.swiper=M,this.props.innerRef(M)}},{key:"render",value:function(){var M=this.props;M.tagName;var R=M.className,_=M.style,I=M.children;M.allowMouseEvents,M.onSwipeUp,M.onSwipeDown,M.onSwipeLeft,M.onSwipeRight,M.onSwipeStart,M.onSwipeMove,M.onSwipeEnd,M.innerRef,M.tolerance;var k=l(M,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},k),I)}}]),S}(n.Component);b.displayName="ReactSwipe",b.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},b.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=b})}(Lo)),Lo}var Nl;function Xc(){return Nl||(Nl=1,function(e){(function(t,n){n(e,Wg())})(Fo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Fo)),Fo}var Ai={},Bl;function Yc(){if(Bl)return Ai;Bl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,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 Ai.default=r,Ai}var Hi={},zi={},Wl;function Ug(){if(Wl)return zi;Wl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return zi.outerWidth=e,zi}var Vi={},Ul;function Ns(){if(Ul)return Vi;Ul=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Vi.default=e,Vi}var $i={},ql;function jc(){if(ql)return $i;ql=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(){return window};return $i.default=e,$i}var Gl;function Kc(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=l(lo()),t=s(Yc()),n=Ug(),r=s(Ns()),i=s(Xc()),o=s(jc());function s(I){return I&&I.__esModule?I:{default:I}}function a(){if(typeof WeakMap!="function")return null;var I=new WeakMap;return a=function(){return I},I}function l(I){if(I&&I.__esModule)return I;if(I===null||u(I)!=="object"&&typeof I!="function")return{default:I};var k=a();if(k&&k.has(I))return k.get(I);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in I)if(Object.prototype.hasOwnProperty.call(I,C)){var E=D?Object.getOwnPropertyDescriptor(I,C):null;E&&(E.get||E.set)?Object.defineProperty(F,C,E):F[C]=I[C]}return F.default=I,k&&k.set(I,F),F}function u(I){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(I)}function c(){return c=Object.assign||function(I){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(I[D]=F[D])}return I},c.apply(this,arguments)}function d(I,k){if(!(I instanceof k))throw new TypeError("Cannot call a class as a function")}function g(I,k){for(var F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,k,F){return k&&g(I.prototype,k),I}function m(I,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(k&&k.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),k&&p(I,k)}function p(I,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(I,k)}function y(I){var k=S();return function(){var D=O(I),C;if(k){var E=O(this).constructor;C=Reflect.construct(D,arguments,E)}else C=D.apply(this,arguments);return b(this,C)}}function b(I,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(I)}function v(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(I){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},O(I)}function M(I,k,F){return k in I?Object.defineProperty(I,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):I[k]=F,I}var R=function(k){return k.hasOwnProperty("key")},_=function(I){m(F,I);var k=y(F);function F(D){var C;return d(this,F),C=k.call(this,D),M(v(C),"itemsWrapperRef",void 0),M(v(C),"itemsListRef",void 0),M(v(C),"thumbsRef",void 0),M(v(C),"setItemsWrapperRef",function(E){C.itemsWrapperRef=E}),M(v(C),"setItemsListRef",function(E){C.itemsListRef=E}),M(v(C),"setThumbsRef",function(E,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=E}),M(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var E=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),N=Math.floor(T/x),G=N<E,j=G?E-N:0;C.setState(function(ie,ee){return{itemSize:x,visibleItems:N,firstItem:G?C.getFirstItem(ee.selectedItem):0,lastPosition:j,showArrows:G}})}}),M(v(C),"handleClickItem",function(E,T,x){if(!R(x)||x.key==="Enter"){var N=C.props.onSelectItem;typeof N=="function"&&N(E,T)}}),M(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),M(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),M(v(C),"onSwipeMove",function(E){var T=E.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,N=e.Children.count(C.props.children),G=-(C.state.firstItem*100)/C.state.visibleItems,j=Math.max(N-C.state.visibleItems,0),ie=-j*100/C.state.visibleItems;G===x&&T>0&&(T=0),G===ie&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,Q=G+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(Q,"%",C.props.axis)}),!0}),M(v(C),"slideRight",function(E){C.moveTo(C.state.firstItem-(typeof E=="number"?E:1))}),M(v(C),"slideLeft",function(E){C.moveTo(C.state.firstItem+(typeof E=="number"?E:1))}),M(v(C),"moveTo",function(E){E=E<0?0:E,E=E>=C.state.lastPosition?C.state.lastPosition:E,C.setState({firstItem:E})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var E=C;return C>=this.state.lastPosition&&(E=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(E=this.state.firstItem),C<this.state.firstItem&&(E=C),E}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(E,T){var x=t.default.ITEM(!1,T===C.state.selectedItem),N={key:T,ref:function(j){return C.setThumbsRef(j,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),E)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var E=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},G=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(G,"px",this.props.axis),ie=this.props.transitionTime+"ms";return N={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:ie,MozTransitionDuration:ie,MsTransitionDuration:ie,OTransitionDuration:ie,transitionDuration:ie,msTransitionDuration:ie},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(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),E?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(Q){return C.setItemsListRef(Q)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Hi.default=_,M(_,"displayName","Thumbs"),M(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Hi}var Ni={},Xl;function qg(){if(Xl)return Ni;Xl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return document};return Ni.default=e,Ni}var Tn={},Yl;function Zc(){if(Yl)return Tn;Yl=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.setPosition=Tn.getPosition=Tn.isKeyboardEvent=Tn.defaultStatusFormatter=Tn.noop=void 0;var e=lo(),t=n(Ns());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};Tn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Tn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Tn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Tn.getPosition=s;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Tn.setPosition=a,Tn}var Nn={},jl;function Gg(){if(jl)return Nn;jl=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.fadeAnimationHandler=Nn.slideStopSwipingHandler=Nn.slideSwipeAnimationHandler=Nn.slideAnimationHandler=void 0;var e=lo(),t=r(Ns()),n=Zc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){s(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}return d}function s(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var m={},p=h.selectedItem,y=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),M=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:M,MozTransitionDuration:M,OTransitionDuration:M,transitionDuration:M,msTransitionDuration:M})),m};Nn.slideAnimationHandler=a;var l=function(g,h,m,p){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),M=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,_=R;O===S&&R>0&&(_=0),O===M&&R<0&&(_=0);var I=O+100/(m.itemSize/_),k=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&I>-100?I-=v*100:m.selectedItem===v-1&&I<-v*100&&(I+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(I,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),y};Nn.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};Nn.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",y={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 h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Nn.fadeAnimationHandler=c,Nn}var Kl;function Xg(){if(Kl)return Li;Kl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=c(lo()),t=l(Xc()),n=l(Yc()),r=l(Kc()),i=l(qg()),o=l(jc()),s=Zc(),a=Gg();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var E={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var N=T?Object.getOwnPropertyDescriptor(D,x):null;N&&(N.get||N.set)?Object.defineProperty(E,x,N):E[x]=D[x]}return E.default=D,C&&C.set(D,E),E}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(E){return typeof E}:d=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var E=arguments[C];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(D[T]=E[T])}return D},g.apply(this,arguments)}function h(D,C){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(D,x).enumerable})),E.push.apply(E,T)}return E}function m(D){for(var C=1;C<arguments.length;C++){var E=arguments[C]!=null?arguments[C]:{};C%2?h(Object(E),!0).forEach(function(T){k(D,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(E,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function y(D,C){for(var E=0;E<C.length;E++){var T=C[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function b(D,C,E){return C&&y(D.prototype,C),D}function v(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=I(D),x;if(C){var N=I(this).constructor;x=Reflect.construct(T,arguments,N)}else x=T.apply(this,arguments);return M(this,x)}}function M(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(D){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},I(D)}function k(D,C,E){return C in D?Object.defineProperty(D,C,{value:E,enumerable:!0,configurable:!0,writable:!0}):D[C]=E,D}var F=function(D){v(E,D);var C=O(E);function E(T){var x;p(this,E),x=C.call(this,T),k(R(x),"thumbsRef",void 0),k(R(x),"carouselWrapperRef",void 0),k(R(x),"listRef",void 0),k(R(x),"itemsRef",void 0),k(R(x),"timer",void 0),k(R(x),"animationHandler",void 0),k(R(x),"setThumbsRef",function(G){x.thumbsRef=G}),k(R(x),"setCarouselWrapperRef",function(G){x.carouselWrapperRef=G}),k(R(x),"setListRef",function(G){x.listRef=G}),k(R(x),"setItemsRef",function(G,j){x.itemsRef||(x.itemsRef=[]),x.itemsRef[j]=G}),k(R(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(R(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(R(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(R(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(R(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(R(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(R(x),"navigateWithKeyboard",function(G){if(x.isFocusWithinTheCarousel()){var j=x.props.axis,ie=j==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Q=ie?ee.ArrowRight:ee.ArrowDown,te=ie?ee.ArrowLeft:ee.ArrowUp;Q===G.keyCode?x.increment():te===G.keyCode&&x.decrement()}}),k(R(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var G=x.props.axis==="horizontal",j=x.itemsRef[0];if(j){var ie=G?j.clientWidth:j.clientHeight;x.setState({itemSize:ie}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(R(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(R(x),"handleClickItem",function(G,j){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(G,j),G!==x.state.selectedItem&&x.setState({selectedItem:G})}}),k(R(x),"handleOnChange",function(G,j){e.Children.count(x.props.children)<=1||x.props.onChange(G,j)}),k(R(x),"handleClickThumb",function(G,j){x.props.onClickThumb(G,j),x.moveTo(G)}),k(R(x),"onSwipeStart",function(G){x.setState({swiping:!0}),x.props.onSwipeStart(G)}),k(R(x),"onSwipeEnd",function(G){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(G),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(R(x),"onSwipeMove",function(G,j){x.props.onSwipeMove(j);var ie=x.props.swipeAnimationHandler(G,x.props,x.state,x.setState.bind(R(x)));return x.setState(m({},ie)),!!Object.keys(ie).length}),k(R(x),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof G=="number"?G:1))}),k(R(x),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof G=="number"?G:1))}),k(R(x),"moveTo",function(G){if(typeof G=="number"){var j=e.Children.count(x.props.children)-1;G<0&&(G=x.props.infiniteLoop?j:0),G>j&&(G=x.props.infiniteLoop?0:j),x.selectItem({selectedItem:G}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(R(x),"onClickNext",function(){x.increment(1)}),k(R(x),"onClickPrev",function(){x.decrement(1)}),k(R(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(R(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(R(x),"changeItem",function(G){return function(j){(!(0,s.isKeyboardEvent)(j)||j.key==="Enter")&&x.moveTo(G)}}),k(R(x),"selectItem",function(G){x.setState(m({previousItem:x.state.selectedItem},G),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(G.selectedItem,e.Children.toArray(x.props.children)[G.selectedItem])}),k(R(x),"getInitialImage",function(){var G=x.props.selectedItem,j=x.itemsRef&&x.itemsRef[G],ie=j&&j.getElementsByTagName("img")||[];return ie[0]}),k(R(x),"getVariableItemHeight",function(G){var j=x.itemsRef&&x.itemsRef[G];if(x.state.hasMount&&j&&j.children.length){var ie=j.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var Q=function ue(){x.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",Q)}}var te=ie[0]||j.children[0],se=te.clientHeight;return se>0?se:null}return null});var N={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},N),x.animationHandler(T,N)),x}return b(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,N){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.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 x=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 N=x.getInitialImage();N&&!N.complete?N.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var N=this;return this.props.children?e.Children.map(this.props.children,function(G,j){var ie=j===N.state.selectedItem,ee=j===N.state.previousItem,Q=ie&&N.state.selectedStyle||ee&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(Q=m(m({},Q),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(Q=m(m({},Q),{},{pointerEvents:"none"}));var te={ref:function(ue){return N.setItemsRef(ue,j)},key:"itemKey"+j+(x?"clone":""),className:n.default.ITEM(!0,j===N.state.selectedItem,j===N.state.previousItem),onClick:N.handleClickItem.bind(N,j,G),style:Q};return e.default.createElement("li",te,N.props.renderItem(G,{isSelected:j===N.state.selectedItem,isPrevious:j===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,N=this.props,G=N.showIndicators,j=N.labels,ie=N.renderIndicator,ee=N.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(Q,te){return ie&&ie(x.changeItem(te),te===x.state.selectedItem,te,j.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var x=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,G=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Q=this.renderItems(!0),te=Q.shift(),se=Q.pop(),ue={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};if(G){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ie,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E}(e.default.Component);return Li.default=F,k(F,"displayName","Carousel"),k(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!E),onClick:C})},renderArrowNext:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!E),onClick:C})},renderIndicator:function(C,E,T,x){return e.default.createElement("li",{className:n.default.DOT(E),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var E=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function(N){return N.type==="img"})),!!x)return x});return E.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):E},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Li}var Zl={},Jl;function Yg(){return Jl||(Jl=1),Zl}var Ql;function jg(){return Ql||(Ql=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Xg()),n=Yg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ka)),Ka}var Kg=jg(),Za,eu;function Zg(){if(eu)return Za;eu=1;var e=mh(),t=function(){return e.Date.now()};return Za=t,Za}var Ja,tu;function Jc(){if(tu)return Ja;tu=1;var e=Tc(),t=Zg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,y=0,b=!1,v=!1,S=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,S="trailing"in u?!!u.trailing:S);function O(E){var T=c,x=d;return c=d=void 0,y=E,h=a.apply(x,T),h}function M(E){return y=E,m=setTimeout(I,l),b?O(E):h}function R(E){var T=E-p,x=E-y,N=l-T;return v?o(N,g-x):N}function _(E){var T=E-p,x=E-y;return p===void 0||T>=l||T<0||v&&x>=g}function I(){var E=t();if(_(E))return k(E);m=setTimeout(I,R(E))}function k(E){return m=void 0,S&&c?O(E):(c=d=void 0,h)}function F(){m!==void 0&&clearTimeout(m),y=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var E=t(),T=_(E);if(c=arguments,d=this,p=E,T){if(m===void 0)return M(p);if(v)return clearTimeout(m),m=setTimeout(I,l),O(p)}return m===void 0&&(m=setTimeout(I,l)),h}return C.cancel=F,C.flush=D,C}return Ja=s,Ja}var Jg=Jc();const Qc=sr(Jg);function bn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function yr(e,t){return e===void 0?void 0:t}const Qg=Math.PI;function nu(e){return e*Qg/180}const ed=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),td=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},nd=(e,t,n)=>Math.min(e,t-n*2),rd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Bs=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 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"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},em=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function tm(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Qc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const nm="֑-߿יִ-﷽ﹰ-ﻼ",rm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",im=new RegExp("^[^"+rm+"]*["+nm+"]");function Ws(e){return im.test(e)?"rtl":"not-rtl"}let Ao;function xs(){if(typeof document>"u")return 0;if(Ao!==void 0)return Ao;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(),Ao=n-r,Ao}const Hr=Symbol();function om(e){const t=f.useRef([Hr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const l=t.current[0];l!==Hr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Hr&&i({}),r(u=>typeof a=="function"?a(l===Hr?u:l):a),t.current[0]=Hr)},[]),s=f.useCallback(()=>{t.current[0]=Hr,i({})},[]);return[t.current[0]===Hr?n:t.current[0],o,s]}function id(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 am(e){const t=f.useRef(e);return pi(e,t.current)||(t.current=e),t.current}const sm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(Bg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Kg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Bs,null)))};function od(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Wr=od();function lm(e){Wr=e}const ad=/[&<>"']/,um=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cm=new RegExp(sd.source,"g"),dm={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=e=>dm[e];function gn(e,t){if(t){if(ad.test(e))return e.replace(um,ru)}else if(sd.test(e))return e.replace(cm,ru);return e}const fm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(fm,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const hm=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(hm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const gm=/[^\w:]/g,mm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(gm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!mm.test(n)&&(n=wm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ho={},pm=/^[^:]+:\/*[^/]*$/,vm=/^([^:]+:)[\s\S]*$/,bm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wm(e,t){Ho[" "+e]||(pm.test(e)?Ho[" "+e]=e+"/":Ho[" "+e]=Ko(e,"/",!0)),e=Ho[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(vm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(bm,"$1")+t:e+t}const ra={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Ko(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function ym(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Cm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?gn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:gn(s)}}function Sm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
3
3
|
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=r.length?i.slice(r.length):i}).join(`
|
4
4
|
`)}class Us{constructor(t){this.options=t||Wr}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:Ko(r,`
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Sm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=Ko(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,s,a,l,u,c,d,g,h,m,p=n[1].trim();const y=p.length>1,b={type:"list",raw:"",ordered:y,start:y?+p.slice(0,-1):"",loose:!1,items:[]};p=y?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=y?p:"[*+-]");const v=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
|
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
|
|
169
169
|
`?(r.push(e.slice(i,s)),i=s+1,a===`
|
170
170
|
`&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
|
171
171
|
`)&&(r.push(Pu(e.slice(i,s))),i=s+1,a===`
|
172
|
-
`&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function _u(e,t,n){const r=B0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Ad(e){return e!==!0}function Fu(e){return typeof e=="string"?e:`${e}px`}const q0=()=>e=>e.innerWidth,G0=()=>e=>e.innerHeight,X0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[q0()],"wmyidgi-1":[G0()]}}),Y0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(X0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},j0=2,K0=1300;function Z0(e,t,n){const r=Vt.useRef(0),[i,o]=e??[0,0];Vt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/K0);const d=r.current**1.618*c*j0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function J0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,y=Cd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const wr={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 at(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function Q0(e){const t=am(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(wr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??wr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??wr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??wr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??wr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??wr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??wr.selectToLastCell};return Lu({...wr,...n})},[t])}function ev(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Qs(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=ev(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Ds(e,t){if(t===void 0||Qs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function tv(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Vt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=yr(r??e?.themeOverride,Vt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Ds(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function nv(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ds(r,n);const i=Ds(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Hd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Hd(o.subGroups??[],i,n)}:o)}function zd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:zd(e[n].subGroups??[],r)}function rv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function iv(e,t,n,r,i){const[o,s]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=om(a),d=f.useRef(i);d.current=i;const g=rv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const m=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const ov=f.lazy(async()=>await Hs(()=>import("./data-grid-overlay-editor.DBCkAuJT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let av=0;function sv(e){return up(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>xr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Vo(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 $o={kind:J.Loading,allowOverlay:!1},No={columns:it.empty(),rows:it.empty(),current:void 0},lv=(e,t)=>{const[n,r]=f.useState(No),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:y,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:M,onFillPattern:R,onFinishedEditing:_,coercePasteValue:I,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:E,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:N,onCellContextMenu:G,className:j,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:te,onCellEdited:se,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:X,onKeyUp:ce,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnAppended:Qe,onColumnMoved:Ee,validateCell:et,highlightRegions:kt,rangeSelect:Ne="rect",columnSelect:ne="multi",rowSelect:me="multi",rangeSelectionBlending:xe="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:be="exclusive",onDelete:Pe,onDragStart:Te,onMouseMove:st,onPaste:Re,copyHeaders:Ge=!1,freezeColumns:He=0,cellActivationBehavior:we="second-click",rowSelectionMode:Be="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:ft,getGroupDetails:Xe,rowGrouping:yt,onSearchClose:Xt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:nn,onVisibleRegionChanged:qt,gridSelection:cn,onGridSelectionChange:Ot,minColumnWidth:ut=50,maxColumnWidth:tn=500,maxColumnAutoWidth:Ct,provideEditor:rn,trailingRowOptions:Bt,freezeTrailingRows:De=0,allowedFillDirections:Et="orthogonal",scrollOffsetX:Pt,scrollOffsetY:yn,verticalBorder:Yt,onDragOverCell:dn,onDrop:Rn,onColumnResize:jt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Rt,fillHandle:Cn,experimental:vt,fixedShadowX:Ft,fixedShadowY:Sn,headerIcons:qn,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ue,onRowMoved:St,overscrollX:mn,overscrollY:ge,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:It,trapFocus:Nt=!1,smoothScrollX:on,smoothScrollY:ka,scaleToRem:fo=!1,rowHeight:Ma=34,headerHeight:ho=36,groupHeaderHeight:Ir=ho,theme:ur,isOutsideClick:Ra,renderers:bi,resizeIndicator:go,scrollToActiveCell:wi=!0,drawFocusRing:Er=!0,portalElementRef:pl}=e,yi=Er==="no-editor"?i===void 0:Er,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=Pn?.kind??e.rowMarkers??"none",Ci=Pn?.width??e.rowMarkerWidth,er=Pn?.startIndex??e.rowMarkerStartIndex??1,tr=Pn?.theme??e.rowMarkerTheme,Xr=Pn?.headerTheme,cr=Pn?.headerAlwaysVisible,Tr=me!=="multi"||Pn?.headerDisabled===!0,Yr=Pn?.checkboxStyle??"square",nr=Math.max(ut,20),jr=Math.max(tn,nr),Ia=Math.max(Ct??jr,nr),mo=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Si,rowHeight:po,getRowThemeOverride:dr}=tv(yt,v,Ma,h),Ea=f.useMemo(()=>Number.parseFloat(mo.fontSize),[mo]),{rowHeight:Gn,headerHeight:xi,groupHeaderHeight:vo,theme:bo,overscrollX:ki,overscrollY:Ta}=J0({groupHeaderHeight:Ir,headerHeight:ho,overscrollX:mn,overscrollY:ge,remSize:Ea,rowHeight:po,scaleToRem:fo,theme:ur}),Xn=Q0(he),fr=Ci??(v>1e4?48:v>1e3?44:v>100?36:32),_n=xn!=="none",U=_n?1:0,Lt=Bt!==void 0,rr=Bt?.sticky===!0,[Mi,wo]=f.useState(!1),Kr=nn??Mi,Da=f.useCallback(()=>{Xt!==void 0?Xt():wo(!1)},[Xt]),K=f.useMemo(()=>cn===void 0?void 0:Vo(cn,U),[cn,U])??n,kn=f.useRef();kn.current===void 0&&(kn.current=new AbortController),f.useEffect(()=>()=>kn?.current.abort(),[]);const[z,oe]=A0(ee,S,U,kn.current,_e),Me=f.useCallback((w,A,L)=>{if(et===void 0)return!0;const W=[w[0]-U,w[1]];return et?.(W,A,L)},[U,et]),Ie=f.useRef(cn),ae=f.useCallback((w,A)=>{A&&(w=W0(w,z,U,x,kn.current)),Ot!==void 0?(Ie.current=Vo(w,-U),Ot(Ie.current)):r(w)},[Ot,z,U,x]),ve=yr(jt,f.useCallback((w,A,L,W)=>{jt?.(b[L-U],A,L-U,W)},[jt,U,b])),Ye=yr(Jt,f.useCallback((w,A,L,W)=>{Jt?.(b[L-U],A,L-U,W)},[Jt,U,b])),ye=yr(We,f.useCallback((w,A,L,W)=>{We?.(b[L-U],A,L-U,W)},[We,U,b])),je=yr(k,f.useCallback((w,A)=>k?.({...w,columnIndex:w.columnIndex-U},A)??!1,[k,U])),ct=yr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Zt=f.useCallback(w=>{if(Pe!==void 0){const A=Pe(Vo(w,-U));return typeof A=="boolean"?A:Vo(A,U)}return!0},[Pe,U]),[dt,Tt,tt]=L0(K,ae,xe,de,be,Ne,T),Je=f.useMemo(()=>or(Cd(),bo),[bo]),[zt,Wt]=f.useState([0,0,0]),Dr=f.useMemo(()=>{if(bi===void 0)return{};const w={};for(const A of bi)w[A.kind]=A;return w},[bi]),en=f.useCallback(w=>w.kind!==J.Custom?Dr[w.kind]:Rt?.find(A=>A.isMatch(w)),[Rt,Dr]);let{sizedColumns:an,nonGrowWidth:hr}=ep(b,_e,oe,zt[0]-(U===0?0:fr)-zt[2],nr,Ia,Je,en,kn.current);xn!=="none"&&(hr+=fr);const _t=f.useMemo(()=>an.some(w=>w.group!==void 0),[an]),Mn=_t?xi+vo:xi,In=K.rows.length,gr=xn==="none"?void 0:In===0?!1:In===_e?!0:void 0,nt=f.useMemo(()=>xn==="none"?an:[{title:"",width:fr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:tr,rowMarker:Yr,rowMarkerChecked:gr,headerRowMarkerTheme:Xr,headerRowMarkerAlwaysVisible:cr,headerRowMarkerDisabled:Tr},...an],[xn,an,fr,tr,Yr,gr,Xr,cr,Tr]),sn=f.useRef({height:1,width:1,x:0,y:0}),Yn=f.useRef(!1),{setVisibleRegion:vl,visibleRegion:Or,scrollRef:Ut}=iv(Pt,yn,Gn,sn,()=>Yn.current=!0);sn.current=Or;const Lf=Or.x+U,yo=Or.y,fn=f.useRef(null),pn=f.useCallback(w=>{w===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Lt?_e+1:_e,Fn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),L=ue?.(A);if(L!==!0)for(const W of A)se?.(W.location,W.value);return L},[se,ue,U]),[Pr,Oa]=f.useState(),Co=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,bl=yi?K.current?.cell:void 0,So=bl?.[0],xo=bl?.[1],Af=f.useMemo(()=>{if((kt===void 0||kt.length===0)&&(Co??So??xo??Pr)===void 0)return;const w=[];if(kt!==void 0)for(const A of kt){const L=nt.length-A.range.x-U;L>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(L,A.range.width)},style:A.style})}return Pr!==void 0&&w.push({color:Nr(Je.accentColor,0),range:Pr,style:"dashed"}),Co!==void 0&&w.push({color:Nr(Je.accentColor,.5),range:Co,style:"solid-outline"}),So!==void 0&&xo!==void 0&&w.push({color:Je.accentColor,range:{x:So,y:xo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Pr,Co,So,xo,kt,nt.length,Je.accentColor,U]),wl=f.useRef(nt);wl.current=nt;const En=f.useCallback(([w,A],L=!1)=>{const W=Lt&&A===hn-1;if(w===0&&_n){if(W)return $o;const Y=Si(A);return Y===void 0?$o:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:Yr,checked:K?.rows.hasIndex(A)===!0,markerKind:xn==="clickable-number"?"number":xn,row:er+Y,drawHandle:St!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=wl.current[w];if(B?.trailingRowOptions?.disabled===!0)return $o;{const Z=B?.trailingRowOptions?.hint??V,le=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const Y=w-U;if(L||vt?.strict===!0){const B=sn.current,Z=B.x>Y||Y>B.x+B.width||B.y>A||A>B.y+B.height||A>=La.current,le=Y===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const wt of B.extras.freezeRegions)if($r(wt,Y,A)){pe=!0;break}}if(Z&&!le&&!pe)return $o}let V=S([Y,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Lt,hn,_n,Si,Yr,K?.rows,xn,er,St,U,Bt?.hint,Bt?.addIcon,vt?.strict,S]),Pa=f.useCallback(w=>{let A=Xe?.(w)??{name:w};return te!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>Ha({group:A.name,bounds:L.bounds})}]}),A},[Xe,te]),ko=f.useCallback(w=>{const[A,L]=w.cell,W=nt[A],q=W?.group!==void 0?Pa(W.group)?.overrideTheme:void 0,Y=W?.themeOverride,V=dr?.(L);o({...w,theme:or(Je,q,Y,V,w.content.themeOverride)})},[dr,nt,Pa,Je]),Zr=f.useCallback((w,A,L)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,Y=En([W,q]);if(Y.kind!==J.Boolean&&Y.allowOverlay){let V=Y;if(L!==void 0)switch(V.kind){case J.Number:{const B=_g(()=>L==="-"?-0:Number.parseFloat(L),0);V={...V,data:Number.isNaN(B)?0:B};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:L};break}ko({target:w,content:V,initialValue:L,cell:[W,q],highlight:L===void 0,forceEditMode:L!==void 0})}else Y.kind===J.Boolean&&A&&Y.readonly!==!0&&(Fn([{location:K.current.cell,value:{...Y,data:Ad(Y.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,ko]),yl=f.useCallback((w,A)=>{const L=fn.current?.getBounds(w,A);if(L===void 0||Ut.current===null)return;const W=En([w,A]);W.allowOverlay&&ko({target:L,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[En,Ut,ko]),Gt=f.useCallback((w,A,L="both",W=0,q=0,Y=void 0)=>{if(Ut.current!==null){const V=fn.current,B=a.current,Z=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,le=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let rt={x:0,y:0,width:0,height:0},Ke=0,Ze=0;if((Z!==void 0||le!==void 0)&&(rt=V.getBounds((Z??0)+U,le??0)??rt,rt.width===0||rt.height===0))return;const ht=B.getBoundingClientRect(),xt=ht.width/B.offsetWidth;if(pe!==void 0&&(rt={...rt,x:pe-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(rt={...rt,y:wt+ht.top-Ut.current.scrollTop,height:1}),rt!==void 0){const pt={x:rt.x-W,y:rt.y-q,width:rt.width+2*W,height:rt.height+2*q};let ri=0;for(let Ua=0;Ua<He;Ua++)ri+=an[Ua].width;let _i=0;const Fi=De+(rr?1:0);Fi>0&&(_i=qr(hn,Fi,Gn));let Kn=ri*xt+ht.left+U*fr*xt,ii=ht.right,Ar=ht.top+Mn*xt,oi=ht.bottom-_i*xt;const Oo=rt.width+W*2;switch(Y?.hAlign){case"start":ii=Kn+Oo;break;case"end":Kn=ii-Oo;break;case"center":Kn=Math.floor((Kn+ii)/2)-Oo/2,ii=Kn+Oo;break}const Po=rt.height+q*2;switch(Y?.vAlign){case"start":oi=Ar+Po;break;case"end":Ar=oi-Po;break;case"center":Ar=Math.floor((Ar+oi)/2)-Po/2,oi=Ar+Po;break}Kn>pt.x?Ke=pt.x-Kn:ii<pt.x+pt.width&&(Ke=pt.x+pt.width-ii),Ar>pt.y?Ze=pt.y-Ar:oi<pt.y+pt.height&&(Ze=pt.y+pt.height-oi),L==="vertical"||typeof w=="number"&&w<He?Ke=0:(L==="horizontal"||typeof A=="number"&&A>=hn-Fi)&&(Ze=0),(Ke!==0||Ze!==0)&&(xt!==1&&(Ke/=xt,Ze/=xt),Ut.current.scrollTo({left:Ke+Ut.current.scrollLeft,top:Ze+Ut.current.scrollTop,behavior:Y?.behavior??"auto"}))}}}},[U,De,fr,Ut,Mn,He,an,hn,rr,Gn]),_a=f.useRef(yl),Fa=f.useRef(S);_a.current=yl,Fa.current=S;const La=f.useRef(_e);La.current=_e;const Cl=f.useRef(nt.length);Cl.current=nt.length;const mr=f.useCallback(async(w,A=!0,L)=>{if(nt[w]?.trailingRowOptions?.disabled===!0)return;const q=Se?.();let Y,V=!0;q!==void 0&&(Y=await q,Y==="top"&&(V=!1),typeof Y=="number"&&(V=!1));let B=0;const Z=()=>{if(La.current<=_e){B<500&&window.setTimeout(Z,B),B=50+B*2;return}const le=typeof Y=="number"?Y:V?_e:0;Do.current(w-U,le,"both",0,0,L?{behavior:L}:void 0),dt({cell:[w,le],range:{x:w,y:le,width:1,height:1}},!1,!1,"edit");const pe=Fa.current([w-U,le]);pe.allowOverlay&&ci(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(w,le)},0)};Z()},[nt,Se,U,_e,dt]),Mo=f.useCallback(async(w,A=!0)=>{const L=Qe?.();let W,q=!0;L!==void 0&&(W=await L,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let Y=0;const V=()=>{if(Cl.current<=nt.length){Y<500&&window.setTimeout(V,Y),Y=50+Y*2;return}const B=typeof W=="number"?W:q?nt.length:0;Gt(B-U,w),dt({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const Z=Fa.current([B-U,w]);Z.allowOverlay&&ci(Z)&&Z.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(B,w)},0)};V()},[nt,Qe,U,Gt,dt]),Jr=f.useCallback(w=>{const A=an[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(_n?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(_n?1:0)}},[an,b,_n,Bt?.targetColumn]),pr=f.useRef(),Qr=f.useRef(),Ii=f.useCallback((w,A)=>{const[L,W]=A;return or(Je,nt[L]?.themeOverride,dr?.(W),w.themeOverride)},[dr,nt,Je]),{mapper:_r}=nv(yt,v),Vn=yt?.navigationBehavior,Ei=f.useCallback(w=>{const A=aa.value?w.metaKey:w.ctrlKey,L=A&&me==="multi",W=A&&ne==="multi",[q,Y]=w.location,V=K.columns,B=K.rows,[Z,le]=K.current?.cell??[];if(w.kind==="cell"){if(Qr.current=void 0,Fr.current=[q,Y],q===0&&_n){if(Lt===!0&&Y===_e||xn==="number"||me==="none")return;const pe=En(w.location);if(pe.kind!==Hn.Marker)return;if(St!==void 0){const Ke=en(pe);Dn(Ke?.kind===Hn.Marker);const Ze=Ke?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ii(pe,w.location),preventDefault:()=>{}});if(Ze===void 0||Ze.checked===pe.checked)return}o(void 0),pn();const wt=B.hasIndex(Y),rt=pr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&rt!==void 0&&B.hasIndex(rt)){const Ke=[Math.min(rt,Y),Math.max(rt,Y)+1];L||Be==="multi"?Tt(void 0,Ke,!0):Tt(it.fromSingleSelection(Ke),void 0,L)}else me==="multi"&&(L||w.isTouch||Be==="multi")?wt?Tt(B.remove(Y),void 0,!0):(Tt(void 0,Y,!0),pr.current=Y):wt&&B.length===1?Tt(it.empty(),void 0,A):(Tt(it.fromSingleSelection(Y),void 0,A),pr.current=Y)}else if(q>=U&&Lt&&Y===_e){const pe=Jr(q);mr(pe??q)}else if(Z!==q||le!==Y){const pe=En(w.location),wt=en(pe);if(wt?.onSelect!==void 0){let Ze=!1;if(wt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ze=!0,theme:Ii(pe,w.location)}),Ze)return}if(Vn==="block"&&_r(Y).isGroupHeader)return;const rt=rr&&Y===_e,Ke=rr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Ke){if(rt)return;const Ze=Math.min(q,Z),ht=Math.max(q,Z),xt=Math.min(Y,le),pt=Math.max(Y,le);dt({...K.current,range:{x:Ze,y:xt,width:ht-Ze+1,height:pt-xt+1}},!0,A,"click"),pr.current=void 0,pn()}else dt({cell:[q,Y],range:{x:q,y:Y,width:1,height:1}},!0,A,"click"),pr.current=void 0,o(void 0),pn()}}else if(w.kind==="header")if(Fr.current=[q,Y],o(void 0),_n&&q===0)pr.current=void 0,Qr.current=void 0,!Tr&&me==="multi"&&(B.length!==_e?Tt(it.fromSingleSelection([0,_e]),void 0,A):Tt(it.empty(),void 0,A),pn());else{const pe=Qr.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const wt=[Math.min(pe,q),Math.max(pe,q)+1];W?tt(void 0,wt,A):tt(it.fromSingleSelection(wt),void 0,A)}else W?(V.hasIndex(q)?tt(V.remove(q),void 0,A):tt(void 0,q,A),Qr.current=q):ne!=="none"&&(V.hasIndex(q)?tt(V.remove(q),void 0,A):tt(it.fromSingleSelection(q),void 0,A),Qr.current=q);pr.current=void 0,pn()}else w.kind===An?Fr.current=[q,Y]:w.kind===sa&&!w.isMaybeScrollbar&&(ae(No,!1),o(void 0),pn(),Mt?.(),pr.current=void 0,Qr.current=void 0)},[me,ne,K,_n,U,Lt,_e,xn,En,St,pn,Be,en,Ii,Tt,Jr,mr,Vn,_r,rr,dt,tt,ae,Mt]),Ti=f.useRef(!1),Fr=f.useRef(),Sl=f.useRef(Or),jn=f.useRef(),Hf=f.useCallback(w=>{if(ei.current=!1,Sl.current=sn.current,w.button!==0&&w.button!==1){jn.current=void 0;return}const A=performance.now();jn.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Ti.current=!0);const L=w.kind==="cell"&&w.isFillHandle;!L&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:L}),Fr.current=void 0,!w.isTouch&&w.button===0&&!L?Ei(w):!w.isTouch&&w.button===1&&(Fr.current=w.location))},[K,Ei]),[Aa,Ha]=f.useState(),xl=f.useCallback(w=>{if(w.kind!==An||ne!=="multi")return;const A=aa.value?w.metaKey:w.ctrlKey,[L]=w.location,W=K.columns;if(L<U)return;const q=nt[L];let Y=L,V=L;for(let B=L-1;B>=U&&no(q.group,nt[B].group);B--)Y--;for(let B=L+1;B<nt.length&&no(q.group,nt[B].group);B++)V++;if(pn(),A)if(W.hasAll([Y,V+1])){let B=W;for(let Z=Y;Z<=V;Z++)B=B.remove(Z);tt(B,void 0,A)}else tt(void 0,[Y,V+1],A);else tt(it.fromSingleSelection([Y,V+1]),void 0,A)},[ne,pn,K.columns,nt,U,tt]),ei=f.useRef(!1),Ro=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=sn.current.y,L=sn.current.height;let W=z({x:w,y:A,width:1,height:Math.min(L,_e-A)},kn.current.signal);typeof W!="object"&&(W=await W());const q=an[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Je.baseFontFull;const B=xd(V,Je,q,0,W,nr,jr,!1,en);ve?.(q,B.width,w,B.width)}}},[an,z,jr,Je,nr,ve,U,_e,en]),[zf,za]=f.useState(),ti=f.useCallback(async(w,A)=>{const L=w.current?.range;if(L===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(R!==void 0){let B=!1;if(R({fillDestination:{...W,x:W.x-U},patternSource:{...L,x:L.x-U},preventDefault:()=>B=!0}),B)return}let q=z(L,kn.current.signal);typeof q!="object"&&(q=await q());const Y=q,V=[];for(let B=0;B<W.width;B++)for(let Z=0;Z<W.height;Z++){const le=[W.x+B,W.y+Z];if(fd(le,L))continue;const pe=Y[Z%L.height][B%L.width];fi(pe)||!ci(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(B=>({cell:B.location})))},[z,Fn,R,U]),kl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,width:1}}};ti(w,K)},[ti,K]),Ml=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,height:1}}};ti(w,K)},[ti,K]),Vf=f.useCallback((w,A)=>{const L=l;if(u(void 0),Oa(void 0),za(void 0),Ti.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Pr===void 0)return;const pe={...K,current:{...K.current,range:Ed(L.previousSelection.current.range,Pr)}};ti(L.previousSelection,pe),ae(pe,!0);return}const[W,q]=w.location,[Y,V]=Fr.current??[],B=()=>{ei.current=!0},Z=pe=>{const wt=pe.isTouch||Y===W&&V===q;if(wt&&O?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!ei.current;if(!ei.current){const rt=En(w.location),Ke=en(rt);if(Ke!==void 0&&Ke.onClick!==void 0&&wt){const ht=Ke.onClick({...pe,cell:rt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ii(rt,w.location),preventDefault:B});ht!==void 0&&!fi(ht)&&ui(ht)&&(Fn([{location:pe.location,value:ht}]),fn.current?.damage([{cell:pe.location}]))}if(ei.current||K.current===void 0)return!1;let Ze=!1;switch(rt.activationBehaviorOverride??we){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=K.current.cell,[pt,ri]=L.previousSelection.current.cell;Ze=W===ht&&W===pt&&q===xt&&q===ri&&(pe.isDoubleClick===!0||we==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze)return M?.([W-U,q]),Zr(pe.bounds,!1),!0}return!1},le=w.location[0]-U;if(w.isTouch){const pe=sn.current,wt=Sl.current;if(pe.x!==wt.x||pe.y!==wt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Zi(K.current?.cell,w.location)){G?.([le,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ie?.(le,{...w,preventDefault:B});return}else if(w.kind===An){if(le<0)return;Q?.(le,{...w,preventDefault:B});return}}w.kind==="cell"?Z(w)||Ei(w):w.kind===An?N?.(le,{...w,preventDefault:B}):(w.kind===Cr&&C?.(le,{...w,preventDefault:B}),Ei(w));return}if(w.kind==="header"){if(le<0)return;w.isEdge?w.isDoubleClick===!0&&Ro(W):w.button===0&&W===Y&&q===V&&C?.(le,{...w,preventDefault:B})}if(w.kind===An){if(le<0)return;w.button===0&&W===Y&&q===V&&(N?.(le,{...w,preventDefault:B}),ei.current||xl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Z(w),Fr.current=void 0},[l,K,U,Pr,ti,ae,O,En,en,we,Ii,Fn,M,Zr,G,ie,Q,Ei,N,C,Ro,xl]),$f=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};st?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Oa(void 0),za(void 0),Ti.current=!1),za(L=>Ti.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===L?.[0]&&w.scrollEdge[1]===L[1]?L:l===void 0||(jn.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,st,U]),Nf=f.useCallback((w,A)=>{mt?.(w-U,A)},[mt,U]),Bf=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ni=K?.current?.cell,Wf=f.useCallback((w,A,L,W,q,Y)=>{Yn.current=!1;let V=ni;V!==void 0&&(V=[V[0]-U,V[1]]);const B=He===0?void 0:{x:0,y:w.y,width:He,height:w.height},Z=[];B!==void 0&&Z.push(B),De>0&&(Z.push({x:w.x-U,y:_e-De,width:w.width,height:De}),He>0&&Z.push({x:0,y:_e-De,width:He,height:De}));const le={x:w.x-U,y:w.y,width:w.width,height:Lt&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:Y,extras:{selected:V,freezeRegion:B,freezeRegions:Z}};sn.current=le,vl(le),Wt([A,L,W]),qt?.(le,le.tx,le.ty,le.extras)},[ni,U,Lt,_e,He,De,vl,qt]),Uf=yr(E,f.useCallback((w,A)=>E?.(w-U,A-U)!==!1,[E,U])),qf=yr(Ee,f.useCallback((w,A)=>{Ee?.(w-U,A-U),ne!=="none"&&tt(it.fromSingleSelection(A),void 0,!0)},[ne,Ee,U,tt])),Va=f.useRef(!1),Gf=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Te?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(Va.current=!0),u(void 0)},[Te,U]),Xf=f.useCallback(()=>{Va.current=!1},[]),Rl=yt?.selectionBehavior,Io=f.useCallback(w=>{if(Rl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:W}=_r(w);if(A)return[w,w];const q=L[L.length-1],Y=w-q,V=w+W-q-1;return[Y,V]},[_r,Rl]),$a=f.useRef(),Na=f.useCallback(w=>{if(!Fd(w,$a.current)&&($a.current=w,!(jn?.current?.button!==void 0&&jn.current.button>=1))){if(w.buttons!==0&&l!==void 0&&jn.current?.location[0]===0&&w.location[0]===0&&U===1&&me==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(jn.current.location[1])&&K.rows.hasIndex(jn.current.location[1])){const A=Math.min(jn.current.location[1],w.location[1]),L=Math.max(jn.current.location[1],w.location[1])+1;Tt(it.fromSingleSelection([A,L]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!Va.current&&!Ti.current&&(Ne==="rect"||Ne==="multi-rect")){const[A,L]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=sn.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const Y=l.previousSelection.current.range;q=Math.min(q,Lt?_e-1:_e);const V=Bp(Y,W,q,Et);Oa(V)}else{if(Lt&&L===_e)return;if(Lt&&q===_e)if(w.kind===sa)q--;else return;W=Math.max(W,U);const B=Io(L);q=B===void 0?q:Ln(q,B[0],B[1]);const Z=W-A,le=q-L,pe={x:Z>=0?A:W,y:le>=0?L:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};dt({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,me,K,Ne,Ht,Tt,Lt,_e,Et,Io,dt]),Yf=f.useCallback(()=>{const w=$a.current;if(w===void 0)return;const[A,L]=w.scrollEdge;let[W,q]=w.location;const Y=sn.current;A===-1?W=Y.extras?.freezeRegion?.x??Y.x:A===1&&(W=Y.x+Y.width),L===-1?q=Math.max(0,Y.y):L===1&&(q=Math.min(_e-1,Y.y+Y.height)),W=Ln(W,0,nt.length-1),q=Ln(q,0,_e-1),Na({...w,location:[W,q]})},[nt.length,Na,_e]);Z0(zf,Ut,Yf);const $n=f.useCallback(w=>{if(K.current===void 0)return;const[A,L]=w,[W,q]=K.current.cell,Y=K.current.range;let V=Y.x,B=Y.x+Y.width,Z=Y.y,le=Y.y+Y.height;const[pe,wt]=Io(q)??[0,_e-1],rt=wt+1;if(L!==0)switch(L){case 2:{le=rt,Z=q,Gt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Gt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Gt(0,Z,"vertical")):(le=Math.min(rt,le+1),Gt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Gt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Gt(0,Z,"vertical"));break}default:to()}if(A!==0)if(A===2)B=nt.length,V=W,Gt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,Gt(V-U,0,"horizontal");else{let Ke=[];if(z!==void 0){const Ze=z({x:V,y:Z,width:B-V-U,height:le-Z},kn.current.signal);typeof Ze=="object"&&(Ke=sv(Ze))}if(A===1){let Ze=!1;if(V<W){if(Ke.length>0){const ht=xr(V+1,W+1).find(xt=>!Ke.includes(xt-U));ht!==void 0&&(V=ht,Ze=!0)}else V++,Ze=!0;Ze&&Gt(V,0,"horizontal")}Ze||(B=Math.min(nt.length,B+1),Gt(B-1-U,0,"horizontal"))}else if(A===-1){let Ze=!1;if(B>W+1){if(Ke.length>0){const ht=xr(B-1,W,-1).find(xt=>!Ke.includes(xt-U));ht!==void 0&&(B=ht,Ze=!0)}else B--,Ze=!0;Ze&&Gt(B-U,0,"horizontal")}Ze||(V=Math.max(U,V-1),Gt(V-U,0,"horizontal"))}else to()}dt({cell:K.current.cell,range:{x:V,y:Z,width:B-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Io,K,nt.length,U,_e,Gt,dt]),Ba=f.useRef(wi);Ba.current=wi;const vr=f.useCallback((w,A,L,W)=>{const q=hn-(L?0:1);w=Ln(w,U,an.length-1+U),A=Ln(A,0,q);const Y=ni?.[0],V=ni?.[1];if(w===Y&&A===V)return!1;if(W&&K.current!==void 0){const B=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&B.push(K.current.range),ae({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else dt({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Ba.current&&Gt(w-U,A),!0},[hn,U,an.length,ni,K,Gt,ae,dt]),jf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&ui(w)&&(Fn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[L,W]=A;if(K.current!==void 0&&(L!==0||W!==0)){const q=K.current.cell[1]===hn-1&&w!==void 0,Y=K.current.cell[0]===nt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&Se!==void 0){V=!1;const B=K.current.cell[0]+L,Z=Jr(B);mr(Z??B,!1)}if(Y&&L===1&&Qe!==void 0){V=!1;const B=K.current.cell[1]+W;Mo(B,!1)}V&&vr(Ln(K.current.cell[0]+L,0,nt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(w,A)},[i?.cell,pn,K,_,Fn,hn,vr,nt.length,mr,Mo,Se,Qe,Jr]),Kf=f.useMemo(()=>`gdg-overlay-${av++}`,[]),Lr=f.useCallback(w=>{pn();const A=[];for(let L=w.x;L<w.x+w.width;L++)for(let W=w.y;W<w.y+w.height;W++){const q=S([L-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let Y;if(q.kind===J.Custom){const V=en(q),B=V?.provideEditor?.({...q,location:[L-U,W]});V?.onDelete!==void 0?Y=V.onDelete(q):Fg(B)&&(Y=B?.deletedValue?.(q))}else(ui(q)&&q.allowOverlay||q.kind===J.Boolean)&&(Y=en(q)?.onDelete?.(q));Y!==void 0&&!fi(Y)&&ui(Y)&&A.push({location:[L,W],value:Y})}Fn(A),fn.current?.damage(A.map(L=>({cell:L.location})))},[pn,S,en,Fn,U]),Di=i!==void 0,Il=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},L={didMatch:!1},{bounds:W}=w,q=K.columns,Y=K.rows,V=Xn;if(!Di&&ot(V.clear,w,L))ae(No,!1),Mt?.();else if(!Di&&ot(V.selectAll,w,L))ae({columns:it.empty(),rows:it.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(ot(V.search,w,L))s?.current?.focus({preventScroll:!0}),wo(!0);else if(ot(V.delete,w,L)){const ht=Zt?.(K)??!0;if(ht!==!1){const xt=ht===!0?K:ht;if(xt.current!==void 0){Lr(xt.current.range);for(const pt of xt.current.rangeStack)Lr(pt)}for(const pt of xt.rows)Lr({x:U,y:pt,width:b.length,height:1});for(const pt of xt.columns)Lr({x:pt,y:0,width:1,height:_e})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,wt=!1;if(ot(V.scrollToSelectedCell,w,L)?Do.current(B-U,Z):ne!=="none"&&ot(V.selectColumn,w,L)?q.hasIndex(B)?tt(q.remove(B),void 0,!0):ne==="single"?tt(it.fromSingleSelection(B),void 0,!0):tt(void 0,B,!0):me!=="none"&&ot(V.selectRow,w,L)?Y.hasIndex(Z)?Tt(Y.remove(Z),void 0,!0):me==="single"?Tt(it.fromSingleSelection(Z),void 0,!0):Tt(void 0,Z,!0):!Di&&W!==void 0&&ot(V.activateCell,w,L)?Z===_e&&Lt?window.setTimeout(()=>{const ht=Jr(B);mr(ht??B)},0):(M?.([B-U,Z]),Zr(W,!0)):K.current.range.height>1&&ot(V.downFill,w,L)?Ml():K.current.range.width>1&&ot(V.rightFill,w,L)?kl():ot(V.goToNextPage,w,L)?Z+=Math.max(1,sn.current.height-4):ot(V.goToPreviousPage,w,L)?Z-=Math.max(1,sn.current.height-4):ot(V.goToFirstCell,w,L)?(o(void 0),Z=0,B=0):ot(V.goToLastCell,w,L)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):ot(V.selectToFirstCell,w,L)?(o(void 0),$n([-2,-2])):ot(V.selectToLastCell,w,L)?(o(void 0),$n([2,2])):Di?(ot(V.closeOverlay,w,L)&&o(void 0),ot(V.acceptOverlayDown,w,L)&&(o(void 0),Z++),ot(V.acceptOverlayUp,w,L)&&(o(void 0),Z--),ot(V.acceptOverlayLeft,w,L)&&(o(void 0),B--),ot(V.acceptOverlayRight,w,L)&&(o(void 0),B++)):(ot(V.goDownCell,w,L)?Z+=1:ot(V.goUpCell,w,L)?Z-=1:ot(V.goRightCell,w,L)?B+=1:ot(V.goLeftCell,w,L)?B-=1:ot(V.goDownCellRetainSelection,w,L)?(Z+=1,pe=!0):ot(V.goUpCellRetainSelection,w,L)?(Z-=1,pe=!0):ot(V.goRightCellRetainSelection,w,L)?(B+=1,pe=!0):ot(V.goLeftCellRetainSelection,w,L)?(B-=1,pe=!0):ot(V.goToLastRow,w,L)?Z=_e-1:ot(V.goToFirstRow,w,L)?Z=Number.MIN_SAFE_INTEGER:ot(V.goToLastColumn,w,L)?B=Number.MAX_SAFE_INTEGER:ot(V.goToFirstColumn,w,L)?B=Number.MIN_SAFE_INTEGER:(Ne==="rect"||Ne==="multi-rect")&&(ot(V.selectGrowDown,w,L)?$n([0,1]):ot(V.selectGrowUp,w,L)?$n([0,-1]):ot(V.selectGrowRight,w,L)?$n([1,0]):ot(V.selectGrowLeft,w,L)?$n([-1,0]):ot(V.selectToLastRow,w,L)?$n([0,2]):ot(V.selectToFirstRow,w,L)?$n([0,-2]):ot(V.selectToLastColumn,w,L)?$n([2,0]):ot(V.selectToFirstColumn,w,L)&&$n([-2,0])),wt=L.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const ht=Vn==="skip-up"||Vn==="skip"||Vn==="block",xt=Vn==="skip-down"||Vn==="skip"||Vn==="block",pt=Z<le;if(pt&&ht){for(;Z>=0&&_r(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!pt&&xt){for(;Z<_e&&_r(Z).isGroupHeader;)Z++;Z>=_e&&(Z=le)}}const Ke=vr(B,Z,!1,pe),Ze=L.didMatch;return Ze&&(Ke||!wt||Nt)&&A(),Ze},[Vn,Di,K,Xn,ne,me,Ne,U,_r,_e,vr,ae,Mt,b.length,Zt,Nt,Lr,tt,Tt,Lt,Jr,mr,M,Zr,Ml,kl,$n]),Oi=f.useCallback(w=>{let A=!1;if(X!==void 0&&X({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||Il(w)||K.current===void 0)return;const[L,W]=K.current.cell,q=sn.current;if(ke&&!w.metaKey&&!w.ctrlKey&&K.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&ci(S([L-U,Math.max(0,Math.min(W,_e-1))]))){if((!Lt||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>L||L>q.x+q.width))return;M?.([L-U,W]),Zr(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[ke,X,Il,K,S,U,_e,Lt,M,Zr]),Zf=f.useCallback((w,A)=>{const L=w.location[0]-U;if(w.kind==="header"&&ie?.(L,{...w,preventDefault:A}),w.kind===An){if(L<0)return;Q?.(L,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([L,q],{...w,preventDefault:A}),Hm(K,w.location)||vr(W,q,!1,!1)}},[K,G,Q,ie,U,vr]),Wa=f.useCallback(async w=>{if(!Xn.paste)return;function A(V,B,Z,le){const pe=typeof Z=="object"?Z?.join(`
|
172
|
+
`&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function _u(e,t,n){const r=B0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Ad(e){return e!==!0}function Fu(e){return typeof e=="string"?e:`${e}px`}const q0=()=>e=>e.innerWidth,G0=()=>e=>e.innerHeight,X0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[q0()],"wmyidgi-1":[G0()]}}),Y0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(X0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},j0=2,K0=1300;function Z0(e,t,n){const r=Vt.useRef(0),[i,o]=e??[0,0];Vt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/K0);const d=r.current**1.618*c*j0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function J0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,y=Cd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const wr={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 at(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function Q0(e){const t=am(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(wr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??wr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??wr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??wr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??wr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??wr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??wr.selectToLastCell};return Lu({...wr,...n})},[t])}function ev(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Qs(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=ev(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Ds(e,t){if(t===void 0||Qs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function tv(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Vt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=yr(r??e?.themeOverride,Vt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Ds(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function nv(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ds(r,n);const i=Ds(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Hd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Hd(o.subGroups??[],i,n)}:o)}function zd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:zd(e[n].subGroups??[],r)}function rv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function iv(e,t,n,r,i){const[o,s]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=om(a),d=f.useRef(i);d.current=i;const g=rv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const m=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const ov=f.lazy(async()=>await Hs(()=>import("./data-grid-overlay-editor.BZB3sRFz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let av=0;function sv(e){return up(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>xr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Vo(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 $o={kind:J.Loading,allowOverlay:!1},No={columns:it.empty(),rows:it.empty(),current:void 0},lv=(e,t)=>{const[n,r]=f.useState(No),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:y,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:M,onFillPattern:R,onFinishedEditing:_,coercePasteValue:I,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:E,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:N,onCellContextMenu:G,className:j,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:te,onCellEdited:se,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:X,onKeyUp:ce,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnAppended:Qe,onColumnMoved:Ee,validateCell:et,highlightRegions:kt,rangeSelect:Ne="rect",columnSelect:ne="multi",rowSelect:me="multi",rangeSelectionBlending:xe="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:be="exclusive",onDelete:Pe,onDragStart:Te,onMouseMove:st,onPaste:Re,copyHeaders:Ge=!1,freezeColumns:He=0,cellActivationBehavior:we="second-click",rowSelectionMode:Be="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:ft,getGroupDetails:Xe,rowGrouping:yt,onSearchClose:Xt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:nn,onVisibleRegionChanged:qt,gridSelection:cn,onGridSelectionChange:Ot,minColumnWidth:ut=50,maxColumnWidth:tn=500,maxColumnAutoWidth:Ct,provideEditor:rn,trailingRowOptions:Bt,freezeTrailingRows:De=0,allowedFillDirections:Et="orthogonal",scrollOffsetX:Pt,scrollOffsetY:yn,verticalBorder:Yt,onDragOverCell:dn,onDrop:Rn,onColumnResize:jt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Rt,fillHandle:Cn,experimental:vt,fixedShadowX:Ft,fixedShadowY:Sn,headerIcons:qn,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ue,onRowMoved:St,overscrollX:mn,overscrollY:ge,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:It,trapFocus:Nt=!1,smoothScrollX:on,smoothScrollY:ka,scaleToRem:fo=!1,rowHeight:Ma=34,headerHeight:ho=36,groupHeaderHeight:Ir=ho,theme:ur,isOutsideClick:Ra,renderers:bi,resizeIndicator:go,scrollToActiveCell:wi=!0,drawFocusRing:Er=!0,portalElementRef:pl}=e,yi=Er==="no-editor"?i===void 0:Er,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=Pn?.kind??e.rowMarkers??"none",Ci=Pn?.width??e.rowMarkerWidth,er=Pn?.startIndex??e.rowMarkerStartIndex??1,tr=Pn?.theme??e.rowMarkerTheme,Xr=Pn?.headerTheme,cr=Pn?.headerAlwaysVisible,Tr=me!=="multi"||Pn?.headerDisabled===!0,Yr=Pn?.checkboxStyle??"square",nr=Math.max(ut,20),jr=Math.max(tn,nr),Ia=Math.max(Ct??jr,nr),mo=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Si,rowHeight:po,getRowThemeOverride:dr}=tv(yt,v,Ma,h),Ea=f.useMemo(()=>Number.parseFloat(mo.fontSize),[mo]),{rowHeight:Gn,headerHeight:xi,groupHeaderHeight:vo,theme:bo,overscrollX:ki,overscrollY:Ta}=J0({groupHeaderHeight:Ir,headerHeight:ho,overscrollX:mn,overscrollY:ge,remSize:Ea,rowHeight:po,scaleToRem:fo,theme:ur}),Xn=Q0(he),fr=Ci??(v>1e4?48:v>1e3?44:v>100?36:32),_n=xn!=="none",U=_n?1:0,Lt=Bt!==void 0,rr=Bt?.sticky===!0,[Mi,wo]=f.useState(!1),Kr=nn??Mi,Da=f.useCallback(()=>{Xt!==void 0?Xt():wo(!1)},[Xt]),K=f.useMemo(()=>cn===void 0?void 0:Vo(cn,U),[cn,U])??n,kn=f.useRef();kn.current===void 0&&(kn.current=new AbortController),f.useEffect(()=>()=>kn?.current.abort(),[]);const[z,oe]=A0(ee,S,U,kn.current,_e),Me=f.useCallback((w,A,L)=>{if(et===void 0)return!0;const W=[w[0]-U,w[1]];return et?.(W,A,L)},[U,et]),Ie=f.useRef(cn),ae=f.useCallback((w,A)=>{A&&(w=W0(w,z,U,x,kn.current)),Ot!==void 0?(Ie.current=Vo(w,-U),Ot(Ie.current)):r(w)},[Ot,z,U,x]),ve=yr(jt,f.useCallback((w,A,L,W)=>{jt?.(b[L-U],A,L-U,W)},[jt,U,b])),Ye=yr(Jt,f.useCallback((w,A,L,W)=>{Jt?.(b[L-U],A,L-U,W)},[Jt,U,b])),ye=yr(We,f.useCallback((w,A,L,W)=>{We?.(b[L-U],A,L-U,W)},[We,U,b])),je=yr(k,f.useCallback((w,A)=>k?.({...w,columnIndex:w.columnIndex-U},A)??!1,[k,U])),ct=yr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Zt=f.useCallback(w=>{if(Pe!==void 0){const A=Pe(Vo(w,-U));return typeof A=="boolean"?A:Vo(A,U)}return!0},[Pe,U]),[dt,Tt,tt]=L0(K,ae,xe,de,be,Ne,T),Je=f.useMemo(()=>or(Cd(),bo),[bo]),[zt,Wt]=f.useState([0,0,0]),Dr=f.useMemo(()=>{if(bi===void 0)return{};const w={};for(const A of bi)w[A.kind]=A;return w},[bi]),en=f.useCallback(w=>w.kind!==J.Custom?Dr[w.kind]:Rt?.find(A=>A.isMatch(w)),[Rt,Dr]);let{sizedColumns:an,nonGrowWidth:hr}=ep(b,_e,oe,zt[0]-(U===0?0:fr)-zt[2],nr,Ia,Je,en,kn.current);xn!=="none"&&(hr+=fr);const _t=f.useMemo(()=>an.some(w=>w.group!==void 0),[an]),Mn=_t?xi+vo:xi,In=K.rows.length,gr=xn==="none"?void 0:In===0?!1:In===_e?!0:void 0,nt=f.useMemo(()=>xn==="none"?an:[{title:"",width:fr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:tr,rowMarker:Yr,rowMarkerChecked:gr,headerRowMarkerTheme:Xr,headerRowMarkerAlwaysVisible:cr,headerRowMarkerDisabled:Tr},...an],[xn,an,fr,tr,Yr,gr,Xr,cr,Tr]),sn=f.useRef({height:1,width:1,x:0,y:0}),Yn=f.useRef(!1),{setVisibleRegion:vl,visibleRegion:Or,scrollRef:Ut}=iv(Pt,yn,Gn,sn,()=>Yn.current=!0);sn.current=Or;const Lf=Or.x+U,yo=Or.y,fn=f.useRef(null),pn=f.useCallback(w=>{w===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Lt?_e+1:_e,Fn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),L=ue?.(A);if(L!==!0)for(const W of A)se?.(W.location,W.value);return L},[se,ue,U]),[Pr,Oa]=f.useState(),Co=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,bl=yi?K.current?.cell:void 0,So=bl?.[0],xo=bl?.[1],Af=f.useMemo(()=>{if((kt===void 0||kt.length===0)&&(Co??So??xo??Pr)===void 0)return;const w=[];if(kt!==void 0)for(const A of kt){const L=nt.length-A.range.x-U;L>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(L,A.range.width)},style:A.style})}return Pr!==void 0&&w.push({color:Nr(Je.accentColor,0),range:Pr,style:"dashed"}),Co!==void 0&&w.push({color:Nr(Je.accentColor,.5),range:Co,style:"solid-outline"}),So!==void 0&&xo!==void 0&&w.push({color:Je.accentColor,range:{x:So,y:xo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Pr,Co,So,xo,kt,nt.length,Je.accentColor,U]),wl=f.useRef(nt);wl.current=nt;const En=f.useCallback(([w,A],L=!1)=>{const W=Lt&&A===hn-1;if(w===0&&_n){if(W)return $o;const Y=Si(A);return Y===void 0?$o:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:Yr,checked:K?.rows.hasIndex(A)===!0,markerKind:xn==="clickable-number"?"number":xn,row:er+Y,drawHandle:St!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=wl.current[w];if(B?.trailingRowOptions?.disabled===!0)return $o;{const Z=B?.trailingRowOptions?.hint??V,le=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const Y=w-U;if(L||vt?.strict===!0){const B=sn.current,Z=B.x>Y||Y>B.x+B.width||B.y>A||A>B.y+B.height||A>=La.current,le=Y===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const wt of B.extras.freezeRegions)if($r(wt,Y,A)){pe=!0;break}}if(Z&&!le&&!pe)return $o}let V=S([Y,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Lt,hn,_n,Si,Yr,K?.rows,xn,er,St,U,Bt?.hint,Bt?.addIcon,vt?.strict,S]),Pa=f.useCallback(w=>{let A=Xe?.(w)??{name:w};return te!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>Ha({group:A.name,bounds:L.bounds})}]}),A},[Xe,te]),ko=f.useCallback(w=>{const[A,L]=w.cell,W=nt[A],q=W?.group!==void 0?Pa(W.group)?.overrideTheme:void 0,Y=W?.themeOverride,V=dr?.(L);o({...w,theme:or(Je,q,Y,V,w.content.themeOverride)})},[dr,nt,Pa,Je]),Zr=f.useCallback((w,A,L)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,Y=En([W,q]);if(Y.kind!==J.Boolean&&Y.allowOverlay){let V=Y;if(L!==void 0)switch(V.kind){case J.Number:{const B=_g(()=>L==="-"?-0:Number.parseFloat(L),0);V={...V,data:Number.isNaN(B)?0:B};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:L};break}ko({target:w,content:V,initialValue:L,cell:[W,q],highlight:L===void 0,forceEditMode:L!==void 0})}else Y.kind===J.Boolean&&A&&Y.readonly!==!0&&(Fn([{location:K.current.cell,value:{...Y,data:Ad(Y.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,ko]),yl=f.useCallback((w,A)=>{const L=fn.current?.getBounds(w,A);if(L===void 0||Ut.current===null)return;const W=En([w,A]);W.allowOverlay&&ko({target:L,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[En,Ut,ko]),Gt=f.useCallback((w,A,L="both",W=0,q=0,Y=void 0)=>{if(Ut.current!==null){const V=fn.current,B=a.current,Z=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,le=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let rt={x:0,y:0,width:0,height:0},Ke=0,Ze=0;if((Z!==void 0||le!==void 0)&&(rt=V.getBounds((Z??0)+U,le??0)??rt,rt.width===0||rt.height===0))return;const ht=B.getBoundingClientRect(),xt=ht.width/B.offsetWidth;if(pe!==void 0&&(rt={...rt,x:pe-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(rt={...rt,y:wt+ht.top-Ut.current.scrollTop,height:1}),rt!==void 0){const pt={x:rt.x-W,y:rt.y-q,width:rt.width+2*W,height:rt.height+2*q};let ri=0;for(let Ua=0;Ua<He;Ua++)ri+=an[Ua].width;let _i=0;const Fi=De+(rr?1:0);Fi>0&&(_i=qr(hn,Fi,Gn));let Kn=ri*xt+ht.left+U*fr*xt,ii=ht.right,Ar=ht.top+Mn*xt,oi=ht.bottom-_i*xt;const Oo=rt.width+W*2;switch(Y?.hAlign){case"start":ii=Kn+Oo;break;case"end":Kn=ii-Oo;break;case"center":Kn=Math.floor((Kn+ii)/2)-Oo/2,ii=Kn+Oo;break}const Po=rt.height+q*2;switch(Y?.vAlign){case"start":oi=Ar+Po;break;case"end":Ar=oi-Po;break;case"center":Ar=Math.floor((Ar+oi)/2)-Po/2,oi=Ar+Po;break}Kn>pt.x?Ke=pt.x-Kn:ii<pt.x+pt.width&&(Ke=pt.x+pt.width-ii),Ar>pt.y?Ze=pt.y-Ar:oi<pt.y+pt.height&&(Ze=pt.y+pt.height-oi),L==="vertical"||typeof w=="number"&&w<He?Ke=0:(L==="horizontal"||typeof A=="number"&&A>=hn-Fi)&&(Ze=0),(Ke!==0||Ze!==0)&&(xt!==1&&(Ke/=xt,Ze/=xt),Ut.current.scrollTo({left:Ke+Ut.current.scrollLeft,top:Ze+Ut.current.scrollTop,behavior:Y?.behavior??"auto"}))}}}},[U,De,fr,Ut,Mn,He,an,hn,rr,Gn]),_a=f.useRef(yl),Fa=f.useRef(S);_a.current=yl,Fa.current=S;const La=f.useRef(_e);La.current=_e;const Cl=f.useRef(nt.length);Cl.current=nt.length;const mr=f.useCallback(async(w,A=!0,L)=>{if(nt[w]?.trailingRowOptions?.disabled===!0)return;const q=Se?.();let Y,V=!0;q!==void 0&&(Y=await q,Y==="top"&&(V=!1),typeof Y=="number"&&(V=!1));let B=0;const Z=()=>{if(La.current<=_e){B<500&&window.setTimeout(Z,B),B=50+B*2;return}const le=typeof Y=="number"?Y:V?_e:0;Do.current(w-U,le,"both",0,0,L?{behavior:L}:void 0),dt({cell:[w,le],range:{x:w,y:le,width:1,height:1}},!1,!1,"edit");const pe=Fa.current([w-U,le]);pe.allowOverlay&&ci(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(w,le)},0)};Z()},[nt,Se,U,_e,dt]),Mo=f.useCallback(async(w,A=!0)=>{const L=Qe?.();let W,q=!0;L!==void 0&&(W=await L,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let Y=0;const V=()=>{if(Cl.current<=nt.length){Y<500&&window.setTimeout(V,Y),Y=50+Y*2;return}const B=typeof W=="number"?W:q?nt.length:0;Gt(B-U,w),dt({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const Z=Fa.current([B-U,w]);Z.allowOverlay&&ci(Z)&&Z.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(B,w)},0)};V()},[nt,Qe,U,Gt,dt]),Jr=f.useCallback(w=>{const A=an[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(_n?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(_n?1:0)}},[an,b,_n,Bt?.targetColumn]),pr=f.useRef(),Qr=f.useRef(),Ii=f.useCallback((w,A)=>{const[L,W]=A;return or(Je,nt[L]?.themeOverride,dr?.(W),w.themeOverride)},[dr,nt,Je]),{mapper:_r}=nv(yt,v),Vn=yt?.navigationBehavior,Ei=f.useCallback(w=>{const A=aa.value?w.metaKey:w.ctrlKey,L=A&&me==="multi",W=A&&ne==="multi",[q,Y]=w.location,V=K.columns,B=K.rows,[Z,le]=K.current?.cell??[];if(w.kind==="cell"){if(Qr.current=void 0,Fr.current=[q,Y],q===0&&_n){if(Lt===!0&&Y===_e||xn==="number"||me==="none")return;const pe=En(w.location);if(pe.kind!==Hn.Marker)return;if(St!==void 0){const Ke=en(pe);Dn(Ke?.kind===Hn.Marker);const Ze=Ke?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ii(pe,w.location),preventDefault:()=>{}});if(Ze===void 0||Ze.checked===pe.checked)return}o(void 0),pn();const wt=B.hasIndex(Y),rt=pr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&rt!==void 0&&B.hasIndex(rt)){const Ke=[Math.min(rt,Y),Math.max(rt,Y)+1];L||Be==="multi"?Tt(void 0,Ke,!0):Tt(it.fromSingleSelection(Ke),void 0,L)}else me==="multi"&&(L||w.isTouch||Be==="multi")?wt?Tt(B.remove(Y),void 0,!0):(Tt(void 0,Y,!0),pr.current=Y):wt&&B.length===1?Tt(it.empty(),void 0,A):(Tt(it.fromSingleSelection(Y),void 0,A),pr.current=Y)}else if(q>=U&&Lt&&Y===_e){const pe=Jr(q);mr(pe??q)}else if(Z!==q||le!==Y){const pe=En(w.location),wt=en(pe);if(wt?.onSelect!==void 0){let Ze=!1;if(wt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ze=!0,theme:Ii(pe,w.location)}),Ze)return}if(Vn==="block"&&_r(Y).isGroupHeader)return;const rt=rr&&Y===_e,Ke=rr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Ke){if(rt)return;const Ze=Math.min(q,Z),ht=Math.max(q,Z),xt=Math.min(Y,le),pt=Math.max(Y,le);dt({...K.current,range:{x:Ze,y:xt,width:ht-Ze+1,height:pt-xt+1}},!0,A,"click"),pr.current=void 0,pn()}else dt({cell:[q,Y],range:{x:q,y:Y,width:1,height:1}},!0,A,"click"),pr.current=void 0,o(void 0),pn()}}else if(w.kind==="header")if(Fr.current=[q,Y],o(void 0),_n&&q===0)pr.current=void 0,Qr.current=void 0,!Tr&&me==="multi"&&(B.length!==_e?Tt(it.fromSingleSelection([0,_e]),void 0,A):Tt(it.empty(),void 0,A),pn());else{const pe=Qr.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const wt=[Math.min(pe,q),Math.max(pe,q)+1];W?tt(void 0,wt,A):tt(it.fromSingleSelection(wt),void 0,A)}else W?(V.hasIndex(q)?tt(V.remove(q),void 0,A):tt(void 0,q,A),Qr.current=q):ne!=="none"&&(V.hasIndex(q)?tt(V.remove(q),void 0,A):tt(it.fromSingleSelection(q),void 0,A),Qr.current=q);pr.current=void 0,pn()}else w.kind===An?Fr.current=[q,Y]:w.kind===sa&&!w.isMaybeScrollbar&&(ae(No,!1),o(void 0),pn(),Mt?.(),pr.current=void 0,Qr.current=void 0)},[me,ne,K,_n,U,Lt,_e,xn,En,St,pn,Be,en,Ii,Tt,Jr,mr,Vn,_r,rr,dt,tt,ae,Mt]),Ti=f.useRef(!1),Fr=f.useRef(),Sl=f.useRef(Or),jn=f.useRef(),Hf=f.useCallback(w=>{if(ei.current=!1,Sl.current=sn.current,w.button!==0&&w.button!==1){jn.current=void 0;return}const A=performance.now();jn.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Ti.current=!0);const L=w.kind==="cell"&&w.isFillHandle;!L&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:L}),Fr.current=void 0,!w.isTouch&&w.button===0&&!L?Ei(w):!w.isTouch&&w.button===1&&(Fr.current=w.location))},[K,Ei]),[Aa,Ha]=f.useState(),xl=f.useCallback(w=>{if(w.kind!==An||ne!=="multi")return;const A=aa.value?w.metaKey:w.ctrlKey,[L]=w.location,W=K.columns;if(L<U)return;const q=nt[L];let Y=L,V=L;for(let B=L-1;B>=U&&no(q.group,nt[B].group);B--)Y--;for(let B=L+1;B<nt.length&&no(q.group,nt[B].group);B++)V++;if(pn(),A)if(W.hasAll([Y,V+1])){let B=W;for(let Z=Y;Z<=V;Z++)B=B.remove(Z);tt(B,void 0,A)}else tt(void 0,[Y,V+1],A);else tt(it.fromSingleSelection([Y,V+1]),void 0,A)},[ne,pn,K.columns,nt,U,tt]),ei=f.useRef(!1),Ro=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=sn.current.y,L=sn.current.height;let W=z({x:w,y:A,width:1,height:Math.min(L,_e-A)},kn.current.signal);typeof W!="object"&&(W=await W());const q=an[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Je.baseFontFull;const B=xd(V,Je,q,0,W,nr,jr,!1,en);ve?.(q,B.width,w,B.width)}}},[an,z,jr,Je,nr,ve,U,_e,en]),[zf,za]=f.useState(),ti=f.useCallback(async(w,A)=>{const L=w.current?.range;if(L===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(R!==void 0){let B=!1;if(R({fillDestination:{...W,x:W.x-U},patternSource:{...L,x:L.x-U},preventDefault:()=>B=!0}),B)return}let q=z(L,kn.current.signal);typeof q!="object"&&(q=await q());const Y=q,V=[];for(let B=0;B<W.width;B++)for(let Z=0;Z<W.height;Z++){const le=[W.x+B,W.y+Z];if(fd(le,L))continue;const pe=Y[Z%L.height][B%L.width];fi(pe)||!ci(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(B=>({cell:B.location})))},[z,Fn,R,U]),kl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,width:1}}};ti(w,K)},[ti,K]),Ml=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,height:1}}};ti(w,K)},[ti,K]),Vf=f.useCallback((w,A)=>{const L=l;if(u(void 0),Oa(void 0),za(void 0),Ti.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Pr===void 0)return;const pe={...K,current:{...K.current,range:Ed(L.previousSelection.current.range,Pr)}};ti(L.previousSelection,pe),ae(pe,!0);return}const[W,q]=w.location,[Y,V]=Fr.current??[],B=()=>{ei.current=!0},Z=pe=>{const wt=pe.isTouch||Y===W&&V===q;if(wt&&O?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!ei.current;if(!ei.current){const rt=En(w.location),Ke=en(rt);if(Ke!==void 0&&Ke.onClick!==void 0&&wt){const ht=Ke.onClick({...pe,cell:rt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ii(rt,w.location),preventDefault:B});ht!==void 0&&!fi(ht)&&ui(ht)&&(Fn([{location:pe.location,value:ht}]),fn.current?.damage([{cell:pe.location}]))}if(ei.current||K.current===void 0)return!1;let Ze=!1;switch(rt.activationBehaviorOverride??we){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=K.current.cell,[pt,ri]=L.previousSelection.current.cell;Ze=W===ht&&W===pt&&q===xt&&q===ri&&(pe.isDoubleClick===!0||we==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze)return M?.([W-U,q]),Zr(pe.bounds,!1),!0}return!1},le=w.location[0]-U;if(w.isTouch){const pe=sn.current,wt=Sl.current;if(pe.x!==wt.x||pe.y!==wt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Zi(K.current?.cell,w.location)){G?.([le,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ie?.(le,{...w,preventDefault:B});return}else if(w.kind===An){if(le<0)return;Q?.(le,{...w,preventDefault:B});return}}w.kind==="cell"?Z(w)||Ei(w):w.kind===An?N?.(le,{...w,preventDefault:B}):(w.kind===Cr&&C?.(le,{...w,preventDefault:B}),Ei(w));return}if(w.kind==="header"){if(le<0)return;w.isEdge?w.isDoubleClick===!0&&Ro(W):w.button===0&&W===Y&&q===V&&C?.(le,{...w,preventDefault:B})}if(w.kind===An){if(le<0)return;w.button===0&&W===Y&&q===V&&(N?.(le,{...w,preventDefault:B}),ei.current||xl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Z(w),Fr.current=void 0},[l,K,U,Pr,ti,ae,O,En,en,we,Ii,Fn,M,Zr,G,ie,Q,Ei,N,C,Ro,xl]),$f=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};st?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Oa(void 0),za(void 0),Ti.current=!1),za(L=>Ti.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===L?.[0]&&w.scrollEdge[1]===L[1]?L:l===void 0||(jn.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,st,U]),Nf=f.useCallback((w,A)=>{mt?.(w-U,A)},[mt,U]),Bf=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ni=K?.current?.cell,Wf=f.useCallback((w,A,L,W,q,Y)=>{Yn.current=!1;let V=ni;V!==void 0&&(V=[V[0]-U,V[1]]);const B=He===0?void 0:{x:0,y:w.y,width:He,height:w.height},Z=[];B!==void 0&&Z.push(B),De>0&&(Z.push({x:w.x-U,y:_e-De,width:w.width,height:De}),He>0&&Z.push({x:0,y:_e-De,width:He,height:De}));const le={x:w.x-U,y:w.y,width:w.width,height:Lt&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:Y,extras:{selected:V,freezeRegion:B,freezeRegions:Z}};sn.current=le,vl(le),Wt([A,L,W]),qt?.(le,le.tx,le.ty,le.extras)},[ni,U,Lt,_e,He,De,vl,qt]),Uf=yr(E,f.useCallback((w,A)=>E?.(w-U,A-U)!==!1,[E,U])),qf=yr(Ee,f.useCallback((w,A)=>{Ee?.(w-U,A-U),ne!=="none"&&tt(it.fromSingleSelection(A),void 0,!0)},[ne,Ee,U,tt])),Va=f.useRef(!1),Gf=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Te?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(Va.current=!0),u(void 0)},[Te,U]),Xf=f.useCallback(()=>{Va.current=!1},[]),Rl=yt?.selectionBehavior,Io=f.useCallback(w=>{if(Rl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:W}=_r(w);if(A)return[w,w];const q=L[L.length-1],Y=w-q,V=w+W-q-1;return[Y,V]},[_r,Rl]),$a=f.useRef(),Na=f.useCallback(w=>{if(!Fd(w,$a.current)&&($a.current=w,!(jn?.current?.button!==void 0&&jn.current.button>=1))){if(w.buttons!==0&&l!==void 0&&jn.current?.location[0]===0&&w.location[0]===0&&U===1&&me==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(jn.current.location[1])&&K.rows.hasIndex(jn.current.location[1])){const A=Math.min(jn.current.location[1],w.location[1]),L=Math.max(jn.current.location[1],w.location[1])+1;Tt(it.fromSingleSelection([A,L]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!Va.current&&!Ti.current&&(Ne==="rect"||Ne==="multi-rect")){const[A,L]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=sn.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const Y=l.previousSelection.current.range;q=Math.min(q,Lt?_e-1:_e);const V=Bp(Y,W,q,Et);Oa(V)}else{if(Lt&&L===_e)return;if(Lt&&q===_e)if(w.kind===sa)q--;else return;W=Math.max(W,U);const B=Io(L);q=B===void 0?q:Ln(q,B[0],B[1]);const Z=W-A,le=q-L,pe={x:Z>=0?A:W,y:le>=0?L:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};dt({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,me,K,Ne,Ht,Tt,Lt,_e,Et,Io,dt]),Yf=f.useCallback(()=>{const w=$a.current;if(w===void 0)return;const[A,L]=w.scrollEdge;let[W,q]=w.location;const Y=sn.current;A===-1?W=Y.extras?.freezeRegion?.x??Y.x:A===1&&(W=Y.x+Y.width),L===-1?q=Math.max(0,Y.y):L===1&&(q=Math.min(_e-1,Y.y+Y.height)),W=Ln(W,0,nt.length-1),q=Ln(q,0,_e-1),Na({...w,location:[W,q]})},[nt.length,Na,_e]);Z0(zf,Ut,Yf);const $n=f.useCallback(w=>{if(K.current===void 0)return;const[A,L]=w,[W,q]=K.current.cell,Y=K.current.range;let V=Y.x,B=Y.x+Y.width,Z=Y.y,le=Y.y+Y.height;const[pe,wt]=Io(q)??[0,_e-1],rt=wt+1;if(L!==0)switch(L){case 2:{le=rt,Z=q,Gt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Gt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Gt(0,Z,"vertical")):(le=Math.min(rt,le+1),Gt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Gt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Gt(0,Z,"vertical"));break}default:to()}if(A!==0)if(A===2)B=nt.length,V=W,Gt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,Gt(V-U,0,"horizontal");else{let Ke=[];if(z!==void 0){const Ze=z({x:V,y:Z,width:B-V-U,height:le-Z},kn.current.signal);typeof Ze=="object"&&(Ke=sv(Ze))}if(A===1){let Ze=!1;if(V<W){if(Ke.length>0){const ht=xr(V+1,W+1).find(xt=>!Ke.includes(xt-U));ht!==void 0&&(V=ht,Ze=!0)}else V++,Ze=!0;Ze&&Gt(V,0,"horizontal")}Ze||(B=Math.min(nt.length,B+1),Gt(B-1-U,0,"horizontal"))}else if(A===-1){let Ze=!1;if(B>W+1){if(Ke.length>0){const ht=xr(B-1,W,-1).find(xt=>!Ke.includes(xt-U));ht!==void 0&&(B=ht,Ze=!0)}else B--,Ze=!0;Ze&&Gt(B-U,0,"horizontal")}Ze||(V=Math.max(U,V-1),Gt(V-U,0,"horizontal"))}else to()}dt({cell:K.current.cell,range:{x:V,y:Z,width:B-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Io,K,nt.length,U,_e,Gt,dt]),Ba=f.useRef(wi);Ba.current=wi;const vr=f.useCallback((w,A,L,W)=>{const q=hn-(L?0:1);w=Ln(w,U,an.length-1+U),A=Ln(A,0,q);const Y=ni?.[0],V=ni?.[1];if(w===Y&&A===V)return!1;if(W&&K.current!==void 0){const B=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&B.push(K.current.range),ae({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else dt({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Ba.current&&Gt(w-U,A),!0},[hn,U,an.length,ni,K,Gt,ae,dt]),jf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&ui(w)&&(Fn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[L,W]=A;if(K.current!==void 0&&(L!==0||W!==0)){const q=K.current.cell[1]===hn-1&&w!==void 0,Y=K.current.cell[0]===nt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&Se!==void 0){V=!1;const B=K.current.cell[0]+L,Z=Jr(B);mr(Z??B,!1)}if(Y&&L===1&&Qe!==void 0){V=!1;const B=K.current.cell[1]+W;Mo(B,!1)}V&&vr(Ln(K.current.cell[0]+L,0,nt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(w,A)},[i?.cell,pn,K,_,Fn,hn,vr,nt.length,mr,Mo,Se,Qe,Jr]),Kf=f.useMemo(()=>`gdg-overlay-${av++}`,[]),Lr=f.useCallback(w=>{pn();const A=[];for(let L=w.x;L<w.x+w.width;L++)for(let W=w.y;W<w.y+w.height;W++){const q=S([L-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let Y;if(q.kind===J.Custom){const V=en(q),B=V?.provideEditor?.({...q,location:[L-U,W]});V?.onDelete!==void 0?Y=V.onDelete(q):Fg(B)&&(Y=B?.deletedValue?.(q))}else(ui(q)&&q.allowOverlay||q.kind===J.Boolean)&&(Y=en(q)?.onDelete?.(q));Y!==void 0&&!fi(Y)&&ui(Y)&&A.push({location:[L,W],value:Y})}Fn(A),fn.current?.damage(A.map(L=>({cell:L.location})))},[pn,S,en,Fn,U]),Di=i!==void 0,Il=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},L={didMatch:!1},{bounds:W}=w,q=K.columns,Y=K.rows,V=Xn;if(!Di&&ot(V.clear,w,L))ae(No,!1),Mt?.();else if(!Di&&ot(V.selectAll,w,L))ae({columns:it.empty(),rows:it.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(ot(V.search,w,L))s?.current?.focus({preventScroll:!0}),wo(!0);else if(ot(V.delete,w,L)){const ht=Zt?.(K)??!0;if(ht!==!1){const xt=ht===!0?K:ht;if(xt.current!==void 0){Lr(xt.current.range);for(const pt of xt.current.rangeStack)Lr(pt)}for(const pt of xt.rows)Lr({x:U,y:pt,width:b.length,height:1});for(const pt of xt.columns)Lr({x:pt,y:0,width:1,height:_e})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,wt=!1;if(ot(V.scrollToSelectedCell,w,L)?Do.current(B-U,Z):ne!=="none"&&ot(V.selectColumn,w,L)?q.hasIndex(B)?tt(q.remove(B),void 0,!0):ne==="single"?tt(it.fromSingleSelection(B),void 0,!0):tt(void 0,B,!0):me!=="none"&&ot(V.selectRow,w,L)?Y.hasIndex(Z)?Tt(Y.remove(Z),void 0,!0):me==="single"?Tt(it.fromSingleSelection(Z),void 0,!0):Tt(void 0,Z,!0):!Di&&W!==void 0&&ot(V.activateCell,w,L)?Z===_e&&Lt?window.setTimeout(()=>{const ht=Jr(B);mr(ht??B)},0):(M?.([B-U,Z]),Zr(W,!0)):K.current.range.height>1&&ot(V.downFill,w,L)?Ml():K.current.range.width>1&&ot(V.rightFill,w,L)?kl():ot(V.goToNextPage,w,L)?Z+=Math.max(1,sn.current.height-4):ot(V.goToPreviousPage,w,L)?Z-=Math.max(1,sn.current.height-4):ot(V.goToFirstCell,w,L)?(o(void 0),Z=0,B=0):ot(V.goToLastCell,w,L)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):ot(V.selectToFirstCell,w,L)?(o(void 0),$n([-2,-2])):ot(V.selectToLastCell,w,L)?(o(void 0),$n([2,2])):Di?(ot(V.closeOverlay,w,L)&&o(void 0),ot(V.acceptOverlayDown,w,L)&&(o(void 0),Z++),ot(V.acceptOverlayUp,w,L)&&(o(void 0),Z--),ot(V.acceptOverlayLeft,w,L)&&(o(void 0),B--),ot(V.acceptOverlayRight,w,L)&&(o(void 0),B++)):(ot(V.goDownCell,w,L)?Z+=1:ot(V.goUpCell,w,L)?Z-=1:ot(V.goRightCell,w,L)?B+=1:ot(V.goLeftCell,w,L)?B-=1:ot(V.goDownCellRetainSelection,w,L)?(Z+=1,pe=!0):ot(V.goUpCellRetainSelection,w,L)?(Z-=1,pe=!0):ot(V.goRightCellRetainSelection,w,L)?(B+=1,pe=!0):ot(V.goLeftCellRetainSelection,w,L)?(B-=1,pe=!0):ot(V.goToLastRow,w,L)?Z=_e-1:ot(V.goToFirstRow,w,L)?Z=Number.MIN_SAFE_INTEGER:ot(V.goToLastColumn,w,L)?B=Number.MAX_SAFE_INTEGER:ot(V.goToFirstColumn,w,L)?B=Number.MIN_SAFE_INTEGER:(Ne==="rect"||Ne==="multi-rect")&&(ot(V.selectGrowDown,w,L)?$n([0,1]):ot(V.selectGrowUp,w,L)?$n([0,-1]):ot(V.selectGrowRight,w,L)?$n([1,0]):ot(V.selectGrowLeft,w,L)?$n([-1,0]):ot(V.selectToLastRow,w,L)?$n([0,2]):ot(V.selectToFirstRow,w,L)?$n([0,-2]):ot(V.selectToLastColumn,w,L)?$n([2,0]):ot(V.selectToFirstColumn,w,L)&&$n([-2,0])),wt=L.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const ht=Vn==="skip-up"||Vn==="skip"||Vn==="block",xt=Vn==="skip-down"||Vn==="skip"||Vn==="block",pt=Z<le;if(pt&&ht){for(;Z>=0&&_r(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!pt&&xt){for(;Z<_e&&_r(Z).isGroupHeader;)Z++;Z>=_e&&(Z=le)}}const Ke=vr(B,Z,!1,pe),Ze=L.didMatch;return Ze&&(Ke||!wt||Nt)&&A(),Ze},[Vn,Di,K,Xn,ne,me,Ne,U,_r,_e,vr,ae,Mt,b.length,Zt,Nt,Lr,tt,Tt,Lt,Jr,mr,M,Zr,Ml,kl,$n]),Oi=f.useCallback(w=>{let A=!1;if(X!==void 0&&X({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||Il(w)||K.current===void 0)return;const[L,W]=K.current.cell,q=sn.current;if(ke&&!w.metaKey&&!w.ctrlKey&&K.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&ci(S([L-U,Math.max(0,Math.min(W,_e-1))]))){if((!Lt||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>L||L>q.x+q.width))return;M?.([L-U,W]),Zr(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[ke,X,Il,K,S,U,_e,Lt,M,Zr]),Zf=f.useCallback((w,A)=>{const L=w.location[0]-U;if(w.kind==="header"&&ie?.(L,{...w,preventDefault:A}),w.kind===An){if(L<0)return;Q?.(L,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([L,q],{...w,preventDefault:A}),Hm(K,w.location)||vr(W,q,!1,!1)}},[K,G,Q,ie,U,vr]),Wa=f.useCallback(async w=>{if(!Xn.paste)return;function A(V,B,Z,le){const pe=typeof Z=="object"?Z?.join(`
|
173
173
|
`)??"":Z?.toString()??"";if(!fi(V)&&ci(V)&&V.readonly!==!0){const wt=I?.(pe,V);if(wt!==void 0&&ui(wt))return{location:B,value:wt};const rt=en(V);if(rt===void 0)return;if(rt.kind===J.Custom){Dn(V.kind===J.Custom);const Ke=rt.onPaste?.(pe,V.data);return Ke===void 0?void 0:{location:B,value:{...V,data:Ke}}}else{const Ke=rt.onPaste?.(pe,V,{formatted:le,formattedString:typeof le=="string"?le:le?.join(`
|
174
174
|
`),rawValue:Z});return Ke===void 0?void 0:(Dn(Ke.kind===V.kind),{location:B,value:Ke})}}}const L=K.columns,W=K.rows,q=Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let Y;if(K.current!==void 0?Y=[K.current.range.x,K.current.range.y]:L.length===1?Y=[L.first()??0,0]:W.length===1&&(Y=[U,W.first()??0]),q&&Y!==void 0){let V,B;const Z="text/plain",le="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const Ze of Ke){if(Ze.types.includes(le)){const xt=await(await Ze.getType(le)).text(),pt=Ou(xt);if(pt!==void 0){V=pt;break}}Ze.types.includes(Z)&&(B=await(await Ze.getType(Z)).text())}}else if(navigator.clipboard.readText!==void 0)B=await navigator.clipboard.readText();else if(w!==void 0&&w?.clipboardData!==null){if(w.clipboardData.types.includes(le)){const Ke=w.clipboardData.getData(le);V=Ou(Ke)}V===void 0&&w.clipboardData.types.includes(Z)&&(B=w.clipboardData.getData(Z))}else return;const[pe,wt]=Y,rt=[];do{if(Re===void 0){const Ke=En(Y),Ze=B??V?.map(xt=>xt.map(pt=>pt.rawValue).join(" ")).join(" ")??"",ht=A(Ke,Y,Ze,void 0);ht!==void 0&&rt.push(ht);break}if(V===void 0){if(B===void 0)return;V=U0(B)}if(Re===!1||typeof Re=="function"&&Re?.([Y[0]-U,Y[1]],V.map(Ke=>Ke.map(Ze=>Ze.rawValue?.toString()??"")))!==!0)return;for(const[Ke,Ze]of V.entries()){if(Ke+wt>=_e)break;for(const[ht,xt]of Ze.entries()){const pt=[ht+pe,Ke+wt],[ri,_i]=pt;if(ri>=nt.length||_i>=hn)continue;const Fi=En(pt),Kn=A(Fi,pt,xt.rawValue,xt.formatted);Kn!==void 0&&rt.push(Kn)}}}while(!1);Fn(rt),fn.current?.damage(rt.map(Ke=>({cell:Ke.location})))}},[I,en,En,K,Xn.paste,Ut,nt.length,Fn,hn,Re,U,_e]);bn("paste",Wa,d,!1,!0);const Pi=f.useCallback(async(w,A)=>{if(!Xn.copy)return;const L=A===!0||Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,W=K.columns,q=K.rows,Y=(V,B)=>{if(!Ge)_u(V,B,w);else{const Z=B.map(le=>({kind:J.Text,data:b[le].title,displayData:b[le].title,allowOverlay:!1}));_u([Z,...V],B,w)}};if(L&&z!==void 0){if(K.current!==void 0){let V=z(K.current.range,kn.current.signal);typeof V!="object"&&(V=await V()),Y(V,xr(K.current.range.x-U,K.current.range.x+K.current.range.width-U))}else if(q!==void 0&&q.length>0){const B=[...q].map(Z=>{const le=z({x:U,y:Z,width:b.length,height:1},kn.current.signal);return typeof le=="object"?le[0]:le().then(pe=>pe[0])});if(B.some(Z=>Z instanceof Promise)){const Z=await Promise.all(B);Y(Z,xr(b.length))}else Y(B,xr(b.length))}else if(W.length>0){const V=[],B=[];for(const Z of W){let le=z({x:Z,y:0,width:1,height:_e},kn.current.signal);typeof le!="object"&&(le=await le()),V.push(le),B.push(Z-U)}if(V.length===1)Y(V[0],B);else{const Z=V.reduce((le,pe)=>le.map((wt,rt)=>[...wt,...pe[rt]]));Y(Z,B)}}}},[b,z,K,Xn.copy,U,Ut,_e,Ge]);bn("copy",Pi,d,!1,!1);const Jf=f.useCallback(async w=>{if(!(!Xn.cut||!(Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Pi(w),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:it.empty(),columns:it.empty()};const W=Zt?.(L);if(W===!1||(L=W===!0?L:W,L.current===void 0))return;Lr(L.current.range)}},[Lr,K,Xn.cut,Pi,Ut,Zt]);bn("cut",Jf,d,!1,!1);const Qf=f.useCallback((w,A)=>{if(fe!==void 0){U!==0&&(w=w.map(q=>[q[0]-U,q[1]])),fe(w,A);return}if(w.length===0||A===-1)return;const[L,W]=w[A];c.current!==void 0&&c.current[0]===L&&c.current[1]===W||(c.current=[L,W],vr(L,W,!1,!1))},[fe,U,vr]),[Eo,To]=cn?.current?.cell??[],Do=f.useRef(Gt);Do.current=Gt,f.useLayoutEffect(()=>{Ba.current&&!Yn.current&&Eo!==void 0&&To!==void 0&&(Eo!==Ie.current?.current?.cell[0]||To!==Ie.current?.current?.cell[1])&&Do.current(Eo,To),Yn.current=!1},[Eo,To]);const El=K.current!==void 0&&(K.current.cell[0]>=nt.length||K.current.cell[1]>=hn);f.useLayoutEffect(()=>{El&&ae(No,!1)},[El,ae]);const eh=f.useMemo(()=>Lt===!0&&Bt?.tint===!0?it.fromSingleSelection(hn-1):it.empty(),[hn,Lt,Bt?.tint]),th=f.useCallback(w=>typeof Yt=="boolean"?Yt:Yt?.(w-U)??!0,[U,Yt]),nh=f.useMemo(()=>{if(Aa===void 0||a.current===null)return null;const{bounds:w,group:A}=Aa,L=a.current.getBoundingClientRect();return f.createElement(_0,{bounds:w,group:A,canvasBounds:L,onClose:()=>Ha(void 0),onFinish:W=>{Ha(void 0),te?.(A,W)}})},[te,Aa]),rh=Math.min(nt.length,He+(_n?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>mr(w+U,A),appendColumn:(w,A)=>Mo(w,A),updateCells:w=>(U!==0&&(w=w.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),fn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Ut?.current===null)){if(w===void 0&&A===void 0){const L=a.current.getBoundingClientRect(),W=L.width/Ut.current.clientWidth;return{x:L.x-Ut.current.scrollLeft*W,y:L.y-Ut.current.scrollTop*W,width:Ut.current.scrollWidth*W,height:Ut.current.scrollHeight*W}}return fn.current?.getBounds((w??0)+U,A)}},focus:()=>fn.current?.focus(),emit:async w=>{switch(w){case"delete":Oi({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":Oi({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":Oi({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 Pi(void 0,!0);break;case"paste":await Wa();break}},scrollTo:Gt,remeasureColumns:w=>{for(const A of w)Ro(A+U)},getMouseArgsForPosition:(w,A,L)=>{if(fn?.current===null)return;const W=fn.current.getMouseArgsForPosition(w,A,L);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[mr,Mo,Ro,Ut,Pi,Oi,Wa,U,Gt]);const[Tl,Dl]=ni??[],ih=f.useCallback(w=>{const[A,L]=w;if(L===-1){ne!=="none"&&(tt(it.fromSingleSelection(A),void 0,!1),pn());return}Tl===A&&Dl===L||(dt({cell:w,range:{x:A,y:L,width:1,height:1}},!0,!1,"keyboard-nav"),Gt(A,L))},[ne,pn,Gt,Tl,Dl,dt,tt]),[oh,ah]=f.useState(!1),Ol=f.useRef(Qc(w=>{ah(w)},5)),sh=f.useCallback(()=>{Ol.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&dt({cell:[U,yo],range:{x:U,y:yo,width:1,height:1}},!0,!1,"keyboard-select")},[yo,K,l,U,dt]),lh=f.useCallback(()=>{Ol.current(!1)},[]),[uh,ch]=f.useMemo(()=>{let w;const A=vt?.scrollbarWidthOverride??xs(),L=_e+(Lt?1:0);if(typeof Gn=="number")w=Mn+L*Gn;else{let q=0;const Y=Math.min(L,10);for(let V=0;V<Y;V++)q+=Gn(V);q=Math.floor(q/Y),w=Mn+L*q}w+=A;const W=nt.reduce((q,Y)=>Y.width+q,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,w)}px`]},[nt,vt?.scrollbarWidthOverride,Gn,_e,Lt,Mn]),dh=f.useMemo(()=>Zm(Je),[Je]);return f.createElement(Sd.Provider,{value:Je},f.createElement(Y0,{style:dh,className:j,inWidth:p??uh,inHeight:y??ch},f.createElement(T0,{fillHandle:Cn,drawFocusRing:yi,experimental:vt,fixedShadowX:Ft,fixedShadowY:Sn,getRowThemeOverride:dr,headerIcons:qn,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ue,onRowMoved:St,overscrollX:ki,overscrollY:Ta,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:It,smoothScrollX:on,smoothScrollY:ka,className:j,enableGroups:_t,onCanvasFocused:sh,onCanvasBlur:lh,canvasRef:a,onContextMenu:Zf,theme:Je,cellXOffset:Lf,cellYOffset:yo,accessibilityHeight:Or.height,onDragEnd:Xf,columns:nt,nonGrowWidth:hr,drawHeader:je,onColumnProposeMove:Uf,drawCell:ct,disabledRows:eh,freezeColumns:rh,lockColumns:U,firstColAccessible:U===0,getCellContent:En,minColumnWidth:nr,maxColumnWidth:jr,searchInputRef:s,showSearch:Kr,onSearchClose:Da,highlightRegions:Af,getCellsForSelection:z,getGroupDetails:Pa,headerHeight:xi,isFocused:oh,groupHeaderHeight:_t?vo:0,freezeTrailingRows:De+(Lt&&Bt?.sticky===!0?1:0),hasAppendRow:Lt,onColumnResize:ve,onColumnResizeEnd:Ye,onColumnResizeStart:ye,onCellFocused:ih,onColumnMoved:qf,onDragStart:Gf,onHeaderMenuClick:Nf,onHeaderIndicatorClick:Bf,onItemHovered:Na,isFilling:l?.fillHandle===!0,onMouseMove:$f,onKeyDown:Oi,onKeyUp:ce,onMouseDown:Hf,onMouseUp:Vf,onDragOverCell:dn,onDrop:Rn,onSearchResultsChanged:Qf,onVisibleRegionChanged:Wf,clientSize:zt,rowHeight:Gn,searchResults:re,searchValue:P,onSearchValueChange:H,rows:hn,scrollRef:Ut,selection:K,translateX:Or.tx,translateY:Or.ty,verticalBorder:th,gridRef:fn,getCellRenderer:en,resizeIndicator:go}),nh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(ov,{...i,validateCell:Me,bloom:D,id:Kf,getCellRenderer:en,className:vt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:rn,imageEditorOverride:g,portalElementRef:pl,onFinishEditing:jf,markdownDivCreateNode:m,isOutsideClick:Ra,customEventTarget:vt?.eventTarget}))))},uv=f.forwardRef(lv);function Au(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=nd(c,a,o.cellVerticalPadding),h=td(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),m=ed(h,d,g),p=rd(l+n,u+r,m);return $s(t)&&p}const cv={getAccessibilityString:e=>e.data?.toString()??"false",kind:J.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>dv(e,e.cell.data,$s(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Au(e)&&e.preventDefault()},onClick:e=>{if(Au(e))return{...e.cell,data:Ad(e.cell.data)}},onPaste:(e,t)=>{let n=ta;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Vs),n===t.data?void 0:{...t,data:n}}};function dv(e,t,n,r,i){if(!n&&t===ta)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:y}=l;let b=!1;if(i>0){let v=n?1-i+i*s:.4;if(t===ta&&(v*=s),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}Zs(o,a,t,h,m,p,y,u,c,d,r,g),b&&(o.globalAlpha=1)}const fv=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),hv=e=>{const{bubbles:t}=e;return f.createElement(fv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},gv={getAccessibilityString:e=>id(e.data),kind:J.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>mv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(hv,{bubbles:t.data})},onPaste:()=>{}};function mv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>s+l)break;const h=Gr(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)Jn(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+Qn(i,r))}const pv=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),vv=e=>{const{drilldowns:t}=e;return f.createElement(pv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},bv={getAccessibilityString:e=>id(e.data.map(t=>t.text)),kind:J.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>yv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(vv,{drilldowns:t.data})},onPaste:()=>{}},us={};function wv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(us[g]!==void 0)return{el:us[g],height:l,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=l,m.scale(i,i),us[g]=h,m.beginPath(),Jn(m,o,o,c,s,r),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),Jn(m,o+.5,o+.5,c,s,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:l,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function yv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,d=Xs(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=r.bubblePadding,y=r.bubbleMargin;let b=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,S=wv(r.bgCell,r.drilldownBorder,g,v),O=[];for(const M of t){if(b>l+u)break;const _=Gr(M.text,i,c).width;let I=0;M.img!==void 0&&o.loadOrGetImage(M.img,s,a)!==void 0&&(I=m-8+4);const k=_+I+p*2;O.push({x:b,width:k}),b+=k+y}if(S!==null){const{el:M,height:R,middleWidth:_,sideWidth:I,width:k,dpr:F,padding:D}=S,C=I/F,E=D/F;for(const T of O){const x=Math.floor(T.x),N=Math.floor(T.width),G=N-(C-E)*2;i.imageSmoothingEnabled=!1,i.drawImage(M,0,0,I,R,x-E,h,C,g),G>0&&i.drawImage(M,I,0,_,R,x+(C-E),h,G,g),i.drawImage(M,k-I,0,I,R,x+N-(C-E),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[M,R]of O.entries()){const _=t[M];let I=R.x+p;if(_.img!==void 0){const k=o.loadOrGetImage(_.img,s,a);if(k!==void 0){const F=m-8;let D=0,C=0,E=k.width,T=k.height;E>T?(D+=(E-T)/2,E=T):T>E&&(C+=(T-E)/2,T=E),i.beginPath(),Jn(i,I,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,E,T,I,h+g/2-F/2,F,F),i.restore(),I+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,I,h+g/2+Qn(i,r))}}const Cv={getAccessibilityString:e=>e.data.join(", "),kind:J.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Sv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??sm;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},cs=4;function Sv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,m=g-a.cellVerticalPadding*2,p=[];let y=0;for(let v=0;v<t.length;v++){const S=t[v];if(S.length===0)continue;const O=u.loadOrGetImage(S,o,s);if(O!==void 0){p[v]=O;const M=O.width*(m/O.height);y+=M+cs}}if(y===0)return;y-=cs;let b=c+a.cellHorizontalPadding;r==="right"?b=Math.floor(c+h-a.cellHorizontalPadding-y):r==="center"&&(b=Math.floor(c+h/2-y/2));for(const v of p){if(v===void 0)continue;const S=v.width*(m/v.height);n>0&&(l.beginPath(),Jn(l,b,d+a.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(v,b,d+a.cellVerticalPadding,S,m),n>0&&l.restore(),b+=S+cs}}function xv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const kv={getAccessibilityString:()=>"",kind:J.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(xv(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);Jn(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Nr(s.textDark,.1),i.fill()},onPaste:()=>{}},Mv=()=>e=>e.targetWidth,Hu=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Mv(),"px"]}}),Rv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,d]=f.useState(l===""||r),g=f.useCallback(()=>{d(m=>!m)},[]),h=l?"gdg-ml-6":"";return c?f.createElement(Hu,{targetWidth:o.width-20},f.createElement(Ur,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},f.createElement(em,null))):f.createElement(Hu,{targetWidth:o.width},f.createElement(Rm,{contents:l,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Bs,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Iv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:uo,measure:(e,t,n)=>{const r=t.data.split(`
|
175
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Zn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(Rv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ev={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Tv,measure:()=>44,draw:e=>Ov(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Tv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Dv,n.textAlign="center",o}function Dv(e){const{ctx:t}=e;t.textAlign="start"}function Ov(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Zs(s,u,n,i?c+p:c,d,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const y of[3,6])for(const b of[-5,-1,3])s.rect(c+y,d+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),y=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=y,s.fillText(p,b,d+h/2+Qn(s,y)),l!==0&&(s.globalAlpha=1)}}const Pv={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>_v(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function _v(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=d-8,y=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,y,b,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,y=g?0:(1-o)*m*.5,b=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+b+y,u+d/2),r.lineTo(l+b+y+p,u+d/2),r.moveTo(l+b+y+p*.5,u+d/2-p*.5),r.lineTo(l+b+y+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+Qn(r,s)),r.beginPath()}function Vd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Fv(e,i,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Nr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Fv(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Gr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Lv=f.lazy(async()=>await Hs(()=>import("./number-overlay-editor.
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Zn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(Rv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ev={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Tv,measure:()=>44,draw:e=>Ov(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Tv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Dv,n.textAlign="center",o}function Dv(e){const{ctx:t}=e;t.textAlign="start"}function Ov(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Zs(s,u,n,i?c+p:c,d,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const y of[3,6])for(const b of[-5,-1,3])s.rect(c+y,d+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),y=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=y,s.fillText(p,b,d+h/2+Qn(s,y)),l!==0&&(s.globalAlpha=1)}}const Pv={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>_v(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function _v(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=d-8,y=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,y,b,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,y=g?0:(1-o)*m*.5,b=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+b+y,u+d/2),r.lineTo(l+b+y+p,u+d/2),r.moveTo(l+b+y+p*.5,u+d/2-p*.5),r.lineTo(l+b+y+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+Qn(r,s)),r.beginPath()}function Vd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Fv(e,i,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Nr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Fv(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Gr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Lv=f.lazy(async()=>await Hs(()=>import("./number-overlay-editor.Db9x94os.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Av={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:uo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&Vd(r,i,u,l,o,t,s),Zn(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(Lv,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},Hv={getAccessibilityString:()=>"",measure:()=>108,kind:J.Protected,needsHover:!1,needsHoverPosition:!1,draw:zv,onPaste:()=>{}};function zv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Vv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>uo(e,t,e.theme.textLight),draw:e=>Zn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return Vt.createElement(Ur,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:uo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Vd(i,s,g,l,o,n,a),Zn(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
176
176
|
`,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Ur,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Nv=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Bv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{l(!0)},[]);return a?f.createElement(Ur,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Nv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Bs,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function $d(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function zu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=pd(s,o.baseFontFull);if(a===void 0)return!1;const l=$d(a,n,o,t.contentAlign);return $r({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Wv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:uo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Gr(l,a,n.baseFontFull),d=$d(c,s,n,t.contentAlign),{x:g,y:h,width:m,height:p}=d;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const y=Qn(a,n.baseFontFull);r("pointer");const b=5,v=h-y;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+p+b)+.5),a.lineTo(s.x+g+m,Math.floor(s.y+v+p+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Zn({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),Zn({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),Zn({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),Zn({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,Zn(e,l,t.contentAlign)},onSelect:e=>{zu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;zu(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(Bv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Uv=[Ev,Pv,cv,gv,bv,Cv,kv,Iv,Av,Hv,Vv,$v,Wv];var ds,Vu;function qv(){if(Vu)return ds;Vu=1;var e=Jc(),t=Tc(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return ds=r,ds}var Gv=qv();const Xv=sr(Gv),fs=[];class Yv extends wd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Xv(()=>{this.imageLoaded(new Qi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=fs.pop()??new Image;let a=!1;const l={img:void 0,cells:[Wn(n,r)],url:t,cancel:()=>{a||(a=!0,fs.length<12?fs.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const d of c.cells)this.loadedLocations.push(Ks(d));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Wn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const jv=(e,t)=>{const n=f.useMemo(()=>({...Vp,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Uv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Yv,[e.imageWindowLoader]);return f.createElement(uv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Kv=f.forwardRef(jv);function $u(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Nd=Un("div",{target:"e32gfpu0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Sr=Un("div",{target:"e32gfpu1"})(({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}}})),Zv=Un("div",{target:"e32gfpu2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),Jv=Un("div",{target:"e32gfpu3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),Qv=Un("div",{target:"e32gfpu4"})(({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"})),e1=Un("div",{target:"e32gfpu5"})(({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"})),t1=Un("span",{target:"e32gfpu6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),n1=Un("button",{target:"e32gfpu7"})(({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}})),Nu=[{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:"}],r1={number:Nu,progress:Nu,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 i1({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=Br(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=r1[e]||[];return g.length===0?qe(Pc,{}):qe(ba,{triggerType:_c.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:qe(Nd,{role:"menu",children:g.map(h=>vn(Sr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:pa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},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",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:va(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const o1=f.memo(i1),Bu=wa.getLogger("ColumnMenu");function a1({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const d=Br(),[g,h]=f.useState(!1),{colors:m,fontSizes:p,radii:y,fontWeights:b}=d;f.useEffect(()=>{function O(M){M.preventDefault()}return document.addEventListener("wheel",O,{passive:!1}),document.addEventListener("touchmove",O,{passive:!1}),()=>{document.removeEventListener("wheel",O),document.removeEventListener("touchmove",O)}},[]);const v=f.useCallback(()=>{o()},[o]),S=f.useCallback(()=>{navigator.clipboard?navigator.clipboard.writeText(l.title).catch(O=>{Bu.error("Failed to copy column name to clipboard:",O)}):Bu.error("Clipboard API not supported.")},[l.title]);return qe(ba,{autoFocus:!0,"aria-label":"Dataframe column menu",content:vn(Nd,{children:[vn(Jv,{children:[qe(Qv,{title:l.kind,children:qe(Bn,{iconValue:l.typeIcon||":material/notes:",size:"base",color:"inherit"})}),vn(e1,{title:l.title,children:[qe(t1,{children:l.title}),qe(n1,{onClick:S,title:"Copy column name","aria-label":"Copy column name",children:qe(Bn,{iconValue:":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),s&&vn(Pc,{children:[vn(Sr,{onClick:()=>{s("asc"),v()},role:"menuitem",children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),vn(Sr,{onClick:()=>{s("desc"),v()},role:"menuitem",children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),qe(Zv,{})]}),u&&qe(o1,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:v,children:vn(Sr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[vn("div",{children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&vn(Sr,{onClick:()=>{c(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&vn(Sr,{onClick:()=>{i(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&vn(Sr,{onClick:()=>{r(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&vn(Sr,{onClick:()=>{a(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:pa.bottomRight,accessibilityType:Fc.menu,showArrow:!1,popoverMargin:ln("0.375rem"),onClickOutside:g?void 0:v,onEsc:v,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:va(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:b.normal,borderTopLeftRadius:y.default,borderTopRightRadius:y.default,borderBottomLeftRadius:y.default,borderBottomRightRadius:y.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:qe("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const s1=f.memo(a1),l1="(index)",u1=({label:e,initialValue:t,onChange:n})=>{const r=Br();return qe(bg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:vg.default,labelPlacement:pg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:i?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:o})=>{const s=o?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&o?`0 0 0 0.2rem ${li(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},c1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=Br();return qe(ba,{triggerType:_c.click,placement:pa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>qe("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return qe(u1,{label:!u.title&&u.isIndex?l1:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.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:va(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:qe("div",{children:o})})},d1=f.memo(c1);var f1=xh();const h1=sr(f1);var Jo={exports:{}};/*! Moment Duration Format v2.2.2
|
177
177
|
* https://github.com/jsmreese/moment-duration-format
|
178
178
|
* Date: 2018-02-16
|
@@ -193,5 +193,5 @@ Error: ${o}`}const r={kind:J.Text,data:"",displayData:"",allowOverlay:!0,content
|
|
193
193
|
40% { opacity: 1; }
|
194
194
|
`]))),dw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Fe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},ms=function(t){var n=t.delay,r=t.offset;return Oe("span",{css:Nc({animation:"".concat(cw," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},fw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=lr(t,nw);return Oe("div",ze({},Kt(Fe(Fe({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Oe(ms,{delay:0,offset:r}),Oe(ms,{delay:160,offset:!0}),Oe(ms,{delay:320,offset:!r}))},hw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Fe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},gw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Oe("div",ze({ref:o},Kt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},mw=gw,pw=["data"],vw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},bw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Oe("div",ze({},Kt(t,"group",{group:!0}),l),Oe(s,ze({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Oe("div",null,n))},ww=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Fe({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},yw=function(t){var n=cf(t);n.data;var r=lr(n,pw);return Oe("div",ze({},Kt(t,"groupHeading",{"group-heading":!0}),r))},Cw=bw,Sw=["innerRef","isDisabled","isHidden","inputClassName"],xw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Fe(Fe({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},kw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},wf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},kw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Fe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},wf)},Mw=function(t){return Fe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},wf)},Rw=function(t){var n=t.cx,r=t.value,i=cf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=lr(i,Sw);return Oe("div",ze({},Kt(t,"input",{"input-container":!0}),{"data-value":r||""}),Oe("input",ze({className:n({input:!0},l),ref:o,style:Mw(a),disabled:s},u)))},Iw=Rw,Ew=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Fe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Tw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Fe({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Dw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Fe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},yf=function(t){var n=t.children,r=t.innerProps;return Oe("div",r,n)},Ow=yf,Pw=yf;function _w(e){var t=e.children,n=e.innerProps;return Oe("div",ze({role:"button"},n),t||Oe(gl,{size:14}))}var Fw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Oe(u,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Oe(c,{data:i,innerProps:Fe({},Kt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Oe(d,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Lw=Fw,Aw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Fe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},Hw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Oe("div",ze({},Kt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},zw=Hw,Vw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Fe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},$w=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"placeholder",{placeholder:!0}),r),n)},Nw=$w,Bw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Fe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Ww=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Oe("div",ze({},Kt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Uw=Ww,Cf={ClearIndicator:sw,Control:mw,DropdownIndicator:ow,DownChevron:vf,CrossIcon:gl,Group:Cw,GroupHeading:yw,IndicatorsContainer:ew,IndicatorSeparator:uw,Input:Iw,LoadingIndicator:fw,Menu:$b,MenuList:Bb,MenuPortal:Yb,LoadingMessage:Gb,NoOptionsMessage:qb,MultiValue:Lw,MultiValueContainer:Ow,MultiValueLabel:Pw,MultiValueRemove:_w,Option:zw,Placeholder:Nw,SelectContainer:Kb,SingleValue:Uw,ValueContainer:Jb},qw=function(t){return Fe(Fe({},Cf),t.components)},cc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Gw(e,t){return!!(e===t||cc(e)&&cc(t))}function Xw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Gw(e[n],t[n]))return!1;return!0}function Yw(e,t){t===void 0&&(t=Xw);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var jw={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"},Kw=function(t){return Oe("span",ze({css:jw},t))},dc=Kw,Zw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,y){return p&&p.length?"".concat(p.indexOf(y)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},Jw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,v=l.options,S=l.screenReaderStatus,O=l.tabSelectsValue,M=l.isLoading,R=l["aria-label"],_=l["aria-live"],I=f.useMemo(function(){return Fe(Fe({},Zw),d||{})},[d]),k=f.useMemo(function(){var x="";if(n&&I.onChange){var N=n.option,G=n.options,j=n.removedValue,ie=n.removedValues,ee=n.value,Q=function(P){return Array.isArray(P)?null:P},te=j||N||Q(ee),se=te?g(te):"",ue=G||ie||void 0,fe=ue?ue.map(g):[],re=Fe({isDisabled:te&&p(te,a),label:se,labels:fe},n);x=I.onChange(re)}return x},[n,I,p,a,g]),F=f.useMemo(function(){var x="",N=r||i,G=!!(r&&a&&a.includes(r));if(N&&I.onFocus){var j={focused:N,label:g(N),isDisabled:p(N,a),isSelected:G,options:o,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};x=I.onFocus(j)}return x},[r,i,g,p,I,o,a,c]),D=f.useMemo(function(){var x="";if(b&&v.length&&!M&&I.onFilter){var N=S({count:o.length});x=I.onFilter({inputValue:h,resultsMessage:N})}return x},[o,h,b,I,v,S,M]),C=n?.action==="initial-input-focus",E=f.useMemo(function(){var x="";if(I.guidance){var N=i?"value":b?"menu":"input";x=I.guidance({"aria-label":R,context:N,isDisabled:r&&p(r,a),isMulti:m,isSearchable:y,tabSelectsValue:O,isInitialFocus:C})}return x},[R,r,i,m,p,y,b,I,a,O,C]),T=Oe(f.Fragment,null,Oe("span",{id:"aria-selection"},k),Oe("span",{id:"aria-focused"},F),Oe("span",{id:"aria-results"},D),Oe("span",{id:"aria-guidance"},E));return Oe(f.Fragment,null,Oe(dc,{id:u},C&&T),Oe(dc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!C&&T))},Qw=Jw,Ls=[{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źẑżžẓẕƶȥɀⱬꝣ"}],ey=new RegExp("["+Ls.map(function(e){return e.letters}).join("")+"]","g"),Sf={};for(var ps=0;ps<Ls.length;ps++)for(var vs=Ls[ps],bs=0;bs<vs.letters.length;bs++)Sf[vs.letters[bs]]=vs.base;var xf=function(t){return t.replace(ey,function(n){return Sf[n]})},ty=Yw(xf),fc=function(t){return t.replace(/^\s+|\s+$/g,"")},ny=function(t){return"".concat(t.label," ").concat(t.value)},ry=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Fe({ignoreCase:!0,ignoreAccents:!0,stringify:ny,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?fc(r):r,d=l?fc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=ty(c),d=xf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},iy=["innerRef"];function oy(e){var t=e.innerRef,n=lr(e,iy),r=Pb(n,"onExited","in","enter","exit","appear");return Oe("input",ze({ref:t},r,{css:Nc({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 ay=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function sy(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=f.useRef(!1),a=f.useRef(!1),l=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,b){if(u.current!==null){var v=u.current,S=v.scrollTop,O=v.scrollHeight,M=v.clientHeight,R=u.current,_=b>0,I=O-M-S,k=!1;I>b&&s.current&&(r&&r(y),s.current=!1),_&&a.current&&(o&&o(y),a.current=!1),_&&b>I?(n&&!s.current&&n(y),R.scrollTop=O,k=!0,s.current=!0):!_&&-b>S&&(i&&!a.current&&i(y),R.scrollTop=0,k=!0,a.current=!0),k&&ay(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var b=l.current-y.changedTouches[0].clientY;c(y,b)},[c]),m=f.useCallback(function(y){if(y){var b=Tb?{passive:!1}:!1;y.addEventListener("wheel",d,b),y.addEventListener("touchstart",g,b),y.addEventListener("touchmove",h,b)}},[h,g,d]),p=f.useCallback(function(y){y&&(y.removeEventListener("wheel",d,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var y=u.current;return m(y),function(){p(y)}}},[t,m,p]),function(y){u.current=y}}var hc=["boxSizing","height","overflow","paddingRight","position"],gc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function mc(e){e.cancelable&&e.preventDefault()}function pc(e){e.stopPropagation()}function vc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function bc(){return"ontouchstart"in window||navigator.maxTouchPoints}var wc=!!(typeof window<"u"&&window.document&&window.document.createElement),Gi=0,si={capture:!1,passive:!1};function ly(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),s=f.useCallback(function(l){if(wc){var u=document.body,c=u&&u.style;if(r&&hc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Gi<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(gc).forEach(function(m){var p=gc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&bc()&&(u.addEventListener("touchmove",mc,si),l&&(l.addEventListener("touchstart",vc,si),l.addEventListener("touchmove",pc,si))),Gi+=1}},[r]),a=f.useCallback(function(l){if(wc){var u=document.body,c=u&&u.style;Gi=Math.max(Gi-1,0),r&&Gi<1&&hc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&bc()&&(u.removeEventListener("touchmove",mc,si),l&&(l.removeEventListener("touchstart",vc,si),l.removeEventListener("touchmove",pc,si)))}},[r]);return f.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var uy=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},cy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function dy(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=sy({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=ly({isEnabled:n}),d=function(h){u(h),c(h)};return Oe(f.Fragment,null,n&&Oe("div",{onClick:uy,css:cy}),t(d))}var fy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},hy=function(t){var n=t.name,r=t.onFocus;return Oe("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:fy,value:"",onChange:function(){}})},gy=hy;function ml(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 my(){return ml(/^iPhone/i)}function kf(){return ml(/^Mac/i)}function py(){return ml(/^iPad/i)||kf()&&navigator.maxTouchPoints>1}function vy(){return my()||py()}function by(){return kf()||vy()}var wy=function(t){return t.label},yy=function(t){return t.label},Cy=function(t){return t.value},Sy=function(t){return!!t.isDisabled},xy={clearIndicator:aw,container:jb,control:hw,dropdownIndicator:iw,group:vw,groupHeading:ww,indicatorsContainer:Qb,indicatorSeparator:lw,input:xw,loadingIndicator:dw,loadingMessage:Ub,menu:Hb,menuList:Nb,menuPortal:Xb,multiValue:Ew,multiValueLabel:Tw,multiValueRemove:Dw,noOptionsMessage:Wb,option:Aw,placeholder:Vw,singleValue:Bw,valueContainer:Zb},ky={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%)"},My=4,Mf=4,Ry=38,Iy=Mf*2,Ey={baseUnit:Mf,controlHeight:Ry,menuGutter:Iy},ws={borderRadius:My,colors:ky,spacing:Ey},Ty={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:lc(),captureMenuScroll:!lc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ry(),formatGroupLabel:wy,getOptionLabel:yy,getOptionValue:Cy,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Sy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Ib(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function yc(e,t,n,r){var i=Ef(e,t,n),o=Tf(e,t,n),s=If(e,t),a=ma(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function ea(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return yc(e,s,t,a)}).filter(function(s){return Sc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=yc(e,n,t,r);return Sc(e,o)?o:void 0}).filter(Db)}function Rf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,zs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Cc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,zs(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Dy(e,t){return Rf(ea(e,t))}function Sc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!Of(e)||!o)&&Df(e,{label:s,value:a,data:i},r)}function Oy(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function Py(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ys=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},If=function(t,n){return t.getOptionLabel(n)},ma=function(t,n){return t.getOptionValue(n)};function Ef(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Tf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ma(e,t);return n.some(function(i){return ma(e,i)===r})}function Df(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Of=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},_y=1,Pf=function(e){xg(n,e);var t=Rg(n);function n(r){var i;if(Mg(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=by(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(l,h),p=i.isOptionDisabled(l,h);if(m){var y=i.getOptionValue(l);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==y}),"deselect-option",l)}else if(!p)d?i.setValue([].concat(zs(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),g=c.filter(function(m){return i.getOptionValue(m)!==d}),h=Yo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(Yo(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=Yo(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return ys(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return Cc(ea(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return Sb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return If(i.props,l)},i.getOptionValue=function(l){return ma(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=xy[l](u,c);d.boxSizing="border-box";var g=i.props.styles[l];return g?g(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return qw(i.props)},i.buildCategorizedOptions=function(){return ea(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return Rf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Fe({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&xa(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return Of(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,y=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,S=u.openMenuOnFocus,O=i.state,M=O.focusedOption,R=O.focusedValue,_=O.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!y||!v||!M||S&&i.isOptionSelected(M,_))return;i.selectOption(M);break;case"Enter":if(l.keyCode===229)break;if(y){if(!M||i.isComposing)return;i.selectOption(M);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!M)return;i.selectOption(M);break;case"ArrowUp":y?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":y?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!y)return;i.focusOption("pageup");break;case"PageDown":if(!y)return;i.focusOption("pagedown");break;case"Home":if(!y)return;i.focusOption("first");break;case"End":if(!y)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++_y),i.state.selectValue=ac(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=ys(o,s[a])}return i}return kg(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&&sc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(sc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="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(ws):Fe(Fe({},ws),this.props.theme):ws}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:p,isMulti:g,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return Ef(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Tf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return Df(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,y=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,S=a||this.getElementId("input"),O=Fe(Fe(Fe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?f.createElement(m,ze({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},O)):f.createElement(oy,ze({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ha,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,y=h.isMulti,b=h.inputValue,v=h.placeholder,S=this.state,O=S.selectValue,M=S.focusedValue,R=S.isFocused;if(!this.hasValue()||!m)return b?null:f.createElement(d,ze({},g,{key:"placeholder",isDisabled:p,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),v);if(y)return O.map(function(I,k){var F=I===M,D="".concat(i.getOptionLabel(I),"-").concat(i.getOptionValue(I));return f.createElement(s,ze({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(I)},onTouchEnd:function(){return i.removeValue(I)},onMouseDown:function(E){E.preventDefault()}},data:I}),i.formatOptionLabel(I,"value"))});if(b)return null;var _=O[0];return f.createElement(c,ze({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return f.createElement(s,ze({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,v=y.inputValue,S=y.isLoading,O=y.loadingMessage,M=y.minMenuHeight,R=y.maxMenuHeight,_=y.menuIsOpen,I=y.menuPlacement,k=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,C=y.menuShouldScrollIntoView,E=y.noOptionsMessage,T=y.onMenuScrollToTop,x=y.onMenuScrollToBottom;if(!_)return null;var N=function(se,ue){var fe=se.type,re=se.data,H=se.isDisabled,P=se.isSelected,X=se.label,ce=se.value,he=p===re,ke=H?void 0:function(){return i.onOptionHover(re)},Se=H?void 0:function(){return i.selectOption(re)},Qe="".concat(i.getElementId("option"),"-").concat(ue),Ee={id:Qe,onClick:Se,onMouseMove:ke,onMouseOver:ke,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return f.createElement(h,ze({},m,{innerProps:Ee,data:re,isDisabled:H,isSelected:P,key:Qe,label:X,type:fe,value:ce,isFocused:he,innerRef:he?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(se.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(te){if(te.type==="group"){var se=te.data,ue=te.options,fe=te.index,re="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(re,"-heading");return f.createElement(s,ze({},m,{key:re,data:se,options:ue,Heading:a,headingProps:{id:H,data:te.data},label:i.formatGroupLabel(te.data)}),te.options.map(function(P){return N(P,"".concat(fe,"-").concat(P.index))}))}else if(te.type==="option")return N(te,"".concat(te.index))});else if(S){var j=O({inputValue:v});if(j===null)return null;G=f.createElement(d,m,j)}else{var ie=E({inputValue:v});if(ie===null)return null;G=f.createElement(g,m,ie)}var ee={minMenuHeight:M,maxMenuHeight:R,menuPlacement:I,menuPosition:k,menuShouldScrollIntoView:C},Q=f.createElement(zb,ze({},m,ee),function(te){var se=te.ref,ue=te.placerProps,fe=ue.placement,re=ue.maxHeight;return f.createElement(l,ze({},m,ee,{innerRef:se,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:S,placement:fe}),f.createElement(dy,{captureEnabled:b,onTopArrive:T,onBottomArrive:x,lockEnabled:D},function(H){return f.createElement(u,ze({},m,{innerRef:function(X){i.getMenuListRef(X),H(X)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:S,maxHeight:re,focusedOption:p}),G)}))});return F||k==="fixed"?f.createElement(c,ze({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:I,menuPosition:k}),Q):Q}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(gy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(p){return i.getOptionValue(p)}).join(s);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(p,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(p)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Qw,ze({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return f.createElement(a,ze({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),f.createElement(o,ze({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),f.createElement(l,ze({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,ze({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,y=i.inputValue,b=i.isMulti,v=ac(m),S={};if(s&&(m!==s.value||h!==s.options||p!==s.menuIsOpen||y!==s.inputValue)){var O=p?Dy(i,v):[],M=p?Cc(ea(i,v),"".concat(g,"-option")):[],R=a?Oy(o,v):null,_=Py(o,O),I=ys(M,_);S={selectValue:v,focusedOption:_,focusedOptionId:I,focusableOptionsWithIds:M,focusedValue:R,clearFocusValueOnUpdate:!1}}var k=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:Yo(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Fe(Fe(Fe({},S),k),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n}(f.Component);Pf.defaultProps=Ty;var Fy=f.forwardRef(function(e,t){var n=ob(e);return f.createElement(Pf,ze({ref:t},n))}),Ly=Fy;const Ay=e=>{const{Menu:t}=Cf,{children:n,...r}=e;return f.createElement(t,{...r},n)},Hy=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),zy=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Vy=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),$y=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:s}=t.data,[a,l]=f.useState(s),[u,c]=f.useState(r??""),d=Jm(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(Vy,null,f.createElement(Ur,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(Hy,null,f.createElement(Ly,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:m})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:m?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(zy,null,f.createElement(Ay,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(m=>window.requestAnimationFrame(m)),n({...t,data:{...t.data,value:h.value}}))}}))},Ny={kind:J.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+Qn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:$y,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 By(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const Wy={marginRight:8},Uy={display:"flex",alignItems:"center",flexGrow:1},qy={kind:J.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,g=s-o,h=(a-o)/g,m=`${By(r.baseFontStyle,.9)} ${r.fontFamily}`,y=Xs(n,m)/2;n.save();let b=0;l!==void 0&&(n.font=m,b=Gr(u??l,n,m).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=y){const S=n.createLinearGradient(c,d,c+v,d);S.addColorStop(0,r.accentColor),S.addColorStop(h,r.accentColor),S.addColorStop(h,r.bgBubble),S.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=S,tc(n,c,d-y/2,v,y,y/2),n.fill(),n.beginPath(),tc(n,c+.5,d-y/2+.5,v-1,y-1,(y-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,d+Qn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return f.createElement("label",{style:Uy},f.createElement("input",{style:Wy,type:"range",value:r,min:i,max:o,step:s,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Gy=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Cs=(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}`)}},Xy=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?Cs(n,t.min,o):t.min,a=t.max instanceof Date?Cs(n,t.max,o):t.max,l=Cs(n,t.date,o);return e.value.readonly?Vt.createElement(Ur,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Vt.createElement(Gy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},Yy={kind:J.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Gs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Xy}),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)}}},jy="None";function xc(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 Ky=e=>{const{cell:t,theme:n,ctx:r}=e;Gs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},jy,t.contentAlign),r.fillStyle=n.textDark};function Zy(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(mi(o))xc(a,l,s);else if(Ca(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Ky(r),c.isRequired&&c.isEditable&&xc(a,l,s);return}i()},[e]),n=f.useMemo(()=>[rb,Ny,qy,Yy,...O1],[]);return{drawCell:t,customRenderers:n}}function Jy(){const e=Br();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:li(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:li(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:li(e.colors.darkenedBgMix100,.9),bgHeaderHovered:li(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(ln("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:li(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(ln(e.spacing.sm)),cellVerticalPadding:Math.round(ln("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(ln("1.25rem")),bubblePadding:Math.round(ln(e.spacing.sm)),bubbleMargin:Math.round(ln(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(ln(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(ln("25rem")),minColumnWidth:Math.round(ln("3.125rem")),maxColumnWidth:Math.round(ln("62.5rem")),maxColumnAutoWidth:Math.round(ln("31.25rem")),defaultRowHeight:Math.round(ln("2.1875rem")),defaultHeaderHeight:Math.round(ln("2.1875rem")),bgRowHovered:og(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Qy=wa.getLogger("useDataEditor");function eC(e,t,n,r,i,o,s,a,l){const u=f.useCallback(([p,y],b)=>{const v=e[p];if(!v.isEditable)return;const S=v.indexNumber,O=n.current.getOriginalRowIndex(i(y)),M=r([p,y]),R=v.getCellValue(M),_=v.getCellValue(b);if(!mi(M)&&_===R)return;const I=v.getCell(_,!0);mi(I)?Qy.warn(`Not applying the cell edit since it causes this error:
|
195
195
|
${I.data}`):(n.current.setCell(S,O,{...I,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const p=new Map;e.forEach(y=>{p.set(y.indexNumber,y.getCell(y.defaultValue))}),n.current.addRow(p),s()},[e,n,t,s]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(p=>{if(p.rows.length>0){if(t)return!0;const y=p.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(y),s(),l(),a(),!1}if(p.current?.range){const y=[],b=p.current.range;for(let v=b.y;v<b.y+b.height;v++)for(let S=b.x;S<b.x+b.width;S++){const O=e[S];O.isEditable&&!O.isRequired&&(y.push({cell:[S,v]}),u([S,v],O.getCell(null)))}return y.length>0&&(a(),o(y)),!1}return!0},[e,n,t,o,i,a,u,l,s]),h=f.useCallback((p,y)=>{const[b,v]=p,S=[];for(let O=0;O<y.length;O++){const M=y[O];if(O+v>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<M.length;R++){const _=M[R],I=O+v,k=R+b;if(k>=e.length)break;const F=e[k];if(F.isEditable){const D=F.getCell(_,!0);if(lt(D)&&!mi(D)){const C=F.indexNumber,E=n.current.getOriginalRowIndex(i(I)),T=F.getCellValue(r([k,I]));F.getCellValue(D)!==T&&(n.current.setCell(C,E,{...D,lastUpdated:performance.now()}),S.push({cell:[k,I]}))}}}S.length>0&&(a(),o(S))}return!1},[e,n,t,i,r,c,a,o]),m=f.useCallback((p,y)=>{const b=p[0];if(b>=e.length)return!0;const v=e[b];if(v.validateInput){const S=v.validateInput(v.getCellValue(y));return S===!0||S===!1?S:v.getCell(S)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:m}}const _f=",",ji='"',tC='"',Ff=`
|
196
|
-
`,nC="\uFEFF",rC=new RegExp(`[${[_f,ji,Ff].join("")}]`),kc=wa.getLogger("useDataExporter");function Mc(e){return e.map(t=>iC(t)).join(_f)+Ff}function iC(e){if(Le(e))return"";const t=gt(e);return rC.test(t)?`${ji}${t.replace(new RegExp(ji,"g"),tC+ji)}${ji}`:t}async function Rc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(nC));const o=n.map(s=>s.name);await e.write(i.encode(Mc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(Mc(a)))}await e.close()}function oC(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Hs(()=>import("./es6.
|
196
|
+
`,nC="\uFEFF",rC=new RegExp(`[${[_f,ji,Ff].join("")}]`),kc=wa.getLogger("useDataExporter");function Mc(e){return e.map(t=>iC(t)).join(_f)+Ff}function iC(e){if(Le(e))return"";const t=gt(e);return rC.test(t)?`${ji}${t.replace(new RegExp(ji,"g"),tC+ji)}${ji}`:t}async function Rc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(nC));const o=n.map(s=>s.name);await e.write(i.encode(Mc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(Mc(a)))}await e.close()}function oC(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Hs(()=>import("./es6.D7Hpvg-Y.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Rc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{kc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Rc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Cg({enforceDownloadInNewTab:r,url:d,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(l){kc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function aC(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Dt("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Dt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(lt(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Dt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const d=e.getCell(u,l),g=ag(e,u,l);return N1(a,d,g,e.styler?.cssStyles)}catch(a){return Dt("Error during cell creation",`This error should never happen. Please report this bug.
|
197
197
|
Error: ${a}`)}},[t,n,e,r])}}function sC(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function lC(e,t,n,r,i){const[o,s]=f.useState({columns:it.empty(),rows:it.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(wn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(wn.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(wn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(wn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(wn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(wn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=f.useCallback(y=>{const b=!Xa(y.rows.toArray(),o.rows.toArray()),v=!Xa(y.columns.toArray(),o.columns.toArray()),S=!Xa(y.current,o.current);let O=a&&b||u&&v,M=y;if((a||u)&&y.current!==void 0&&S&&(M={...y,rows:o.rows,columns:o.columns},O=!1),b&&y.rows.length>0&&v&&y.columns.length===0&&(M={...M,columns:o.columns},O=!0),v&&y.columns.length>0&&b&&y.rows.length===0&&(M={...M,rows:o.rows},O=!0),v&&M.columns.length>=0){let R=M.columns;r.forEach((_,I)=>{_.isIndex&&(R=R.remove(I))}),R.length<M.columns.length&&(M={...M,columns:R})}s(M),O&&i(M)},[o,a,u,i,r]),p=f.useCallback((y=!1,b=!1)=>{const v={columns:b?o.columns:it.empty(),rows:y?o.rows:it.empty(),current:void 0};s(v),(!y&&a||!b&&u)&&i(v)},[o,a,u,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function uC(e,t,n,r,i,o,s){const a=e.rowHeight??t.defaultRowHeight,l=t.defaultHeaderHeight+a+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===wn.EditingMode.DYNAMIC?1:0,d=n+c;let g=Math.max(d*a+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,l),g=Math.max(e.height,g)),o&&(h=Math.min(h,o),g=Math.min(g,o),e.height||(h=g));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let y,b=p;e.useContainerWidth?y=p:e.width&&(y=Math.min(Math.max(e.width,m),p),b=Math.min(Math.max(e.width,b),p));const[v,S]=f.useState({width:y||"100%",height:h});return f.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&S(O=>({...O,width:p}))},[p]),f.useLayoutEffect(()=>{S(O=>({...O,width:y||"100%"}))},[y]),f.useLayoutEffect(()=>{S(O=>({...O,height:h}))},[h,n]),f.useLayoutEffect(()=>{if(s){const O=e.useContainerWidth||lt(e.width)&&e.width>0;S({width:O?b:"100%",height:g})}else S({width:y||"100%",height:h})},[s]),{minHeight:l,maxHeight:g,minWidth:m,maxWidth:b,rowHeight:a,resizableSize:v,setResizableSize:S}}const cC=600,dC="⚠️ Please fill out this cell.";function fC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),s=f.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&<(g))d=g.help;else if(l.kind==="cell"){const h=t([u,c]);mi(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&Ca(h)?d=dC:b1(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},cC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}function hC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=Br(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return qe(ba,{content:qe(sg,{"data-testid":"stDataFrameTooltipContent",children:qe(lg,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:pa.top,accessibilityType:Fc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:va(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:qe("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const gC=f.memo(hC),Ic=Un("div",{target:"e1u61huh0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Ec=150,mC=15e4,jo=6;function pC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:s,expand:a,collapse:l,width:u,height:c}=ug(gg),d=f.useRef(null),g=f.useRef(null),h=f.useRef(null),m=Jy(),{getRowThemeOverride:p,onItemHovered:y}=sC(m),{libConfig:{enforceDownloadInNewTab:b=!1}}=f.useContext(cg),[v,S]=f.useState(!0),[O,M]=f.useState(!1),[R,_]=f.useState(!1),[I,k]=f.useState(!1),[F,D]=f.useState(),[C,E]=f.useState(!1),T=f.useCallback(()=>E(ge=>!ge),[]),x=f.useCallback(()=>E(!1),[]),N=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),G=f.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Le(e.editingMode)&&(e.editingMode=wn.EditingMode.READ_ONLY);const{READ_ONLY:j,DYNAMIC:ie}=wn.EditingMode,ee=t.dimensions,Q=Math.max(0,ee.numDataRows),te=Q===0&&!(e.editingMode===ie&&ee.numDataColumns>0),se=Q>mC,ue=!se&&!te&&e.editingMode!==ie,fe=!te&&e.editingMode===ie&&!n,re=f.useRef(new Uo(Q)),[H,P]=f.useState(re.current.getNumRows());f.useEffect(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]);const X=f.useCallback(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]),[ce,he]=f.useState(e.columnOrder);f.useEffect(()=>{he(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ke,allColumns:Se,setColumnConfigMapping:Qe}=U1(e,t,n,ce);f.useEffect(()=>{if(e.editingMode===j)return;const ge=r.getStringValue({id:e.id,formId:e.formId});ge&&(re.current.fromJson(ge,ke),P(re.current.getNumRows()))},[]);const{getCellContent:Ee}=aC(t,ke,H,re),{columns:et,sortColumn:kt,getOriginalIndex:Ne,getCellContent:ne}=eb(Q,ke,Ee),me=f.useCallback(ge=>{const bt={selection:{rows:[],columns:[]}};bt.selection.rows=ge.rows.toArray().map(Nt=>Ne(Nt)),bt.selection.columns=ge.columns.toArray().map(Nt=>eo(et[Nt]));const Qt=JSON.stringify(bt),It=r.getStringValue({id:e.id,formId:e.formId});(It===void 0||It!==Qt)&&r.setStringValue({id:e.id,formId:e.formId},Qt,{fromUi:!0},o)},[et,e.id,e.formId,r,o,Ne]),{debouncedCallback:xe}=$u(me,Ec),{gridSelection:de,isRowSelectionActivated:be,isMultiRowSelectionActivated:Pe,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:st,isRowSelected:Re,isColumnSelected:Ge,isCellSelected:He,clearSelection:we,processSelectionChange:Be}=lC(e,te,n,et,xe);f.useEffect(()=>{we(!0,!0)},[s]);const mt=f.useCallback(ge=>{g.current?.updateCells(ge)},[]);f.useEffect(()=>{if(!be&&!Te)return;const ge=r.getStringValue({id:e.id,formId:e.formId});if(ge){const bt=et.map(on=>eo(on)),Qt=JSON.parse(ge);let It=it.empty(),Nt=it.empty();Qt.selection?.rows?.forEach(on=>{It=It.add(on)}),Qt.selection?.columns?.forEach(on=>{Nt=Nt.add(bt.indexOf(on))}),(It.length>0||Nt.length>0)&&Be({rows:It,columns:Nt,current:void 0})}},[]);const ft=f.useCallback(()=>{H!==re.current.getNumRows()&&P(re.current.getNumRows())},[H]),Xe=f.useCallback(()=>{const ge=re.current.toJson(et);let bt=r.getStringValue({id:e.id,formId:e.formId});bt===void 0&&(bt=new Uo(0).toJson([])),ge!==bt&&r.setStringValue({id:e.id,formId:e.formId},ge,{fromUi:!0},o)},[et,e.id,e.formId,r,o]),{debouncedCallback:yt}=$u(Xe,Ec),{exportToCsv:Xt}=oC(ne,et,H,b),{onCellEdited:Ht,onPaste:Mt,onRowAppended:nn,onDelete:qt,validateCell:cn}=eC(et,e.editingMode!==ie,re,ne,Ne,mt,ft,yt,we),Ot=f.useMemo(()=>te?[0]:fe?[H]:[],[te,fe,H]),{tooltip:ut,clearTooltip:tn,onItemHovered:Ct}=fC(et,ne,Ot),{drawCell:rn,customRenderers:Bt}=Zy(et),{provideEditor:De}=nb(),Et=f.useCallback(ge=>({...ge,hasMenu:!te}),[te]),Pt=f.useMemo(()=>et.map(ge=>Et(Ps(ge))),[et,Et]),{columns:yn,onColumnResize:Yt}=Y1(Pt),dn=t.dimensions.numHeaderRows>1,{minHeight:Rn,maxHeight:jt,minWidth:Jt,maxWidth:We,rowHeight:Rt,resizableSize:Cn,setResizableSize:vt}=uC(e,m,H,dn,u||0,c,s),Ft=f.useCallback(([ge,bt])=>({...w1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(et.length-1,0)]}),[et,m.glideTheme.textLight]),Sn=f.useCallback(()=>{X(),we()},[X,we]);fg({element:e,widgetMgr:r,onFormCleared:Sn});const{pinColumn:qn,unpinColumn:zn,freezeColumns:$}=G1(et,te,u||0,m.minColumnWidth,we,Qe),{changeColumnFormat:$e}=q1(Qe),{hideColumn:Ue,showColumn:St}=tb(we,Qe),{onColumnMoved:mn}=X1(et,$,qn,zn,he);return f.useEffect(()=>{setTimeout(()=>{if(h.current&&g.current){const ge=h.current?.querySelector(".dvn-stack")?.getBoundingClientRect();ge&&(_(ge.height>h.current.clientHeight),k(ge.width>h.current.clientWidth))}},1)},[Cn,H,yn]),f.useEffect(()=>{Se.length==et.length&&E(!1)},[Se.length,et.length]),vn(Ic,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:G,ref:h,onMouseDown:ge=>{if(h.current&&G){const bt=h.current.getBoundingClientRect();I&&bt.height-(jo+1)<ge.clientY-bt.top&&ge.stopPropagation(),R&&bt.width-(jo+1)<ge.clientX-bt.left&&ge.stopPropagation()}},onBlur:ge=>{!v&&!N&&!ge.currentTarget.contains(ge.relatedTarget)&&we(!0,!0)},children:[vn(mg,{isFullScreen:s,disableFullscreenMode:i,locked:Re&&!be||He||N&&v||C,onExpand:a,onCollapse:l,target:Ic,children:[(be&&Re||Te&&Ge)&&qe(ai,{label:"Clear selection",icon:Sg,onClick:()=>{we(),tn()}}),fe&&Re&&qe(ai,{label:"Delete row(s)",icon:Ig,onClick:()=>{qt&&(qt(de),tn())}}),fe&&!Re&&qe(ai,{label:"Add row",icon:Bc,onClick:()=>{nn&&(S(!0),nn(),tn(),g.current?.scrollTo(0,H,"vertical"))}}),!te&&Se.length>et.length&&qe(d1,{columns:Se,columnOrder:ce,setColumnOrder:he,hideColumn:Ue,showColumn:St,isOpen:C,onClose:x,children:qe(ai,{label:"Show/hide columns",icon:Uc,onClick:T})}),!se&&!te&&qe(ai,{label:"Download as CSV",icon:Eg,onClick:Xt}),!te&&qe(ai,{label:"Search",icon:Wc,onClick:()=>{O?M(!1):(S(!0),M(!0)),tn()}})]}),qe(dg,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Cn,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Rn,maxHeight:jt,minWidth:Jt,maxWidth:We,size:Cn,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Rt],snapGap:Rt/3,onResizeStop:(ge,bt,Qt,It)=>{if(d.current){const Nt=2*m.tableBorderWidth;vt({width:d.current.size.width,height:jt-d.current.size.height===Nt?d.current.size.height+Nt:d.current.size.height})}},children:qe(Kv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:yn,rows:te?1:H,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Rt,headerHeight:m.defaultHeaderHeight,getCellContent:te?Ft:ne,onColumnResize:N?void 0:Yt,resizeIndicator:"header",freezeColumns:$,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:N?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Te?void 0:mn,onItemHovered:ge=>{y?.(ge),Ct?.(ge)},keybindings:{downFill:!0},onKeyDown:ge=>{(ge.ctrlKey||ge.metaKey)&&ge.key==="f"&&(M(bt=>!bt),ge.stopPropagation(),ge.preventDefault())},showSearch:O,searchResults:O?void 0:[],onSearchClose:()=>{M(!1),tn()},onHeaderClicked:(ge,bt)=>{!ue||Te||(O&&M(!1),be&&Re?we():we(!0,!0),kt(ge,"auto"))},gridSelection:de,onGridSelectionChange:ge=>{(v||N)&&(Be(ge),ut!==void 0&&tn())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:ge=>{ge.kind==="out-of-bounds"&&v?S(!1):ge.kind!=="out-of-bounds"&&!v&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...G&&{paddingBottom:I?-jo:void 0,paddingRight:R?-jo:void 0}},provideEditor:De,drawCell:rn,customRenderers:Bt,imageEditorOverride:D1,headerIcons:m.headerIcons,validateCell:cn,onHeaderMenuClick:(ge,bt)=>{D({columnIdx:ge,headerBounds:bt})},onPaste:!1,...be&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader,textMedium:m.glideTheme.textLight}},rowSelectionMode:Pe?"multi":"auto",rowSelect:n?"none":Pe?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":st?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!te&&e.editingMode!==j&&!n&&{fillHandle:!N,onCellEdited:Ht,onPaste:Mt,onDelete:qt},...!te&&e.editingMode===ie&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:nn,onHeaderClicked:void 0}})}),ut&&ut.content&&qe(gC,{top:ut.top,left:ut.left,content:ut.content,clearTooltip:tn}),F&&$c.createPortal(qe(s1,{top:F.headerBounds.y+F.headerBounds.height,left:F.headerBounds.x+F.headerBounds.width,column:ke[F.columnIdx],onCloseMenu:()=>D(void 0),onSortColumn:ue?ge=>{O&&M(!1),we(!(be&&Re),!0),kt(F.columnIdx,ge,!0)}:void 0,isColumnPinned:ke[F.columnIdx].isPinned,onUnpinColumn:()=>{zn(ke[F.columnIdx].id)},onPinColumn:()=>{qn(ke[F.columnIdx].id)},onHideColumn:()=>{Ue(ke[F.columnIdx].id)},onChangeFormat:ge=>{$e(ke[F.columnIdx].id,ge),setTimeout(()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))},100)},onAutosize:()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))}}),document.querySelector("#portal"))]})}const vC=hg(pC),bC=f.memo(vC),OC=Object.freeze(Object.defineProperty({__proto__:null,default:bC},Symbol.toStringTag,{value:"Module"}));export{D0 as C,Sd as T,fi as a,Fg as b,OC as c,ui as i,Zm as m,un as s};
|