streamlit-nightly 1.45.2.dev20250526__py3-none-any.whl → 1.45.2.dev20250527__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/commands/echo.py +1 -1
- streamlit/config.py +1 -2
- streamlit/config_option.py +1 -1
- streamlit/config_util.py +5 -4
- streamlit/elements/exception.py +12 -4
- streamlit/elements/graphviz_chart.py +1 -1
- streamlit/elements/heading.py +4 -3
- streamlit/elements/lib/image_utils.py +3 -2
- streamlit/elements/markdown.py +1 -1
- streamlit/elements/media.py +1 -1
- streamlit/elements/progress.py +3 -3
- streamlit/elements/widgets/button.py +1 -1
- streamlit/elements/widgets/color_picker.py +14 -8
- streamlit/elements/widgets/radio.py +1 -1
- streamlit/elements/widgets/selectbox.py +1 -1
- streamlit/elements/widgets/slider.py +18 -10
- streamlit/elements/widgets/text_widgets.py +2 -1
- streamlit/hello/animation_demo.py +1 -1
- streamlit/hello/mapping_demo.py +4 -3
- streamlit/logger.py +1 -1
- streamlit/runtime/caching/hashing.py +9 -8
- streamlit/runtime/credentials.py +21 -8
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.CtshIbC5.js → ErrorOutline.esm.qteVcUUN.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.A0XrMp_A.js → FileDownload.esm.ncu7N-Hr.js} +1 -1
- streamlit/static/static/js/{FileHelper.BkYmOfR4.js → FileHelper.zsMZ7RXt.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.DvUrjO5s.js → FormClearHelper.W8yVYXZp.js} +1 -1
- streamlit/static/static/js/{Hooks.Dw0PPeMp.js → Hooks.DBj6srQ1.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BwkpOG-3.js → InputInstructions.BobLsJJb.js} +1 -1
- streamlit/static/static/js/{ProgressBar.Po8toa5U.js → ProgressBar.CtvJrIzN.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DG7izwhP.js → RenderInPortalIfExists.DnT_UdzV.js} +1 -1
- streamlit/static/static/js/{Toolbar.zoRxypF9.js → Toolbar.BVF7NtOB.js} +1 -1
- streamlit/static/static/js/{base-input.3hmq5vR4.js → base-input.B4sdS3vw.js} +1 -1
- streamlit/static/static/js/{checkbox.DHVebTBP.js → checkbox.DKDitzF8.js} +1 -1
- streamlit/static/static/js/{createSuper.CCzF882j.js → createSuper.mhx956J9.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CRIS0V5u.js → data-grid-overlay-editor.CmXS0PAX.js} +1 -1
- streamlit/static/static/js/{downloader.DOuJ7F43.js → downloader.Cnd9SuxG.js} +1 -1
- streamlit/static/static/js/{es6.BojNhy97.js → es6.DM-pf09u.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CmN7IDO7.js → iframeResizer.contentWindow.Gc5GAjZM.js} +1 -1
- streamlit/static/static/js/{index.HdiDLe37.js → index.AWkO-7e-.js} +1 -1
- streamlit/static/static/js/{index.DNlMgaSP.js → index.B0E6Rv1F.js} +1 -1
- streamlit/static/static/js/{index.DcLQo3NB.js → index.B29JQLHa.js} +5 -5
- streamlit/static/static/js/{index.CdgLDqMc.js → index.B45ExNhw.js} +1 -1
- streamlit/static/static/js/{index.Ih0EXMso.js → index.B6xTo8b8.js} +1 -1
- streamlit/static/static/js/{index.DkNaEiLi.js → index.BJQNG4O1.js} +1 -1
- streamlit/static/static/js/{index.YtwVjbe-.js → index.BNNR5Jmd.js} +1 -1
- streamlit/static/static/js/{index.DtpZrdsz.js → index.BONHiJUZ.js} +1 -1
- streamlit/static/static/js/{index.CZ6f-p0K.js → index.BR-S54Iv.js} +1 -1
- streamlit/static/static/js/{index.B0GUCtHl.js → index.BV38yp5k.js} +1 -1
- streamlit/static/static/js/{index.BV-8GugV.js → index.BWTBe3a1.js} +1 -1
- streamlit/static/static/js/{index.BMWx_YQD.js → index.BfusYuD8.js} +1 -1
- streamlit/static/static/js/{index.CWweAMBx.js → index.BkLkRTpZ.js} +1 -1
- streamlit/static/static/js/{index.p5qVS5RU.js → index.C5KKmyWy.js} +1 -1
- streamlit/static/static/js/{index.CzMgwzgb.js → index.CJ-XXd1r.js} +1 -1
- streamlit/static/static/js/{index.BgmEuudT.js → index.COBionvf.js} +1 -1
- streamlit/static/static/js/{index.BfcdLS9y.js → index.CWgnk1N4.js} +1 -1
- streamlit/static/static/js/{index.whcmqOYZ.js → index.CZ5fZcT5.js} +1 -1
- streamlit/static/static/js/{index.CTVSiPCo.js → index.C_2m4F7k.js} +1 -1
- streamlit/static/static/js/{index.DP7RHJHC.js → index.CgOynO1t.js} +1 -1
- streamlit/static/static/js/{index.BEfxU01i.js → index.CjBaoWYr.js} +1 -1
- streamlit/static/static/js/{index.muQ-sA7D.js → index.CkKptP1T.js} +1 -1
- streamlit/static/static/js/{index.VVmp3qV7.js → index.D4XRYl23.js} +1 -1
- streamlit/static/static/js/{index.Cpz3pp0B.js → index.DAvhwYMG.js} +1 -1
- streamlit/static/static/js/{index.B6guKn0h.js → index.DIyx-z1Q.js} +1 -1
- streamlit/static/static/js/{index.DH2YAEv6.js → index.DOYomqqU.js} +1 -1
- streamlit/static/static/js/{index.CPiByGGr.js → index.DOl-SOKu.js} +1 -1
- streamlit/static/static/js/{index.BsiojTxz.js → index.DQGSbu2C.js} +1 -1
- streamlit/static/static/js/{index.CVxkW_lc.js → index.DTU7qmDP.js} +1 -1
- streamlit/static/static/js/{index.B3Y99Usz.js → index.DdyZtGcg.js} +1 -1
- streamlit/static/static/js/{index.YePOPnW6.js → index.DwUISpCs.js} +5 -5
- streamlit/static/static/js/{index.BvWDoWjf.js → index.I3iNnzJx.js} +1 -1
- streamlit/static/static/js/{index.3HscCA0Q.js → index.WWYmGCrM.js} +1 -1
- streamlit/static/static/js/{index.kWUcv9pK.js → index._BaeK1t7.js} +1 -1
- streamlit/static/static/js/{index.BXfm7UZe.js → index.gBOr8z2K.js} +1 -1
- streamlit/static/static/js/{index.CLFnBokZ.js → index.p2Wl4zMi.js} +1 -1
- streamlit/static/static/js/{index.R5J-UXhx.js → index.vOqxh1m2.js} +1 -1
- streamlit/static/static/js/{input.C95vVzrH.js → input.BvD9DHLa.js} +1 -1
- streamlit/static/static/js/{memory.lfILky3m.js → memory.DCVB1HOm.js} +1 -1
- streamlit/static/static/js/{mergeWith.CdpKbzWl.js → mergeWith.BqTORFAq.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.D2TjUrKf.js → number-overlay-editor.VB_OvuPv.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DQV58bYB.js → possibleConstructorReturn.DhYxBDlj.js} +1 -1
- streamlit/static/static/js/{sandbox.R1dhBCnm.js → sandbox.CoN7LRFk.js} +1 -1
- streamlit/static/static/js/{textarea.t5D4QCw3.js → textarea.DkHpIjdT.js} +1 -1
- streamlit/static/static/js/{timepicker.BI9iPIxz.js → timepicker.C8UIzYhf.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.COyXrPhy.js → toConsumableArray.DXfr1fvT.js} +1 -1
- streamlit/static/static/js/{uniqueId.CaWObuU_.js → uniqueId.CgrMSBTb.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Wd2TSACf.js → useBasicWidgetState.C-e-WEFS.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CUFXty-S.js → useOnInputChange.CtRJhZD6.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.wgkD5MeK.js → withFullScreenWrapper.od0SAvAK.js} +1 -1
- streamlit/watcher/path_watcher.py +3 -2
- streamlit/web/bootstrap.py +1 -1
- streamlit/web/server/server.py +1 -1
- {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/METADATA +2 -2
- {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/RECORD +98 -98
- {streamlit_nightly-1.45.2.dev20250526.data → streamlit_nightly-1.45.2.dev20250527.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.45.2.dev20250526.dist-info → streamlit_nightly-1.45.2.dev20250527.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
|
-
var dh=Object.defineProperty;var fh=(e,t,n)=>t in e?dh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>fh(e,typeof t!="symbol"?t+"":t,n);import{r as d,E as Ls,_ as Ke,c as hh,g as wr,R as At,i as Ya,d as ho,e as gh,f as mh,h as ph,m as Tc,o as Dc,p as vh,q as Oc,s as bh,t as wh,u as yh,v as Ch,w as Sh,x as xh,a as lr,y as Fs,n as Ci,z as Gr,j as lt,F as Pc,A as Ca,T as _c,B as Sa,C as Ln,D as gr,G as xa,H as Wn,I as Lc,J as Jo,K as kh,L as Mh,M as Ne,N as Fc,O as pt,Q as Ki,S as qr,U as Xa,V as Rh,W as Eh,X as Ih,Y as Ol,Z as Th,$ as Ac,a0 as Dh,a1 as Oh,a2 as Ss,a3 as Hc,a4 as zc,a5 as Ph,a6 as _h,a7 as Lh,a8 as Fh,a9 as Ah,aa as Hh,ab as zh,ac as Vh,ad as $h,ae as Nh,af as Vc,ag as Bh,ah as Wh,ai as Uh,aj as qh,ak as Yh,al as Xh,am as jh,an as Gh,ao as Kh,ap as Zh,aq as Jh,ar as Qh,as as Mn,l as As,at as Zi,au as yr,av as $e,aw as eg,b as $c,ax as Nc,k as tg,ay as ng,az as rg,aA as ja,aB as ig,aC as og,aD as ag,aE as sg,aF as lg}from"./index.YePOPnW6.js";import{u as ug}from"./FormClearHelper.DvUrjO5s.js";import{w as cg,E as dg}from"./withFullScreenWrapper.wgkD5MeK.js";import{T as fg,a as di}from"./Toolbar.zoRxypF9.js";import{L as hg,S as gg,a as mg}from"./checkbox.DHVebTBP.js";import{m as pg}from"./mergeWith.CdpKbzWl.js";import{s as vg}from"./sprintf.D7DtBTRn.js";import{c as bg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as pr,a as Hs,C as wg}from"./toConsumableArray.COyXrPhy.js";import{_ as yg,a as Cg,b as Sg}from"./possibleConstructorReturn.DQV58bYB.js";import{_ as xg}from"./createSuper.CCzF882j.js";import{D as kg,F as Mg}from"./FileDownload.esm.A0XrMp_A.js";var Bc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";function qc(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return qc(t)}function oo(e,t){return qc(t??"Hell froze over")}function Rg(e,t){try{return e()}catch{return t}}const Pl=Object.prototype.hasOwnProperty;function wi(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--&&wi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Pl.call(e,n)&&++r&&!Pl.call(t,n)||!(n in t)||!wi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ga,_l;function Eg(){if(_l)return Ga;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ga=n,Ga}var Ka,Ll;function Ig(){if(Ll)return Ka;Ll=1;var e=Eg(),t=hh();function n(r,i){return r!=null&&t(r,i,e)}return Ka=n,Ka}var Tg=Ig();const Dg=wr(Tg),ia=null,zs=void 0;var te;(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"})(te||(te={}));var Fl;(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"})(Fl||(Fl={}));var oa;(function(e){e.Triangle="triangle",e.Dots="dots"})(oa||(oa={}));function Ao(e){return"width"in e&&typeof e.width=="number"}async function Al(e){return typeof e=="object"?e:await e()}function hi(e){return!(e.kind===te.Loading||e.kind===te.Bubble||e.kind===te.RowID||e.kind===te.Protected||e.kind===te.Drilldown)}function mi(e){return e.kind===Yn.Marker||e.kind===Yn.NewRow}function Ji(e){if(!hi(e)||e.kind===te.Image)return!1;if(e.kind===te.Text||e.kind===te.Number||e.kind===te.Markdown||e.kind===te.Uri||e.kind===te.Custom||e.kind===te.Boolean)return e.readonly!==!0;oo(e,"A cell was passed with an invalid kind")}function Og(e){return Dg(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Yn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Yn||(Yn={}));function Pg(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 Hl;const mr=class mr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new mr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Pg([...this.items,n]);return new mr(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,a]of n.entries()){const[l,s]=a;if(l<=i&&r<=s){const u=[];l<r&&u.push([l,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new mr(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}};dt(mr,"empty",()=>Hl??(Hl=new mr([]))),dt(mr,"fromSingleSelection",t=>mr.empty().add(t));let mt=mr;var _g=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(l=>{if(l.startsWith("atm_")){const[,s]=l.split("_");n[s]=l}else r.push(l)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},zl=_g,Lg=e=>e.toUpperCase()===e,Fg=e=>t=>e.indexOf(t)===-1,Yc=(e,t)=>{const n={};return Object.keys(e).filter(Fg(t)).forEach(r=>{n[r]=e[r]}),n};function Ag(e,t,n){const r=Yc(t,n);if(!e){const i=typeof Ya=="function"?{default:Ya}:Ya;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Hg=(e,t)=>{};function zg(e){let t="";return n=>{const r=(o,a)=>{const{as:l=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!Lg(l[0])):n.propsAsIs,c=Ag(u,o,["as","class"]);c.ref=a,c.className=n.atomic?zl(n.class,c.className||s):zl(c.className||s,n.class);const{vars:f}=n;if(f){const g={};for(const p in f){const v=f[p],w=v[0],b=v[1]||"",M=typeof w=="function"?w(o):w;Hg(M,n.name),g[`--${p}`]=`${M}${b}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__linaria&&e!==l?(c.as=l,At.createElement(e,c)):At.createElement(l,c)},i=At.forwardRef?At.forwardRef(r):o=>{const a=Yc(o,["innerRef"]);return r(a,o.innerRef)};return i.displayName=n.name,i.__linaria={className:n.class||t,extends:e},i}}var mn=zg;const Vg=mn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Za={},Hi={},Ho={},zo={},Vl;function $g(){return Vl||(Vl=1,function(e){(function(t,n){n(e,ho(),gh())})(zo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=a(n),o=a(r);function a(b){return b&&b.__esModule?b:{default:b}}var l=Object.assign||function(b){for(var M=1;M<arguments.length;M++){var O=arguments[M];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(b[S]=O[S])}return b};function s(b,M){var O={};for(var S in b)M.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(b,S)&&(O[S]=b[S]);return O}function u(b,M){if(!(b instanceof M))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(M,O){for(var S=0;S<O.length;S++){var R=O[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(M,R.key,R)}}return function(M,O,S){return O&&b(M.prototype,O),S&&b(M,S),M}}();function f(b,M){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:b}function g(b,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);b.prototype=Object.create(M&&M.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(b,M):b.__proto__=M)}var h=!1;function m(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function v(b){if("touches"in b){var M=b.touches[0],O=M.pageX,S=M.pageY;return{x:O,y:S}}var R=b.screenX,_=b.screenY;return{x:R,y:_}}var w=function(b){g(M,b);function M(){var O;u(this,M);for(var S=arguments.length,R=Array(S),_=0;_<S;_++)R[_]=arguments[_];var E=f(this,(O=M.__proto__||Object.getPrototypeOf(M)).call.apply(O,[this].concat(R)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(M,[{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(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var R=v(S),_=R.x,E=R.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var R=v(S),_=R.x,E=R.y,x=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:x,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,S):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var R=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var x=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},x),E)}}]),M}(n.Component);w.displayName="ReactSwipe",w.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},w.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=w})}(zo)),zo}var $l;function Xc(){return $l||($l=1,function(e){(function(t,n){n(e,$g())})(Ho,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Ho)),Ho}var zi={},Nl;function jc(){if(Nl)return zi;Nl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=t(mh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,a){return o in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,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,a){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":a==="horizontal","axis-vertical":a!=="horizontal"})},SLIDER:function(o,a){return(0,e.default)({thumbs:!o,slider:o,animated:!a})},ITEM:function(o,a,l){return(0,e.default)({thumb:!o,slide:o,selected:a,previous:l})},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 zi.default=r,zi}var Vi={},$i={},Bl;function Ng(){if(Bl)return $i;Bl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return $i.outerWidth=e,$i}var Ni={},Wl;function $s(){if(Wl)return Ni;Wl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,a=i==="horizontal"?[o,0,0]:[0,o,0],l="translate3d",s="("+a.join(",")+")";return l+s};return Ni.default=e,Ni}var Bi={},Ul;function Gc(){if(Ul)return Bi;Ul=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=function(){return window};return Bi.default=e,Bi}var ql;function Kc(){if(ql)return Vi;ql=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=s(ho()),t=a(jc()),n=Ng(),r=a($s()),i=a(Xc()),o=a(Gc());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var x=l();if(x&&x.has(E))return x.get(E);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(L,C,I):L[C]=E[C]}return L.default=E,x&&x.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function f(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function g(E,x){for(var L=0;L<x.length;L++){var D=x[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,x,L){return x&&g(E.prototype,x),E}function m(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),x&&p(E,x)}function p(E,x){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,x)}function v(E){var x=M();return function(){var D=O(E),C;if(x){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return w(this,C)}}function w(E,x){return x&&(u(x)==="object"||typeof x=="function")?x:b(E)}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function M(){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(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,x,L){return x in E?Object.defineProperty(E,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[x]=L,E}var R=function(x){return x.hasOwnProperty("key")},_=function(E){m(L,E);var x=v(L);function L(D){var C;return f(this,L),C=x.call(this,D),S(b(C),"itemsWrapperRef",void 0),S(b(C),"itemsListRef",void 0),S(b(C),"thumbsRef",void 0),S(b(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(b(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(b(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,k=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(T/k),N=z<I,X=N?I-z:0;C.setState(function(re,j){return{itemSize:k,visibleItems:z,firstItem:N?C.getFirstItem(j.selectedItem):0,lastPosition:X,showArrows:N}})}}),S(b(C),"handleClickItem",function(I,T,k){if(!R(k)||k.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(I,T)}}),S(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(b(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var k=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max(z-C.state.visibleItems,0),re=-X*100/C.state.visibleItems;N===k&&T>0&&(T=0),N===re&&T<0&&(T=0);var j=C.itemsWrapperRef.clientWidth,G=N+100/(j/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ae){C.itemsListRef.style[ae]=(0,r.default)(G,"%",C.props.axis)}),!0}),S(b(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(b(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(b(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(L,[{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 I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var k=t.default.ITEM(!1,T===C.state.selectedItem),z={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:k,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({},z,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(N,"px",this.props.axis),re=this.props.transitionTime+"ms";return z={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:re,MozTransitionDuration:re,MsTransitionDuration:re,OTransitionDuration:re,transitionDuration:re,msTransitionDuration:re},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}),I?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:z,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(G){return C.setItemsListRef(G)},style:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return Vi.default=_,S(_,"displayName","Thumbs"),S(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Vi}var Wi={},Yl;function Bg(){if(Yl)return Wi;Yl=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.default=void 0;var e=function(){return document};return Wi.default=e,Wi}var _n={},Xl;function Zc(){if(Xl)return _n;Xl=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.setPosition=_n.getPosition=_n.isKeyboardEvent=_n.defaultStatusFormatter=_n.noop=void 0;var e=ho(),t=n($s());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};_n.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};_n.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};_n.isKeyboardEvent=o;var a=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var f=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=f-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};_n.getPosition=a;var l=function(u,c){var f={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){f[g]=(0,t.default)(u,"%",c)}),f};return _n.setPosition=l,_n}var er={},jl;function Wg(){if(jl)return er;jl=1,Object.defineProperty(er,"__esModule",{value:!0}),er.fadeAnimationHandler=er.slideStopSwipingHandler=er.slideSwipeAnimationHandler=er.slideAnimationHandler=void 0;var e=ho(),t=r($s()),n=Zc();function r(f){return f&&f.__esModule?f:{default:f}}function i(f,g){var h=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(f,p).enumerable})),h.push.apply(h,m)}return h}function o(f){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){a(f,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(h,m))})}return f}function a(f,g,h){return g in f?Object.defineProperty(f,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[g]=h,f}var l=function(g,h){var m={},p=h.selectedItem,v=p,w=e.Children.count(g.children)-1,b=g.infiniteLoop&&(p<0||p>w);if(b)return v<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,g.axis):v>w&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var M=(0,n.getPosition)(p,g),O=(0,t.default)(M,"%",g.axis),S=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};er.slideAnimationHandler=l;var s=function(g,h,m,p){var v={},w=h.axis==="horizontal",b=e.Children.count(h.children),M=0,O=(0,n.getPosition)(m.selectedItem,h),S=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),R=w?g.x:g.y,_=R;O===M&&R>0&&(_=0),O===S&&R<0&&(_=0);var E=O+100/(m.itemSize/_),x=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&x&&(m.selectedItem===0&&E>-100?E-=b*100:m.selectedItem===b-1&&E<-b*100&&(E+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||x||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(E,h.axis)),x&&!m.cancelClick&&p({cancelClick:!0}),v};er.slideSwipeAnimationHandler=s;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};er.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",v={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||(v=o(o({},v),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:v,selectedStyle:o(o({},v),{},{opacity:1,position:"relative"}),prevStyle:o({},v)}};return er.fadeAnimationHandler=c,er}var Gl;function Ug(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=c(ho()),t=s(Xc()),n=s(jc()),r=s(Kc()),i=s(Bg()),o=s(Gc()),a=Zc(),l=Wg();function s(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||f(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var z=T?Object.getOwnPropertyDescriptor(D,k):null;z&&(z.get||z.set)?Object.defineProperty(I,k,z):I[k]=D[k]}return I.default=D,C&&C.set(D,I),I}function f(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(I){return typeof I}:f=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},f(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){x(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function v(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,I){return C&&v(D.prototype,C),D}function b(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&&M(D,C)}function M(D,C){return M=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},M(D,C)}function O(D){var C=_();return function(){var T=E(D),k;if(C){var z=E(this).constructor;k=Reflect.construct(T,arguments,z)}else k=T.apply(this,arguments);return S(this,k)}}function S(D,C){return C&&(f(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 E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function x(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){b(I,D);var C=O(I);function I(T){var k;p(this,I),k=C.call(this,T),x(R(k),"thumbsRef",void 0),x(R(k),"carouselWrapperRef",void 0),x(R(k),"listRef",void 0),x(R(k),"itemsRef",void 0),x(R(k),"timer",void 0),x(R(k),"animationHandler",void 0),x(R(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(R(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(R(k),"setListRef",function(N){k.listRef=N}),x(R(k),"setItemsRef",function(N,X){k.itemsRef||(k.itemsRef=[]),k.itemsRef[X]=N}),x(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),x(R(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var X=k.props.axis,re=X==="horizontal",j={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},G=re?j.ArrowRight:j.ArrowDown,ae=re?j.ArrowLeft:j.ArrowUp;G===N.keyCode?k.increment():ae===N.keyCode&&k.decrement()}}),x(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",X=k.itemsRef[0];if(X){var re=N?X.clientWidth:X.clientHeight;k.setState({itemSize:re}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(R(k),"handleClickItem",function(N,X){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,X),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(R(k),"handleOnChange",function(N,X){e.Children.count(k.props.children)<=1||k.props.onChange(N,X)}),x(R(k),"handleClickThumb",function(N,X){k.props.onClickThumb(N,X),k.moveTo(N)}),x(R(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(R(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(R(k),"onSwipeMove",function(N,X){k.props.onSwipeMove(X);var re=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(R(k)));return k.setState(m({},re)),!!Object.keys(re).length}),x(R(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(R(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(R(k),"moveTo",function(N){if(typeof N=="number"){var X=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?X:0),N>X&&(N=k.props.infiniteLoop?0:X),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(R(k),"onClickNext",function(){k.increment(1)}),x(R(k),"onClickPrev",function(){k.decrement(1)}),x(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"changeItem",function(N){return function(X){(!(0,a.isKeyboardEvent)(X)||X.key==="Enter")&&k.moveTo(N)}}),x(R(k),"selectItem",function(N){k.setState(m({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(R(k),"getInitialImage",function(){var N=k.props.selectedItem,X=k.itemsRef&&k.itemsRef[N],re=X&&X.getElementsByTagName("img")||[];return re[0]}),x(R(k),"getVariableItemHeight",function(N){var X=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&X&&X.children.length){var re=X.children[0].getElementsByTagName("img")||[];if(re.length>0){var j=re[0];if(!j.complete){var G=function le(){k.forceUpdate(),j.removeEventListener("load",le)};j.addEventListener("load",G)}}var ae=re[0]||X.children[0],ie=ae.clientHeight;return ie>0?ie:null}return null});var z={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 k.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=m(m({},z),k.animationHandler(T,z)),k}return w(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,z){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.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 k=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 z=k.getInitialImage();z&&!z.complete?z.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.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 k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,X){var re=X===z.state.selectedItem,j=X===z.state.previousItem,G=re&&z.state.selectedStyle||j&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(G=m(m({},G),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(G=m(m({},G),{},{pointerEvents:"none"}));var ae={ref:function(le){return z.setItemsRef(le,X)},key:"itemKey"+X+(k?"clone":""),className:n.default.ITEM(!0,X===z.state.selectedItem,X===z.state.previousItem),onClick:z.handleClickItem.bind(z,X,N),style:G};return e.default.createElement("li",ae,z.props.renderItem(N,{isSelected:X===z.state.selectedItem,isPrevious:X===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,z=this.props,N=z.showIndicators,X=z.labels,re=z.renderIndicator,j=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(j,function(G,ae){return re&&re(k.changeItem(ae),ae===k.state.selectedItem,ae,X.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 k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,re=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,j=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,G=this.renderItems(!0),ae=G.shift(),ie=G.pop(),le={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(N){if(le.onSwipeLeft=this.onSwipeForward,le.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var Q=this.getVariableItemHeight(this.state.selectedItem);fe.height=Q||"auto"}}else le.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,le.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,le.style=m(m({},le.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,re,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},z?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},le,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&ae):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return k.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&ae)),this.props.renderArrowNext(this.onClickNext,j,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Hi.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,k){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var k=T;if(T.type!=="img"&&(k=e.Children.toArray(T.props.children).find(function(z){return z.type==="img"})),!!k)return k});return I.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"),[]):I},statusFormatter:a.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Hi}var Kl={},Zl;function qg(){return Zl||(Zl=1),Kl}var Jl;function Yg(){return Jl||(Jl=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(Ug()),n=qg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(Za)),Za}var Xg=Yg(),Ja,Ql;function jg(){if(Ql)return Ja;Ql=1;var e=ph(),t=function(){return e.Date.now()};return Ja=t,Ja}var Qa,eu;function Jc(){if(eu)return Qa;eu=1;var e=Tc(),t=jg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function a(l,s,u){var c,f,g,h,m,p,v=0,w=!1,b=!1,M=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(w=!!u.leading,b="maxWait"in u,g=b?i(n(u.maxWait)||0,s):g,M="trailing"in u?!!u.trailing:M);function O(I){var T=c,k=f;return c=f=void 0,v=I,h=l.apply(k,T),h}function S(I){return v=I,m=setTimeout(E,s),w?O(I):h}function R(I){var T=I-p,k=I-v,z=s-T;return b?o(z,g-k):z}function _(I){var T=I-p,k=I-v;return p===void 0||T>=s||T<0||b&&k>=g}function E(){var I=t();if(_(I))return x(I);m=setTimeout(E,R(I))}function x(I){return m=void 0,M&&c?O(I):(c=f=void 0,h)}function L(){m!==void 0&&clearTimeout(m),v=0,c=p=f=m=void 0}function D(){return m===void 0?h:x(t())}function C(){var I=t(),T=_(I);if(c=arguments,f=this,p=I,T){if(m===void 0)return S(p);if(b)return clearTimeout(m),m=setTimeout(E,s),O(p)}return m===void 0&&(m=setTimeout(E,s)),h}return C.cancel=L,C.flush=D,C}return Qa=a,Qa}var Gg=Jc();const Qc=wr(Gg);function gn(e,t,n,r,i=!1){const o=d.useRef();o.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var u;(u=o.current)==null||u.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:i}),()=>{a.removeEventListener(e,l,{capture:i})}},[e,n,r,i])}function Yr(e,t){return e===void 0?void 0:t}const Kg=Math.PI;function tu(e){return e*Kg/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,Ns=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Zg=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Jg(e,t,n){const[r,i]=d.useState(e),o=d.useRef(!0);d.useEffect(()=>()=>{o.current=!1},[]);const a=d.useRef(Qc(l=>{o.current&&i(l)},n));return d.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),r}const Qg="֑-߿יִ-﷽ﹰ-ﻼ",em="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",tm=new RegExp("^[^"+em+"]*["+Qg+"]");function Bs(e){return tm.test(e)?"rtl":"not-rtl"}let Vo;function xs(){if(typeof document>"u")return 0;if(Vo!==void 0)return Vo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Vo=n-r,Vo}const Wr=Symbol();function nm(e){const t=d.useRef([Wr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,i]=d.useState(),o=d.useCallback(l=>{const s=t.current[0];s!==Wr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Wr&&i({}),r(u=>typeof l=="function"?l(s===Wr?u:s):l),t.current[0]=Wr)},[]),a=d.useCallback(()=>{t.current[0]=Wr,i({})},[]);return[t.current[0]===Wr?n:t.current[0],o,a]}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 rm(e){const t=d.useRef(e);return wi(e,t.current)||(t.current=e),t.current}const im=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(l=>l!=="");if(o.length===0)return null;const a=o.length>1;return d.createElement(Vg,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(Xg.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(l=>{const s=(i==null?void 0:i(l))??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Ns,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 Kr=od();function om(e){Kr=e}const ad=/[&<>"']/,am=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,sm=new RegExp(sd.source,"g"),lm={"&":"&","<":"<",">":">",'"':""","'":"'"},nu=e=>lm[e];function wn(e,t){if(t){if(ad.test(e))return e.replace(am,nu)}else if(sd.test(e))return e.replace(sm,nu);return e}const um=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(um,(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 cm=/(^|[^\[])\^/g;function Nt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(cm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const dm=/[^\w:]/g,fm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ru(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(dm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!fm.test(n)&&(n=pm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const $o={},hm=/^[^:]+:\/*[^/]*$/,gm=/^([^:]+:)[\s\S]*$/,mm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pm(e,t){$o[" "+e]||(hm.test(e)?$o[" "+e]=e+"/":$o[" "+e]=Qo(e,"/",!0)),e=$o[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(gm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(mm,"$1")+t:e+t}const aa={exec:function(){}};function iu(e,t){const n=e.replace(/\|/g,(o,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Qo(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 vm(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 bm(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 ou(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function au(e,t,n,r){const i=t.href,o=t.title?wn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:wn(a)}}function wm(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.CmXS0PAX.js","./index.DwUISpCs.js","../css/index.C6rq3aMZ.css","./FormClearHelper.W8yVYXZp.js","./withFullScreenWrapper.od0SAvAK.js","./Toolbar.BVF7NtOB.js","./checkbox.DKDitzF8.js","./mergeWith.BqTORFAq.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.DXfr1fvT.js","./possibleConstructorReturn.DhYxBDlj.js","./createSuper.mhx956J9.js","./FileDownload.esm.ncu7N-Hr.js","./number-overlay-editor.VB_OvuPv.js","./es6.DM-pf09u.js"])))=>i.map(i=>d[i]);
|
2
|
+
var dh=Object.defineProperty;var fh=(e,t,n)=>t in e?dh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>fh(e,typeof t!="symbol"?t+"":t,n);import{r as d,E as Ls,_ as Ke,c as hh,g as wr,R as At,i as Ya,d as ho,e as gh,f as mh,h as ph,m as Tc,o as Dc,p as vh,q as Oc,s as bh,t as wh,u as yh,v as Ch,w as Sh,x as xh,a as lr,y as Fs,n as Ci,z as Gr,j as lt,F as Pc,A as Ca,T as _c,B as Sa,C as Ln,D as gr,G as xa,H as Wn,I as Lc,J as Jo,K as kh,L as Mh,M as Ne,N as Fc,O as pt,Q as Ki,S as qr,U as Xa,V as Rh,W as Eh,X as Ih,Y as Ol,Z as Th,$ as Ac,a0 as Dh,a1 as Oh,a2 as Ss,a3 as Hc,a4 as zc,a5 as Ph,a6 as _h,a7 as Lh,a8 as Fh,a9 as Ah,aa as Hh,ab as zh,ac as Vh,ad as $h,ae as Nh,af as Vc,ag as Bh,ah as Wh,ai as Uh,aj as qh,ak as Yh,al as Xh,am as jh,an as Gh,ao as Kh,ap as Zh,aq as Jh,ar as Qh,as as Mn,l as As,at as Zi,au as yr,av as $e,aw as eg,b as $c,ax as Nc,k as tg,ay as ng,az as rg,aA as ja,aB as ig,aC as og,aD as ag,aE as sg,aF as lg}from"./index.DwUISpCs.js";import{u as ug}from"./FormClearHelper.W8yVYXZp.js";import{w as cg,E as dg}from"./withFullScreenWrapper.od0SAvAK.js";import{T as fg,a as di}from"./Toolbar.BVF7NtOB.js";import{L as hg,S as gg,a as mg}from"./checkbox.DKDitzF8.js";import{m as pg}from"./mergeWith.BqTORFAq.js";import{s as vg}from"./sprintf.D7DtBTRn.js";import{c as bg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as pr,a as Hs,C as wg}from"./toConsumableArray.DXfr1fvT.js";import{_ as yg,a as Cg,b as Sg}from"./possibleConstructorReturn.DhYxBDlj.js";import{_ as xg}from"./createSuper.mhx956J9.js";import{D as kg,F as Mg}from"./FileDownload.esm.ncu7N-Hr.js";var Bc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";function qc(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return qc(t)}function oo(e,t){return qc(t??"Hell froze over")}function Rg(e,t){try{return e()}catch{return t}}const Pl=Object.prototype.hasOwnProperty;function wi(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--&&wi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Pl.call(e,n)&&++r&&!Pl.call(t,n)||!(n in t)||!wi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ga,_l;function Eg(){if(_l)return Ga;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ga=n,Ga}var Ka,Ll;function Ig(){if(Ll)return Ka;Ll=1;var e=Eg(),t=hh();function n(r,i){return r!=null&&t(r,i,e)}return Ka=n,Ka}var Tg=Ig();const Dg=wr(Tg),ia=null,zs=void 0;var te;(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"})(te||(te={}));var Fl;(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"})(Fl||(Fl={}));var oa;(function(e){e.Triangle="triangle",e.Dots="dots"})(oa||(oa={}));function Ao(e){return"width"in e&&typeof e.width=="number"}async function Al(e){return typeof e=="object"?e:await e()}function hi(e){return!(e.kind===te.Loading||e.kind===te.Bubble||e.kind===te.RowID||e.kind===te.Protected||e.kind===te.Drilldown)}function mi(e){return e.kind===Yn.Marker||e.kind===Yn.NewRow}function Ji(e){if(!hi(e)||e.kind===te.Image)return!1;if(e.kind===te.Text||e.kind===te.Number||e.kind===te.Markdown||e.kind===te.Uri||e.kind===te.Custom||e.kind===te.Boolean)return e.readonly!==!0;oo(e,"A cell was passed with an invalid kind")}function Og(e){return Dg(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Yn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Yn||(Yn={}));function Pg(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 Hl;const mr=class mr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new mr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Pg([...this.items,n]);return new mr(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,a]of n.entries()){const[l,s]=a;if(l<=i&&r<=s){const u=[];l<r&&u.push([l,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new mr(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}};dt(mr,"empty",()=>Hl??(Hl=new mr([]))),dt(mr,"fromSingleSelection",t=>mr.empty().add(t));let mt=mr;var _g=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(l=>{if(l.startsWith("atm_")){const[,s]=l.split("_");n[s]=l}else r.push(l)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},zl=_g,Lg=e=>e.toUpperCase()===e,Fg=e=>t=>e.indexOf(t)===-1,Yc=(e,t)=>{const n={};return Object.keys(e).filter(Fg(t)).forEach(r=>{n[r]=e[r]}),n};function Ag(e,t,n){const r=Yc(t,n);if(!e){const i=typeof Ya=="function"?{default:Ya}:Ya;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Hg=(e,t)=>{};function zg(e){let t="";return n=>{const r=(o,a)=>{const{as:l=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!Lg(l[0])):n.propsAsIs,c=Ag(u,o,["as","class"]);c.ref=a,c.className=n.atomic?zl(n.class,c.className||s):zl(c.className||s,n.class);const{vars:f}=n;if(f){const g={};for(const p in f){const v=f[p],w=v[0],b=v[1]||"",M=typeof w=="function"?w(o):w;Hg(M,n.name),g[`--${p}`]=`${M}${b}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__linaria&&e!==l?(c.as=l,At.createElement(e,c)):At.createElement(l,c)},i=At.forwardRef?At.forwardRef(r):o=>{const a=Yc(o,["innerRef"]);return r(a,o.innerRef)};return i.displayName=n.name,i.__linaria={className:n.class||t,extends:e},i}}var mn=zg;const Vg=mn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Za={},Hi={},Ho={},zo={},Vl;function $g(){return Vl||(Vl=1,function(e){(function(t,n){n(e,ho(),gh())})(zo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=a(n),o=a(r);function a(b){return b&&b.__esModule?b:{default:b}}var l=Object.assign||function(b){for(var M=1;M<arguments.length;M++){var O=arguments[M];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(b[S]=O[S])}return b};function s(b,M){var O={};for(var S in b)M.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(b,S)&&(O[S]=b[S]);return O}function u(b,M){if(!(b instanceof M))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(M,O){for(var S=0;S<O.length;S++){var R=O[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(M,R.key,R)}}return function(M,O,S){return O&&b(M.prototype,O),S&&b(M,S),M}}();function f(b,M){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:b}function g(b,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);b.prototype=Object.create(M&&M.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(b,M):b.__proto__=M)}var h=!1;function m(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function v(b){if("touches"in b){var M=b.touches[0],O=M.pageX,S=M.pageY;return{x:O,y:S}}var R=b.screenX,_=b.screenY;return{x:R,y:_}}var w=function(b){g(M,b);function M(){var O;u(this,M);for(var S=arguments.length,R=Array(S),_=0;_<S;_++)R[_]=arguments[_];var E=f(this,(O=M.__proto__||Object.getPrototypeOf(M)).call.apply(O,[this].concat(R)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(M,[{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(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var R=v(S),_=R.x,E=R.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var R=v(S),_=R.x,E=R.y,x=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:x,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,S):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var R=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var x=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},x),E)}}]),M}(n.Component);w.displayName="ReactSwipe",w.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},w.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=w})}(zo)),zo}var $l;function Xc(){return $l||($l=1,function(e){(function(t,n){n(e,$g())})(Ho,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Ho)),Ho}var zi={},Nl;function jc(){if(Nl)return zi;Nl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=t(mh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,a){return o in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,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,a){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":a==="horizontal","axis-vertical":a!=="horizontal"})},SLIDER:function(o,a){return(0,e.default)({thumbs:!o,slider:o,animated:!a})},ITEM:function(o,a,l){return(0,e.default)({thumb:!o,slide:o,selected:a,previous:l})},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 zi.default=r,zi}var Vi={},$i={},Bl;function Ng(){if(Bl)return $i;Bl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return $i.outerWidth=e,$i}var Ni={},Wl;function $s(){if(Wl)return Ni;Wl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,a=i==="horizontal"?[o,0,0]:[0,o,0],l="translate3d",s="("+a.join(",")+")";return l+s};return Ni.default=e,Ni}var Bi={},Ul;function Gc(){if(Ul)return Bi;Ul=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=function(){return window};return Bi.default=e,Bi}var ql;function Kc(){if(ql)return Vi;ql=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=s(ho()),t=a(jc()),n=Ng(),r=a($s()),i=a(Xc()),o=a(Gc());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var x=l();if(x&&x.has(E))return x.get(E);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(L,C,I):L[C]=E[C]}return L.default=E,x&&x.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function f(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function g(E,x){for(var L=0;L<x.length;L++){var D=x[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,x,L){return x&&g(E.prototype,x),E}function m(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),x&&p(E,x)}function p(E,x){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,x)}function v(E){var x=M();return function(){var D=O(E),C;if(x){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return w(this,C)}}function w(E,x){return x&&(u(x)==="object"||typeof x=="function")?x:b(E)}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function M(){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(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,x,L){return x in E?Object.defineProperty(E,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[x]=L,E}var R=function(x){return x.hasOwnProperty("key")},_=function(E){m(L,E);var x=v(L);function L(D){var C;return f(this,L),C=x.call(this,D),S(b(C),"itemsWrapperRef",void 0),S(b(C),"itemsListRef",void 0),S(b(C),"thumbsRef",void 0),S(b(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(b(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(b(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,k=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(T/k),N=z<I,X=N?I-z:0;C.setState(function(re,j){return{itemSize:k,visibleItems:z,firstItem:N?C.getFirstItem(j.selectedItem):0,lastPosition:X,showArrows:N}})}}),S(b(C),"handleClickItem",function(I,T,k){if(!R(k)||k.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(I,T)}}),S(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(b(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var k=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max(z-C.state.visibleItems,0),re=-X*100/C.state.visibleItems;N===k&&T>0&&(T=0),N===re&&T<0&&(T=0);var j=C.itemsWrapperRef.clientWidth,G=N+100/(j/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ae){C.itemsListRef.style[ae]=(0,r.default)(G,"%",C.props.axis)}),!0}),S(b(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(b(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(b(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(L,[{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 I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var k=t.default.ITEM(!1,T===C.state.selectedItem),z={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:k,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({},z,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(N,"px",this.props.axis),re=this.props.transitionTime+"ms";return z={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:re,MozTransitionDuration:re,MsTransitionDuration:re,OTransitionDuration:re,transitionDuration:re,msTransitionDuration:re},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}),I?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:z,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(G){return C.setItemsListRef(G)},style:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return Vi.default=_,S(_,"displayName","Thumbs"),S(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Vi}var Wi={},Yl;function Bg(){if(Yl)return Wi;Yl=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.default=void 0;var e=function(){return document};return Wi.default=e,Wi}var _n={},Xl;function Zc(){if(Xl)return _n;Xl=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.setPosition=_n.getPosition=_n.isKeyboardEvent=_n.defaultStatusFormatter=_n.noop=void 0;var e=ho(),t=n($s());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};_n.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};_n.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};_n.isKeyboardEvent=o;var a=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var f=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=f-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};_n.getPosition=a;var l=function(u,c){var f={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){f[g]=(0,t.default)(u,"%",c)}),f};return _n.setPosition=l,_n}var er={},jl;function Wg(){if(jl)return er;jl=1,Object.defineProperty(er,"__esModule",{value:!0}),er.fadeAnimationHandler=er.slideStopSwipingHandler=er.slideSwipeAnimationHandler=er.slideAnimationHandler=void 0;var e=ho(),t=r($s()),n=Zc();function r(f){return f&&f.__esModule?f:{default:f}}function i(f,g){var h=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(f,p).enumerable})),h.push.apply(h,m)}return h}function o(f){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){a(f,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(h,m))})}return f}function a(f,g,h){return g in f?Object.defineProperty(f,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[g]=h,f}var l=function(g,h){var m={},p=h.selectedItem,v=p,w=e.Children.count(g.children)-1,b=g.infiniteLoop&&(p<0||p>w);if(b)return v<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,g.axis):v>w&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var M=(0,n.getPosition)(p,g),O=(0,t.default)(M,"%",g.axis),S=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};er.slideAnimationHandler=l;var s=function(g,h,m,p){var v={},w=h.axis==="horizontal",b=e.Children.count(h.children),M=0,O=(0,n.getPosition)(m.selectedItem,h),S=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),R=w?g.x:g.y,_=R;O===M&&R>0&&(_=0),O===S&&R<0&&(_=0);var E=O+100/(m.itemSize/_),x=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&x&&(m.selectedItem===0&&E>-100?E-=b*100:m.selectedItem===b-1&&E<-b*100&&(E+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||x||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(E,h.axis)),x&&!m.cancelClick&&p({cancelClick:!0}),v};er.slideSwipeAnimationHandler=s;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};er.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",v={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||(v=o(o({},v),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:v,selectedStyle:o(o({},v),{},{opacity:1,position:"relative"}),prevStyle:o({},v)}};return er.fadeAnimationHandler=c,er}var Gl;function Ug(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=c(ho()),t=s(Xc()),n=s(jc()),r=s(Kc()),i=s(Bg()),o=s(Gc()),a=Zc(),l=Wg();function s(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||f(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var z=T?Object.getOwnPropertyDescriptor(D,k):null;z&&(z.get||z.set)?Object.defineProperty(I,k,z):I[k]=D[k]}return I.default=D,C&&C.set(D,I),I}function f(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(I){return typeof I}:f=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},f(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){x(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function v(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,I){return C&&v(D.prototype,C),D}function b(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&&M(D,C)}function M(D,C){return M=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},M(D,C)}function O(D){var C=_();return function(){var T=E(D),k;if(C){var z=E(this).constructor;k=Reflect.construct(T,arguments,z)}else k=T.apply(this,arguments);return S(this,k)}}function S(D,C){return C&&(f(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 E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function x(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){b(I,D);var C=O(I);function I(T){var k;p(this,I),k=C.call(this,T),x(R(k),"thumbsRef",void 0),x(R(k),"carouselWrapperRef",void 0),x(R(k),"listRef",void 0),x(R(k),"itemsRef",void 0),x(R(k),"timer",void 0),x(R(k),"animationHandler",void 0),x(R(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(R(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(R(k),"setListRef",function(N){k.listRef=N}),x(R(k),"setItemsRef",function(N,X){k.itemsRef||(k.itemsRef=[]),k.itemsRef[X]=N}),x(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),x(R(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var X=k.props.axis,re=X==="horizontal",j={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},G=re?j.ArrowRight:j.ArrowDown,ae=re?j.ArrowLeft:j.ArrowUp;G===N.keyCode?k.increment():ae===N.keyCode&&k.decrement()}}),x(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",X=k.itemsRef[0];if(X){var re=N?X.clientWidth:X.clientHeight;k.setState({itemSize:re}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(R(k),"handleClickItem",function(N,X){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,X),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(R(k),"handleOnChange",function(N,X){e.Children.count(k.props.children)<=1||k.props.onChange(N,X)}),x(R(k),"handleClickThumb",function(N,X){k.props.onClickThumb(N,X),k.moveTo(N)}),x(R(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(R(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(R(k),"onSwipeMove",function(N,X){k.props.onSwipeMove(X);var re=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(R(k)));return k.setState(m({},re)),!!Object.keys(re).length}),x(R(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(R(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(R(k),"moveTo",function(N){if(typeof N=="number"){var X=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?X:0),N>X&&(N=k.props.infiniteLoop?0:X),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(R(k),"onClickNext",function(){k.increment(1)}),x(R(k),"onClickPrev",function(){k.decrement(1)}),x(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"changeItem",function(N){return function(X){(!(0,a.isKeyboardEvent)(X)||X.key==="Enter")&&k.moveTo(N)}}),x(R(k),"selectItem",function(N){k.setState(m({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(R(k),"getInitialImage",function(){var N=k.props.selectedItem,X=k.itemsRef&&k.itemsRef[N],re=X&&X.getElementsByTagName("img")||[];return re[0]}),x(R(k),"getVariableItemHeight",function(N){var X=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&X&&X.children.length){var re=X.children[0].getElementsByTagName("img")||[];if(re.length>0){var j=re[0];if(!j.complete){var G=function le(){k.forceUpdate(),j.removeEventListener("load",le)};j.addEventListener("load",G)}}var ae=re[0]||X.children[0],ie=ae.clientHeight;return ie>0?ie:null}return null});var z={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 k.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=m(m({},z),k.animationHandler(T,z)),k}return w(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,z){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.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 k=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 z=k.getInitialImage();z&&!z.complete?z.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.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 k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,X){var re=X===z.state.selectedItem,j=X===z.state.previousItem,G=re&&z.state.selectedStyle||j&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(G=m(m({},G),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(G=m(m({},G),{},{pointerEvents:"none"}));var ae={ref:function(le){return z.setItemsRef(le,X)},key:"itemKey"+X+(k?"clone":""),className:n.default.ITEM(!0,X===z.state.selectedItem,X===z.state.previousItem),onClick:z.handleClickItem.bind(z,X,N),style:G};return e.default.createElement("li",ae,z.props.renderItem(N,{isSelected:X===z.state.selectedItem,isPrevious:X===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,z=this.props,N=z.showIndicators,X=z.labels,re=z.renderIndicator,j=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(j,function(G,ae){return re&&re(k.changeItem(ae),ae===k.state.selectedItem,ae,X.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 k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,re=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,j=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,G=this.renderItems(!0),ae=G.shift(),ie=G.pop(),le={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(N){if(le.onSwipeLeft=this.onSwipeForward,le.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var Q=this.getVariableItemHeight(this.state.selectedItem);fe.height=Q||"auto"}}else le.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,le.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,le.style=m(m({},le.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,re,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},z?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},le,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&ae):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return k.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&ae)),this.props.renderArrowNext(this.onClickNext,j,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Hi.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,k){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var k=T;if(T.type!=="img"&&(k=e.Children.toArray(T.props.children).find(function(z){return z.type==="img"})),!!k)return k});return I.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"),[]):I},statusFormatter:a.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Hi}var Kl={},Zl;function qg(){return Zl||(Zl=1),Kl}var Jl;function Yg(){return Jl||(Jl=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(Ug()),n=qg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(Za)),Za}var Xg=Yg(),Ja,Ql;function jg(){if(Ql)return Ja;Ql=1;var e=ph(),t=function(){return e.Date.now()};return Ja=t,Ja}var Qa,eu;function Jc(){if(eu)return Qa;eu=1;var e=Tc(),t=jg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function a(l,s,u){var c,f,g,h,m,p,v=0,w=!1,b=!1,M=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(w=!!u.leading,b="maxWait"in u,g=b?i(n(u.maxWait)||0,s):g,M="trailing"in u?!!u.trailing:M);function O(I){var T=c,k=f;return c=f=void 0,v=I,h=l.apply(k,T),h}function S(I){return v=I,m=setTimeout(E,s),w?O(I):h}function R(I){var T=I-p,k=I-v,z=s-T;return b?o(z,g-k):z}function _(I){var T=I-p,k=I-v;return p===void 0||T>=s||T<0||b&&k>=g}function E(){var I=t();if(_(I))return x(I);m=setTimeout(E,R(I))}function x(I){return m=void 0,M&&c?O(I):(c=f=void 0,h)}function L(){m!==void 0&&clearTimeout(m),v=0,c=p=f=m=void 0}function D(){return m===void 0?h:x(t())}function C(){var I=t(),T=_(I);if(c=arguments,f=this,p=I,T){if(m===void 0)return S(p);if(b)return clearTimeout(m),m=setTimeout(E,s),O(p)}return m===void 0&&(m=setTimeout(E,s)),h}return C.cancel=L,C.flush=D,C}return Qa=a,Qa}var Gg=Jc();const Qc=wr(Gg);function gn(e,t,n,r,i=!1){const o=d.useRef();o.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var u;(u=o.current)==null||u.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:i}),()=>{a.removeEventListener(e,l,{capture:i})}},[e,n,r,i])}function Yr(e,t){return e===void 0?void 0:t}const Kg=Math.PI;function tu(e){return e*Kg/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,Ns=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Zg=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Jg(e,t,n){const[r,i]=d.useState(e),o=d.useRef(!0);d.useEffect(()=>()=>{o.current=!1},[]);const a=d.useRef(Qc(l=>{o.current&&i(l)},n));return d.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),r}const Qg="֑-߿יִ-﷽ﹰ-ﻼ",em="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",tm=new RegExp("^[^"+em+"]*["+Qg+"]");function Bs(e){return tm.test(e)?"rtl":"not-rtl"}let Vo;function xs(){if(typeof document>"u")return 0;if(Vo!==void 0)return Vo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Vo=n-r,Vo}const Wr=Symbol();function nm(e){const t=d.useRef([Wr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,i]=d.useState(),o=d.useCallback(l=>{const s=t.current[0];s!==Wr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Wr&&i({}),r(u=>typeof l=="function"?l(s===Wr?u:s):l),t.current[0]=Wr)},[]),a=d.useCallback(()=>{t.current[0]=Wr,i({})},[]);return[t.current[0]===Wr?n:t.current[0],o,a]}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 rm(e){const t=d.useRef(e);return wi(e,t.current)||(t.current=e),t.current}const im=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(l=>l!=="");if(o.length===0)return null;const a=o.length>1;return d.createElement(Vg,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(Xg.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(l=>{const s=(i==null?void 0:i(l))??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Ns,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 Kr=od();function om(e){Kr=e}const ad=/[&<>"']/,am=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,sm=new RegExp(sd.source,"g"),lm={"&":"&","<":"<",">":">",'"':""","'":"'"},nu=e=>lm[e];function wn(e,t){if(t){if(ad.test(e))return e.replace(am,nu)}else if(sd.test(e))return e.replace(sm,nu);return e}const um=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(um,(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 cm=/(^|[^\[])\^/g;function Nt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(cm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const dm=/[^\w:]/g,fm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ru(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(dm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!fm.test(n)&&(n=pm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const $o={},hm=/^[^:]+:\/*[^/]*$/,gm=/^([^:]+:)[\s\S]*$/,mm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pm(e,t){$o[" "+e]||(hm.test(e)?$o[" "+e]=e+"/":$o[" "+e]=Qo(e,"/",!0)),e=$o[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(gm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(mm,"$1")+t:e+t}const aa={exec:function(){}};function iu(e,t){const n=e.replace(/\|/g,(o,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Qo(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 vm(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 bm(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 ou(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function au(e,t,n,r){const i=t.href,o=t.title?wn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:wn(a)}}function wm(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[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
|
4
4
|
`)}class Ws{constructor(t){this.options=t||Kr}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:Qo(r,`
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=wm(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=Qo(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,a,l,s,u,c,f,g,h,m,p=n[1].trim();const v=p.length>1,w={type:"list",raw:"",ordered:v,start:v?+p.slice(0,-1):"",loose:!1,items:[]};p=v?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=v?p:"[*+-]");const b=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=b.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,a)),i=a+1,l===`
|
170
170
|
`&&(n.push(r),r=[])):l==='"'&&(o=t.inString);break;case t.inString:l==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?o=t.inString:((l===" "||l===`
|
171
171
|
`)&&(r.push(Ou(e.slice(i,a))),i=a+1,l===`
|
172
|
-
`&&(n.push(r),r=[])),o=t.None);break}a++}return i<e.length&&r.push(Ou(e.slice(i,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Pu(e,t,n){var l;const r=H0(e,t),i=s=>{var u;(u=window.navigator.clipboard)==null||u.writeText(s)},o=(s,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(s,u)=>{var c,f;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",s),(f=n==null?void 0:n.clipboardData)==null||f.setData("text/html",u)}catch{o(s,u)||i(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Hd(e){return e!==!0}function _u(e){return typeof e=="string"?e:`${e}px`}const $0=()=>e=>e.innerWidth,N0=()=>e=>e.innerHeight,B0=mn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[$0()],"wmyidgi-1":[N0()]}}),W0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return d.createElement(B0,{innerHeight:_u(n),innerWidth:_u(t),...i},r)},U0=2,q0=1300;function Y0(e,t,n){const r=At.useRef(0),[i,o]=e??[0,0];At.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let a=!1,l=0;const s=u=>{var c;if(!a){if(l===0)l=u;else{const f=u-l;r.current=Math.min(1,r.current+f/q0);const g=r.current**1.618*f*U0;(c=t.current)==null||c.scrollBy(i*g,o*g),l=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,i,o,n])}function X0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:a,remSize:l}){const[s,u,c,f,g,h]=At.useMemo(()=>{if(!a||l===16)return[e,t,n,r,i,o];const m=l/16,p=e,v=Sd();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??v.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??v.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:f,overscrollX:g,overscrollY:h}}const Dr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=ca.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function j0(e){const t=rm(e);return At.useMemo(()=>{if(t===void 0)return Lu(Dr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Dr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Dr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Dr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Dr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Dr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Dr.selectToLastCell};return Lu({...Dr,...n})},[t])}function G0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const a={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(a.subGroups=r.subGroups.map((l,s)=>t(l,i+1,[...o,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),a}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Zs(e,t){const n=[];function r(a,l,s=!1){let u=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const f=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:l;r(a.subGroups[c],f,s||a.isCollapsed)}}const i=G0(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;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function fa(e,t){if(t===void 0||Zs.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(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function K0(e,t,n,r){const i=At.useMemo(()=>e===void 0?void 0:Zs(e,t),[e,t]),o=At.useMemo(()=>i===void 0?t:i.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[i,t]),a=At.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=fa(u,i);return c?e.height:typeof n=="number"?n:n(u)},[i,e,n]),l=At.useCallback(u=>{if(i===void 0)return u;let c=u;for(const f of i){if(c===0)return;if(c--,!f.isCollapsed){if(c<f.rows)return f.contentIndex+c;c-=f.rows}}return u},[i]),s=Yr(r??(e==null?void 0:e.themeOverride),At.useCallback(u=>{if(e===void 0)return r==null?void 0:r(u,u,u);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:f,groupIndex:g}=fa(u,i);return c?e.themeOverride:r==null?void 0:r(u,g,f)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:o,rowNumberMapper:l,getRowThemeOverride:s}}function Z0(e,t){const n=At.useMemo(()=>e===void 0?void 0:Zs(e,t),[e,t]);return{getRowGroupingForPath:Vd,updateRowGroupingByPath:zd,mapper:At.useCallback(r=>{if(typeof r=="number")return fa(r,n);const i=fa(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function zd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,a)=>a===r?{...o,...n}:o):e.map((o,a)=>a===r?{...o,subGroups:zd(o.subGroups??[],i,n)}:o)}function Vd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Vd(e[n].subGroups??[],r)}function J0(e,t){const[n]=d.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 Q0(e,t,n,r,i){const[o,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,o]),[s,u,c]=nm(l),f=d.useRef(i);f.current=i;const g=J0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),f.current()}},[t,h,c,g]);const m=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),f.current()}},[e,m,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const ev=d.lazy(async()=>await Fs(()=>import("./data-grid-overlay-editor.CRIS0V5u.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let tv=0;function nv(e){return ap(yu(yu(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return lr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Bo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Wo={kind:te.Loading,allowOverlay:!1},Uo={columns:mt.empty(),rows:mt.empty(),current:void 0},rv=(e,t)=>{var Il,Tl,Dl;const[n,r]=d.useState(Uo),[i,o]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,u]=d.useState(),c=d.useRef(),f=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:v,columns:w,rows:b,getCellContent:M,onCellClicked:O,onCellActivated:S,onFillPattern:R,onFinishedEditing:_,coercePasteValue:E,drawHeader:x,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:X,onHeaderContextMenu:re,getCellsForSelection:j,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:ae,onCellEdited:ie,onCellsEdited:le,onSearchResultsChanged:fe,searchResults:Q,onSearchValueChange:H,searchValue:P,onKeyDown:W,onKeyUp:ce,keybindings:De,editOnType:He=!0,onRowAppended:ye,onColumnMoved:Re,validateCell:Se,highlightRegions:Et,rangeSelect:wt="rect",columnSelect:rt="multi",rowSelect:se="multi",rangeSelectionBlending:et="exclusive",columnSelectionBlending:me="exclusive",rowSelectionBlending:he="exclusive",onDelete:pe,onDragStart:ze,onMouseMove:Pe,onPaste:tt,copyHeaders:ve=!1,freezeColumns:ue=0,cellActivationBehavior:it="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:Qe,onHeaderIndicatorClick:vt,getGroupDetails:ht,rowGrouping:Ve,onSearchClose:Dt,onItemHovered:Yt,onSelectionCleared:xt,showSearch:_t,onVisibleRegionChanged:nn,gridSelection:zt,onGridSelectionChange:ln,minColumnWidth:It=50,maxColumnWidth:yt=500,maxColumnAutoWidth:Dn,provideEditor:yn,trailingRowOptions:Oe,freezeTrailingRows:Lt=0,allowedFillDirections:fn="orthogonal",scrollOffsetX:hn,scrollOffsetY:pn,verticalBorder:at,onDragOverCell:Xt,onDrop:Ot,onColumnResize:rn,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:Be,fillHandle:Bt,experimental:Pt,fixedShadowX:Vt,fixedShadowY:$t,headerIcons:Cn,imageWindowLoader:nr,initialSize:Hn,isDraggable:V,onDragLeave:Je,onRowMoved:We,overscrollX:de,overscrollY:st,preventDiagonalScrolling:Wt,rightElement:dn,rightElementProps:Zt,trapFocus:Gt=!1,smoothScrollX:Sn,smoothScrollY:vn,scaleToRem:Cr=!1,rowHeight:Xn=34,headerHeight:po=36,groupHeaderHeight:Ia=po,theme:ei,isOutsideClick:Sr,renderers:Si,resizeIndicator:Ta,scrollToActiveCell:xi=!0,drawFocusRing:ki=!0}=e,Ar=ki==="no-editor"?i===void 0:ki,Qt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=(Qt==null?void 0:Qt.kind)??e.rowMarkers??"none",Mi=(Qt==null?void 0:Qt.width)??e.rowMarkerWidth,Ri=(Qt==null?void 0:Qt.startIndex)??e.rowMarkerStartIndex??1,ti=(Qt==null?void 0:Qt.theme)??e.rowMarkerTheme,fr=Qt==null?void 0:Qt.headerTheme,hr=Qt==null?void 0:Qt.headerAlwaysVisible,ni=se!=="multi",rr=(Qt==null?void 0:Qt.checkboxStyle)??"square",ir=Math.max(It,20),Hr=Math.max(yt,ir),vo=Math.max(Dn??Hr,ir),Ei=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:bo,rowHeight:wo,getRowThemeOverride:zn}=K0(Ve,b,Xn,h),yo=d.useMemo(()=>Number.parseFloat(Ei.fontSize),[Ei]),{rowHeight:jn,headerHeight:Ii,groupHeaderHeight:Co,theme:So,overscrollX:Da,overscrollY:Oa}=X0({groupHeaderHeight:Ia,headerHeight:po,overscrollX:de,overscrollY:st,remSize:yo,rowHeight:wo,scaleToRem:Cr,theme:ei}),Vn=j0(De),xr=Mi??(b>1e4?48:b>1e3?44:b>100?36:32),$n=Rn!=="none",q=$n?1:0,Kt=ye!==void 0,kr=(Oe==null?void 0:Oe.sticky)===!0,[ri,ii]=d.useState(!1),Ti=_t??ri,Pa=d.useCallback(()=>{Dt!==void 0?Dt():ii(!1)},[Dt]),K=d.useMemo(()=>zt===void 0?void 0:Bo(zt,q),[zt,q])??n,un=d.useRef();un.current===void 0&&(un.current=new AbortController),d.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,_a]=O0(j,M,q,un.current,je),$=d.useCallback((y,A,F)=>{if(Se===void 0)return!0;const U=[y[0]-q,y[1]];return Se==null?void 0:Se(U,A,F)},[q,Se]),oe=d.useRef(zt),Ce=d.useCallback((y,A)=>{A&&(y=z0(y,cn,q,k,un.current)),ln!==void 0?(oe.current=Bo(y,-q),ln(oe.current)):r(y)},[ln,cn,q,k]),xe=Yr(rn,d.useCallback((y,A,F,U)=>{rn==null||rn(w[F-q],A,F-q,U)},[rn,q,w])),ge=Yr(Tt,d.useCallback((y,A,F,U)=>{Tt==null||Tt(w[F-q],A,F-q,U)},[Tt,q,w])),Me=Yr(Ft,d.useCallback((y,A,F,U)=>{Ft==null||Ft(w[F-q],A,F-q,U)},[Ft,q,w])),nt=Yr(x,d.useCallback((y,A)=>(x==null?void 0:x({...y,columnIndex:y.columnIndex-q},A))??!1,[x,q])),ot=Yr(L,d.useCallback((y,A)=>(L==null?void 0:L({...y,col:y.col-q},A))??!1,[L,q])),Ie=d.useCallback(y=>{if(pe!==void 0){const A=pe(Bo(y,-q));return typeof A=="boolean"?A:Bo(A,q)}return!0},[pe,q]),[kt,ke,Ge]=D0(K,Ce,et,me,he,wt,T),Ue=d.useMemo(()=>vr(Sd(),So),[So]),[ft,sn]=d.useState([0,0,0]),En=d.useMemo(()=>{if(Si===void 0)return{};const y={};for(const A of Si)y[A.kind]=A;return y},[Si]),Ct=d.useCallback(y=>y.kind!==te.Custom?En[y.kind]:Be==null?void 0:Be.find(A=>A.isMatch(y)),[Be,En]);let{sizedColumns:Jt,nonGrowWidth:Gn}=Zm(w,je,_a,ft[0]-(q===0?0:xr)-ft[2],ir,vo,Ue,Ct,un.current);Rn!=="none"&&(Gn+=xr);const xn=d.useMemo(()=>Jt.some(y=>y.group!==void 0),[Jt]),Rt=xn?Ii+Co:Ii,In=K.rows.length,On=Rn==="none"?void 0:In===0?!1:In===je?!0:void 0,St=d.useMemo(()=>Rn==="none"?Jt:[{title:"",width:xr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ti,rowMarker:rr,rowMarkerChecked:On,headerRowMarkerTheme:fr,headerRowMarkerAlwaysVisible:hr,headerRowMarkerDisabled:ni},...Jt],[Rn,Jt,xr,ti,rr,On,fr,hr,ni]),en=d.useRef({height:1,width:1,x:0,y:0}),Mr=d.useRef(!1),{setVisibleRegion:Rr,visibleRegion:zr,scrollRef:Ut}=Q0(hn,pn,jn,en,()=>Mr.current=!0);en.current=zr;const Ff=zr.x+q,xo=zr.y,Tn=d.useRef(null),kn=d.useCallback(y=>{var A;y===!0?(A=Tn.current)==null||A.focus():window.requestAnimationFrame(()=>{var F;(F=Tn.current)==null||F.focus()})},[]),bn=Kt?je+1:je,Nn=d.useCallback(y=>{const A=q===0?y:y.map(U=>({...U,location:[U.location[0]-q,U.location[1]]})),F=le==null?void 0:le(A);if(F!==!0)for(const U of A)ie==null||ie(U.location,U.value);return F},[ie,le,q]),[Vr,La]=d.useState(),ko=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,oi=Ar?(Il=K.current)==null?void 0:Il.cell:void 0,Mo=oi==null?void 0:oi[0],Ro=oi==null?void 0:oi[1],Af=d.useMemo(()=>{if((Et===void 0||Et.length===0)&&(ko??Mo??Ro??Vr)===void 0)return;const y=[];if(Et!==void 0)for(const A of Et){const F=St.length-A.range.x-q;F>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+q,width:Math.min(F,A.range.width)},style:A.style})}return Vr!==void 0&&y.push({color:jr(Ue.accentColor,0),range:Vr,style:"dashed"}),ko!==void 0&&y.push({color:jr(Ue.accentColor,.5),range:ko,style:"solid-outline"}),Mo!==void 0&&Ro!==void 0&&y.push({color:Ue.accentColor,range:{x:Mo,y:Ro,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Vr,ko,Mo,Ro,Et,St.length,Ue.accentColor,q]),gl=d.useRef(St);gl.current=St;const Pn=d.useCallback(([y,A],F=!1)=>{var J,Y,Z,ee,ne,be,_e;const U=Kt&&A===bn-1;if(y===0&&$n){if(U)return Wo;const we=bo(A);return we===void 0?Wo:{kind:Yn.Marker,allowOverlay:!1,checkboxStyle:rr,checked:(K==null?void 0:K.rows.hasIndex(A))===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Ri+we,drawHandle:We!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(U){const Fe=y===q?(Oe==null?void 0:Oe.hint)??"":"",Te=gl.current[y];if(((J=Te==null?void 0:Te.trailingRowOptions)==null?void 0:J.disabled)===!0)return Wo;{const gt=((Y=Te==null?void 0:Te.trailingRowOptions)==null?void 0:Y.hint)??Fe,qe=((Z=Te==null?void 0:Te.trailingRowOptions)==null?void 0:Z.addIcon)??(Oe==null?void 0:Oe.addIcon);return{kind:Yn.NewRow,hint:gt,allowOverlay:!1,icon:qe}}}else{const we=y-q;if(F||(Pt==null?void 0:Pt.strict)===!0){const Te=en.current,gt=Te.x>we||we>Te.x+Te.width||Te.y>A||A>Te.y+Te.height||A>=Aa.current,qe=we===((ne=(ee=Te.extras)==null?void 0:ee.selected)==null?void 0:ne[0])&&A===((be=Te.extras)==null?void 0:be.selected[1]);let Le=!1;if(((_e=Te.extras)==null?void 0:_e.freezeRegions)!==void 0){for(const Mt of Te.extras.freezeRegions)if(Xr(Mt,we,A)){Le=!0;break}}if(gt&&!qe&&!Le)return Wo}let Fe=M([we,A]);return q!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+q,Fe.span[1]+q]}),Fe}},[Kt,bn,$n,bo,rr,K==null?void 0:K.rows,Rn,Ri,We,q,Oe==null?void 0:Oe.hint,Oe==null?void 0:Oe.addIcon,Pt==null?void 0:Pt.strict,M]),Fa=d.useCallback(y=>{let A=(ht==null?void 0:ht(y))??{name:y};return ae!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>za({group:A.name,bounds:F.bounds})}]}),A},[ht,ae]),Eo=d.useCallback(y=>{var Z;const[A,F]=y.cell,U=St[A],B=(U==null?void 0:U.group)!==void 0?(Z=Fa(U.group))==null?void 0:Z.overrideTheme:void 0,J=U==null?void 0:U.themeOverride,Y=zn==null?void 0:zn(F);o({...y,theme:vr(Ue,B,J,Y,y.content.themeOverride)})},[zn,St,Fa,Ue]),ai=d.useCallback((y,A,F)=>{var Y;if(K.current===void 0)return;const[U,B]=K.current.cell,J=Pn([U,B]);if(J.kind!==te.Boolean&&J.allowOverlay){let Z=J;if(F!==void 0)switch(Z.kind){case te.Number:{const ee=Rg(()=>F==="-"?-0:Number.parseFloat(F),0);Z={...Z,data:Number.isNaN(ee)?0:ee};break}case te.Text:case te.Markdown:case te.Uri:Z={...Z,data:F};break}Eo({target:y,content:Z,initialValue:F,cell:[U,B],highlight:F===void 0,forceEditMode:F!==void 0})}else J.kind===te.Boolean&&A&&J.readonly!==!0&&(Nn([{location:K.current.cell,value:{...J,data:Hd(J.data)}}]),(Y=Tn.current)==null||Y.damage([{cell:K.current.cell}]))},[Pn,K,Nn,Eo]),ml=d.useCallback((y,A)=>{var B;const F=(B=Tn.current)==null?void 0:B.getBounds(y,A);if(F===void 0||Ut.current===null)return;const U=Pn([y,A]);U.allowOverlay&&Eo({target:F,content:U,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[Pn,Ut,Eo]),on=d.useCallback((y,A,F="both",U=0,B=0,J=void 0)=>{if(Ut.current!==null){const Y=Tn.current,Z=l.current,ee=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,ne=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,be=typeof y!="number"&&y.unit==="px"?y.amount:void 0,_e=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(Y!==null&&Z!==null){let we={x:0,y:0,width:0,height:0},Fe=0,Te=0;if((ee!==void 0||ne!==void 0)&&(we=Y.getBounds((ee??0)+q,ne??0)??we,we.width===0||we.height===0))return;const gt=Z.getBoundingClientRect(),qe=gt.width/Z.offsetWidth;if(be!==void 0&&(we={...we,x:be-gt.left-Ut.current.scrollLeft,width:1}),_e!==void 0&&(we={...we,y:_e+gt.top-Ut.current.scrollTop,height:1}),we!==void 0){const Le={x:we.x-U,y:we.y-B,width:we.width+2*U,height:we.height+2*B};let Mt=0;for(let qa=0;qa<ue;qa++)Mt+=Jt[qa].width;let jt=0;const an=Lt+(kr?1:0);an>0&&(jt=Jr(bn,an,jn));let Jn=Mt*qe+gt.left+q*xr*qe,ar=gt.right,Qn=gt.top+Rt*qe,sr=gt.bottom-jt*qe;const Lo=we.width+U*2;switch(J==null?void 0:J.hAlign){case"start":ar=Jn+Lo;break;case"end":Jn=ar-Lo;break;case"center":Jn=Math.floor((Jn+ar)/2)-Lo/2,ar=Jn+Lo;break}const Fo=we.height+B*2;switch(J==null?void 0:J.vAlign){case"start":sr=Qn+Fo;break;case"end":Qn=sr-Fo;break;case"center":Qn=Math.floor((Qn+sr)/2)-Fo/2,sr=Qn+Fo;break}Jn>Le.x?Fe=Le.x-Jn:ar<Le.x+Le.width&&(Fe=Le.x+Le.width-ar),Qn>Le.y?Te=Le.y-Qn:sr<Le.y+Le.height&&(Te=Le.y+Le.height-sr),F==="vertical"||typeof y=="number"&&y<ue?Fe=0:(F==="horizontal"||typeof A=="number"&&A>=bn-an)&&(Te=0),(Fe!==0||Te!==0)&&(qe!==1&&(Fe/=qe,Te/=qe),Ut.current.scrollTo(Fe+Ut.current.scrollLeft,Te+Ut.current.scrollTop))}}}},[q,Lt,xr,Ut,Rt,ue,Jt,bn,kr,jn]),pl=d.useRef(ml),vl=d.useRef(M),Aa=d.useRef(je);pl.current=ml,vl.current=M,Aa.current=je;const si=d.useCallback(async(y,A=!0)=>{var ee;const F=St[y];if(((ee=F==null?void 0:F.trailingRowOptions)==null?void 0:ee.disabled)===!0)return;const U=ye==null?void 0:ye();let B,J=!0;U!==void 0&&(B=await U,B==="top"&&(J=!1),typeof B=="number"&&(J=!1));let Y=0;const Z=()=>{if(Aa.current<=je){Y<500&&window.setTimeout(Z,Y),Y=50+Y*2;return}const ne=typeof B=="number"?B:J?je:0;_o.current(y-q,ne),kt({cell:[y,ne],range:{x:y,y:ne,width:1,height:1}},!1,!1,"edit");const be=vl.current([y-q,ne]);be.allowOverlay&&Ji(be)&&be.readonly!==!0&&A&&window.setTimeout(()=>{pl.current(y,ne)},0)};Z()},[St,ye,q,je,kt]),Io=d.useCallback(y=>{var F,U;const A=((U=(F=Jt[y])==null?void 0:F.trailingRowOptions)==null?void 0:U.targetColumn)??(Oe==null?void 0:Oe.targetColumn);if(typeof A=="number")return A+($n?1:0);if(typeof A=="object"){const B=w.indexOf(A);if(B>=0)return B+($n?1:0)}},[Jt,w,$n,Oe==null?void 0:Oe.targetColumn]),Er=d.useRef(),li=d.useRef(),Oi=d.useCallback((y,A)=>{var B;const[F,U]=A;return vr(Ue,(B=St[F])==null?void 0:B.themeOverride,zn==null?void 0:zn(U),y.themeOverride)},[zn,St,Ue]),{mapper:$r}=Z0(Ve,b),Kn=Ve==null?void 0:Ve.navigationBehavior,Pi=d.useCallback(y=>{var be,_e,we;const A=ca.value?y.metaKey:y.ctrlKey,F=A&&se==="multi",U=A&&rt==="multi",[B,J]=y.location,Y=K.columns,Z=K.rows,[ee,ne]=((be=K.current)==null?void 0:be.cell)??[];if(y.kind==="cell"){if(li.current=void 0,Nr.current=[B,J],B===0&&$n){if(Kt===!0&&J===je||Rn==="number"||se==="none")return;const Fe=Pn(y.location);if(Fe.kind!==Yn.Marker)return;if(We!==void 0){const qe=Ct(Fe);Fn((qe==null?void 0:qe.kind)===Yn.Marker);const Le=(_e=qe==null?void 0:qe.onClick)==null?void 0:_e.call(qe,{...y,cell:Fe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Oi(Fe,y.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Fe.checked)return}o(void 0),kn();const Te=Z.hasIndex(J),gt=Er.current;if(se==="multi"&&(y.shiftKey||y.isLongTouch===!0)&>!==void 0&&Z.hasIndex(gt)){const qe=[Math.min(gt,J),Math.max(gt,J)+1];F||Ae==="multi"?ke(void 0,qe,!0):ke(mt.fromSingleSelection(qe),void 0,F)}else se==="multi"&&(F||y.isTouch||Ae==="multi")?Te?ke(Z.remove(J),void 0,!0):(ke(void 0,J,!0),Er.current=J):Te&&Z.length===1?ke(mt.empty(),void 0,A):(ke(mt.fromSingleSelection(J),void 0,A),Er.current=J)}else if(B>=q&&Kt&&J===je){const Fe=Io(B);si(Fe??B)}else if(ee!==B||ne!==J){const Fe=Pn(y.location),Te=Ct(Fe);if((Te==null?void 0:Te.onSelect)!==void 0){let Le=!1;if(Te.onSelect({...y,cell:Fe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Le=!0,theme:Oi(Fe,y.location)}),Le)return}if(Kn==="block"&&$r(J).isGroupHeader)return;const gt=kr&&J===je,qe=kr&&K!==void 0&&((we=K.current)==null?void 0:we.cell[1])===je;if((y.shiftKey||y.isLongTouch===!0)&&ee!==void 0&&ne!==void 0&&K.current!==void 0&&!qe){if(gt)return;const Le=Math.min(B,ee),Mt=Math.max(B,ee),jt=Math.min(J,ne),an=Math.max(J,ne);kt({...K.current,range:{x:Le,y:jt,width:Mt-Le+1,height:an-jt+1}},!0,A,"click"),Er.current=void 0,kn()}else kt({cell:[B,J],range:{x:B,y:J,width:1,height:1}},!0,A,"click"),Er.current=void 0,o(void 0),kn()}}else if(y.kind==="header")if(Nr.current=[B,J],o(void 0),$n&&B===0)Er.current=void 0,li.current=void 0,se==="multi"&&(Z.length!==je?ke(mt.fromSingleSelection([0,je]),void 0,A):ke(mt.empty(),void 0,A),kn());else{const Fe=li.current;if(rt==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Fe!==void 0&&Y.hasIndex(Fe)){const Te=[Math.min(Fe,B),Math.max(Fe,B)+1];U?Ge(void 0,Te,A):Ge(mt.fromSingleSelection(Te),void 0,A)}else U?(Y.hasIndex(B)?Ge(Y.remove(B),void 0,A):Ge(void 0,B,A),li.current=B):rt!=="none"&&(Ge(mt.fromSingleSelection(B),void 0,A),li.current=B);Er.current=void 0,kn()}else y.kind===qn?Nr.current=[B,J]:y.kind===da&&!y.isMaybeScrollbar&&(Ce(Uo,!1),o(void 0),kn(),xt==null||xt(),Er.current=void 0,li.current=void 0)},[se,rt,K,$n,q,Kt,je,Rn,Pn,We,kn,Ae,Ct,Oi,ke,Io,si,Kn,$r,kr,kt,Ge,Ce,xt]),_i=d.useRef(!1),Nr=d.useRef(),bl=d.useRef(zr),Bn=d.useRef(),Hf=d.useCallback(y=>{if(ui.current=!1,bl.current=en.current,y.button!==0&&y.button!==1){Bn.current=void 0;return}const A=performance.now();Bn.current={button:y.button,time:A,location:y.location},(y==null?void 0:y.kind)==="header"&&(_i.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:F}),Nr.current=void 0,!y.isTouch&&y.button===0&&!F?Pi(y):!y.isTouch&&y.button===1&&(Nr.current=y.location))},[K,Pi]),[Ha,za]=d.useState(),wl=d.useCallback(y=>{if(y.kind!==qn||rt!=="multi")return;const A=ca.value?y.metaKey:y.ctrlKey,[F]=y.location,U=K.columns;if(F<q)return;const B=St[F];let J=F,Y=F;for(let Z=F-1;Z>=q&&ao(B.group,St[Z].group);Z--)J--;for(let Z=F+1;Z<St.length&&ao(B.group,St[Z].group);Z++)Y++;if(kn(),A)if(U.hasAll([J,Y+1])){let Z=U;for(let ee=J;ee<=Y;ee++)Z=Z.remove(ee);Ge(Z,void 0,A)}else Ge(void 0,[J,Y+1],A);else Ge(mt.fromSingleSelection([J,Y+1]),void 0,A)},[rt,kn,K.columns,St,q,Ge]),ui=d.useRef(!1),To=d.useCallback(async y=>{if(cn!==void 0&&xe!==void 0){const A=en.current.y,F=en.current.height;let U=cn({x:y,y:A,width:1,height:Math.min(F,je-A)},un.current.signal);typeof U!="object"&&(U=await U());const B=Jt[y-q],Y=document.createElement("canvas").getContext("2d",{alpha:!1});if(Y!==null){Y.font=Ue.baseFontFull;const Z=kd(Y,Ue,B,0,U,ir,Hr,!1,Ct);xe==null||xe(B,Z.width,y,Z.width)}}},[Jt,cn,Hr,Ue,ir,xe,q,je,Ct]),[zf,Va]=d.useState(),ci=d.useCallback(async(y,A)=>{var Z,ee;const F=(Z=y.current)==null?void 0:Z.range;if(F===void 0||cn===void 0||A.current===void 0)return;const U=A.current.range;if(R!==void 0){let ne=!1;if(R({fillDestination:{...U,x:U.x-q},patternSource:{...F,x:F.x-q},preventDefault:()=>ne=!0}),ne)return}let B=cn(F,un.current.signal);typeof B!="object"&&(B=await B());const J=B,Y=[];for(let ne=0;ne<U.width;ne++)for(let be=0;be<U.height;be++){const _e=[U.x+ne,U.y+be];if(fd(_e,F))continue;const we=J[be%F.height][ne%F.width];mi(we)||!Ji(we)||Y.push({location:_e,value:{...we}})}Nn(Y),(ee=Tn.current)==null||ee.damage(Y.map(ne=>({cell:ne.location})))},[cn,Nn,R,q]),yl=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};ci(y,K)},[ci,K]),Cl=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};ci(y,K)},[ci,K]),Vf=d.useCallback((y,A)=>{var be,_e;const F=s;if(u(void 0),La(void 0),Va(void 0),_i.current=!1,A)return;if((F==null?void 0:F.fillHandle)===!0&&K.current!==void 0&&((be=F.previousSelection)==null?void 0:be.current)!==void 0){if(Vr===void 0)return;const we={...K,current:{...K.current,range:Td(F.previousSelection.current.range,Vr)}};ci(F.previousSelection,we),Ce(we,!0);return}const[U,B]=y.location,[J,Y]=Nr.current??[],Z=()=>{ui.current=!0},ee=we=>{var Te,gt,qe;const Fe=we.isTouch||J===U&&Y===B;if(Fe&&(O==null||O([U-q,B],{...we,preventDefault:Z})),we.button===1)return!ui.current;if(!ui.current){const Le=Pn(y.location),Mt=Ct(Le);if(Mt!==void 0&&Mt.onClick!==void 0&&Fe){const an=Mt.onClick({...we,cell:Le,posX:we.localEventX,posY:we.localEventY,bounds:we.bounds,theme:Oi(Le,y.location),preventDefault:Z});an!==void 0&&!mi(an)&&hi(an)&&(Nn([{location:we.location,value:an}]),(Te=Tn.current)==null||Te.damage([{cell:we.location}]))}if(ui.current||K.current===void 0)return!1;let jt=!1;switch(Le.activationBehaviorOverride??it){case"double-click":case"second-click":{if(((qe=(gt=F==null?void 0:F.previousSelection)==null?void 0:gt.current)==null?void 0:qe.cell)===void 0)break;const[an,Jn]=K.current.cell,[ar,Qn]=F.previousSelection.current.cell;jt=U===an&&U===ar&&B===Jn&&B===Qn&&(we.isDoubleClick===!0||it==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return S==null||S([U-q,B]),ai(we.bounds,!1),!0}return!1},ne=y.location[0]-q;if(y.isTouch){const we=en.current,Fe=bl.current;if(we.x!==Fe.x||we.y!==Fe.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&to((_e=K.current)==null?void 0:_e.cell,y.location)){N==null||N([ne,y.location[1]],{...y,preventDefault:Z});return}else if(y.kind==="header"&&K.columns.hasIndex(U)){re==null||re(ne,{...y,preventDefault:Z});return}else if(y.kind===qn){if(ne<0)return;G==null||G(ne,{...y,preventDefault:Z});return}}y.kind==="cell"?ee(y)||Pi(y):y.kind===qn?z==null||z(ne,{...y,preventDefault:Z}):(y.kind===Or&&(C==null||C(ne,{...y,preventDefault:Z})),Pi(y));return}if(y.kind==="header"){if(ne<0)return;y.isEdge?y.isDoubleClick===!0&&To(U):y.button===0&&U===J&&B===Y&&(C==null||C(ne,{...y,preventDefault:Z}))}if(y.kind===qn){if(ne<0)return;y.button===0&&U===J&&B===Y&&(z==null||z(ne,{...y,preventDefault:Z}),ui.current||wl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&ee(y),Nr.current=void 0},[s,K,q,Vr,ci,Ce,O,Pn,Ct,it,Oi,Nn,S,ai,N,re,G,Pi,z,C,To,wl]),$f=d.useCallback(y=>{const A={...y,location:[y.location[0]-q,y.location[1]]};Pe==null||Pe(A),s!==void 0&&y.buttons===0&&(u(void 0),La(void 0),Va(void 0),_i.current=!1),Va(F=>{var U;return _i.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===(F==null?void 0:F[0])&&y.scrollEdge[1]===F[1]?F:s===void 0||(((U=Bn.current)==null?void 0:U.location[0])??0)<q?void 0:y.scrollEdge})},[s,Pe,q]),Nf=d.useCallback((y,A)=>{Qe==null||Qe(y-q,A)},[Qe,q]),Bf=d.useCallback((y,A)=>{vt==null||vt(y-q,A)},[vt,q]),or=(Tl=K==null?void 0:K.current)==null?void 0:Tl.cell,Wf=d.useCallback((y,A,F,U,B,J)=>{Mr.current=!1;let Y=or;Y!==void 0&&(Y=[Y[0]-q,Y[1]]);const Z=ue===0?void 0:{x:0,y:y.y,width:ue,height:y.height},ee=[];Z!==void 0&&ee.push(Z),Lt>0&&(ee.push({x:y.x-q,y:je-Lt,width:y.width,height:Lt}),ue>0&&ee.push({x:0,y:je-Lt,width:ue,height:Lt}));const ne={x:y.x-q,y:y.y,width:y.width,height:Kt&&y.y+y.height>=je?y.height-1:y.height,tx:B,ty:J,extras:{selected:Y,freezeRegion:Z,freezeRegions:ee}};en.current=ne,Rr(ne),sn([A,F,U]),nn==null||nn(ne,ne.tx,ne.ty,ne.extras)},[or,q,Kt,je,ue,Lt,Rr,nn]),Uf=Yr(Re,d.useCallback((y,A)=>{Re==null||Re(y-q,A-q),rt!=="none"&&Ge(mt.fromSingleSelection(A),void 0,!0)},[rt,Re,q,Ge])),$a=d.useRef(!1),qf=d.useCallback(y=>{if(y.location[0]===0&&q>0){y.preventDefault();return}ze==null||ze({...y,location:[y.location[0]-q,y.location[1]]}),y.defaultPrevented()||($a.current=!0),u(void 0)},[ze,q]),Yf=d.useCallback(()=>{$a.current=!1},[]),Sl=Ve==null?void 0:Ve.selectionBehavior,Do=d.useCallback(y=>{if(Sl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:U}=$r(y);if(A)return[y,y];const B=F[F.length-1],J=y-B,Y=y+U-B-1;return[J,Y]},[$r,Sl]),Na=d.useRef(),Ba=d.useCallback(y=>{var A,F,U;if(!Fd(y,Na.current)&&(Na.current=y,!(((A=Bn==null?void 0:Bn.current)==null?void 0:A.button)!==void 0&&Bn.current.button>=1))){if(y.buttons!==0&&s!==void 0&&((F=Bn.current)==null?void 0:F.location[0])===0&&y.location[0]===0&&q===1&&se==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Bn.current.location[1])&&K.rows.hasIndex(Bn.current.location[1])){const B=Math.min(Bn.current.location[1],y.location[1]),J=Math.max(Bn.current.location[1],y.location[1])+1;ke(mt.fromSingleSelection([B,J]),void 0,!1)}if(y.buttons!==0&&s!==void 0&&K.current!==void 0&&!$a.current&&!_i.current&&(wt==="rect"||wt==="multi-rect")){const[B,J]=K.current.cell;let[Y,Z]=y.location;if(Z<0&&(Z=en.current.y),s.fillHandle===!0&&((U=s.previousSelection)==null?void 0:U.current)!==void 0){const ee=s.previousSelection.current.range;Z=Math.min(Z,Kt?je-1:je);const ne=Vp(ee,Y,Z,fn);La(ne)}else{if(Kt&&J===je)return;if(Kt&&Z===je)if(y.kind===da)Z--;else return;Y=Math.max(Y,q);const be=Do(J);Z=be===void 0?Z:Un(Z,be[0],be[1]);const _e=Y-B,we=Z-J,Fe={x:_e>=0?B:Y,y:we>=0?J:Z,width:Math.abs(_e)+1,height:Math.abs(we)+1};kt({...K.current,range:Fe},!0,!1,"drag")}}Yt==null||Yt({...y,location:[y.location[0]-q,y.location[1]]})}},[s,q,se,K,wt,Yt,ke,Kt,je,fn,Do,kt]),Xf=d.useCallback(()=>{var Y,Z;const y=Na.current;if(y===void 0)return;const[A,F]=y.scrollEdge;let[U,B]=y.location;const J=en.current;A===-1?U=((Z=(Y=J.extras)==null?void 0:Y.freezeRegion)==null?void 0:Z.x)??J.x:A===1&&(U=J.x+J.width),F===-1?B=Math.max(0,J.y):F===1&&(B=Math.min(je-1,J.y+J.height)),U=Un(U,0,St.length-1),B=Un(B,0,je-1),Ba({...y,location:[U,B]})},[St.length,Ba,je]);Y0(zf,Ut,Xf);const Zn=d.useCallback(y=>{if(K.current===void 0)return;const[A,F]=y,[U,B]=K.current.cell,J=K.current.range;let Y=J.x,Z=J.x+J.width,ee=J.y,ne=J.y+J.height;const[be,_e]=Do(B)??[0,je-1],we=_e+1;if(F!==0)switch(F){case 2:{ne=we,ee=B,on(0,ne,"vertical");break}case-2:{ee=be,ne=B+1,on(0,ee,"vertical");break}case 1:{ee<B?(ee++,on(0,ee,"vertical")):(ne=Math.min(we,ne+1),on(0,ne,"vertical"));break}case-1:{ne>B+1?(ne--,on(0,ne,"vertical")):(ee=Math.max(be,ee-1),on(0,ee,"vertical"));break}default:oo()}if(A!==0)if(A===2)Z=St.length,Y=U,on(Z-1-q,0,"horizontal");else if(A===-2)Y=q,Z=U+1,on(Y-q,0,"horizontal");else{let Fe=[];if(cn!==void 0){const Te=cn({x:Y,y:ee,width:Z-Y-q,height:ne-ee},un.current.signal);typeof Te=="object"&&(Fe=nv(Te))}if(A===1){let Te=!1;if(Y<U){if(Fe.length>0){const gt=lr(Y+1,U+1).find(qe=>!Fe.includes(qe-q));gt!==void 0&&(Y=gt,Te=!0)}else Y++,Te=!0;Te&&on(Y,0,"horizontal")}Te||(Z=Math.min(St.length,Z+1),on(Z-1-q,0,"horizontal"))}else if(A===-1){let Te=!1;if(Z>U+1){if(Fe.length>0){const gt=lr(Z-1,U,-1).find(qe=>!Fe.includes(qe-q));gt!==void 0&&(Z=gt,Te=!0)}else Z--,Te=!0;Te&&on(Z-q,0,"horizontal")}Te||(Y=Math.max(q,Y-1),on(Y-q,0,"horizontal"))}else oo()}kt({cell:K.current.cell,range:{x:Y,y:ee,width:Z-Y,height:ne-ee}},!0,!1,"keyboard-select")},[cn,Do,K,St.length,q,je,on,kt]),Wa=d.useRef(xi);Wa.current=xi;const Ir=d.useCallback((y,A,F,U)=>{const B=bn-(F?0:1);y=Un(y,q,Jt.length-1+q),A=Un(A,0,B);const J=or==null?void 0:or[0],Y=or==null?void 0:or[1];if(y===J&&A===Y)return!1;if(U&&K.current!==void 0){const Z=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&Z.push(K.current.range),Ce({...K,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:Z}},!0)}else kt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Wa.current&&on(y-q,A),!0},[bn,q,Jt.length,or,K,on,Ce,kt]),jf=d.useCallback((y,A)=>{(i==null?void 0:i.cell)!==void 0&&y!==void 0&&hi(y)&&(Nn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{var B;(B=Tn.current)==null||B.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[F,U]=A;if(K.current!==void 0&&(F!==0||U!==0)){const B=K.current.cell[1]===bn-1&&y!==void 0;Ir(Un(K.current.cell[0]+F,0,St.length-1),Un(K.current.cell[1]+U,0,bn-1),B,!1)}_==null||_(y,A)},[i==null?void 0:i.cell,kn,K,_,Nn,bn,Ir,St.length]),Gf=d.useMemo(()=>`gdg-overlay-${tv++}`,[]),Br=d.useCallback(y=>{var F,U,B,J;kn();const A=[];for(let Y=y.x;Y<y.x+y.width;Y++)for(let Z=y.y;Z<y.y+y.height;Z++){const ee=M([Y-q,Z]);if(!ee.allowOverlay&&ee.kind!==te.Boolean)continue;let ne;if(ee.kind===te.Custom){const be=Ct(ee),_e=(F=be==null?void 0:be.provideEditor)==null?void 0:F.call(be,ee);(be==null?void 0:be.onDelete)!==void 0?ne=be.onDelete(ee):Og(_e)&&(ne=(U=_e==null?void 0:_e.deletedValue)==null?void 0:U.call(_e,ee))}else if(hi(ee)&&ee.allowOverlay||ee.kind===te.Boolean){const be=Ct(ee);ne=(B=be==null?void 0:be.onDelete)==null?void 0:B.call(be,ee)}ne!==void 0&&!mi(ne)&&hi(ne)&&A.push({location:[Y,Z],value:ne})}Nn(A),(J=Tn.current)==null||J.damage(A.map(Y=>({cell:Y.location})))},[kn,M,Ct,Nn,q]),Li=i!==void 0,xl=d.useCallback(y=>{var gt,qe;const A=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:U}=y,B=K.columns,J=K.rows,Y=Vn;if(!Li&&ut(Y.clear,y,F))Ce(Uo,!1),xt==null||xt();else if(!Li&&ut(Y.selectAll,y,F))Ce({columns:mt.empty(),rows:mt.empty(),current:{cell:((gt=K.current)==null?void 0:gt.cell)??[q,0],range:{x:q,y:0,width:w.length,height:je},rangeStack:[]}},!1);else if(ut(Y.search,y,F))(qe=a==null?void 0:a.current)==null||qe.focus({preventScroll:!0}),ii(!0);else if(ut(Y.delete,y,F)){const Le=(Ie==null?void 0:Ie(K))??!0;if(Le!==!1){const Mt=Le===!0?K:Le;if(Mt.current!==void 0){Br(Mt.current.range);for(const jt of Mt.current.rangeStack)Br(jt)}for(const jt of Mt.rows)Br({x:q,y:jt,width:w.length,height:1});for(const jt of Mt.columns)Br({x:jt,y:0,width:1,height:je})}}if(F.didMatch)return A(),!0;if(K.current===void 0)return!1;let[Z,ee]=K.current.cell;const[,ne]=K.current.cell;let be=!1,_e=!1;if(ut(Y.scrollToSelectedCell,y,F)?_o.current(Z-q,ee):rt!=="none"&&ut(Y.selectColumn,y,F)?B.hasIndex(Z)?Ge(B.remove(Z),void 0,!0):rt==="single"?Ge(mt.fromSingleSelection(Z),void 0,!0):Ge(void 0,Z,!0):se!=="none"&&ut(Y.selectRow,y,F)?J.hasIndex(ee)?ke(J.remove(ee),void 0,!0):se==="single"?ke(mt.fromSingleSelection(ee),void 0,!0):ke(void 0,ee,!0):!Li&&U!==void 0&&ut(Y.activateCell,y,F)?ee===je&&Kt?window.setTimeout(()=>{const Le=Io(Z);si(Le??Z)},0):(S==null||S([Z-q,ee]),ai(U,!0)):K.current.range.height>1&&ut(Y.downFill,y,F)?Cl():K.current.range.width>1&&ut(Y.rightFill,y,F)?yl():ut(Y.goToNextPage,y,F)?ee+=Math.max(1,en.current.height-4):ut(Y.goToPreviousPage,y,F)?ee-=Math.max(1,en.current.height-4):ut(Y.goToFirstCell,y,F)?(o(void 0),ee=0,Z=0):ut(Y.goToLastCell,y,F)?(o(void 0),ee=Number.MAX_SAFE_INTEGER,Z=Number.MAX_SAFE_INTEGER):ut(Y.selectToFirstCell,y,F)?(o(void 0),Zn([-2,-2])):ut(Y.selectToLastCell,y,F)?(o(void 0),Zn([2,2])):Li?(ut(Y.closeOverlay,y,F)&&o(void 0),ut(Y.acceptOverlayDown,y,F)&&(o(void 0),ee++),ut(Y.acceptOverlayUp,y,F)&&(o(void 0),ee--),ut(Y.acceptOverlayLeft,y,F)&&(o(void 0),Z--),ut(Y.acceptOverlayRight,y,F)&&(o(void 0),Z++)):(ut(Y.goDownCell,y,F)?ee+=1:ut(Y.goUpCell,y,F)?ee-=1:ut(Y.goRightCell,y,F)?Z+=1:ut(Y.goLeftCell,y,F)?Z-=1:ut(Y.goDownCellRetainSelection,y,F)?(ee+=1,be=!0):ut(Y.goUpCellRetainSelection,y,F)?(ee-=1,be=!0):ut(Y.goRightCellRetainSelection,y,F)?(Z+=1,be=!0):ut(Y.goLeftCellRetainSelection,y,F)?(Z-=1,be=!0):ut(Y.goToLastRow,y,F)?ee=je-1:ut(Y.goToFirstRow,y,F)?ee=Number.MIN_SAFE_INTEGER:ut(Y.goToLastColumn,y,F)?Z=Number.MAX_SAFE_INTEGER:ut(Y.goToFirstColumn,y,F)?Z=Number.MIN_SAFE_INTEGER:(wt==="rect"||wt==="multi-rect")&&(ut(Y.selectGrowDown,y,F)?Zn([0,1]):ut(Y.selectGrowUp,y,F)?Zn([0,-1]):ut(Y.selectGrowRight,y,F)?Zn([1,0]):ut(Y.selectGrowLeft,y,F)?Zn([-1,0]):ut(Y.selectToLastRow,y,F)?Zn([0,2]):ut(Y.selectToFirstRow,y,F)?Zn([0,-2]):ut(Y.selectToLastColumn,y,F)?Zn([2,0]):ut(Y.selectToFirstColumn,y,F)&&Zn([-2,0])),_e=F.didMatch),Kn!==void 0&&Kn!=="normal"&&ee!==ne){const Le=Kn==="skip-up"||Kn==="skip"||Kn==="block",Mt=Kn==="skip-down"||Kn==="skip"||Kn==="block",jt=ee<ne;if(jt&&Le){for(;ee>=0&&$r(ee).isGroupHeader;)ee--;ee<0&&(ee=ne)}else if(!jt&&Mt){for(;ee<je&&$r(ee).isGroupHeader;)ee++;ee>=je&&(ee=ne)}}const Fe=Ir(Z,ee,!1,be),Te=F.didMatch;return Te&&(Fe||!_e||Gt)&&A(),Te},[Kn,Li,K,Vn,rt,se,wt,q,$r,je,Ir,Ce,xt,w.length,Ie,Gt,Br,Ge,ke,Kt,Io,si,S,ai,Cl,yl,Zn]),Fi=d.useCallback(y=>{let A=!1;if(W!==void 0&&W({...y,cancel:()=>{A=!0}}),A||xl(y)||K.current===void 0)return;const[F,U]=K.current.cell,B=en.current;if(He&&!y.metaKey&&!y.ctrlKey&&K.current!==void 0&&y.key.length===1&&/[ -~]/g.test(y.key)&&y.bounds!==void 0&&Ji(M([F-q,Math.max(0,Math.min(U,je-1))]))){if((!Kt||U!==je)&&(B.y>U||U>B.y+B.height||B.x>F||F>B.x+B.width))return;ai(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[He,W,xl,K,M,q,je,Kt,ai]),Kf=d.useCallback((y,A)=>{const F=y.location[0]-q;if(y.kind==="header"&&(re==null||re(F,{...y,preventDefault:A})),y.kind===qn){if(F<0)return;G==null||G(F,{...y,preventDefault:A})}if(y.kind==="cell"){const[U,B]=y.location;N==null||N([F,B],{...y,preventDefault:A}),Lm(K,y.location)||Ir(U,B,!1,!1)}},[K,N,G,re,q,Ir]),Ua=d.useCallback(async y=>{var Y,Z,ee;if(!Vn.paste)return;function A(ne,be,_e,we){var Te,gt;const Fe=typeof _e=="object"?(_e==null?void 0:_e.join(`
|
172
|
+
`&&(n.push(r),r=[])),o=t.None);break}a++}return i<e.length&&r.push(Ou(e.slice(i,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Pu(e,t,n){var l;const r=H0(e,t),i=s=>{var u;(u=window.navigator.clipboard)==null||u.writeText(s)},o=(s,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(s,u)=>{var c,f;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",s),(f=n==null?void 0:n.clipboardData)==null||f.setData("text/html",u)}catch{o(s,u)||i(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Hd(e){return e!==!0}function _u(e){return typeof e=="string"?e:`${e}px`}const $0=()=>e=>e.innerWidth,N0=()=>e=>e.innerHeight,B0=mn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[$0()],"wmyidgi-1":[N0()]}}),W0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return d.createElement(B0,{innerHeight:_u(n),innerWidth:_u(t),...i},r)},U0=2,q0=1300;function Y0(e,t,n){const r=At.useRef(0),[i,o]=e??[0,0];At.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let a=!1,l=0;const s=u=>{var c;if(!a){if(l===0)l=u;else{const f=u-l;r.current=Math.min(1,r.current+f/q0);const g=r.current**1.618*f*U0;(c=t.current)==null||c.scrollBy(i*g,o*g),l=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,i,o,n])}function X0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:a,remSize:l}){const[s,u,c,f,g,h]=At.useMemo(()=>{if(!a||l===16)return[e,t,n,r,i,o];const m=l/16,p=e,v=Sd();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??v.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??v.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:f,overscrollX:g,overscrollY:h}}const Dr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=ca.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function j0(e){const t=rm(e);return At.useMemo(()=>{if(t===void 0)return Lu(Dr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Dr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Dr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Dr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Dr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Dr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Dr.selectToLastCell};return Lu({...Dr,...n})},[t])}function G0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const a={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(a.subGroups=r.subGroups.map((l,s)=>t(l,i+1,[...o,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),a}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Zs(e,t){const n=[];function r(a,l,s=!1){let u=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const f=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:l;r(a.subGroups[c],f,s||a.isCollapsed)}}const i=G0(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;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function fa(e,t){if(t===void 0||Zs.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(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function K0(e,t,n,r){const i=At.useMemo(()=>e===void 0?void 0:Zs(e,t),[e,t]),o=At.useMemo(()=>i===void 0?t:i.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[i,t]),a=At.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=fa(u,i);return c?e.height:typeof n=="number"?n:n(u)},[i,e,n]),l=At.useCallback(u=>{if(i===void 0)return u;let c=u;for(const f of i){if(c===0)return;if(c--,!f.isCollapsed){if(c<f.rows)return f.contentIndex+c;c-=f.rows}}return u},[i]),s=Yr(r??(e==null?void 0:e.themeOverride),At.useCallback(u=>{if(e===void 0)return r==null?void 0:r(u,u,u);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:f,groupIndex:g}=fa(u,i);return c?e.themeOverride:r==null?void 0:r(u,g,f)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:o,rowNumberMapper:l,getRowThemeOverride:s}}function Z0(e,t){const n=At.useMemo(()=>e===void 0?void 0:Zs(e,t),[e,t]);return{getRowGroupingForPath:Vd,updateRowGroupingByPath:zd,mapper:At.useCallback(r=>{if(typeof r=="number")return fa(r,n);const i=fa(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function zd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,a)=>a===r?{...o,...n}:o):e.map((o,a)=>a===r?{...o,subGroups:zd(o.subGroups??[],i,n)}:o)}function Vd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Vd(e[n].subGroups??[],r)}function J0(e,t){const[n]=d.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 Q0(e,t,n,r,i){const[o,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,o]),[s,u,c]=nm(l),f=d.useRef(i);f.current=i;const g=J0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),f.current()}},[t,h,c,g]);const m=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),f.current()}},[e,m,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const ev=d.lazy(async()=>await Fs(()=>import("./data-grid-overlay-editor.CmXS0PAX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let tv=0;function nv(e){return ap(yu(yu(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return lr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Bo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Wo={kind:te.Loading,allowOverlay:!1},Uo={columns:mt.empty(),rows:mt.empty(),current:void 0},rv=(e,t)=>{var Il,Tl,Dl;const[n,r]=d.useState(Uo),[i,o]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,u]=d.useState(),c=d.useRef(),f=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:v,columns:w,rows:b,getCellContent:M,onCellClicked:O,onCellActivated:S,onFillPattern:R,onFinishedEditing:_,coercePasteValue:E,drawHeader:x,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:X,onHeaderContextMenu:re,getCellsForSelection:j,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:ae,onCellEdited:ie,onCellsEdited:le,onSearchResultsChanged:fe,searchResults:Q,onSearchValueChange:H,searchValue:P,onKeyDown:W,onKeyUp:ce,keybindings:De,editOnType:He=!0,onRowAppended:ye,onColumnMoved:Re,validateCell:Se,highlightRegions:Et,rangeSelect:wt="rect",columnSelect:rt="multi",rowSelect:se="multi",rangeSelectionBlending:et="exclusive",columnSelectionBlending:me="exclusive",rowSelectionBlending:he="exclusive",onDelete:pe,onDragStart:ze,onMouseMove:Pe,onPaste:tt,copyHeaders:ve=!1,freezeColumns:ue=0,cellActivationBehavior:it="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:Qe,onHeaderIndicatorClick:vt,getGroupDetails:ht,rowGrouping:Ve,onSearchClose:Dt,onItemHovered:Yt,onSelectionCleared:xt,showSearch:_t,onVisibleRegionChanged:nn,gridSelection:zt,onGridSelectionChange:ln,minColumnWidth:It=50,maxColumnWidth:yt=500,maxColumnAutoWidth:Dn,provideEditor:yn,trailingRowOptions:Oe,freezeTrailingRows:Lt=0,allowedFillDirections:fn="orthogonal",scrollOffsetX:hn,scrollOffsetY:pn,verticalBorder:at,onDragOverCell:Xt,onDrop:Ot,onColumnResize:rn,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:Be,fillHandle:Bt,experimental:Pt,fixedShadowX:Vt,fixedShadowY:$t,headerIcons:Cn,imageWindowLoader:nr,initialSize:Hn,isDraggable:V,onDragLeave:Je,onRowMoved:We,overscrollX:de,overscrollY:st,preventDiagonalScrolling:Wt,rightElement:dn,rightElementProps:Zt,trapFocus:Gt=!1,smoothScrollX:Sn,smoothScrollY:vn,scaleToRem:Cr=!1,rowHeight:Xn=34,headerHeight:po=36,groupHeaderHeight:Ia=po,theme:ei,isOutsideClick:Sr,renderers:Si,resizeIndicator:Ta,scrollToActiveCell:xi=!0,drawFocusRing:ki=!0}=e,Ar=ki==="no-editor"?i===void 0:ki,Qt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=(Qt==null?void 0:Qt.kind)??e.rowMarkers??"none",Mi=(Qt==null?void 0:Qt.width)??e.rowMarkerWidth,Ri=(Qt==null?void 0:Qt.startIndex)??e.rowMarkerStartIndex??1,ti=(Qt==null?void 0:Qt.theme)??e.rowMarkerTheme,fr=Qt==null?void 0:Qt.headerTheme,hr=Qt==null?void 0:Qt.headerAlwaysVisible,ni=se!=="multi",rr=(Qt==null?void 0:Qt.checkboxStyle)??"square",ir=Math.max(It,20),Hr=Math.max(yt,ir),vo=Math.max(Dn??Hr,ir),Ei=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:bo,rowHeight:wo,getRowThemeOverride:zn}=K0(Ve,b,Xn,h),yo=d.useMemo(()=>Number.parseFloat(Ei.fontSize),[Ei]),{rowHeight:jn,headerHeight:Ii,groupHeaderHeight:Co,theme:So,overscrollX:Da,overscrollY:Oa}=X0({groupHeaderHeight:Ia,headerHeight:po,overscrollX:de,overscrollY:st,remSize:yo,rowHeight:wo,scaleToRem:Cr,theme:ei}),Vn=j0(De),xr=Mi??(b>1e4?48:b>1e3?44:b>100?36:32),$n=Rn!=="none",q=$n?1:0,Kt=ye!==void 0,kr=(Oe==null?void 0:Oe.sticky)===!0,[ri,ii]=d.useState(!1),Ti=_t??ri,Pa=d.useCallback(()=>{Dt!==void 0?Dt():ii(!1)},[Dt]),K=d.useMemo(()=>zt===void 0?void 0:Bo(zt,q),[zt,q])??n,un=d.useRef();un.current===void 0&&(un.current=new AbortController),d.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,_a]=O0(j,M,q,un.current,je),$=d.useCallback((y,A,F)=>{if(Se===void 0)return!0;const U=[y[0]-q,y[1]];return Se==null?void 0:Se(U,A,F)},[q,Se]),oe=d.useRef(zt),Ce=d.useCallback((y,A)=>{A&&(y=z0(y,cn,q,k,un.current)),ln!==void 0?(oe.current=Bo(y,-q),ln(oe.current)):r(y)},[ln,cn,q,k]),xe=Yr(rn,d.useCallback((y,A,F,U)=>{rn==null||rn(w[F-q],A,F-q,U)},[rn,q,w])),ge=Yr(Tt,d.useCallback((y,A,F,U)=>{Tt==null||Tt(w[F-q],A,F-q,U)},[Tt,q,w])),Me=Yr(Ft,d.useCallback((y,A,F,U)=>{Ft==null||Ft(w[F-q],A,F-q,U)},[Ft,q,w])),nt=Yr(x,d.useCallback((y,A)=>(x==null?void 0:x({...y,columnIndex:y.columnIndex-q},A))??!1,[x,q])),ot=Yr(L,d.useCallback((y,A)=>(L==null?void 0:L({...y,col:y.col-q},A))??!1,[L,q])),Ie=d.useCallback(y=>{if(pe!==void 0){const A=pe(Bo(y,-q));return typeof A=="boolean"?A:Bo(A,q)}return!0},[pe,q]),[kt,ke,Ge]=D0(K,Ce,et,me,he,wt,T),Ue=d.useMemo(()=>vr(Sd(),So),[So]),[ft,sn]=d.useState([0,0,0]),En=d.useMemo(()=>{if(Si===void 0)return{};const y={};for(const A of Si)y[A.kind]=A;return y},[Si]),Ct=d.useCallback(y=>y.kind!==te.Custom?En[y.kind]:Be==null?void 0:Be.find(A=>A.isMatch(y)),[Be,En]);let{sizedColumns:Jt,nonGrowWidth:Gn}=Zm(w,je,_a,ft[0]-(q===0?0:xr)-ft[2],ir,vo,Ue,Ct,un.current);Rn!=="none"&&(Gn+=xr);const xn=d.useMemo(()=>Jt.some(y=>y.group!==void 0),[Jt]),Rt=xn?Ii+Co:Ii,In=K.rows.length,On=Rn==="none"?void 0:In===0?!1:In===je?!0:void 0,St=d.useMemo(()=>Rn==="none"?Jt:[{title:"",width:xr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ti,rowMarker:rr,rowMarkerChecked:On,headerRowMarkerTheme:fr,headerRowMarkerAlwaysVisible:hr,headerRowMarkerDisabled:ni},...Jt],[Rn,Jt,xr,ti,rr,On,fr,hr,ni]),en=d.useRef({height:1,width:1,x:0,y:0}),Mr=d.useRef(!1),{setVisibleRegion:Rr,visibleRegion:zr,scrollRef:Ut}=Q0(hn,pn,jn,en,()=>Mr.current=!0);en.current=zr;const Ff=zr.x+q,xo=zr.y,Tn=d.useRef(null),kn=d.useCallback(y=>{var A;y===!0?(A=Tn.current)==null||A.focus():window.requestAnimationFrame(()=>{var F;(F=Tn.current)==null||F.focus()})},[]),bn=Kt?je+1:je,Nn=d.useCallback(y=>{const A=q===0?y:y.map(U=>({...U,location:[U.location[0]-q,U.location[1]]})),F=le==null?void 0:le(A);if(F!==!0)for(const U of A)ie==null||ie(U.location,U.value);return F},[ie,le,q]),[Vr,La]=d.useState(),ko=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,oi=Ar?(Il=K.current)==null?void 0:Il.cell:void 0,Mo=oi==null?void 0:oi[0],Ro=oi==null?void 0:oi[1],Af=d.useMemo(()=>{if((Et===void 0||Et.length===0)&&(ko??Mo??Ro??Vr)===void 0)return;const y=[];if(Et!==void 0)for(const A of Et){const F=St.length-A.range.x-q;F>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+q,width:Math.min(F,A.range.width)},style:A.style})}return Vr!==void 0&&y.push({color:jr(Ue.accentColor,0),range:Vr,style:"dashed"}),ko!==void 0&&y.push({color:jr(Ue.accentColor,.5),range:ko,style:"solid-outline"}),Mo!==void 0&&Ro!==void 0&&y.push({color:Ue.accentColor,range:{x:Mo,y:Ro,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Vr,ko,Mo,Ro,Et,St.length,Ue.accentColor,q]),gl=d.useRef(St);gl.current=St;const Pn=d.useCallback(([y,A],F=!1)=>{var J,Y,Z,ee,ne,be,_e;const U=Kt&&A===bn-1;if(y===0&&$n){if(U)return Wo;const we=bo(A);return we===void 0?Wo:{kind:Yn.Marker,allowOverlay:!1,checkboxStyle:rr,checked:(K==null?void 0:K.rows.hasIndex(A))===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Ri+we,drawHandle:We!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(U){const Fe=y===q?(Oe==null?void 0:Oe.hint)??"":"",Te=gl.current[y];if(((J=Te==null?void 0:Te.trailingRowOptions)==null?void 0:J.disabled)===!0)return Wo;{const gt=((Y=Te==null?void 0:Te.trailingRowOptions)==null?void 0:Y.hint)??Fe,qe=((Z=Te==null?void 0:Te.trailingRowOptions)==null?void 0:Z.addIcon)??(Oe==null?void 0:Oe.addIcon);return{kind:Yn.NewRow,hint:gt,allowOverlay:!1,icon:qe}}}else{const we=y-q;if(F||(Pt==null?void 0:Pt.strict)===!0){const Te=en.current,gt=Te.x>we||we>Te.x+Te.width||Te.y>A||A>Te.y+Te.height||A>=Aa.current,qe=we===((ne=(ee=Te.extras)==null?void 0:ee.selected)==null?void 0:ne[0])&&A===((be=Te.extras)==null?void 0:be.selected[1]);let Le=!1;if(((_e=Te.extras)==null?void 0:_e.freezeRegions)!==void 0){for(const Mt of Te.extras.freezeRegions)if(Xr(Mt,we,A)){Le=!0;break}}if(gt&&!qe&&!Le)return Wo}let Fe=M([we,A]);return q!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+q,Fe.span[1]+q]}),Fe}},[Kt,bn,$n,bo,rr,K==null?void 0:K.rows,Rn,Ri,We,q,Oe==null?void 0:Oe.hint,Oe==null?void 0:Oe.addIcon,Pt==null?void 0:Pt.strict,M]),Fa=d.useCallback(y=>{let A=(ht==null?void 0:ht(y))??{name:y};return ae!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>za({group:A.name,bounds:F.bounds})}]}),A},[ht,ae]),Eo=d.useCallback(y=>{var Z;const[A,F]=y.cell,U=St[A],B=(U==null?void 0:U.group)!==void 0?(Z=Fa(U.group))==null?void 0:Z.overrideTheme:void 0,J=U==null?void 0:U.themeOverride,Y=zn==null?void 0:zn(F);o({...y,theme:vr(Ue,B,J,Y,y.content.themeOverride)})},[zn,St,Fa,Ue]),ai=d.useCallback((y,A,F)=>{var Y;if(K.current===void 0)return;const[U,B]=K.current.cell,J=Pn([U,B]);if(J.kind!==te.Boolean&&J.allowOverlay){let Z=J;if(F!==void 0)switch(Z.kind){case te.Number:{const ee=Rg(()=>F==="-"?-0:Number.parseFloat(F),0);Z={...Z,data:Number.isNaN(ee)?0:ee};break}case te.Text:case te.Markdown:case te.Uri:Z={...Z,data:F};break}Eo({target:y,content:Z,initialValue:F,cell:[U,B],highlight:F===void 0,forceEditMode:F!==void 0})}else J.kind===te.Boolean&&A&&J.readonly!==!0&&(Nn([{location:K.current.cell,value:{...J,data:Hd(J.data)}}]),(Y=Tn.current)==null||Y.damage([{cell:K.current.cell}]))},[Pn,K,Nn,Eo]),ml=d.useCallback((y,A)=>{var B;const F=(B=Tn.current)==null?void 0:B.getBounds(y,A);if(F===void 0||Ut.current===null)return;const U=Pn([y,A]);U.allowOverlay&&Eo({target:F,content:U,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[Pn,Ut,Eo]),on=d.useCallback((y,A,F="both",U=0,B=0,J=void 0)=>{if(Ut.current!==null){const Y=Tn.current,Z=l.current,ee=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,ne=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,be=typeof y!="number"&&y.unit==="px"?y.amount:void 0,_e=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(Y!==null&&Z!==null){let we={x:0,y:0,width:0,height:0},Fe=0,Te=0;if((ee!==void 0||ne!==void 0)&&(we=Y.getBounds((ee??0)+q,ne??0)??we,we.width===0||we.height===0))return;const gt=Z.getBoundingClientRect(),qe=gt.width/Z.offsetWidth;if(be!==void 0&&(we={...we,x:be-gt.left-Ut.current.scrollLeft,width:1}),_e!==void 0&&(we={...we,y:_e+gt.top-Ut.current.scrollTop,height:1}),we!==void 0){const Le={x:we.x-U,y:we.y-B,width:we.width+2*U,height:we.height+2*B};let Mt=0;for(let qa=0;qa<ue;qa++)Mt+=Jt[qa].width;let jt=0;const an=Lt+(kr?1:0);an>0&&(jt=Jr(bn,an,jn));let Jn=Mt*qe+gt.left+q*xr*qe,ar=gt.right,Qn=gt.top+Rt*qe,sr=gt.bottom-jt*qe;const Lo=we.width+U*2;switch(J==null?void 0:J.hAlign){case"start":ar=Jn+Lo;break;case"end":Jn=ar-Lo;break;case"center":Jn=Math.floor((Jn+ar)/2)-Lo/2,ar=Jn+Lo;break}const Fo=we.height+B*2;switch(J==null?void 0:J.vAlign){case"start":sr=Qn+Fo;break;case"end":Qn=sr-Fo;break;case"center":Qn=Math.floor((Qn+sr)/2)-Fo/2,sr=Qn+Fo;break}Jn>Le.x?Fe=Le.x-Jn:ar<Le.x+Le.width&&(Fe=Le.x+Le.width-ar),Qn>Le.y?Te=Le.y-Qn:sr<Le.y+Le.height&&(Te=Le.y+Le.height-sr),F==="vertical"||typeof y=="number"&&y<ue?Fe=0:(F==="horizontal"||typeof A=="number"&&A>=bn-an)&&(Te=0),(Fe!==0||Te!==0)&&(qe!==1&&(Fe/=qe,Te/=qe),Ut.current.scrollTo(Fe+Ut.current.scrollLeft,Te+Ut.current.scrollTop))}}}},[q,Lt,xr,Ut,Rt,ue,Jt,bn,kr,jn]),pl=d.useRef(ml),vl=d.useRef(M),Aa=d.useRef(je);pl.current=ml,vl.current=M,Aa.current=je;const si=d.useCallback(async(y,A=!0)=>{var ee;const F=St[y];if(((ee=F==null?void 0:F.trailingRowOptions)==null?void 0:ee.disabled)===!0)return;const U=ye==null?void 0:ye();let B,J=!0;U!==void 0&&(B=await U,B==="top"&&(J=!1),typeof B=="number"&&(J=!1));let Y=0;const Z=()=>{if(Aa.current<=je){Y<500&&window.setTimeout(Z,Y),Y=50+Y*2;return}const ne=typeof B=="number"?B:J?je:0;_o.current(y-q,ne),kt({cell:[y,ne],range:{x:y,y:ne,width:1,height:1}},!1,!1,"edit");const be=vl.current([y-q,ne]);be.allowOverlay&&Ji(be)&&be.readonly!==!0&&A&&window.setTimeout(()=>{pl.current(y,ne)},0)};Z()},[St,ye,q,je,kt]),Io=d.useCallback(y=>{var F,U;const A=((U=(F=Jt[y])==null?void 0:F.trailingRowOptions)==null?void 0:U.targetColumn)??(Oe==null?void 0:Oe.targetColumn);if(typeof A=="number")return A+($n?1:0);if(typeof A=="object"){const B=w.indexOf(A);if(B>=0)return B+($n?1:0)}},[Jt,w,$n,Oe==null?void 0:Oe.targetColumn]),Er=d.useRef(),li=d.useRef(),Oi=d.useCallback((y,A)=>{var B;const[F,U]=A;return vr(Ue,(B=St[F])==null?void 0:B.themeOverride,zn==null?void 0:zn(U),y.themeOverride)},[zn,St,Ue]),{mapper:$r}=Z0(Ve,b),Kn=Ve==null?void 0:Ve.navigationBehavior,Pi=d.useCallback(y=>{var be,_e,we;const A=ca.value?y.metaKey:y.ctrlKey,F=A&&se==="multi",U=A&&rt==="multi",[B,J]=y.location,Y=K.columns,Z=K.rows,[ee,ne]=((be=K.current)==null?void 0:be.cell)??[];if(y.kind==="cell"){if(li.current=void 0,Nr.current=[B,J],B===0&&$n){if(Kt===!0&&J===je||Rn==="number"||se==="none")return;const Fe=Pn(y.location);if(Fe.kind!==Yn.Marker)return;if(We!==void 0){const qe=Ct(Fe);Fn((qe==null?void 0:qe.kind)===Yn.Marker);const Le=(_e=qe==null?void 0:qe.onClick)==null?void 0:_e.call(qe,{...y,cell:Fe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Oi(Fe,y.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Fe.checked)return}o(void 0),kn();const Te=Z.hasIndex(J),gt=Er.current;if(se==="multi"&&(y.shiftKey||y.isLongTouch===!0)&>!==void 0&&Z.hasIndex(gt)){const qe=[Math.min(gt,J),Math.max(gt,J)+1];F||Ae==="multi"?ke(void 0,qe,!0):ke(mt.fromSingleSelection(qe),void 0,F)}else se==="multi"&&(F||y.isTouch||Ae==="multi")?Te?ke(Z.remove(J),void 0,!0):(ke(void 0,J,!0),Er.current=J):Te&&Z.length===1?ke(mt.empty(),void 0,A):(ke(mt.fromSingleSelection(J),void 0,A),Er.current=J)}else if(B>=q&&Kt&&J===je){const Fe=Io(B);si(Fe??B)}else if(ee!==B||ne!==J){const Fe=Pn(y.location),Te=Ct(Fe);if((Te==null?void 0:Te.onSelect)!==void 0){let Le=!1;if(Te.onSelect({...y,cell:Fe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Le=!0,theme:Oi(Fe,y.location)}),Le)return}if(Kn==="block"&&$r(J).isGroupHeader)return;const gt=kr&&J===je,qe=kr&&K!==void 0&&((we=K.current)==null?void 0:we.cell[1])===je;if((y.shiftKey||y.isLongTouch===!0)&&ee!==void 0&&ne!==void 0&&K.current!==void 0&&!qe){if(gt)return;const Le=Math.min(B,ee),Mt=Math.max(B,ee),jt=Math.min(J,ne),an=Math.max(J,ne);kt({...K.current,range:{x:Le,y:jt,width:Mt-Le+1,height:an-jt+1}},!0,A,"click"),Er.current=void 0,kn()}else kt({cell:[B,J],range:{x:B,y:J,width:1,height:1}},!0,A,"click"),Er.current=void 0,o(void 0),kn()}}else if(y.kind==="header")if(Nr.current=[B,J],o(void 0),$n&&B===0)Er.current=void 0,li.current=void 0,se==="multi"&&(Z.length!==je?ke(mt.fromSingleSelection([0,je]),void 0,A):ke(mt.empty(),void 0,A),kn());else{const Fe=li.current;if(rt==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Fe!==void 0&&Y.hasIndex(Fe)){const Te=[Math.min(Fe,B),Math.max(Fe,B)+1];U?Ge(void 0,Te,A):Ge(mt.fromSingleSelection(Te),void 0,A)}else U?(Y.hasIndex(B)?Ge(Y.remove(B),void 0,A):Ge(void 0,B,A),li.current=B):rt!=="none"&&(Ge(mt.fromSingleSelection(B),void 0,A),li.current=B);Er.current=void 0,kn()}else y.kind===qn?Nr.current=[B,J]:y.kind===da&&!y.isMaybeScrollbar&&(Ce(Uo,!1),o(void 0),kn(),xt==null||xt(),Er.current=void 0,li.current=void 0)},[se,rt,K,$n,q,Kt,je,Rn,Pn,We,kn,Ae,Ct,Oi,ke,Io,si,Kn,$r,kr,kt,Ge,Ce,xt]),_i=d.useRef(!1),Nr=d.useRef(),bl=d.useRef(zr),Bn=d.useRef(),Hf=d.useCallback(y=>{if(ui.current=!1,bl.current=en.current,y.button!==0&&y.button!==1){Bn.current=void 0;return}const A=performance.now();Bn.current={button:y.button,time:A,location:y.location},(y==null?void 0:y.kind)==="header"&&(_i.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:F}),Nr.current=void 0,!y.isTouch&&y.button===0&&!F?Pi(y):!y.isTouch&&y.button===1&&(Nr.current=y.location))},[K,Pi]),[Ha,za]=d.useState(),wl=d.useCallback(y=>{if(y.kind!==qn||rt!=="multi")return;const A=ca.value?y.metaKey:y.ctrlKey,[F]=y.location,U=K.columns;if(F<q)return;const B=St[F];let J=F,Y=F;for(let Z=F-1;Z>=q&&ao(B.group,St[Z].group);Z--)J--;for(let Z=F+1;Z<St.length&&ao(B.group,St[Z].group);Z++)Y++;if(kn(),A)if(U.hasAll([J,Y+1])){let Z=U;for(let ee=J;ee<=Y;ee++)Z=Z.remove(ee);Ge(Z,void 0,A)}else Ge(void 0,[J,Y+1],A);else Ge(mt.fromSingleSelection([J,Y+1]),void 0,A)},[rt,kn,K.columns,St,q,Ge]),ui=d.useRef(!1),To=d.useCallback(async y=>{if(cn!==void 0&&xe!==void 0){const A=en.current.y,F=en.current.height;let U=cn({x:y,y:A,width:1,height:Math.min(F,je-A)},un.current.signal);typeof U!="object"&&(U=await U());const B=Jt[y-q],Y=document.createElement("canvas").getContext("2d",{alpha:!1});if(Y!==null){Y.font=Ue.baseFontFull;const Z=kd(Y,Ue,B,0,U,ir,Hr,!1,Ct);xe==null||xe(B,Z.width,y,Z.width)}}},[Jt,cn,Hr,Ue,ir,xe,q,je,Ct]),[zf,Va]=d.useState(),ci=d.useCallback(async(y,A)=>{var Z,ee;const F=(Z=y.current)==null?void 0:Z.range;if(F===void 0||cn===void 0||A.current===void 0)return;const U=A.current.range;if(R!==void 0){let ne=!1;if(R({fillDestination:{...U,x:U.x-q},patternSource:{...F,x:F.x-q},preventDefault:()=>ne=!0}),ne)return}let B=cn(F,un.current.signal);typeof B!="object"&&(B=await B());const J=B,Y=[];for(let ne=0;ne<U.width;ne++)for(let be=0;be<U.height;be++){const _e=[U.x+ne,U.y+be];if(fd(_e,F))continue;const we=J[be%F.height][ne%F.width];mi(we)||!Ji(we)||Y.push({location:_e,value:{...we}})}Nn(Y),(ee=Tn.current)==null||ee.damage(Y.map(ne=>({cell:ne.location})))},[cn,Nn,R,q]),yl=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};ci(y,K)},[ci,K]),Cl=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};ci(y,K)},[ci,K]),Vf=d.useCallback((y,A)=>{var be,_e;const F=s;if(u(void 0),La(void 0),Va(void 0),_i.current=!1,A)return;if((F==null?void 0:F.fillHandle)===!0&&K.current!==void 0&&((be=F.previousSelection)==null?void 0:be.current)!==void 0){if(Vr===void 0)return;const we={...K,current:{...K.current,range:Td(F.previousSelection.current.range,Vr)}};ci(F.previousSelection,we),Ce(we,!0);return}const[U,B]=y.location,[J,Y]=Nr.current??[],Z=()=>{ui.current=!0},ee=we=>{var Te,gt,qe;const Fe=we.isTouch||J===U&&Y===B;if(Fe&&(O==null||O([U-q,B],{...we,preventDefault:Z})),we.button===1)return!ui.current;if(!ui.current){const Le=Pn(y.location),Mt=Ct(Le);if(Mt!==void 0&&Mt.onClick!==void 0&&Fe){const an=Mt.onClick({...we,cell:Le,posX:we.localEventX,posY:we.localEventY,bounds:we.bounds,theme:Oi(Le,y.location),preventDefault:Z});an!==void 0&&!mi(an)&&hi(an)&&(Nn([{location:we.location,value:an}]),(Te=Tn.current)==null||Te.damage([{cell:we.location}]))}if(ui.current||K.current===void 0)return!1;let jt=!1;switch(Le.activationBehaviorOverride??it){case"double-click":case"second-click":{if(((qe=(gt=F==null?void 0:F.previousSelection)==null?void 0:gt.current)==null?void 0:qe.cell)===void 0)break;const[an,Jn]=K.current.cell,[ar,Qn]=F.previousSelection.current.cell;jt=U===an&&U===ar&&B===Jn&&B===Qn&&(we.isDoubleClick===!0||it==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return S==null||S([U-q,B]),ai(we.bounds,!1),!0}return!1},ne=y.location[0]-q;if(y.isTouch){const we=en.current,Fe=bl.current;if(we.x!==Fe.x||we.y!==Fe.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&to((_e=K.current)==null?void 0:_e.cell,y.location)){N==null||N([ne,y.location[1]],{...y,preventDefault:Z});return}else if(y.kind==="header"&&K.columns.hasIndex(U)){re==null||re(ne,{...y,preventDefault:Z});return}else if(y.kind===qn){if(ne<0)return;G==null||G(ne,{...y,preventDefault:Z});return}}y.kind==="cell"?ee(y)||Pi(y):y.kind===qn?z==null||z(ne,{...y,preventDefault:Z}):(y.kind===Or&&(C==null||C(ne,{...y,preventDefault:Z})),Pi(y));return}if(y.kind==="header"){if(ne<0)return;y.isEdge?y.isDoubleClick===!0&&To(U):y.button===0&&U===J&&B===Y&&(C==null||C(ne,{...y,preventDefault:Z}))}if(y.kind===qn){if(ne<0)return;y.button===0&&U===J&&B===Y&&(z==null||z(ne,{...y,preventDefault:Z}),ui.current||wl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&ee(y),Nr.current=void 0},[s,K,q,Vr,ci,Ce,O,Pn,Ct,it,Oi,Nn,S,ai,N,re,G,Pi,z,C,To,wl]),$f=d.useCallback(y=>{const A={...y,location:[y.location[0]-q,y.location[1]]};Pe==null||Pe(A),s!==void 0&&y.buttons===0&&(u(void 0),La(void 0),Va(void 0),_i.current=!1),Va(F=>{var U;return _i.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===(F==null?void 0:F[0])&&y.scrollEdge[1]===F[1]?F:s===void 0||(((U=Bn.current)==null?void 0:U.location[0])??0)<q?void 0:y.scrollEdge})},[s,Pe,q]),Nf=d.useCallback((y,A)=>{Qe==null||Qe(y-q,A)},[Qe,q]),Bf=d.useCallback((y,A)=>{vt==null||vt(y-q,A)},[vt,q]),or=(Tl=K==null?void 0:K.current)==null?void 0:Tl.cell,Wf=d.useCallback((y,A,F,U,B,J)=>{Mr.current=!1;let Y=or;Y!==void 0&&(Y=[Y[0]-q,Y[1]]);const Z=ue===0?void 0:{x:0,y:y.y,width:ue,height:y.height},ee=[];Z!==void 0&&ee.push(Z),Lt>0&&(ee.push({x:y.x-q,y:je-Lt,width:y.width,height:Lt}),ue>0&&ee.push({x:0,y:je-Lt,width:ue,height:Lt}));const ne={x:y.x-q,y:y.y,width:y.width,height:Kt&&y.y+y.height>=je?y.height-1:y.height,tx:B,ty:J,extras:{selected:Y,freezeRegion:Z,freezeRegions:ee}};en.current=ne,Rr(ne),sn([A,F,U]),nn==null||nn(ne,ne.tx,ne.ty,ne.extras)},[or,q,Kt,je,ue,Lt,Rr,nn]),Uf=Yr(Re,d.useCallback((y,A)=>{Re==null||Re(y-q,A-q),rt!=="none"&&Ge(mt.fromSingleSelection(A),void 0,!0)},[rt,Re,q,Ge])),$a=d.useRef(!1),qf=d.useCallback(y=>{if(y.location[0]===0&&q>0){y.preventDefault();return}ze==null||ze({...y,location:[y.location[0]-q,y.location[1]]}),y.defaultPrevented()||($a.current=!0),u(void 0)},[ze,q]),Yf=d.useCallback(()=>{$a.current=!1},[]),Sl=Ve==null?void 0:Ve.selectionBehavior,Do=d.useCallback(y=>{if(Sl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:U}=$r(y);if(A)return[y,y];const B=F[F.length-1],J=y-B,Y=y+U-B-1;return[J,Y]},[$r,Sl]),Na=d.useRef(),Ba=d.useCallback(y=>{var A,F,U;if(!Fd(y,Na.current)&&(Na.current=y,!(((A=Bn==null?void 0:Bn.current)==null?void 0:A.button)!==void 0&&Bn.current.button>=1))){if(y.buttons!==0&&s!==void 0&&((F=Bn.current)==null?void 0:F.location[0])===0&&y.location[0]===0&&q===1&&se==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Bn.current.location[1])&&K.rows.hasIndex(Bn.current.location[1])){const B=Math.min(Bn.current.location[1],y.location[1]),J=Math.max(Bn.current.location[1],y.location[1])+1;ke(mt.fromSingleSelection([B,J]),void 0,!1)}if(y.buttons!==0&&s!==void 0&&K.current!==void 0&&!$a.current&&!_i.current&&(wt==="rect"||wt==="multi-rect")){const[B,J]=K.current.cell;let[Y,Z]=y.location;if(Z<0&&(Z=en.current.y),s.fillHandle===!0&&((U=s.previousSelection)==null?void 0:U.current)!==void 0){const ee=s.previousSelection.current.range;Z=Math.min(Z,Kt?je-1:je);const ne=Vp(ee,Y,Z,fn);La(ne)}else{if(Kt&&J===je)return;if(Kt&&Z===je)if(y.kind===da)Z--;else return;Y=Math.max(Y,q);const be=Do(J);Z=be===void 0?Z:Un(Z,be[0],be[1]);const _e=Y-B,we=Z-J,Fe={x:_e>=0?B:Y,y:we>=0?J:Z,width:Math.abs(_e)+1,height:Math.abs(we)+1};kt({...K.current,range:Fe},!0,!1,"drag")}}Yt==null||Yt({...y,location:[y.location[0]-q,y.location[1]]})}},[s,q,se,K,wt,Yt,ke,Kt,je,fn,Do,kt]),Xf=d.useCallback(()=>{var Y,Z;const y=Na.current;if(y===void 0)return;const[A,F]=y.scrollEdge;let[U,B]=y.location;const J=en.current;A===-1?U=((Z=(Y=J.extras)==null?void 0:Y.freezeRegion)==null?void 0:Z.x)??J.x:A===1&&(U=J.x+J.width),F===-1?B=Math.max(0,J.y):F===1&&(B=Math.min(je-1,J.y+J.height)),U=Un(U,0,St.length-1),B=Un(B,0,je-1),Ba({...y,location:[U,B]})},[St.length,Ba,je]);Y0(zf,Ut,Xf);const Zn=d.useCallback(y=>{if(K.current===void 0)return;const[A,F]=y,[U,B]=K.current.cell,J=K.current.range;let Y=J.x,Z=J.x+J.width,ee=J.y,ne=J.y+J.height;const[be,_e]=Do(B)??[0,je-1],we=_e+1;if(F!==0)switch(F){case 2:{ne=we,ee=B,on(0,ne,"vertical");break}case-2:{ee=be,ne=B+1,on(0,ee,"vertical");break}case 1:{ee<B?(ee++,on(0,ee,"vertical")):(ne=Math.min(we,ne+1),on(0,ne,"vertical"));break}case-1:{ne>B+1?(ne--,on(0,ne,"vertical")):(ee=Math.max(be,ee-1),on(0,ee,"vertical"));break}default:oo()}if(A!==0)if(A===2)Z=St.length,Y=U,on(Z-1-q,0,"horizontal");else if(A===-2)Y=q,Z=U+1,on(Y-q,0,"horizontal");else{let Fe=[];if(cn!==void 0){const Te=cn({x:Y,y:ee,width:Z-Y-q,height:ne-ee},un.current.signal);typeof Te=="object"&&(Fe=nv(Te))}if(A===1){let Te=!1;if(Y<U){if(Fe.length>0){const gt=lr(Y+1,U+1).find(qe=>!Fe.includes(qe-q));gt!==void 0&&(Y=gt,Te=!0)}else Y++,Te=!0;Te&&on(Y,0,"horizontal")}Te||(Z=Math.min(St.length,Z+1),on(Z-1-q,0,"horizontal"))}else if(A===-1){let Te=!1;if(Z>U+1){if(Fe.length>0){const gt=lr(Z-1,U,-1).find(qe=>!Fe.includes(qe-q));gt!==void 0&&(Z=gt,Te=!0)}else Z--,Te=!0;Te&&on(Z-q,0,"horizontal")}Te||(Y=Math.max(q,Y-1),on(Y-q,0,"horizontal"))}else oo()}kt({cell:K.current.cell,range:{x:Y,y:ee,width:Z-Y,height:ne-ee}},!0,!1,"keyboard-select")},[cn,Do,K,St.length,q,je,on,kt]),Wa=d.useRef(xi);Wa.current=xi;const Ir=d.useCallback((y,A,F,U)=>{const B=bn-(F?0:1);y=Un(y,q,Jt.length-1+q),A=Un(A,0,B);const J=or==null?void 0:or[0],Y=or==null?void 0:or[1];if(y===J&&A===Y)return!1;if(U&&K.current!==void 0){const Z=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&Z.push(K.current.range),Ce({...K,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:Z}},!0)}else kt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Wa.current&&on(y-q,A),!0},[bn,q,Jt.length,or,K,on,Ce,kt]),jf=d.useCallback((y,A)=>{(i==null?void 0:i.cell)!==void 0&&y!==void 0&&hi(y)&&(Nn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{var B;(B=Tn.current)==null||B.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[F,U]=A;if(K.current!==void 0&&(F!==0||U!==0)){const B=K.current.cell[1]===bn-1&&y!==void 0;Ir(Un(K.current.cell[0]+F,0,St.length-1),Un(K.current.cell[1]+U,0,bn-1),B,!1)}_==null||_(y,A)},[i==null?void 0:i.cell,kn,K,_,Nn,bn,Ir,St.length]),Gf=d.useMemo(()=>`gdg-overlay-${tv++}`,[]),Br=d.useCallback(y=>{var F,U,B,J;kn();const A=[];for(let Y=y.x;Y<y.x+y.width;Y++)for(let Z=y.y;Z<y.y+y.height;Z++){const ee=M([Y-q,Z]);if(!ee.allowOverlay&&ee.kind!==te.Boolean)continue;let ne;if(ee.kind===te.Custom){const be=Ct(ee),_e=(F=be==null?void 0:be.provideEditor)==null?void 0:F.call(be,ee);(be==null?void 0:be.onDelete)!==void 0?ne=be.onDelete(ee):Og(_e)&&(ne=(U=_e==null?void 0:_e.deletedValue)==null?void 0:U.call(_e,ee))}else if(hi(ee)&&ee.allowOverlay||ee.kind===te.Boolean){const be=Ct(ee);ne=(B=be==null?void 0:be.onDelete)==null?void 0:B.call(be,ee)}ne!==void 0&&!mi(ne)&&hi(ne)&&A.push({location:[Y,Z],value:ne})}Nn(A),(J=Tn.current)==null||J.damage(A.map(Y=>({cell:Y.location})))},[kn,M,Ct,Nn,q]),Li=i!==void 0,xl=d.useCallback(y=>{var gt,qe;const A=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:U}=y,B=K.columns,J=K.rows,Y=Vn;if(!Li&&ut(Y.clear,y,F))Ce(Uo,!1),xt==null||xt();else if(!Li&&ut(Y.selectAll,y,F))Ce({columns:mt.empty(),rows:mt.empty(),current:{cell:((gt=K.current)==null?void 0:gt.cell)??[q,0],range:{x:q,y:0,width:w.length,height:je},rangeStack:[]}},!1);else if(ut(Y.search,y,F))(qe=a==null?void 0:a.current)==null||qe.focus({preventScroll:!0}),ii(!0);else if(ut(Y.delete,y,F)){const Le=(Ie==null?void 0:Ie(K))??!0;if(Le!==!1){const Mt=Le===!0?K:Le;if(Mt.current!==void 0){Br(Mt.current.range);for(const jt of Mt.current.rangeStack)Br(jt)}for(const jt of Mt.rows)Br({x:q,y:jt,width:w.length,height:1});for(const jt of Mt.columns)Br({x:jt,y:0,width:1,height:je})}}if(F.didMatch)return A(),!0;if(K.current===void 0)return!1;let[Z,ee]=K.current.cell;const[,ne]=K.current.cell;let be=!1,_e=!1;if(ut(Y.scrollToSelectedCell,y,F)?_o.current(Z-q,ee):rt!=="none"&&ut(Y.selectColumn,y,F)?B.hasIndex(Z)?Ge(B.remove(Z),void 0,!0):rt==="single"?Ge(mt.fromSingleSelection(Z),void 0,!0):Ge(void 0,Z,!0):se!=="none"&&ut(Y.selectRow,y,F)?J.hasIndex(ee)?ke(J.remove(ee),void 0,!0):se==="single"?ke(mt.fromSingleSelection(ee),void 0,!0):ke(void 0,ee,!0):!Li&&U!==void 0&&ut(Y.activateCell,y,F)?ee===je&&Kt?window.setTimeout(()=>{const Le=Io(Z);si(Le??Z)},0):(S==null||S([Z-q,ee]),ai(U,!0)):K.current.range.height>1&&ut(Y.downFill,y,F)?Cl():K.current.range.width>1&&ut(Y.rightFill,y,F)?yl():ut(Y.goToNextPage,y,F)?ee+=Math.max(1,en.current.height-4):ut(Y.goToPreviousPage,y,F)?ee-=Math.max(1,en.current.height-4):ut(Y.goToFirstCell,y,F)?(o(void 0),ee=0,Z=0):ut(Y.goToLastCell,y,F)?(o(void 0),ee=Number.MAX_SAFE_INTEGER,Z=Number.MAX_SAFE_INTEGER):ut(Y.selectToFirstCell,y,F)?(o(void 0),Zn([-2,-2])):ut(Y.selectToLastCell,y,F)?(o(void 0),Zn([2,2])):Li?(ut(Y.closeOverlay,y,F)&&o(void 0),ut(Y.acceptOverlayDown,y,F)&&(o(void 0),ee++),ut(Y.acceptOverlayUp,y,F)&&(o(void 0),ee--),ut(Y.acceptOverlayLeft,y,F)&&(o(void 0),Z--),ut(Y.acceptOverlayRight,y,F)&&(o(void 0),Z++)):(ut(Y.goDownCell,y,F)?ee+=1:ut(Y.goUpCell,y,F)?ee-=1:ut(Y.goRightCell,y,F)?Z+=1:ut(Y.goLeftCell,y,F)?Z-=1:ut(Y.goDownCellRetainSelection,y,F)?(ee+=1,be=!0):ut(Y.goUpCellRetainSelection,y,F)?(ee-=1,be=!0):ut(Y.goRightCellRetainSelection,y,F)?(Z+=1,be=!0):ut(Y.goLeftCellRetainSelection,y,F)?(Z-=1,be=!0):ut(Y.goToLastRow,y,F)?ee=je-1:ut(Y.goToFirstRow,y,F)?ee=Number.MIN_SAFE_INTEGER:ut(Y.goToLastColumn,y,F)?Z=Number.MAX_SAFE_INTEGER:ut(Y.goToFirstColumn,y,F)?Z=Number.MIN_SAFE_INTEGER:(wt==="rect"||wt==="multi-rect")&&(ut(Y.selectGrowDown,y,F)?Zn([0,1]):ut(Y.selectGrowUp,y,F)?Zn([0,-1]):ut(Y.selectGrowRight,y,F)?Zn([1,0]):ut(Y.selectGrowLeft,y,F)?Zn([-1,0]):ut(Y.selectToLastRow,y,F)?Zn([0,2]):ut(Y.selectToFirstRow,y,F)?Zn([0,-2]):ut(Y.selectToLastColumn,y,F)?Zn([2,0]):ut(Y.selectToFirstColumn,y,F)&&Zn([-2,0])),_e=F.didMatch),Kn!==void 0&&Kn!=="normal"&&ee!==ne){const Le=Kn==="skip-up"||Kn==="skip"||Kn==="block",Mt=Kn==="skip-down"||Kn==="skip"||Kn==="block",jt=ee<ne;if(jt&&Le){for(;ee>=0&&$r(ee).isGroupHeader;)ee--;ee<0&&(ee=ne)}else if(!jt&&Mt){for(;ee<je&&$r(ee).isGroupHeader;)ee++;ee>=je&&(ee=ne)}}const Fe=Ir(Z,ee,!1,be),Te=F.didMatch;return Te&&(Fe||!_e||Gt)&&A(),Te},[Kn,Li,K,Vn,rt,se,wt,q,$r,je,Ir,Ce,xt,w.length,Ie,Gt,Br,Ge,ke,Kt,Io,si,S,ai,Cl,yl,Zn]),Fi=d.useCallback(y=>{let A=!1;if(W!==void 0&&W({...y,cancel:()=>{A=!0}}),A||xl(y)||K.current===void 0)return;const[F,U]=K.current.cell,B=en.current;if(He&&!y.metaKey&&!y.ctrlKey&&K.current!==void 0&&y.key.length===1&&/[ -~]/g.test(y.key)&&y.bounds!==void 0&&Ji(M([F-q,Math.max(0,Math.min(U,je-1))]))){if((!Kt||U!==je)&&(B.y>U||U>B.y+B.height||B.x>F||F>B.x+B.width))return;ai(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[He,W,xl,K,M,q,je,Kt,ai]),Kf=d.useCallback((y,A)=>{const F=y.location[0]-q;if(y.kind==="header"&&(re==null||re(F,{...y,preventDefault:A})),y.kind===qn){if(F<0)return;G==null||G(F,{...y,preventDefault:A})}if(y.kind==="cell"){const[U,B]=y.location;N==null||N([F,B],{...y,preventDefault:A}),Lm(K,y.location)||Ir(U,B,!1,!1)}},[K,N,G,re,q,Ir]),Ua=d.useCallback(async y=>{var Y,Z,ee;if(!Vn.paste)return;function A(ne,be,_e,we){var Te,gt;const Fe=typeof _e=="object"?(_e==null?void 0:_e.join(`
|
173
173
|
`))??"":(_e==null?void 0:_e.toString())??"";if(!mi(ne)&&Ji(ne)&&ne.readonly!==!0){const qe=E==null?void 0:E(Fe,ne);if(qe!==void 0&&hi(qe))return{location:be,value:qe};const Le=Ct(ne);if(Le===void 0)return;if(Le.kind===te.Custom){Fn(ne.kind===te.Custom);const Mt=(Te=Le.onPaste)==null?void 0:Te.call(Le,Fe,ne.data);return Mt===void 0?void 0:{location:be,value:{...ne,data:Mt}}}else{const Mt=(gt=Le.onPaste)==null?void 0:gt.call(Le,Fe,ne,{formatted:we,formattedString:typeof we=="string"?we:we==null?void 0:we.join(`
|
174
174
|
`),rawValue:_e});return Mt===void 0?void 0:(Fn(Mt.kind===ne.kind),{location:be,value:Mt})}}}const F=K.columns,U=K.rows,B=((Y=Ut.current)==null?void 0:Y.contains(document.activeElement))===!0||((Z=l.current)==null?void 0:Z.contains(document.activeElement))===!0;let J;if(K.current!==void 0?J=[K.current.range.x,K.current.range.y]:F.length===1?J=[F.first()??0,0]:U.length===1&&(J=[q,U.first()??0]),B&&J!==void 0){let ne,be;const _e="text/plain",we="text/html";if(navigator.clipboard.read!==void 0){const qe=await navigator.clipboard.read();for(const Le of qe){if(Le.types.includes(we)){const jt=await(await Le.getType(we)).text(),an=Du(jt);if(an!==void 0){ne=an;break}}Le.types.includes(_e)&&(be=await(await Le.getType(_e)).text())}}else if(navigator.clipboard.readText!==void 0)be=await navigator.clipboard.readText();else if(y!==void 0&&(y==null?void 0:y.clipboardData)!==null){if(y.clipboardData.types.includes(we)){const qe=y.clipboardData.getData(we);ne=Du(qe)}ne===void 0&&y.clipboardData.types.includes(_e)&&(be=y.clipboardData.getData(_e))}else return;const[Fe,Te]=J,gt=[];do{if(tt===void 0){const qe=Pn(J),Le=be??(ne==null?void 0:ne.map(jt=>jt.map(an=>an.rawValue).join(" ")).join(" "))??"",Mt=A(qe,J,Le,void 0);Mt!==void 0&>.push(Mt);break}if(ne===void 0){if(be===void 0)return;ne=V0(be)}if(tt===!1||typeof tt=="function"&&(tt==null?void 0:tt([J[0]-q,J[1]],ne.map(qe=>qe.map(Le=>{var Mt;return((Mt=Le.rawValue)==null?void 0:Mt.toString())??""}))))!==!0)return;for(const[qe,Le]of ne.entries()){if(qe+Te>=je)break;for(const[Mt,jt]of Le.entries()){const an=[Mt+Fe,qe+Te],[Jn,ar]=an;if(Jn>=St.length||ar>=bn)continue;const Qn=Pn(an),sr=A(Qn,an,jt.rawValue,jt.formatted);sr!==void 0&>.push(sr)}}}while(!1);Nn(gt),(ee=Tn.current)==null||ee.damage(gt.map(qe=>({cell:qe.location})))}},[E,Ct,Pn,K,Vn.paste,Ut,St.length,Nn,bn,tt,q,je]);gn("paste",Ua,f,!1,!0);const Ai=d.useCallback(async(y,A)=>{var Y,Z;if(!Vn.copy)return;const F=A===!0||((Y=Ut.current)==null?void 0:Y.contains(document.activeElement))===!0||((Z=l.current)==null?void 0:Z.contains(document.activeElement))===!0,U=K.columns,B=K.rows,J=(ee,ne)=>{if(!ve)Pu(ee,ne,y);else{const be=ne.map(_e=>({kind:te.Text,data:w[_e].title,displayData:w[_e].title,allowOverlay:!1}));Pu([be,...ee],ne,y)}};if(F&&cn!==void 0){if(K.current!==void 0){let ee=cn(K.current.range,un.current.signal);typeof ee!="object"&&(ee=await ee()),J(ee,lr(K.current.range.x-q,K.current.range.x+K.current.range.width-q))}else if(B!==void 0&&B.length>0){const ne=[...B].map(be=>{const _e=cn({x:q,y:be,width:w.length,height:1},un.current.signal);return typeof _e=="object"?_e[0]:_e().then(we=>we[0])});if(ne.some(be=>be instanceof Promise)){const be=await Promise.all(ne);J(be,lr(w.length))}else J(ne,lr(w.length))}else if(U.length>0){const ee=[],ne=[];for(const be of U){let _e=cn({x:be,y:0,width:1,height:je},un.current.signal);typeof _e!="object"&&(_e=await _e()),ee.push(_e),ne.push(be-q)}if(ee.length===1)J(ee[0],ne);else{const be=ee.reduce((_e,we)=>_e.map((Fe,Te)=>[...Fe,...we[Te]]));J(be,ne)}}}},[w,cn,K,Vn.copy,q,Ut,je,ve]);gn("copy",Ai,f,!1,!1);const Zf=d.useCallback(async y=>{var F,U;if(!(!Vn.cut||!(((F=Ut.current)==null?void 0:F.contains(document.activeElement))===!0||((U=l.current)==null?void 0:U.contains(document.activeElement))===!0))&&(await Ai(y),K.current!==void 0)){let B={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:mt.empty(),columns:mt.empty()};const J=Ie==null?void 0:Ie(B);if(J===!1||(B=J===!0?B:J,B.current===void 0))return;Br(B.current.range)}},[Br,K,Vn.cut,Ai,Ut,Ie]);gn("cut",Zf,f,!1,!1);const Jf=d.useCallback((y,A)=>{if(fe!==void 0){q!==0&&(y=y.map(B=>[B[0]-q,B[1]])),fe(y,A);return}if(y.length===0||A===-1)return;const[F,U]=y[A];c.current!==void 0&&c.current[0]===F&&c.current[1]===U||(c.current=[F,U],Ir(F,U,!1,!1))},[fe,q,Ir]),[Oo,Po]=((Dl=zt==null?void 0:zt.current)==null?void 0:Dl.cell)??[],_o=d.useRef(on);_o.current=on,d.useLayoutEffect(()=>{var y,A,F,U;Wa.current&&!Mr.current&&Oo!==void 0&&Po!==void 0&&(Oo!==((A=(y=oe.current)==null?void 0:y.current)==null?void 0:A.cell[0])||Po!==((U=(F=oe.current)==null?void 0:F.current)==null?void 0:U.cell[1]))&&_o.current(Oo,Po),Mr.current=!1},[Oo,Po]);const kl=K.current!==void 0&&(K.current.cell[0]>=St.length||K.current.cell[1]>=bn);d.useLayoutEffect(()=>{kl&&Ce(Uo,!1)},[kl,Ce]);const Qf=d.useMemo(()=>Kt===!0&&(Oe==null?void 0:Oe.tint)===!0?mt.fromSingleSelection(bn-1):mt.empty(),[bn,Kt,Oe==null?void 0:Oe.tint]),eh=d.useCallback(y=>typeof at=="boolean"?at:(at==null?void 0:at(y-q))??!0,[q,at]),th=d.useMemo(()=>{if(Ha===void 0||l.current===null)return null;const{bounds:y,group:A}=Ha,F=l.current.getBoundingClientRect();return d.createElement(I0,{bounds:y,group:A,canvasBounds:F,onClose:()=>za(void 0),onFinish:U=>{za(void 0),ae==null||ae(A,U)}})},[ae,Ha]),nh=Math.min(St.length,ue+($n?1:0));d.useImperativeHandle(t,()=>({appendRow:(y,A)=>si(y+q,A),updateCells:y=>{var A;return q!==0&&(y=y.map(F=>({cell:[F.cell[0]+q,F.cell[1]]}))),(A=Tn.current)==null?void 0:A.damage(y)},getBounds:(y,A)=>{var F;if(!((l==null?void 0:l.current)===null||(Ut==null?void 0:Ut.current)===null)){if(y===void 0&&A===void 0){const U=l.current.getBoundingClientRect(),B=U.width/Ut.current.clientWidth;return{x:U.x-Ut.current.scrollLeft*B,y:U.y-Ut.current.scrollTop*B,width:Ut.current.scrollWidth*B,height:Ut.current.scrollHeight*B}}return(F=Tn.current)==null?void 0:F.getBounds((y??0)+q,A)}},focus:()=>{var y;return(y=Tn.current)==null?void 0:y.focus()},emit:async y=>{switch(y){case"delete":Fi({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":Fi({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":Fi({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 Ai(void 0,!0);break;case"paste":await Ua();break}},scrollTo:on,remeasureColumns:y=>{for(const A of y)To(A+q)}}),[si,To,Ut,Ai,Fi,Ua,q,on]);const[Ml,Rl]=or??[],rh=d.useCallback(y=>{const[A,F]=y;if(F===-1){rt!=="none"&&(Ge(mt.fromSingleSelection(A),void 0,!1),kn());return}Ml===A&&Rl===F||(kt({cell:y,range:{x:A,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),on(A,F))},[rt,kn,on,Ml,Rl,kt,Ge]),[ih,oh]=d.useState(!1),El=d.useRef(Qc(y=>{oh(y)},5)),ah=d.useCallback(()=>{El.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&s===void 0&&kt({cell:[q,xo],range:{x:q,y:xo,width:1,height:1}},!0,!1,"keyboard-select")},[xo,K,s,q,kt]),sh=d.useCallback(()=>{El.current(!1)},[]),[lh,uh]=d.useMemo(()=>{let y;const A=(Pt==null?void 0:Pt.scrollbarWidthOverride)??xs(),F=je+(Kt?1:0);if(typeof jn=="number")y=Rt+F*jn;else{let B=0;const J=Math.min(F,10);for(let Y=0;Y<J;Y++)B+=jn(Y);B=Math.floor(B/J),y=Rt+F*B}y+=A;const U=St.reduce((B,J)=>J.width+B,0)+A;return[`${Math.min(1e5,U)}px`,`${Math.min(1e5,y)}px`]},[St,Pt==null?void 0:Pt.scrollbarWidthOverride,jn,je,Kt,Rt]),ch=d.useMemo(()=>jm(Ue),[Ue]);return d.createElement(xd.Provider,{value:Ue},d.createElement(W0,{style:ch,className:X,inWidth:p??lh,inHeight:v??uh},d.createElement(k0,{fillHandle:Bt,drawFocusRing:Ar,experimental:Pt,fixedShadowX:Vt,fixedShadowY:$t,getRowThemeOverride:zn,headerIcons:Cn,imageWindowLoader:nr,initialSize:Hn,isDraggable:V,onDragLeave:Je,onRowMoved:We,overscrollX:Da,overscrollY:Oa,preventDiagonalScrolling:Wt,rightElement:dn,rightElementProps:Zt,smoothScrollX:Sn,smoothScrollY:vn,className:X,enableGroups:xn,onCanvasFocused:ah,onCanvasBlur:sh,canvasRef:l,onContextMenu:Kf,theme:Ue,cellXOffset:Ff,cellYOffset:xo,accessibilityHeight:zr.height,onDragEnd:Yf,columns:St,nonGrowWidth:Gn,drawHeader:nt,onColumnProposeMove:I,drawCell:ot,disabledRows:Qf,freezeColumns:nh,lockColumns:q,firstColAccessible:q===0,getCellContent:Pn,minColumnWidth:ir,maxColumnWidth:Hr,searchInputRef:a,showSearch:Ti,onSearchClose:Pa,highlightRegions:Af,getCellsForSelection:cn,getGroupDetails:Fa,headerHeight:Ii,isFocused:ih,groupHeaderHeight:xn?Co:0,freezeTrailingRows:Lt+(Kt&&(Oe==null?void 0:Oe.sticky)===!0?1:0),hasAppendRow:Kt,onColumnResize:xe,onColumnResizeEnd:ge,onColumnResizeStart:Me,onCellFocused:rh,onColumnMoved:Uf,onDragStart:qf,onHeaderMenuClick:Nf,onHeaderIndicatorClick:Bf,onItemHovered:Ba,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:$f,onKeyDown:Fi,onKeyUp:ce,onMouseDown:Hf,onMouseUp:Vf,onDragOverCell:Xt,onDrop:Ot,onSearchResultsChanged:Jf,onVisibleRegionChanged:Wf,clientSize:ft,rowHeight:jn,searchResults:Q,searchValue:P,onSearchValueChange:H,rows:bn,scrollRef:Ut,selection:K,translateX:zr.tx,translateY:zr.ty,verticalBorder:eh,gridRef:Tn,getCellRenderer:Ct,resizeIndicator:Ta}),th,i!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(ev,{...i,validateCell:$,bloom:D,id:Gf,getCellRenderer:Ct,className:(Pt==null?void 0:Pt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:yn,imageEditorOverride:g,onFinishEditing:jf,markdownDivCreateNode:m,isOutsideClick:Sr,customEventTarget:Pt==null?void 0:Pt.eventTarget}))))},iv=d.forwardRef(rv),$d=20;function Fu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:a,height:l,x:s,y:u}=i,c=t.maxSize??$d,f=Math.floor(i.y+l/2),g=nd(c,l,o.cellVerticalPadding),h=td(t.contentAlign??"center",s,a,o.cellHorizontalPadding,g),m=ed(h,f,g),p=rd(s+n,u+r,m);return Vs(t)&&p}const ov={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:te.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>av(e,e.cell.data,Vs(e.cell),e.cell.maxSize??$d,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Fu(e)&&e.preventDefault()},onClick:e=>{if(Fu(e))return{...e.cell,data:Hd(e.cell.data)}},onPaste:(e,t)=>{let n=ia;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=zs),n===t.data?void 0:{...t,data:n}}};function av(e,t,n,r,i){if(!n&&t===ia)return;const{ctx:o,hoverAmount:a,theme:l,rect:s,highlighted:u,hoverX:c,hoverY:f,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:v}=s;let w=!1;if(i>0){let b=n?1-i+i*a:.4;if(t===ia&&(b*=a),b===0)return;b<1&&(w=!0,o.globalAlpha=b)}Gs(o,l,t,h,m,p,v,u,c,f,r,g),w&&(o.globalAlpha=1)}const sv=mn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),lv=e=>{const{bubbles:t}=e;return d.createElement(sv,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},uv={getAccessibilityString:e=>id(e.data),kind:te.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i).width+r+20,0)+2*n.cellHorizontalPadding-4,draw:e=>dv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(lv,{bubbles:t.data})},onPaste:()=>{}},cv=4;function dv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:a,y:l,width:s,height:u}=n,c=20,f=8,g=cv;let h=a+r.cellHorizontalPadding;const m=[];for(const p of t){if(h>a+s)break;const v=Qr(p,i,r.baseFontFull).width;m.push({x:h,width:v}),h+=v+f*2+g}i.beginPath();for(const p of m)cr(i,p.x,l+(u-c)/2,p.width+f*2,c,r.roundingRadius??c/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[p,v]of m.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[p],v.x+f,l+u/2+dr(i,r))}const fv=mn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),hv=e=>{const{drilldowns:t}=e;return d.createElement(fv,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},gv={getAccessibilityString:e=>id(e.data.map(t=>t.text)),kind:te.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+20+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>vv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(hv,{drilldowns:t.data})},onPaste:()=>{}},mv=4,cs={};function pv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,l=4,s=n*i,u=r+o,c=r*3,f=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(cs[g]!==void 0)return{el:cs[g],height:s,width:f,middleWidth:l*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=f,h.height=s,m.scale(i,i),cs[g]=h,m.beginPath(),cr(m,o,o,c,a,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(),cr(m,o+.5,o+.5,c,a,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:s,width:f,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function vv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:a,row:l}=e,{x:s,width:u}=n,c=r.baseFontFull,f=bd(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(f*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=8,v=mv;let w=s+r.cellHorizontalPadding;const b=r.roundingRadius??6,M=pv(r.bgCell,r.drilldownBorder,g,b),O=[];for(const S of t){if(w>s+u)break;const _=Qr(S.text,i,c).width;let E=0;S.img!==void 0&&o.loadOrGetImage(S.img,a,l)!==void 0&&(E=m-8+4);const x=_+E+p*2;O.push({x:w,width:x}),w+=x+v}if(M!==null){const{el:S,height:R,middleWidth:_,sideWidth:E,width:x,dpr:L,padding:D}=M,C=E/L,I=D/L;for(const T of O){const k=Math.floor(T.x),z=Math.floor(T.width),N=z-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,E,R,k-I,h,C,g),N>0&&i.drawImage(S,E,0,_,R,k+(C-I),h,N,g),i.drawImage(S,x-E,0,E,R,k+z-(C-I),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[S,R]of O.entries()){const _=t[S];let E=R.x+p;if(_.img!==void 0){const x=o.loadOrGetImage(_.img,a,l);if(x!==void 0){const L=m-8;let D=0,C=0,I=x.width,T=x.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),cr(i,E,h+g/2-L/2,L,L,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(x,D,C,I,T,E,h+g/2-L/2,L,L),i.restore(),E+=L+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+g/2+dr(i,r))}}const bv={getAccessibilityString:e=>e.data.join(", "),kind:te.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>wv(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??im;return d.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}}},ds=4;function wv(e,t,n,r){const{rect:i,col:o,row:a,theme:l,ctx:s,imageLoader:u}=e,{x:c,y:f,height:g,width:h}=i,m=g-l.cellVerticalPadding*2,p=[];let v=0;for(let b=0;b<t.length;b++){const M=t[b];if(M.length===0)continue;const O=u.loadOrGetImage(M,o,a);if(O!==void 0){p[b]=O;const S=O.width*(m/O.height);v+=S+ds}}if(v===0)return;v-=ds;let w=c+l.cellHorizontalPadding;r==="right"?w=Math.floor(c+h-l.cellHorizontalPadding-v):r==="center"&&(w=Math.floor(c+h/2-v/2));for(const b of p){if(b===void 0)continue;const M=b.width*(m/b.height);n>0&&(s.beginPath(),cr(s,w,f+l.cellVerticalPadding,M,m,n),s.save(),s.clip()),s.drawImage(b,w,f+l.cellVerticalPadding,M,m),n>0&&s.restore(),w+=M+ds}}function yv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Cv={getAccessibilityString:()=>"",kind:te.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(yv(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=o.width&&(l=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);cr(i,o.x+s,o.y+(o.height-u)/2,l,u,a.roundingRadius??3),i.fillStyle=jr(a.textDark,.1),i.fill()},onPaste:()=>{}},Sv=()=>e=>e.targetWidth,Au=mn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Sv(),"px"]}}),xv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:a,validatedSelection:l}=e,s=t.data,u=t.readonly===!0,[c,f]=d.useState(s===""||r),g=d.useCallback(()=>{f(m=>!m)},[]),h=s?"gdg-ml-6":"";return c?d.createElement(Au,{targetWidth:o.width-20},d.createElement(Zr,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>a(t)},d.createElement(Zg,null))):d.createElement(Au,{targetWidth:o.width},d.createElement(xm,{contents:s,createNode:i}),!u&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},d.createElement(Ns,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},kv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:go,measure:(e,t,n)=>{const r=t.data.split(`
|
175
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ur(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:a,validatedSelection:l}=e;return d.createElement(xv,{onFinish:i,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Mv={getAccessibilityString:e=>e.row.toString(),kind:Yn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Rv,measure:()=>44,draw:e=>Iv(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:a}=t,l=n.drawHandle?7+(o-7)/2:o/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Rv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==i&&(n.font=i,o.font=i),o.deprep=Ev,n.textAlign="center",o}function Ev(e){const{ctx:t}=e;t.textAlign="start"}function Iv(e,t,n,r,i,o){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:f,width:g,height:h}=l,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?s:1);if(Gs(a,u,n,i?c+p:c,f,i?g-p:g,h,!0,void 0,void 0,18,"center",o),i){a.globalAlpha=s,a.beginPath();for(const v of[3,6])for(const w of[-5,-1,3])a.rect(c+v,f+h/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,w=c+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=v,a.fillText(p,w,f+h/2+dr(a,v)),s!==0&&(a.globalAlpha=1)}}const Tv={getAccessibilityString:()=>"",kind:Yn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Dv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Dv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:f}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,f-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=f-8,v=s+8/2,w=u+8/2;l.drawSprite(n,"normal",r,v,w,p,a,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,v=g?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(r.moveTo(s+w+v,u+f/2),r.lineTo(s+w+v+p,u+f/2),r.moveTo(s+w+v+p*.5,u+f/2-p*.5),r.lineTo(s+w+v+p*.5,u+f/2+p*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,h+s+a.cellHorizontalPadding+.5,u+f/2+dr(r,a)),r.beginPath()}function Nd(e,t,n,r,i,o,a){e.textBaseline="alphabetic";const l=Ov(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),cr(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??jr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function Ov(e,t,n,r,i){const o=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const l=Qr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:l.width+o*3,height:u-1}}const Pv=d.lazy(async()=>await Fs(()=>import("./number-overlay-editor.
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ur(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:a,validatedSelection:l}=e;return d.createElement(xv,{onFinish:i,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Mv={getAccessibilityString:e=>e.row.toString(),kind:Yn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Rv,measure:()=>44,draw:e=>Iv(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:a}=t,l=n.drawHandle?7+(o-7)/2:o/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Rv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==i&&(n.font=i,o.font=i),o.deprep=Ev,n.textAlign="center",o}function Ev(e){const{ctx:t}=e;t.textAlign="start"}function Iv(e,t,n,r,i,o){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:f,width:g,height:h}=l,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?s:1);if(Gs(a,u,n,i?c+p:c,f,i?g-p:g,h,!0,void 0,void 0,18,"center",o),i){a.globalAlpha=s,a.beginPath();for(const v of[3,6])for(const w of[-5,-1,3])a.rect(c+v,f+h/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,w=c+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=v,a.fillText(p,w,f+h/2+dr(a,v)),s!==0&&(a.globalAlpha=1)}}const Tv={getAccessibilityString:()=>"",kind:Yn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Dv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Dv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:f}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,f-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=f-8,v=s+8/2,w=u+8/2;l.drawSprite(n,"normal",r,v,w,p,a,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,v=g?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(r.moveTo(s+w+v,u+f/2),r.lineTo(s+w+v+p,u+f/2),r.moveTo(s+w+v+p*.5,u+f/2-p*.5),r.lineTo(s+w+v+p*.5,u+f/2+p*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,h+s+a.cellHorizontalPadding+.5,u+f/2+dr(r,a)),r.beginPath()}function Nd(e,t,n,r,i,o,a){e.textBaseline="alphabetic";const l=Ov(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),cr(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??jr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function Ov(e,t,n,r,i){const o=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const l=Qr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:l.width+o*3,height:u-1}}const Pv=d.lazy(async()=>await Fs(()=>import("./number-overlay-editor.VB_OvuPv.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),_v={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:go,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:u}=n;l===!0&&t>0&&Nd(r,i,u,s,o,t,a),ur(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 d.createElement(d.Suspense,{fallback:null},d.createElement(Pv,{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}}},Lv={getAccessibilityString:()=>"",measure:()=>108,kind:te.Protected,needsHover:!1,needsHoverPosition:!1,draw:Fv,onPaste:()=>{}};function Fv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:a}=r;t.beginPath();const l=2.5;let s=i+n.cellHorizontalPadding+l;const u=o+a/2,c=Math.cos(tu(30))*l,f=Math.sin(tu(30))*l;for(let g=0;g<12;g++)t.moveTo(s,u-l),t.lineTo(s,u+l),t.moveTo(s+c,u-f),t.lineTo(s-c,u+f),t.moveTo(s-c,u-f),t.lineTo(s+c,u+f),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Av={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>go(e,t,e.theme.textLight),draw:e=>ur(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 At.createElement(Zr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Hv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:go,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:f,hoverEffectTheme:g}=t;c===!0&&n>0&&Nd(i,a,g,s,o,n,l),ur(e,s,u,f,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 d.createElement(Zr,{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:a=>r({...i,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},zv=mn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Vv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:a}=e,[l,s]=d.useState(!i&&(t===""||r)),u=d.useCallback(()=>{s(!0)},[]);return l?d.createElement(Zr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(zv,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!i&&d.createElement("div",{className:"gdg-edit-icon",onClick:u},d.createElement(Ns,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Bd(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?i=t.width-a-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-a/2),{x:i,y:o,width:a,height:l}}function Hu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=pd(a,o.baseFontFull);if(l===void 0)return!1;const s=Bd(l,n,o,t.contentAlign);return Xr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const $v={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:go,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:a,ctx:l}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Qr(s,l,n.baseFontFull),f=Bd(c,a,n,t.contentAlign),{x:g,y:h,width:m,height:p}=f;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const v=dr(l,n.baseFontFull);r("pointer");const w=5,b=h-v;l.beginPath(),l.moveTo(a.x+g,Math.floor(a.y+b+p+w)+.5),l.lineTo(a.x+g+m,Math.floor(a.y+b+p+w)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,ur({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),ur({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),ur({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),ur({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=u?n.linkColor:n.textDark,ur(e,s,t.contentAlign)},onSelect:e=>{Hu(e)&&e.preventDefault()},onClick:e=>{var r;const{cell:t}=e;Hu(e)&&((r=t.onClickUri)==null||r.call(t,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 d.createElement(Vv,{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:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Nv=[Mv,Tv,ov,uv,gv,bv,Cv,kv,_v,Lv,Av,Hv,$v];var fs,zu;function Bv(){if(zu)return fs;zu=1;var e=Jc(),t=Tc(),n="Expected a function";function r(i,o,a){var l=!0,s=!0;if(typeof i!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(i,o,{leading:l,maxWait:o,trailing:s})}return fs=r,fs}var Wv=Bv();const Uv=wr(Wv),hs=[];class qv extends yd{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",Uv(()=>{this.imageLoaded(new ro(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const i=this.cache[r];let o=!1;for(let a=0;a<i.cells.length;a++){const l=i.cells[a];if(this.isInWindow(l)){o=!0;break}}o?i.cells=i.cells.filter(this.isInWindow):(i.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,i,o){let a=!1;const l=hs.pop()??new Image;let s=!1;const u={img:void 0,cells:[tr(r,i)],url:n,cancel:()=>{s||(s=!0,hs.length<12?hs.unshift(l):a||(l.src=""))}},c=new Promise(f=>l.addEventListener("load",()=>f(null)));requestAnimationFrame(async()=>{try{l.src=n,await c,await l.decode();const f=this.cache[o];if(f!==void 0&&!s){f.img=l;for(const g of f.cells)this.loadedLocations.push(js(g));a=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,r,i){const o=n,a=this.cache[o];if(a!==void 0){const l=tr(r,i);return a.cells.includes(l)||a.cells.push(l),a.img}else this.loadImage(n,r,i,o)}}const Yv=(e,t)=>{const n=d.useMemo(()=>({...Ap,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.imageWindowLoader??new qv,[e.imageWindowLoader]);return d.createElement(iv,{...e,renderers:Nv,headerIcons:n,ref:t,imageWindowLoader:r})},Xv=d.forwardRef(Yv);function Vu(e,t){const n=d.useRef(null),r=d.useRef(),i=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>i,[i]),{debouncedCallback:d.useCallback((...a)=>{r.current=a,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Wd=Ci("div",{target:"ee4nolw0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Pr=Ci("div",{target:"ee4nolw1"})(({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}}})),jv=Ci("div",{target:"ee4nolw2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),$u=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],Gv={number:$u,progress:$u,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 Kv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:a}){const l=Gr(),{colors:s,fontSizes:u,radii:c,fontWeights:f}=l,g=Gv[e]||[];return g.length===0?lt(Pc,{}):lt(xa,{triggerType:_c.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:lt(Wd,{role:"menu",children:g.map(h=>Ln(Pr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:Ca.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:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Sa(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:u.sm,fontWeight:f.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:a})}const Zv=d.memo(Kv);function Jv({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:a,onHideColumn:l,columnKind:s,onChangeFormat:u,onAutosize:c}){const f=Gr(),[g,h]=d.useState(!1),{colors:m,fontSizes:p,radii:v,fontWeights:w}=f;d.useEffect(()=>{function M(O){O.preventDefault()}return document.addEventListener("wheel",M,{passive:!1}),document.addEventListener("touchmove",M,{passive:!1}),()=>{document.removeEventListener("wheel",M),document.removeEventListener("touchmove",M)}},[]);const b=d.useCallback(()=>{o()},[o]);return lt(xa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Ln(Wd,{children:[a&&Ln(Pc,{children:[Ln(Pr,{onClick:()=>{a("asc"),b()},role:"menuitem",children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Ln(Pr,{onClick:()=>{a("desc"),b()},role:"menuitem",children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),lt(jv,{})]}),u&<(Zv,{columnKind:s,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:b,children:Ln(Pr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[Ln("div",{children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&Ln(Pr,{onClick:()=>{c(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&Ln(Pr,{onClick:()=>{i(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Ln(Pr,{onClick:()=>{r(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),l&&Ln(Pr,{onClick:()=>{l(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Ca.bottomRight,accessibilityType:Lc.menu,showArrow:!1,popoverMargin:Wn("0.375rem"),onClickOutside:g?void 0:b,onEsc:b,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${f.sizes.borderWidth} solid ${f.colors.borderColor}`,backgroundColor:Sa(f)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:w.normal,borderTopLeftRadius:v.default,borderTopRightRadius:v.default,borderBottomLeftRadius:v.default,borderBottomRightRadius:v.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:lt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Qv=d.memo(Jv),e1="(index)",t1=({label:e,initialValue:t,onChange:n})=>{const r=Gr();return lt(mg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:gg.default,labelPlacement:hg.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 a=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 ${Jo(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:a,borderRightColor:a,borderTopColor:a,borderBottomColor:a}}},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})},n1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:a,onClose:l})=>{const s=Gr();return lt(xa,{triggerType:_c.click,placement:Ca.bottomRight,autoFocus:!0,focusLock:!0,content:()=>lt("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return lt(t1,{label:!u.title&&u.isIndex?e1:u.title,initialValue:!(u.isHidden===!0||c),onChange:f=>{f?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:a,onClickOutside:l,onClick:()=>a?l():void 0,onEsc:l,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Sa(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:lt("div",{children:o})})},r1=d.memo(n1);var i1=kh();const o1=wr(i1);var ta={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:te.Text,data:"",displayData:"",allowOverlay:!0,conten
|
|
193
193
|
40% { opacity: 1; }
|
194
194
|
`]))),ow=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return Ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},ms=function(t){var n=t.delay,r=t.offset;return $e("span",{css:Nc({animation:"".concat(iw," 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"},"","")})},aw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=yr(t,Kb);return $e("div",Ke({},tn(Ye(Ye({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),$e(ms,{delay:0,offset:r}),$e(ms,{delay:160,offset:!0}),$e(ms,{delay:320,offset:!r}))},sw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,s=o.spacing;return Ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},lw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return $e("div",Ke({ref:o},tn(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},uw=lw,cw=["data"],dw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},fw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,f=t.selectProps;return $e("div",Ke({},tn(t,"group",{group:!0}),s),$e(a,Ke({},l,{selectProps:f,theme:c,getStyles:i,getClassNames:o,cx:r}),u),$e("div",null,n))},hw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Ye({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"})},gw=function(t){var n=cf(t);n.data;var r=yr(n,cw);return $e("div",Ke({},tn(t,"groupHeading",{"group-heading":!0}),r))},mw=fw,pw=["innerRef","isDisabled","isHidden","inputClassName"],vw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return Ye(Ye({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},bw),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},wf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},bw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},wf)},ww=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},wf)},yw=function(t){var n=t.cx,r=t.value,i=cf(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,s=i.inputClassName,u=yr(i,pw);return $e("div",Ke({},tn(t,"input",{"input-container":!0}),{"data-value":r||""}),$e("input",Ke({className:n({input:!0},s),ref:o,style:ww(l),disabled:a},u)))},Cw=yw,Sw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},xw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},kw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},yf=function(t){var n=t.children,r=t.innerProps;return $e("div",r,n)},Mw=yf,Rw=yf;function Ew(e){var t=e.children,n=e.innerProps;return $e("div",Ke({role:"button"},n),t||$e(fl,{size:14}))}var Iw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,f=r.Remove;return $e(u,{data:i,innerProps:Ye(Ye({},tn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:s},$e(c,{data:i,innerProps:Ye({},tn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),$e(f,{data:i,innerProps:Ye(Ye({},tn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:s}))},Tw=Iw,Dw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,s=a.colors;return Ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?s.primary:i?s.primary25:"transparent",color:r?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},Ow=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return $e("div",Ke({},tn(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},Pw=Ow,_w=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},Lw=function(t){var n=t.children,r=t.innerProps;return $e("div",Ke({},tn(t,"placeholder",{placeholder:!0}),r),n)},Fw=Lw,Aw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Hw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return $e("div",Ke({},tn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},zw=Hw,Cf={ClearIndicator:tw,Control:uw,DropdownIndicator:Qb,DownChevron:vf,CrossIcon:fl,Group:mw,GroupHeading:gw,IndicatorsContainer:jb,IndicatorSeparator:rw,Input:Cw,LoadingIndicator:aw,Menu:Lb,MenuList:Ab,MenuPortal:Bb,LoadingMessage:$b,NoOptionsMessage:Vb,MultiValue:Tw,MultiValueContainer:Mw,MultiValueLabel:Rw,MultiValueRemove:Ew,Option:Pw,Placeholder:Fw,SelectContainer:Ub,SingleValue:zw,ValueContainer:Yb},Vw=function(t){return Ye(Ye({},Cf),t.components)},uc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function $w(e,t){return!!(e===t||uc(e)&&uc(t))}function Nw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!$w(e[n],t[n]))return!1;return!0}function Bw(e,t){t===void 0&&(t=Nw);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 a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}var Ww={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"},Uw=function(t){return $e("span",Ke({css:Ww},t))},cc=Uw,qw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=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 a?"".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,a=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 a?"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,a=o===void 0?"":o,l=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,f=function(p,v){return p&&p.length?"".concat(p.indexOf(v)+1," of ").concat(p.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(f(l,r),".");if(n==="menu"&&c){var g=s?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(a).concat(h,", ").concat(f(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},Yw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,f=s.ariaLiveMessages,g=s.getOptionLabel,h=s.inputValue,m=s.isMulti,p=s.isOptionDisabled,v=s.isSearchable,w=s.menuIsOpen,b=s.options,M=s.screenReaderStatus,O=s.tabSelectsValue,S=s.isLoading,R=s["aria-label"],_=s["aria-live"],E=d.useMemo(function(){return Ye(Ye({},qw),f||{})},[f]),x=d.useMemo(function(){var k="";if(n&&E.onChange){var z=n.option,N=n.options,X=n.removedValue,re=n.removedValues,j=n.value,G=function(P){return Array.isArray(P)?null:P},ae=X||z||G(j),ie=ae?g(ae):"",le=N||re||void 0,fe=le?le.map(g):[],Q=Ye({isDisabled:ae&&p(ae,l),label:ie,labels:fe},n);k=E.onChange(Q)}return k},[n,E,p,l,g]),L=d.useMemo(function(){var k="",z=r||i,N=!!(r&&l&&l.includes(r));if(z&&E.onFocus){var X={focused:z,label:g(z),isDisabled:p(z,l),isSelected:N,options:o,context:z===r?"menu":"value",selectValue:l,isAppleDevice:c};k=E.onFocus(X)}return k},[r,i,g,p,E,o,l,c]),D=d.useMemo(function(){var k="";if(w&&b.length&&!S&&E.onFilter){var z=M({count:o.length});k=E.onFilter({inputValue:h,resultsMessage:z})}return k},[o,h,w,E,b,M,S]),C=(n==null?void 0:n.action)==="initial-input-focus",I=d.useMemo(function(){var k="";if(E.guidance){var z=i?"value":w?"menu":"input";k=E.guidance({"aria-label":R,context:z,isDisabled:r&&p(r,l),isMulti:m,isSearchable:v,tabSelectsValue:O,isInitialFocus:C})}return k},[R,r,i,m,p,v,w,E,l,O,C]),T=$e(d.Fragment,null,$e("span",{id:"aria-selection"},x),$e("span",{id:"aria-focused"},L),$e("span",{id:"aria-results"},D),$e("span",{id:"aria-guidance"},I));return $e(d.Fragment,null,$e(cc,{id:u},C&&T),$e(cc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!C&&T))},Xw=Yw,_s=[{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źẑżžẓẕƶȥɀⱬꝣ"}],jw=new RegExp("["+_s.map(function(e){return e.letters}).join("")+"]","g"),Sf={};for(var ps=0;ps<_s.length;ps++)for(var vs=_s[ps],bs=0;bs<vs.letters.length;bs++)Sf[vs.letters[bs]]=vs.base;var xf=function(t){return t.replace(jw,function(n){return Sf[n]})},Gw=Bw(xf),dc=function(t){return t.replace(/^\s+|\s+$/g,"")},Kw=function(t){return"".concat(t.label," ").concat(t.value)},Zw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:Kw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,s=i.trim,u=i.matchFrom,c=s?dc(r):r,f=s?dc(l(n)):l(n);return o&&(c=c.toLowerCase(),f=f.toLowerCase()),a&&(c=Gw(c),f=xf(f)),u==="start"?f.substr(0,c.length)===c:f.indexOf(c)>-1}},Jw=["innerRef"];function Qw(e){var t=e.innerRef,n=yr(e,Jw),r=Rb(n,"onExited","in","enter","exit","appear");return $e("input",Ke({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 ey=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function ty(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=d.useRef(!1),l=d.useRef(!1),s=d.useRef(0),u=d.useRef(null),c=d.useCallback(function(v,w){if(u.current!==null){var b=u.current,M=b.scrollTop,O=b.scrollHeight,S=b.clientHeight,R=u.current,_=w>0,E=O-S-M,x=!1;E>w&&a.current&&(r&&r(v),a.current=!1),_&&l.current&&(o&&o(v),l.current=!1),_&&w>E?(n&&!a.current&&n(v),R.scrollTop=O,x=!0,a.current=!0):!_&&-w>M&&(i&&!l.current&&i(v),R.scrollTop=0,x=!0,l.current=!0),x&&ey(v)}},[n,r,i,o]),f=d.useCallback(function(v){c(v,v.deltaY)},[c]),g=d.useCallback(function(v){s.current=v.changedTouches[0].clientY},[]),h=d.useCallback(function(v){var w=s.current-v.changedTouches[0].clientY;c(v,w)},[c]),m=d.useCallback(function(v){if(v){var w=xb?{passive:!1}:!1;v.addEventListener("wheel",f,w),v.addEventListener("touchstart",g,w),v.addEventListener("touchmove",h,w)}},[h,g,f]),p=d.useCallback(function(v){v&&(v.removeEventListener("wheel",f,!1),v.removeEventListener("touchstart",g,!1),v.removeEventListener("touchmove",h,!1))},[h,g,f]);return d.useEffect(function(){if(t){var v=u.current;return m(v),function(){p(v)}}},[t,m,p]),function(v){u.current=v}}var fc=["boxSizing","height","overflow","paddingRight","position"],hc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function gc(e){e.preventDefault()}function mc(e){e.stopPropagation()}function pc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function vc(){return"ontouchstart"in window||navigator.maxTouchPoints}var bc=!!(typeof window<"u"&&window.document&&window.document.createElement),Gi=0,fi={capture:!1,passive:!1};function ny(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=d.useRef({}),o=d.useRef(null),a=d.useCallback(function(s){if(bc){var u=document.body,c=u&&u.style;if(r&&fc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Gi<1){var f=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+f||0;Object.keys(hc).forEach(function(m){var p=hc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&vc()&&(u.addEventListener("touchmove",gc,fi),s&&(s.addEventListener("touchstart",pc,fi),s.addEventListener("touchmove",mc,fi))),Gi+=1}},[r]),l=d.useCallback(function(s){if(bc){var u=document.body,c=u&&u.style;Gi=Math.max(Gi-1,0),r&&Gi<1&&fc.forEach(function(f){var g=i.current[f];c&&(c[f]=g)}),u&&vc()&&(u.removeEventListener("touchmove",gc,fi),s&&(s.removeEventListener("touchstart",pc,fi),s.removeEventListener("touchmove",mc,fi)))}},[r]);return d.useEffect(function(){if(t){var s=o.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){o.current=s}}var ry=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},iy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oy(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,u=ty({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),c=ny({isEnabled:n}),f=function(h){u(h),c(h)};return $e(d.Fragment,null,n&&$e("div",{onClick:ry,css:iy}),t(f))}var ay={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},sy=function(t){var n=t.name,r=t.onFocus;return $e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:ay,value:"",onChange:function(){}})},ly=sy;function hl(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 uy(){return hl(/^iPhone/i)}function kf(){return hl(/^Mac/i)}function cy(){return hl(/^iPad/i)||kf()&&navigator.maxTouchPoints>1}function dy(){return uy()||cy()}function fy(){return kf()||dy()}var hy=function(t){return t.label},gy=function(t){return t.label},my=function(t){return t.value},py=function(t){return!!t.isDisabled},vy={clearIndicator:ew,container:Wb,control:sw,dropdownIndicator:Jb,group:dw,groupHeading:hw,indicatorsContainer:Xb,indicatorSeparator:nw,input:vw,loadingIndicator:ow,loadingMessage:zb,menu:Ob,menuList:Fb,menuPortal:Nb,multiValue:Sw,multiValueLabel:xw,multiValueRemove:kw,noOptionsMessage:Hb,option:Dw,placeholder:_w,singleValue:Aw,valueContainer:qb},by={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%)"},wy=4,Mf=4,yy=38,Cy=Mf*2,Sy={baseUnit:Mf,controlHeight:yy,menuGutter:Cy},ws={borderRadius:wy,colors:by,spacing:Sy},xy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:sc(),captureMenuScroll:!sc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Zw(),formatGroupLabel:hy,getOptionLabel:gy,getOptionValue:my,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:py,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Cb(),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 wc(e,t,n,r){var i=If(e,t,n),o=Tf(e,t,n),a=Ef(e,t),l=ya(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function ra(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return wc(e,a,t,l)}).filter(function(a){return Cc(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=wc(e,n,t,r);return Cc(e,o)?o:void 0}).filter(kb)}function Rf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Hs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function yc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Hs(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 ky(e,t){return Rf(ra(e,t))}function Cc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!Of(e)||!o)&&Df(e,{label:a,value:l,data:i},r)}function My(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 Ry(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},Ef=function(t,n){return t.getOptionLabel(n)},ya=function(t,n){return t.getOptionValue(n)};function If(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=ya(e,t);return n.some(function(i){return ya(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},Ey=1,Pf=function(e){yg(n,e);var t=xg(n);function n(r){var i;if(Sg(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=fy(),i.controlRef=null,i.getControlRef=function(s){i.controlRef=s},i.focusedOptionRef=null,i.getFocusedOptionRef=function(s){i.focusedOptionRef=s},i.menuListRef=null,i.getMenuListRef=function(s){i.menuListRef=s},i.inputRef=null,i.getInputRef=function(s){i.inputRef=s},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(s,u){var c=i.props,f=c.onChange,g=c.name;u.name=g,i.ariaOnChange(s,u),f(s,u)},i.setValue=function(s,u,c){var f=i.props,g=f.closeMenuOnSelect,h=f.isMulti,m=f.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(s,{action:u,option:c})},i.selectOption=function(s){var u=i.props,c=u.blurInputOnSelect,f=u.isMulti,g=u.name,h=i.state.selectValue,m=f&&i.isOptionSelected(s,h),p=i.isOptionDisabled(s,h);if(m){var v=i.getOptionValue(s);i.setValue(h.filter(function(w){return i.getOptionValue(w)!==v}),"deselect-option",s)}else if(!p)f?i.setValue([].concat(Hs(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:g});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,f=i.getOptionValue(s),g=c.filter(function(m){return i.getOptionValue(m)!==f}),h=Zo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(Zo(i.props.isMulti,[],null),{action:"clear",removedValues:s})},i.popValue=function(){var s=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],f=u.slice(0,u.length-1),g=Zo(s,f,f[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return ys(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return yc(ra(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return pb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return Ef(i.props,s)},i.getOptionValue=function(s){return ya(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,f=vy[s](u,c);f.boxSizing="border-box";var g=i.props.styles[s];return g?g(f,u):f},i.getClassNames=function(s,u){var c,f;return(c=(f=i.props.classNames)[s])===null||c===void 0?void 0:c.call(f,u)},i.getElementId=function(s){return"".concat(i.state.instancePrefix,"-").concat(s)},i.getComponents=function(){return Vw(i.props)},i.buildCategorizedOptions=function(){return ra(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return Rf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:Ye({value:s},u)})},i.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(s){i.blockOptionHover=!1},i.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},i.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,f=u.menuIsOpen;i.focusInput(),f?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),s.preventDefault()}},i.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(i.clearValue(),s.preventDefault(),i.openAfterFocus=!1,s.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(s){typeof i.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Ea(s.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(s)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var f=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=f>h||g>h}},i.onTouchEnd=function(s){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(s.target)&&i.menuListRef&&!i.menuListRef.contains(s.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(s){i.userIsDragging||i.onControlMouseDown(s)},i.onClearIndicatorTouchEnd=function(s){i.userIsDragging||i.onClearIndicatorMouseDown(s)},i.onDropdownIndicatorTouchEnd=function(s){i.userIsDragging||i.onDropdownIndicatorMouseDown(s)},i.handleInputChange=function(s){var u=i.props.inputValue,c=s.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(s){i.props.onFocus&&i.props.onFocus(s),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(s){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(s),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(s){if(!(i.blockOptionHover||i.state.focusedOption===s)){var u=i.getFocusableOptions(),c=u.indexOf(s);i.setState({focusedOption:s,focusedOptionId:c>-1?i.getFocusedOptionId(s):null})}},i.shouldHideSelectedOptions=function(){return Of(i.props)},i.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),i.focus()},i.onKeyDown=function(s){var u=i.props,c=u.isMulti,f=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,v=u.menuIsOpen,w=u.onKeyDown,b=u.tabSelectsValue,M=u.openMenuOnFocus,O=i.state,S=O.focusedOption,R=O.focusedValue,_=O.selectValue;if(!p&&!(typeof w=="function"&&(w(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!f)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||s.shiftKey||!v||!b||!S||M&&i.isOptionSelected(S,_))return;i.selectOption(S);break;case"Enter":if(s.keyCode===229)break;if(v){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":v?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!v){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":v?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":v?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!v)return;i.focusOption("pageup");break;case"PageDown":if(!v)return;i.focusOption("pagedown");break;case"Home":if(!v)return;i.focusOption("first");break;case"End":if(!v)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Ey),i.state.selectValue=oc(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=ys(o,a[l])}return i}return Cg(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&&ac(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,s=this.state.isFocused;(s&&!a&&i.isDisabled||s&&l&&!i.menuIsOpen)&&this.focusInput(),s&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ac(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,a=this.state,l=a.selectValue,s=a.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var f=u.indexOf(l[0]);f>-1&&(c=f)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=a.indexOf(l);l||(s=-1);var u=a.length-1,c=-1;if(a.length){switch(i){case"previous":s===0?c=0:s===-1?c=u:c=s-1;break;case"next":s>-1&&s<u&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var s=0,u=l.indexOf(a);a||(u=-1),i==="up"?s=u>0?u-1:l.length-1:i==="down"?s=(u+1)%l.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>l.length-1&&(s=l.length-1)):i==="last"&&(s=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(ws):Ye(Ye({},ws),this.props.theme):ws}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,f=this.props,g=f.isMulti,h=f.isRtl,m=f.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:s,hasValue:p,isMulti:g,isRtl:h,options:m,selectOption:u,selectProps:f,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,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return If(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 a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}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,a=i.isSearchable,l=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,f=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,v=p.inputIsHidden,w=p.ariaSelection,b=this.commonProps,M=l||this.getElementId("input"),O=Ye(Ye(Ye({"aria-autocomplete":"list","aria-expanded":f,"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||""},f&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(w==null?void 0:w.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?d.createElement(m,Ke({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:M,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},O)):d.createElement(Qw,Ke({id:M,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ba,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,l=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,f=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,v=h.isMulti,w=h.inputValue,b=h.placeholder,M=this.state,O=M.selectValue,S=M.focusedValue,R=M.isFocused;if(!this.hasValue()||!m)return w?null:d.createElement(f,Ke({},g,{key:"placeholder",isDisabled:p,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return O.map(function(E,x){var L=E===S,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return d.createElement(a,Ke({},g,{components:{Container:l,Label:s,Remove:u},isFocused:L,isDisabled:p,key:D,index:x,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(I){I.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(w)return null;var _=O[0];return d.createElement(c,Ke({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||s||!this.hasValue()||u)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ke({},a,{innerProps:f,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!o||!u)return null;var f={"aria-hidden":"true"};return d.createElement(o,Ke({},a,{innerProps:f,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return d.createElement(a,Ke({},l,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ke({},a,{innerProps:u,isDisabled:l,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,f=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,v=this.props,w=v.captureMenuScroll,b=v.inputValue,M=v.isLoading,O=v.loadingMessage,S=v.minMenuHeight,R=v.maxMenuHeight,_=v.menuIsOpen,E=v.menuPlacement,x=v.menuPosition,L=v.menuPortalTarget,D=v.menuShouldBlockScroll,C=v.menuShouldScrollIntoView,I=v.noOptionsMessage,T=v.onMenuScrollToTop,k=v.onMenuScrollToBottom;if(!_)return null;var z=function(ie,le){var fe=ie.type,Q=ie.data,H=ie.isDisabled,P=ie.isSelected,W=ie.label,ce=ie.value,De=p===Q,He=H?void 0:function(){return i.onOptionHover(Q)},ye=H?void 0:function(){return i.selectOption(Q)},Re="".concat(i.getElementId("option"),"-").concat(le),Se={id:Re,onClick:ye,onMouseMove:He,onMouseOver:He,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return d.createElement(h,Ke({},m,{innerProps:Se,data:Q,isDisabled:H,isSelected:P,key:Re,label:W,type:fe,value:ce,isFocused:De,innerRef:De?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ie.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(ae){if(ae.type==="group"){var ie=ae.data,le=ae.options,fe=ae.index,Q="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(Q,"-heading");return d.createElement(a,Ke({},m,{key:Q,data:ie,options:le,Heading:l,headingProps:{id:H,data:ae.data},label:i.formatGroupLabel(ae.data)}),ae.options.map(function(P){return z(P,"".concat(fe,"-").concat(P.index))}))}else if(ae.type==="option")return z(ae,"".concat(ae.index))});else if(M){var X=O({inputValue:b});if(X===null)return null;N=d.createElement(f,m,X)}else{var re=I({inputValue:b});if(re===null)return null;N=d.createElement(g,m,re)}var j={minMenuHeight:S,maxMenuHeight:R,menuPlacement:E,menuPosition:x,menuShouldScrollIntoView:C},G=d.createElement(Pb,Ke({},m,j),function(ae){var ie=ae.ref,le=ae.placerProps,fe=le.placement,Q=le.maxHeight;return d.createElement(s,Ke({},m,j,{innerRef:ie,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:M,placement:fe}),d.createElement(oy,{captureEnabled:w,onTopArrive:T,onBottomArrive:k,lockEnabled:D},function(H){return d.createElement(u,Ke({},m,{innerRef:function(W){i.getMenuListRef(W),H(W)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:M,maxHeight:Q,focusedOption:p}),N)}))});return L||x==="fixed"?d.createElement(c,Ke({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:E,menuPosition:x}),G):G}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,f=this.state.selectValue;if(c&&!this.hasValue()&&!l)return d.createElement(ly,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(s)if(a){var g=f.map(function(p){return i.getOptionValue(p)}).join(a);return d.createElement("input",{name:u,type:"hidden",value:g})}else{var h=f.length>0?f.map(function(p,v){return d.createElement("input",{key:"i-".concat(v),name:u,type:"hidden",value:i.getOptionValue(p)})}):d.createElement("input",{name:u,type:"hidden",value:""});return d.createElement("div",null,h)}else{var m=f[0]?this.getOptionValue(f[0]):"";return d.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,f=this.getFocusableOptions();return d.createElement(Xw,Ke({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,f=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return d.createElement(l,Ke({},p,{className:c,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),d.createElement(o,Ke({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),d.createElement(s,Ke({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(a,Ke({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,f=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,v=i.inputValue,w=i.isMulti,b=oc(m),M={};if(a&&(m!==a.value||h!==a.options||p!==a.menuIsOpen||v!==a.inputValue)){var O=p?ky(i,b):[],S=p?yc(ra(i,b),"".concat(g,"-option")):[],R=l?My(o,b):null,_=Ry(o,O),E=ys(S,_);M={selectValue:b,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:S,focusedValue:R,clearFocusValueOnUpdate:!1}}var x=s!=null&&i!==a?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},L=u,D=c&&f;return c&&!D&&(L={value:Zo(w,b,b[0]||null),options:b,action:"initial-input-focus"},D=!f),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),Ye(Ye(Ye({},M),x),{},{prevProps:i,ariaSelection:L,prevWasFocused:D})}}]),n}(d.Component);Pf.defaultProps=xy;var Iy=d.forwardRef(function(e,t){var n=Q1(e);return d.createElement(Pf,Ke({ref:t},n))}),Ty=Iy;const Dy=e=>{const{Menu:t}=Cf,{children:n,...r}=e;return d.createElement(t,{...r},n)},Oy=mn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Py=mn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),_y=mn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Ly=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:i,value:o}=t.data,[a,l]=d.useState(o),[s,u]=d.useState(r??""),c=Gm(),f=d.useMemo(()=>i.map(g=>typeof g=="string"||g===null||g===void 0?{value:g,label:(g==null?void 0:g.toString())??""}:g),[i]);return t.readonly?d.createElement(_y,null,d.createElement(Zr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):d.createElement(Oy,null,d.createElement(Ty,{className:"glide-select",inputValue:s,onInputChange:u,menuPlacement:"auto",value:f.find(g=>g.value===a),styles:{control:g=>({...g,border:0,boxShadow:"none"}),option:(g,{isFocused:h})=>({...g,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:h?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...g[":active"],color:c.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:g=>({...g,colors:{...g.colors,neutral0:c.bgCell,neutral5:c.bgCell,neutral10:c.bgCell,neutral20:c.bgCellMedium,neutral30:c.bgCellMedium,neutral40:c.bgCellMedium,neutral50:c.textLight,neutral60:c.textMedium,neutral70:c.textMedium,neutral80:c.textDark,neutral90:c.textDark,neutral100:c.textDark,primary:c.accentColor,primary75:c.accentColor,primary50:c.accentColor,primary25:c.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:g=>d.createElement(Py,null,d.createElement(Dy,{className:"click-outside-ignore",...g}))},options:f,onChange:async g=>{g!==null&&(l(g.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:g.value}}))}}))},Fy={kind:te.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),l=typeof a=="string"?a:(a==null?void 0:a.label)??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,i.x+r.cellHorizontalPadding,i.y+i.height/2+dr(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Ly,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Ur=6,Ay={marginRight:8},Hy={display:"flex",alignItems:"center",flexGrow:1},zy={kind:te.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:a,value:l,label:s,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,f=i.y+i.height/2,g=a-o,h=(l-o)/g;n.save();let m=0;s!==void 0&&(n.font=`12px ${r.fontFamily}`,m=Qr(u??s,n,`12px ${r.fontFamily}`).width+r.cellHorizontalPadding);const p=i.width-r.cellHorizontalPadding*2-m;if(p>=Ur){const v=n.createLinearGradient(c,f,c+p,f);v.addColorStop(0,r.accentColor),v.addColorStop(h,r.accentColor),v.addColorStop(h,r.bgBubble),v.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=v,ec(n,c,f-Ur/2,p,Ur,Ur/2),n.fill(),n.beginPath(),ec(n,c+.5,f-Ur/2+.5,p-1,Ur-1,(Ur-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,i.x+i.width-r.cellHorizontalPadding,f+dr(n,`12px ${r.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return d.createElement("label",{style:Hy},d.createElement("input",{style:Ay,type:"range",value:r,min:i,max:o,step:a,onChange:l,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Vy=mn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Cs=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},$y=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.min instanceof Date?Cs(n,t.min):t.min,a=t.max instanceof Date?Cs(n,t.max):t.max;let l=t.date;const s=t.timezoneOffset?t.timezoneOffset*60*1e3:0;s&&l&&(l=new Date(l.getTime()+s));const u=Cs(n,l);return e.value.readonly?At.createElement(Zr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):At.createElement(Vy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:i,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-s)}})}})},Ny={kind:te.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return qs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:$y}),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)}}},By="None";function Sc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Wy=e=>{const{cell:t,theme:n,ctx:r}=e;qs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},By,t.contentAlign),r.fillStyle=n.textDark};function Uy(e){const t=d.useCallback((r,i)=>{const{cell:o,theme:a,ctx:l,rect:s}=r,u=r.col;if(bi(o))Sc(l,s,a);else if(Ma(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Wy(r),c.isRequired&&c.isEditable&&Sc(l,s,a);return}i()},[e]),n=d.useMemo(()=>[Z1,Fy,zy,Ny,...M1],[]);return{drawCell:t,customRenderers:n}}function qy(){const e=Gr();return d.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:Jo(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Jo(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.darkenedBgMix15,bgHeaderHovered:e.colors.darkenedBgMix15,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${Wn(e.fontSizes.sm)}px`,baseFontStyle:`${Wn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Jo(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(Wn(e.spacing.sm)),cellVerticalPadding:Math.round(Wn("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(Wn("25rem")),minColumnWidth:Math.round(Wn("3.125rem")),maxColumnWidth:Math.round(Wn("62.5rem")),maxColumnAutoWidth:Math.round(Wn("31.25rem")),defaultRowHeight:Math.round(Wn("2.1875rem")),defaultHeaderHeight:Math.round(Wn("2.1875rem")),bgRowHovered:ng(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Yy=As.getLogger("useDataEditor");function Xy(e,t,n,r,i,o,a,l,s){const u=d.useCallback(([p,v],w)=>{const b=e[p];if(!b.isEditable)return;const M=b.indexNumber,O=n.current.getOriginalRowIndex(i(v)),S=r([p,v]),R=b.getCellValue(S),_=b.getCellValue(w);if(!bi(S)&&_===R)return;const E=b.getCell(_,!0);bi(E)?Yy.warn(`Not applying the cell edit since it causes this error:
|
195
195
|
${E.data}`):(n.current.setCell(M,O,{...E,lastUpdated:performance.now()}),l())},[e,n,i,r,l]),c=d.useCallback(()=>{if(t)return;const p=new Map;e.forEach(v=>{p.set(v.indexNumber,v.getCell(v.defaultValue))}),n.current.addRow(p),a()},[e,n,t,a]),f=d.useCallback(()=>{t||(c(),l())},[c,l,t]),g=d.useCallback(p=>{var v;if(p.rows.length>0){if(t)return!0;const w=p.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(w),a(),s(),l(),!1}if((v=p.current)!=null&&v.range){const w=[],b=p.current.range;for(let M=b.y;M<b.y+b.height;M++)for(let O=b.x;O<b.x+b.width;O++){const S=e[O];S.isEditable&&!S.isRequired&&(w.push({cell:[O,M]}),u([O,M],S.getCell(null)))}return w.length>0&&(l(),o(w)),!1}return!0},[e,n,t,o,i,l,u,s,a]),h=d.useCallback((p,v)=>{const[w,b]=p,M=[];for(let O=0;O<v.length;O++){const S=v[O];if(O+b>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<S.length;R++){const _=S[R],E=O+b,x=R+w;if(x>=e.length)break;const L=e[x];if(L.isEditable){const D=L.getCell(_,!0);if(pt(D)&&!bi(D)){const C=L.indexNumber,I=n.current.getOriginalRowIndex(i(E)),T=L.getCellValue(r([x,E]));L.getCellValue(D)!==T&&(n.current.setCell(C,I,{...D,lastUpdated:performance.now()}),M.push({cell:[x,E]}))}}}M.length>0&&(l(),o(M))}return!1},[e,n,t,i,r,c,l,o]),m=d.useCallback((p,v)=>{const w=p[0];if(w>=e.length)return!0;const b=e[w];if(b.validateInput){const M=b.validateInput(b.getCellValue(v));return M===!0||M===!1?M:b.getCell(M)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:f,onDelete:g,validateCell:m}}const _f=",",Qi='"',jy='"',Lf=`
|
196
|
-
`,Gy="\uFEFF",Ky=new RegExp(`[${[_f,Qi,Lf].join("")}]`),xc=As.getLogger("useDataExporter");function kc(e){return e.map(t=>Zy(t)).join(_f)+Lf}function Zy(e){if(Ne(e))return"";const t=bt(e);return Ky.test(t)?`${Qi}${t.replace(new RegExp(Qi,"g"),jy+Qi)}${Qi}`:t}async function Mc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Gy));const o=n.map(a=>a.name);await e.write(i.encode(kc(o)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(i.encode(kc(l)))}await e.close()}function Jy(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fs(()=>import("./es6.
|
196
|
+
`,Gy="\uFEFF",Ky=new RegExp(`[${[_f,Qi,Lf].join("")}]`),xc=As.getLogger("useDataExporter");function kc(e){return e.map(t=>Zy(t)).join(_f)+Lf}function Zy(e){if(Ne(e))return"";const t=bt(e);return Ky.test(t)?`${Qi}${t.replace(new RegExp(Qi,"g"),jy+Qi)}${Qi}`:t}async function Mc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Gy));const o=n.map(a=>a.name);await e.write(i.encode(kc(o)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(i.encode(kc(l)))}await e.close()}function Jy(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fs(()=>import("./es6.DM-pf09u.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Mc(u,e,t,n)}catch(l){if(l instanceof Error&&l.name==="AbortError")return;try{xc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",l);let s="";const u=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Mc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),f=URL.createObjectURL(c),g=bg({enforceDownloadInNewTab:r,url:f,filename:a});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(f)}catch(s){xc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Qy(e,t,n,r){return{getCellContent:d.useCallback(([o,a])=>{var l;if(o>t.length-1)return Ht("Column index out of bounds","This error should never happen. Please report this bug.");if(a>n-1)return Ht("Row index out of bounds","This error should never happen. Please report this bug.");try{const s=t[o],u=s.indexNumber,c=r.current.getOriginalRowIndex(a),f=r.current.isAddedRow(c);if(s.isEditable||f){const m=r.current.getCell(u,c);if(pt(m))return{...s.getCell(s.getCellValue(m),!1),lastUpdated:m.lastUpdated};if(f)return Ht("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${u}; row=${c}`)}const g=e.getCell(c,u),h=rg(e,c,u);return F1(s,g,h,(l=e.styler)==null?void 0:l.cssStyles)}catch(s){return Ht("Error during cell creation",`This error should never happen. Please report this bug.
|
197
197
|
Error: ${s}`)}},[t,n,e,r])}}function eC(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function tC(e,t,n,r,i){const[o,a]=d.useState({columns:mt.empty(),rows:mt.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(Mn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Mn.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(Mn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Mn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Mn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Mn.SelectionMode.MULTI_COLUMN),f=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=d.useCallback(v=>{const w=!ja(v.rows.toArray(),o.rows.toArray()),b=!ja(v.columns.toArray(),o.columns.toArray()),M=!ja(v.current,o.current);let O=l&&w||u&&b,S=v;if((l||u)&&v.current!==void 0&&M&&(S={...v,rows:o.rows,columns:o.columns},O=!1),w&&v.rows.length>0&&b&&v.columns.length===0&&(S={...S,columns:o.columns},O=!0),b&&v.columns.length>0&&w&&v.rows.length===0&&(S={...S,rows:o.rows},O=!0),b&&S.columns.length>=0){let R=S.columns;r.forEach((_,E)=>{_.isIndex&&(R=R.remove(E))}),R.length<S.columns.length&&(S={...S,columns:R})}a(S),O&&i(S)},[o,l,u,i,r]),p=d.useCallback((v=!1,w=!1)=>{const b={columns:w?o.columns:mt.empty(),rows:v?o.rows:mt.empty(),current:void 0};a(b),(!v&&l||!w&&u)&&i(b)},[o,l,u,i]);return{gridSelection:o,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:f,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function nC(e,t,n,r,i,o,a){const l=e.rowHeight??t.defaultRowHeight,s=t.defaultHeaderHeight+l+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===Mn.EditingMode.DYNAMIC?1:0,f=n+c;let g=Math.max(f*l+u*t.defaultHeaderHeight+2*t.tableBorderWidth,s),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,s),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 v,w=p;e.useContainerWidth?v=p:e.width&&(v=Math.min(Math.max(e.width,m),p),w=Math.min(Math.max(e.width,w),p));const[b,M]=d.useState({width:v||"100%",height:h});return d.useLayoutEffect(()=>{e.useContainerWidth&&b.width==="100%"&&M(O=>({...O,width:p}))},[p]),d.useLayoutEffect(()=>{M(O=>({...O,width:v||"100%"}))},[v]),d.useLayoutEffect(()=>{M(O=>({...O,height:h}))},[h,n]),d.useLayoutEffect(()=>{if(a){const O=e.useContainerWidth||pt(e.width)&&e.width>0;M({width:O?w:"100%",height:g})}else M({width:v||"100%",height:h})},[a]),{minHeight:s,maxHeight:g,minWidth:m,maxWidth:w,rowHeight:l,resizableSize:b,setResizableSize:M}}const rC=600,iC="⚠️ Please fill out this cell.";function oC(e,t,n=[]){const[r,i]=d.useState(),o=d.useRef(null),a=d.useCallback(s=>{if(clearTimeout(o.current),o.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const u=s.location[0],c=s.location[1];let f;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(s.kind==="header"&&pt(g))f=g.help;else if(s.kind==="cell"){const h=t([u,c]);bi(h)?f=h.errorDetails:g.isRequired&&g.isEditable&&Ma(h)?f=iC:c1(h)&&(f=h.tooltip)}f&&(o.current=setTimeout(()=>{f&&i({content:f,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},rC))}},[e,t,i,o,n]),l=d.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}function aC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=d.useState(!0),a=Gr(),{colors:l,fontSizes:s,radii:u,fontWeights:c}=a,f=d.useCallback(()=>{o(!1),r()},[r,o]);return lt(xa,{content:lt(ig,{"data-testid":"stDataFrameTooltipContent",children:lt(og,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Ca.top,accessibilityType:Lc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:f,onEsc:f,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:Sa(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:lt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const sC=d.memo(aC),Rc=Ci("div",{target:"ew1n8yw0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-seveqep":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Ec=150,lC=15e4,Ic=6;function uC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:a,expand:l,collapse:s,width:u,height:c}=ag(dg),f=d.useRef(null),g=d.useRef(null),h=d.useRef(null),m=qy(),{getRowThemeOverride:p,onItemHovered:v}=eC(m),{libConfig:{enforceDownloadInNewTab:w=!1}}=d.useContext(sg),[b,M]=d.useState(!0),[O,S]=d.useState(!1),[R,_]=d.useState(!1),[E,x]=d.useState(!1),[L,D]=d.useState(),[C,I]=d.useState(!1),T=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),k=d.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ne(e.editingMode)&&(e.editingMode=Mn.EditingMode.READ_ONLY);const{READ_ONLY:z,DYNAMIC:N}=Mn.EditingMode,X=t.dimensions,re=Math.max(0,X.numDataRows),j=re===0&&!(e.editingMode===N&&X.numDataColumns>0),G=re>lC,ae=!G&&!j&&e.editingMode!==N,ie=!j&&e.editingMode===N&&!n,le=d.useRef(new Xo(re)),[fe,Q]=d.useState(le.current.getNumRows());d.useEffect(()=>{le.current=new Xo(re),Q(le.current.getNumRows())},[re]);const H=d.useCallback(()=>{le.current=new Xo(re),Q(le.current.getNumRows())},[re]),[P,W]=d.useState(e.columnOrder);d.useEffect(()=>{W(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ce,allColumns:De,setColumnConfigMapping:He}=z1(e,t,n,P);d.useEffect(()=>{if(e.editingMode===z)return;const de=r.getStringValue({id:e.id,formId:e.formId});de&&(le.current.fromJson(de,ce),Q(le.current.getNumRows()))},[]);const{getCellContent:ye}=Qy(t,ce,fe,le),{columns:Re,sortColumn:Se,getOriginalIndex:Et,getCellContent:wt}=j1(re,ce,ye),rt=d.useCallback(de=>{const st={selection:{rows:[],columns:[]}};st.selection.rows=de.rows.toArray().map(Zt=>Et(Zt)),st.selection.columns=de.columns.toArray().map(Zt=>io(Re[Zt]));const Wt=JSON.stringify(st),dn=r.getStringValue({id:e.id,formId:e.formId});(dn===void 0||dn!==Wt)&&r.setStringValue({id:e.id,formId:e.formId},Wt,{fromUi:!0},o)},[Re,e.id,e.formId,r,o,Et]),{debouncedCallback:se}=Vu(rt,Ec),{gridSelection:et,isRowSelectionActivated:me,isMultiRowSelectionActivated:he,isColumnSelectionActivated:pe,isMultiColumnSelectionActivated:ze,isRowSelected:Pe,isColumnSelected:tt,isCellSelected:ve,clearSelection:ue,processSelectionChange:it}=tC(e,j,n,Re,se);d.useEffect(()=>{ue(!0,!0)},[a]);const Ae=d.useCallback(de=>{var st;(st=g.current)==null||st.updateCells(de)},[]);d.useEffect(()=>{var st,Wt,dn,Zt;if(!me&&!pe)return;const de=r.getStringValue({id:e.id,formId:e.formId});if(de){const Gt=Re.map(Xn=>io(Xn)),Sn=JSON.parse(de);let vn=mt.empty(),Cr=mt.empty();(Wt=(st=Sn.selection)==null?void 0:st.rows)==null||Wt.forEach(Xn=>{vn=vn.add(Xn)}),(Zt=(dn=Sn.selection)==null?void 0:dn.columns)==null||Zt.forEach(Xn=>{Cr=Cr.add(Gt.indexOf(Xn))}),(vn.length>0||Cr.length>0)&&it({rows:vn,columns:Cr,current:void 0})}},[]);const Qe=d.useCallback(()=>{fe!==le.current.getNumRows()&&Q(le.current.getNumRows())},[fe]),vt=d.useCallback(()=>{const de=le.current.toJson(Re);let st=r.getStringValue({id:e.id,formId:e.formId});st===void 0&&(st=new Xo(0).toJson([])),de!==st&&r.setStringValue({id:e.id,formId:e.formId},de,{fromUi:!0},o)},[Re,e.id,e.formId,r,o]),{debouncedCallback:ht}=Vu(vt,Ec),{exportToCsv:Ve}=Jy(wt,Re,fe,w),{onCellEdited:Dt,onPaste:Yt,onRowAppended:xt,onDelete:_t,validateCell:nn}=Xy(Re,e.editingMode!==N,le,wt,Et,Ae,Qe,ht,ue),zt=d.useMemo(()=>j?[0]:ie?[fe]:[],[j,ie,fe]),{tooltip:ln,clearTooltip:It,onItemHovered:yt}=oC(Re,wt,zt),{drawCell:Dn,customRenderers:yn}=Uy(Re),{provideEditor:Oe}=K1(),Lt=d.useCallback(de=>({...de,hasMenu:!j}),[j]),fn=d.useMemo(()=>Re.map(de=>Lt(Ds(de))),[Re,Lt]),{columns:hn,onColumnResize:pn}=B1(fn),at=t.dimensions.numHeaderRows>1,{minHeight:Xt,maxHeight:Ot,minWidth:rn,maxWidth:Tt,rowHeight:Ft,resizableSize:Be,setResizableSize:Bt}=nC(e,m,fe,at,u||0,c,a),Pt=d.useCallback(([de,st])=>({...d1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(Re.length-1,0)]}),[Re,m.glideTheme.textLight]),Vt=d.useCallback(()=>{H(),ue()},[H,ue]);ug({element:e,widgetMgr:r,onFormCleared:Vt});const{pinColumn:$t,unpinColumn:Cn,freezeColumns:nr}=$1(Re,j,u||0,m.minColumnWidth,ue,He),{changeColumnFormat:Hn}=V1(He),{hideColumn:V,showColumn:Je}=G1(ue,He),{onColumnMoved:We}=N1(Re,nr,$t,Cn,W);return d.useEffect(()=>{setTimeout(()=>{var de,st;if(h.current&&g.current){const Wt=(st=(de=h.current)==null?void 0:de.querySelector(".dvn-stack"))==null?void 0:st.getBoundingClientRect();Wt&&(_(Wt.height>h.current.clientHeight),x(Wt.width>h.current.clientWidth))}},1)},[Be,fe,hn]),d.useEffect(()=>{De.length==Re.length&&I(!1)},[De.length,Re.length]),Ln(Rc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:k,ref:h,onMouseDown:de=>{if(h.current&&k){const st=h.current.getBoundingClientRect();E&&st.height-(Ic+1)<de.clientY-st.top&&de.stopPropagation(),R&&st.width-(Ic+1)<de.clientX-st.left&&de.stopPropagation()}},onBlur:de=>{!b&&!T&&!de.currentTarget.contains(de.relatedTarget)&&ue(!0,!0)},children:[Ln(fg,{isFullScreen:a,disableFullscreenMode:i,locked:Pe&&!me||ve||T&&b||C,onExpand:l,onCollapse:s,target:Rc,children:[(me&&Pe||pe&&tt)&<(di,{label:"Clear selection",icon:wg,onClick:()=>{ue(),It()}}),ie&&Pe&<(di,{label:"Delete row(s)",icon:kg,onClick:()=>{_t&&(_t(et),It())}}),ie&&!Pe&<(di,{label:"Add row",icon:Bc,onClick:()=>{var de;xt&&(M(!0),xt(),It(),(de=g.current)==null||de.scrollTo(0,fe,"vertical"))}}),!j&&De.length>Re.length&<(r1,{columns:De,columnOrder:P,setColumnOrder:W,hideColumn:V,showColumn:Je,isOpen:C,onClose:()=>I(!1),children:lt(di,{label:"Show/hide columns",icon:Uc,onClick:()=>I(!0)})}),!G&&!j&<(di,{label:"Download as CSV",icon:Mg,onClick:()=>Ve()}),!j&<(di,{label:"Search",icon:Wc,onClick:()=>{O?S(!1):(M(!0),S(!0)),It()}})]}),lt(lg,{"data-testid":"stDataFrameResizable",ref:f,defaultSize:Be,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Xt,maxHeight:Ot,minWidth:rn,maxWidth:Tt,size:Be,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Ft],snapGap:Ft/3,onResizeStop:(de,st,Wt,dn)=>{if(f.current){const Zt=2*m.tableBorderWidth;Bt({width:f.current.size.width,height:Ot-f.current.size.height===Zt?f.current.size.height+Zt:f.current.size.height})}},children:lt(Xv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:hn,rows:j?1:fe,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Ft,headerHeight:m.defaultHeaderHeight,getCellContent:j?Pt:wt,onColumnResize:T?void 0:pn,resizeIndicator:"header",freezeColumns:nr,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:T?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:pe?void 0:We,onItemHovered:de=>{v==null||v(de),yt==null||yt(de)},keybindings:{downFill:!0},onKeyDown:de=>{(de.ctrlKey||de.metaKey)&&de.key==="f"&&(S(st=>!st),de.stopPropagation(),de.preventDefault())},showSearch:O,onSearchClose:()=>{S(!1),It()},onHeaderClicked:(de,st)=>{!ae||pe||(me&&Pe?ue():ue(!0,!0),Se(de,"auto"))},gridSelection:et,onGridSelectionChange:de=>{(b||T)&&(it(de),ln!==void 0&&It())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:de=>{de.kind==="out-of-bounds"&&b?M(!1):de.kind!=="out-of-bounds"&&!b&&M(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...k&&{paddingBottom:E?-6:void 0,paddingRight:R?-6:void 0}},provideEditor:Oe,drawCell:Dn,customRenderers:yn,imageEditorOverride:k1,headerIcons:m.headerIcons,validateCell:nn,onHeaderMenuClick:(de,st)=>{D({columnIdx:de,headerBounds:st})},onPaste:!1,...me&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:he?"multi":"auto",rowSelect:n?"none":he?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...pe&&{columnSelect:n?"none":ze?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!j&&e.editingMode!==z&&!n&&{fillHandle:!T,onCellEdited:Dt,onPaste:Yt,onDelete:_t},...!j&&e.editingMode===N&&{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:xt,onHeaderClicked:void 0}})}),ln&&ln.content&<(sC,{top:ln.top,left:ln.left,content:ln.content,clearTooltip:It}),L&&$c.createPortal(lt(Qv,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,columnKind:ce[L.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:ae?de=>{ue(!(me&&Pe),!0),Se(L.columnIdx,de,!0)}:void 0,isColumnPinned:ce[L.columnIdx].isPinned,onUnpinColumn:()=>{Cn(ce[L.columnIdx].id)},onPinColumn:()=>{$t(ce[L.columnIdx].id)},onHideColumn:()=>{V(ce[L.columnIdx].id)},onChangeFormat:de=>{Hn(ce[L.columnIdx].id,de),setTimeout(()=>{var st;(st=g.current)==null||st.remeasureColumns(mt.fromSingleSelection(L.columnIdx))},100)},onAutosize:()=>{var de;(de=g.current)==null||de.remeasureColumns(mt.fromSingleSelection(L.columnIdx))}}),document.querySelector("#portal"))]})}const cC=cg(uC),dC=d.memo(cC),MC=Object.freeze(Object.defineProperty({__proto__:null,default:dC},Symbol.toStringTag,{value:"Module"}));export{M0 as C,xd as T,mi as a,Og as b,MC as c,hi as i,jm as m,mn as s};
|