@stlite/desktop 0.92.1 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +17 -0
- package/bin/dump_artifacts.js +3 -3
- package/build/assets/{ErrorOutline.esm-B7r5abii-8TGLClC0.js → ErrorOutline.esm-7dB9RqDz-BlHant9M.js} +1 -1
- package/build/assets/{FileDownload.esm-CYy3w3Vv-BwlEuFJu.js → FileDownload.esm-GWMXlTU--nCHLLVVG.js} +1 -1
- package/build/assets/{FileHelper-8inOMdj8-8VXLhO12.js → FileHelper-Cma-1EXD-BHg6ViEo.js} +1 -1
- package/build/assets/{FormClearHelper-DcUb9gFm-uvoV81fq.js → FormClearHelper-7XVCWEDh-CHeSF048.js} +1 -1
- package/build/assets/{Hooks-BLb3umpI-BjA4i06_.js → Hooks-BLb3umpI-DELjvxVH.js} +1 -1
- package/build/assets/{InputInstructions-CWrzjlV--n3Hf1PP9.js → InputInstructions-BVDJIGMt-C7cosSXk.js} +1 -1
- package/build/assets/{Particles-DtETFR7S-2aUDxKFJ.js → Particles-g7RgLbWv-DjAdgaht.js} +1 -1
- package/build/assets/{ProgressBar-Q8F-JGwo-LczZQzat.js → ProgressBar-Di9e5f4y-D4tmR6iS.js} +1 -1
- package/build/assets/{Toolbar-Dj6ALImb-BVamUnHI.js → Toolbar-BPTl0_g8-DgJSJ3GD.js} +1 -1
- package/build/assets/{base-input-GLmTpqXt-CImyaDRq.js → base-input-ChvJQUff-BpwD4YlX.js} +1 -1
- package/build/assets/{checkbox-CEGFZTJa-C72AFGdh.js → checkbox-4WgCYqx1-Bgkcmn0F.js} +1 -1
- package/build/assets/{createSuper-DBoQFSgk-BYJ7jbld.js → createSuper-dKmkwP0m-DxhpQ4SI.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-KB2z8mJP-C62BT9jT.js → data-grid-overlay-editor-IoEmbFO9-CBCubcQ1.js} +1 -1
- package/build/assets/{downloader-DcCTL3Wz-DCpITTU1.js → downloader-DcCTL3Wz-3ZFKL_NQ.js} +1 -1
- package/build/assets/{es6--XPcqeHG-DhJ5N6cn.js → es6--XPcqeHG-r3GRWny2.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-B8PMRo_J-DvNzNbbR.js → iframeResizer.contentWindow-fVUnxJjZ-DtdoD2Oh.js} +1 -1
- package/build/assets/{index-CRwtTJoc-DxkxT91b.js → index-8B5BiglZ-DvZZ_HIe.js} +5 -5
- package/build/assets/{index-DGEZt8XB-BPwUD6x9.js → index-AJUjtcR2-Db1saaJD.js} +1 -1
- package/build/assets/{index-CmxogrTC-CmhUjGHI.js → index-BLhXykcy-2Rx1rqrE.js} +1 -1
- package/build/assets/{index-DpJLAqiz-BkX4MLEb.js → index-BMwC0KGj-BtsmDkp_.js} +1 -1
- package/build/assets/{index-BEhJ1GQx-Bd2m54CP.js → index-BkFrTmMq-A28f28cz.js} +1 -1
- package/build/assets/{index-hQQyMr9F-eQNYPxka.js → index-Bm-Z6YEI-DCou195f.js} +1 -1
- package/build/assets/{index-DQkZMKcP-qmoywAyX.js → index-BqZLpS9v-B3Caq8Gw.js} +1 -1
- package/build/assets/{index-MLOYywLc-D7-SprmM.js → index-BqjVvYwm-D3YtGOj9.js} +1 -1
- package/build/assets/{index-Bn_Q7wro-BclOBnF3.js → index-BsXatFUH-Dt_dN6HK.js} +1 -1
- package/build/assets/{index-BlHNutXS-Bf1cUsIS.js → index-C-iz7Ope-j2Jou3c7.js} +1 -1
- package/build/assets/{index-C5n_E3xJ-C9GlH5Bh.js → index-C4pwXyLd-CSMg93MD.js} +1 -1
- package/build/assets/{index-BOT4J8P2-nhENc6Pb.js → index-CECyqIrl-D2yv4RoH.js} +1 -1
- package/build/assets/{index-BIyIgwS4.js → index-CI5Lukhr.js} +4 -4
- package/build/assets/{index-B4C0HP4d-BkRIYQ6B.js → index-CQIHksOR-Bnp4a981.js} +1 -1
- package/build/assets/{index-BcOX_8Yb-BQhvH4hh.js → index-C_KUQlWP-B51Pxs_l.js} +1 -1
- package/build/assets/{index-BeQFPWOx-B1_VBork.js → index-CceKGChf-GDzkl9eM.js} +1 -1
- package/build/assets/{index-C43v7-zt-XSOlpSRO.js → index-CdsL7CI5-DlOa3Fof.js} +1 -1
- package/build/assets/{index-DXzYmrGv-DMgQyWr1.js → index-CmMya3Pz-CihX18ph.js} +1 -1
- package/build/assets/{index-CKhpdqU4-B-ULAgQ3.js → index-CuLrbTLp-C50eNwoW.js} +1 -1
- package/build/assets/{index-gFid1htU-BDjIBtvA.js → index-Cw0ECNa7-BB6dE3b3.js} +1 -1
- package/build/assets/{index-C9MF7a8p-1U1wjf1z.js → index-DD51aFbc-gN5mz9FN.js} +1 -1
- package/build/assets/{index-BUQFjfFe-DhpyxZBa.js → index-DEu3PxaD-CXRBV7Mf.js} +1 -1
- package/build/assets/{index-nCXiKSAh-DSiervQu.js → index-DOE9zKwT-5mur2MVZ.js} +1 -1
- package/build/assets/{index-Dws1I0Ds-DN2TZwAq.js → index-DQpSdbfe-5SdJiHTD.js} +1 -1
- package/build/assets/{index-CVVkGp8U-OXoobo4A.js → index-DTykN4zG-Bxhd8idt.js} +1 -1
- package/build/assets/{index-EY_iYK3N-Bp22waFF.js → index-DV29szBC-B2CEbIRH.js} +1 -1
- package/build/assets/{index-BvmneqQT-C6pM51YE.js → index-DfRa51wX-Mc7dF5x1.js} +1 -1
- package/build/assets/{index-C9t9keZs-Cj8jGlNq.js → index-DgYLMrUQ-tRG-LD_v.js} +1 -1
- package/build/assets/{index-E8OLJqjb-DnzI_NxU.js → index-Di5puO_--CqiV0ywo.js} +1 -1
- package/build/assets/{index-oX5euHW0-C-SIRbDl.js → index-Dj7MXPcv-nT5EfVwd.js} +1 -1
- package/build/assets/{index-Bqaw3D2g-DJFA3vu1.js → index-DlV4h_p4-DqwBbw5_.js} +1 -1
- package/build/assets/{index-h6RjFy4Y-C5de9ASo.js → index-DnGo_A7H-BE-NsOfW.js} +1 -1
- package/build/assets/{index-DIlmdxHH-DZzaykGG.js → index-HR_X9srR-BAYtFzZt.js} +1 -1
- package/build/assets/{index-B8DruXv7-BsVgHQy8.js → index-TBJNdPHu-DT-qyCZS.js} +1 -1
- package/build/assets/{index-CCBxT-Px-B32Uy-Qk.js → index-ZYgJQ_x8-1_8zzrU9.js} +1 -1
- package/build/assets/{index-kEUlOODQ-D3h_Flo2.js → index-hTcF3gtQ-DxQnuRL_.js} +1 -1
- package/build/assets/{index-BIgXGMHt-JW2hwTbx.js → index-vcKHNpuC-BSd57fPp.js} +1 -1
- package/build/assets/{inherits-BwU0tCO4-DkeIG_qH.js → inherits-Pmi26wgm-BX3RGE7G.js} +1 -1
- package/build/assets/{input-DMrd22sk-UYShFfZu.js → input-BXGQ9mRm-CIPmPBGI.js} +1 -1
- package/build/assets/{memory-B3L1Fctl-WytsaLFU.js → memory-B3L1Fctl-CHwR207P.js} +1 -1
- package/build/assets/{number-overlay-editor-CdbzA3D_-BCwwbhhn.js → number-overlay-editor-C_tZpFZY-CxWzCIFN.js} +1 -1
- package/build/assets/{sandbox-ChAzL-i--CpDb1da2.js → sandbox-ChAzL-i--wpcA3s4s.js} +1 -1
- package/build/assets/{slicedToArray-CQ1aOJ-Q-fFO-C-TS.js → slicedToArray-BwzokRlj-E5mBrutT.js} +1 -1
- package/build/assets/{timepicker-DZap2iV8-CkcqVZT5.js → timepicker-Buj3NwSV-DhVe9hFS.js} +1 -1
- package/build/assets/{uniqueId-Dmqdy5md-DdrLw8YB.js → uniqueId-Ct03yls4--ZtLtucJ.js} +1 -1
- package/build/assets/{useBasicWidgetState-DH5OpqC3-H5wMmJFo.js → useBasicWidgetState-KOlq_goV-CB6E7iWN.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-B5nEdsJC-DTKFLxU2.js → useTextInputAutoExpand-DWOWjQ4t-BoiRRHH6.js} +1 -1
- package/build/assets/{useUpdateUiValue-CzJ3I42c-D42S2lbA.js → useUpdateUiValue-DoEkLcX2--ATHLwKP.js} +1 -1
- package/build/assets/{withFullScreenWrapper-CsmVH3u1-BwamaUTy.js → withFullScreenWrapper-B2V0S41O-DCzGUvSO.js} +1 -1
- package/build/electron/main.js +2 -2
- package/build/index.html +1 -1
- package/package.json +3 -3
- package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-
|
|
2
|
-
import{j as me,r as d,c9 as cc,ca as on,aC as St,cb as sp,c8 as ns,bX as cp,cc as sd,l as rs,E as os,_ as Ae,cd as up,ce as cd,cf as ud,X as vr,d as Tr,cg as dp,Q as nl,v as Te,c as Qn,ch as hp,ci as fp,x as ot,cj as dd,C as pp,ck as gp,cl as mp,cm as vp,cn as bp,co as yp,cp as wp,cq as Fl,cr as hd,aB as rn,cs as xp,ct as kp,cu as Cp,cv as Sp,cw as Mp,cx as Rp,cy as Ip,U as li,m as Yr,bg as Oa,bf as Da,cz as fd,M as Pa,F as qn,cA as Ep,bu as pd,cB as Tp,H as Op,e as uc,cC as Dp,cD as Pp,L as Hp,b as gd,cE as zp,cF as Lp,cG as Ap,cH as Fp,cI as Vp,at as md,cJ as si,cK as dc,aH as _p,cL as $p,cM as Bp,cN as vd,ao as xo,cO as Np,cP as Wp,cQ as jp,y as rl,cR as Gp,bZ as ol,cS as Up,cT as bd,cU as Kp,be as Ur,cV as Xp,cW as qp,cX as Zp,cY as Yp,D as Jp,cZ as yd,c_ as Qp,c$ as eg,aD as tg,d0 as ng,d1 as rg,d2 as og,A as ig,B as ag,d3 as lg,d4 as sg,z as cg,d5 as ug,d6 as dg,d7 as hg,d8 as cr,$ as Eo,bH as fg,d9 as pg,da as gg,db as mg,dc as vg,dd as bg,de as yg,df as wg,dg as aa,dh as Uo,di as At,dj as Ct,dk as ha,dl as vn,dm as xg,dn as kg,dp as Cg,dq as Sg,dr as Mg,ds as Rg,dt as Ig,du as Wr,dv as hc,dw as fc,dx as wd,dy as xd,dz as Eg,dA as Vl,dB as Tg,dC as Og,dD as kd,dE as Dg}from"./index-BIyIgwS4.js";import{v as Pg,d as Hg}from"./withFullScreenWrapper-CsmVH3u1-BwamaUTy.js";import{y as zg,X as yo}from"./Toolbar-Dj6ALImb-BVamUnHI.js";import{m as Lg}from"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import{_ as Ag}from"./sprintf-D5E86llw-6tzWM3a-.js";import{v as Fg,y as Vg,T as _g}from"./checkbox-CEGFZTJa-C72AFGdh.js";import{a as $g}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{p as Bg,_ as gr}from"./slicedToArray-CQ1aOJ-Q-fFO-C-TS.js";import{b as Ng,p as Wg,l as jg}from"./inherits-BwU0tCO4-DkeIG_qH.js";import{i as Gg}from"./createSuper-DBoQFSgk-BYJ7jbld.js";import{o as Ug,i as Kg}from"./FileDownload.esm-CYy3w3Vv-BwlEuFJu.js";var Cd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({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"}))});Cd.displayName="Add";var Sd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({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"}))});Sd.displayName="Search";var Md=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({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"}))});Md.displayName="Visibility";var il,pc;function Xg(){if(pc)return il;pc=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return il=n,il}var al,gc;function qg(){if(gc)return al;gc=1;var e=Xg(),t=up();function n(r,o){return r!=null&&t(r,o,e)}return al=n,al}var Zg=qg();const Yg=vr(Zg);function Rd(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return Rd(t)}function mi(e,t){return Rd(t??"Hell froze over")}function Jg(e,t){try{return e()}catch{return t}}const mc=Object.prototype.hasOwnProperty;function Oo(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--&&Oo(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(mc.call(e,n)&&++r&&!mc.call(t,n)||!(n in t)||!Oo(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const fa=null,is=void 0;var Y;(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"})(Y||(Y={}));var vc;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(vc||(vc={}));var pa;(function(e){e.Triangle="triangle",e.Dots="dots"})(pa||(pa={}));function Ki(e){return"width"in e&&typeof e.width=="number"}async function bc(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Y.Loading||e.kind===Y.Bubble||e.kind===Y.RowID||e.kind===Y.Protected||e.kind===Y.Drilldown)}function Mo(e){return e.kind===jn.Marker||e.kind===jn.NewRow}function Co(e){if(!ko(e)||e.kind===Y.Image)return!1;switch(e.kind){case Y.Text:case Y.Number:case Y.Markdown:case Y.Uri:case Y.Custom:case Y.Boolean:return e.readonly!==!0;default:mi(e,"A cell was passed with an invalid kind")}}function Qg(e){return Yg(e,"editor")}function as(e){return!(e.readonly??!1)}var jn;(function(e){e.NewRow="new-row",e.Marker="marker"})(jn||(jn={}));const ga={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function ll(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let yc;class Ye{items;constructor(t){this.items=t}static create=t=>new Ye(ll(t));static empty=()=>yc??(yc=new Ye([]));static fromSingleSelection=t=>Ye.empty().add(t);static fromArray=t=>{if(t.length===0)return Ye.empty();const n=t.map(o=>[o,o+1]),r=ll(n);return new Ye(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Ye(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=ll([...this.items,n]);return new Ye(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new Ye(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var em=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},wc=em,tm=e=>e.toUpperCase()===e,nm=e=>t=>e.indexOf(t)===-1,Id=(e,t)=>{const n={};return Object.keys(e).filter(nm(t)).forEach(r=>{n[r]=e[r]}),n};function rm(e,t,n){const r=Id(t,n);if(!e){const o=typeof ol=="function"?{default:ol}:ol;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var om=(e,t)=>{};function im(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!tm(l[0])):n.propsAsIs,u=rm(c,i,["as","class"]);u.ref=a,u.className=n.atomic?wc(n.class,u.className||s):wc(u.className||s,n.class);const{vars:h}=n;if(h){const g={};for(const m in h){const w=h[m],y=w[0],v=w[1]||"",x=typeof y=="function"?y(i):y;om(x,n.name),g[`--${m}`]=`${x}${v}`}const f=u.style||{},p=Object.keys(f);p.length>0&&p.forEach(m=>{g[m]=f[m]}),u.style=g}return e.__wyw_meta&&e!==l?(u.as=l,d.createElement(e,u)):d.createElement(l,u)},o=d.forwardRef?d.forwardRef(r):(i=>{const a=Id(i,["innerRef"]);return r(a,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var un=im;const am=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var xc={},Ko={},sl={},cl={},kc;function lm(){return kc||(kc=1,(function(e){(function(t,n){n(e,St,tg())})(cl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var o=a(n),i=a(r);function a(v){return v&&v.__esModule?v:{default:v}}var l=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var I=arguments[x];for(var O in I)Object.prototype.hasOwnProperty.call(I,O)&&(v[O]=I[O])}return v};function s(v,x){var I={};for(var O in v)x.indexOf(O)>=0||Object.prototype.hasOwnProperty.call(v,O)&&(I[O]=v[O]);return I}function c(v,x){if(!(v instanceof x))throw new TypeError("Cannot call a class as a function")}var u=(function(){function v(x,I){for(var O=0;O<I.length;O++){var M=I[O];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,I,O){return I&&v(x.prototype,I),O&&v(x,O),x}})();function h(v,x){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:v}function g(v,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);v.prototype=Object.create(x&&x.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(v,x):v.__proto__=x)}var f=!1;function p(v){f=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?v:v.capture}function w(v){if("touches"in v){var x=v.touches[0],I=x.pageX,O=x.pageY;return{x:I,y:O}}var M=v.screenX,P=v.screenY;return{x:M,y:P}}var y=(function(v){g(x,v);function x(){var I;c(this,x);for(var O=arguments.length,M=Array(O),P=0;P<O;P++)M[P]=arguments[P];var S=h(this,(I=x.__proto__||Object.getPrototypeOf(x)).call.apply(I,[this].concat(M)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return u(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(I){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(I))}},{key:"_onMouseMove",value:function(I){this.mouseDown&&this._handleSwipeMove(I)}},{key:"_onMouseUp",value:function(I){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(I)}},{key:"_handleSwipeStart",value:function(I){var O=w(I),M=O.x,P=O.y;this.moveStart={x:M,y:P},this.props.onSwipeStart(I)}},{key:"_handleSwipeMove",value:function(I){if(this.moveStart){var O=w(I),M=O.x,P=O.y,S=M-this.moveStart.x,k=P-this.moveStart.y;this.moving=!0;var H=this.props.onSwipeMove({x:S,y:k},I);H&&I.cancelable&&I.preventDefault(),this.movePosition={deltaX:S,deltaY:k}}}},{key:"_handleSwipeEnd",value:function(I){this.props.onSwipeEnd(I);var O=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-O?this.props.onSwipeLeft(1,I):this.movePosition.deltaX>O&&this.props.onSwipeRight(1,I),this.movePosition.deltaY<-O?this.props.onSwipeUp(1,I):this.movePosition.deltaY>O&&this.props.onSwipeDown(1,I)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(I){this.swiper=I,this.props.innerRef(I)}},{key:"render",value:function(){var I=this.props;I.tagName;var O=I.className,M=I.style,P=I.children;I.allowMouseEvents,I.onSwipeUp,I.onSwipeDown,I.onSwipeLeft,I.onSwipeRight,I.onSwipeStart,I.onSwipeMove,I.onSwipeEnd,I.innerRef,I.tolerance;var S=s(I,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:O,style:M},S),P)}}]),x})(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})})(cl)),cl}var Cc;function Ed(){return Cc||(Cc=1,(function(e){(function(t,n){n(e,lm())})(sl,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(sl)),sl}var Xo={},Sc;function Td(){if(Sc)return Xo;Sc=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=void 0;var e=t(Gp());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,e.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,a){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xo.default=r,Xo}var qo={},Zo={},Mc;function sm(){if(Mc)return Zo;Mc=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Zo.outerWidth=e,Zo}var Yo={},Rc;function ls(){if(Rc)return Yo;Rc=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.default=void 0;var e=function(t,n,r){var o=t===0?t:t+n,i=r==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+i.join(",")+")";return a+l};return Yo.default=e,Yo}var Jo={},Ic;function Od(){if(Ic)return Jo;Ic=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(){return window};return Jo.default=e,Jo}var Ec;function Dd(){if(Ec)return qo;Ec=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e=s(St),t=a(Td()),n=sm(),r=a(ls()),o=a(Ed()),i=a(Od());function a(S){return S&&S.__esModule?S:{default:S}}function l(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return l=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||c(S)!=="object"&&typeof S!="function")return{default:S};var k=l();if(k&&k.has(S))return k.get(S);var H={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in S)if(Object.prototype.hasOwnProperty.call(S,R)){var T=E?Object.getOwnPropertyDescriptor(S,R):null;T&&(T.get||T.set)?Object.defineProperty(H,R,T):H[R]=S[R]}return H.default=S,k&&k.set(S,H),H}function c(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(k){return typeof k}:c=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},c(S)}function u(){return u=Object.assign||function(S){for(var k=1;k<arguments.length;k++){var H=arguments[k];for(var E in H)Object.prototype.hasOwnProperty.call(H,E)&&(S[E]=H[E])}return S},u.apply(this,arguments)}function h(S,k){if(!(S instanceof k))throw new TypeError("Cannot call a class as a function")}function g(S,k){for(var H=0;H<k.length;H++){var E=k[H];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function f(S,k,H){return k&&g(S.prototype,k),S}function p(S,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(k&&k.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),k&&m(S,k)}function m(S,k){return m=Object.setPrototypeOf||function(H,E){return H.__proto__=E,H},m(S,k)}function w(S){var k=x();return function(){var H=I(S),E;if(k){var R=I(this).constructor;E=Reflect.construct(H,arguments,R)}else E=H.apply(this,arguments);return y(this,E)}}function y(S,k){return k&&(c(k)==="object"||typeof k=="function")?k:v(S)}function v(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(S){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(k){return k.__proto__||Object.getPrototypeOf(k)},I(S)}function O(S,k,H){return k in S?Object.defineProperty(S,k,{value:H,enumerable:!0,configurable:!0,writable:!0}):S[k]=H,S}var M=function(S){return S.hasOwnProperty("key")},P=(function(S){p(H,S);var k=w(H);function H(E){var R;return h(this,H),R=k.call(this,E),O(v(R),"itemsWrapperRef",void 0),O(v(R),"itemsListRef",void 0),O(v(R),"thumbsRef",void 0),O(v(R),"setItemsWrapperRef",function(T){R.itemsWrapperRef=T}),O(v(R),"setItemsListRef",function(T){R.itemsListRef=T}),O(v(R),"setThumbsRef",function(T,D){R.thumbsRef||(R.thumbsRef=[]),R.thumbsRef[D]=T}),O(v(R),"updateSizes",function(){if(!(!R.props.children||!R.itemsWrapperRef||!R.thumbsRef)){var T=e.Children.count(R.props.children),D=R.itemsWrapperRef.clientWidth,C=R.props.thumbWidth?R.props.thumbWidth:(0,n.outerWidth)(R.thumbsRef[0]),J=Math.floor(D/C),W=J<T,Z=W?T-J:0;R.setState(function(ce,te){return{itemSize:C,visibleItems:J,firstItem:W?R.getFirstItem(te.selectedItem):0,lastPosition:Z,showArrows:W}})}}),O(v(R),"handleClickItem",function(T,D,C){if(!M(C)||C.key==="Enter"){var J=R.props.onSelectItem;typeof J=="function"&&J(T,D)}}),O(v(R),"onSwipeStart",function(){R.setState({swiping:!0})}),O(v(R),"onSwipeEnd",function(){R.setState({swiping:!1})}),O(v(R),"onSwipeMove",function(T){var D=T.x;if(!R.state.itemSize||!R.itemsWrapperRef||!R.state.visibleItems)return!1;var C=0,J=e.Children.count(R.props.children),W=-(R.state.firstItem*100)/R.state.visibleItems,Z=Math.max(J-R.state.visibleItems,0),ce=-Z*100/R.state.visibleItems;W===C&&D>0&&(D=0),W===ce&&D<0&&(D=0);var te=R.itemsWrapperRef.clientWidth,q=W+100/(te/D);return R.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ge){R.itemsListRef.style[ge]=(0,r.default)(q,"%",R.props.axis)}),!0}),O(v(R),"slideRight",function(T){R.moveTo(R.state.firstItem-(typeof T=="number"?T:1))}),O(v(R),"slideLeft",function(T){R.moveTo(R.state.firstItem+(typeof T=="number"?T:1))}),O(v(R),"moveTo",function(T){T=T<0?0:T,T=T>=R.state.lastPosition?R.state.lastPosition:T,R.setState({firstItem:T})}),R.state={selectedItem:E.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},R}return f(H,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(E){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==E.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(E){var R=E;return E>=this.state.lastPosition&&(R=this.state.lastPosition),E<this.state.firstItem+this.state.visibleItems&&(R=this.state.firstItem),E<this.state.firstItem&&(R=E),R}},{key:"renderItems",value:function(){var E=this;return this.props.children.map(function(R,T){var D=t.default.ITEM(!1,T===E.state.selectedItem),C={key:T,ref:function(J){return E.setThumbsRef(J,T)},className:D,onClick:E.handleClickItem.bind(E,T,E.props.children[T]),onKeyDown:E.handleClickItem.bind(E,T,E.props.children[T]),"aria-label":"".concat(E.props.labels.item," ").concat(T+1),style:{width:E.props.thumbWidth}};return e.default.createElement("li",u({},C,{role:"button",tabIndex:0}),R)})}},{key:"render",value:function(){var E=this;if(!this.props.children)return null;var R=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,C={},J=-this.state.firstItem*(this.state.itemSize||0),W=(0,r.default)(J,"px",this.props.axis),Z=this.props.transitionTime+"ms";return C={WebkitTransform:W,MozTransform:W,MsTransform:W,OTransform:W,transform:W,msTransform:W,WebkitTransitionDuration:Z,MozTransitionDuration:Z,MsTransitionDuration:Z,OTransitionDuration:Z,transitionDuration:Z,msTransitionDuration:Z},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 E.slideRight()},"aria-label":this.props.labels.leftArrow}),R?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:C,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ce){return E.setItemsListRef(ce)},style:C},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return E.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),H})(e.Component);return qo.default=P,O(P,"displayName","Thumbs"),O(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),qo}var Qo={},Tc;function cm(){if(Tc)return Qo;Tc=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var e=function(){return document};return Qo.default=e,Qo}var Ln={},Oc;function Pd(){if(Oc)return Ln;Oc=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=St,t=n(ls());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};Ln.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=i;var a=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,g=u-1;return s&&(s!==g||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===g&&(h+=100-c.centerSlidePercentage),h}return-s*100};Ln.getPosition=a;var l=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return Ln.setPosition=l,Ln}var Xn={},Dc;function um(){if(Dc)return Xn;Dc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fadeAnimationHandler=Xn.slideStopSwipingHandler=Xn.slideSwipeAnimationHandler=Xn.slideAnimationHandler=void 0;var e=St,t=r(ls()),n=Pd();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,p)}return f}function i(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?o(Object(f),!0).forEach(function(p){a(h,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(f,p))})}return h}function a(h,g,f){return g in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}var l=function(h,g){var f={},p=g.selectedItem,m=p,w=e.Children.count(h.children)-1,y=h.infiniteLoop&&(p<0||p>w);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):m>w&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var v=(0,n.getPosition)(p,h),x=(0,t.default)(v,"%",h.axis),I=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:x,msTransform:x,OTransform:x,transform:x},g.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:I,MozTransitionDuration:I,OTransitionDuration:I,transitionDuration:I,msTransitionDuration:I})),f};Xn.slideAnimationHandler=l;var s=function(h,g,f,p){var m={},w=g.axis==="horizontal",y=e.Children.count(g.children),v=0,x=(0,n.getPosition)(f.selectedItem,g),I=g.infiniteLoop?(0,n.getPosition)(y-1,g)-100:(0,n.getPosition)(y-1,g),O=w?h.x:h.y,M=O;x===v&&O>0&&(M=0),x===I&&O<0&&(M=0);var P=x+100/(f.itemSize/M),S=Math.abs(O)>g.swipeScrollTolerance;return g.infiniteLoop&&S&&(f.selectedItem===0&&P>-100?P-=y*100:f.selectedItem===y-1&&P<-y*100&&(P+=y*100)),(!g.preventMovementUntilSwipeScrollTolerance||S||f.swipeMovementStarted)&&(f.swipeMovementStarted||p({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(P,g.axis)),S&&!f.cancelClick&&p({cancelClick:!0}),m};Xn.slideSwipeAnimationHandler=s;var c=function(h,g){var f=(0,n.getPosition)(g.selectedItem,h),p=(0,n.setPosition)(f,h.axis);return{itemListStyle:p}};Xn.slideStopSwipingHandler=c;var u=function(h,g){var f=h.transitionTime+"ms",p="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Xn.fadeAnimationHandler=u,Xn}var Pc;function dm(){if(Pc)return Ko;Pc=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var e=u(St),t=s(Ed()),n=s(Td()),r=s(Dd()),o=s(cm()),i=s(Od()),a=Pd(),l=um();function s(E){return E&&E.__esModule?E:{default:E}}function c(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return c=function(){return E},E}function u(E){if(E&&E.__esModule)return E;if(E===null||h(E)!=="object"&&typeof E!="function")return{default:E};var R=c();if(R&&R.has(E))return R.get(E);var T={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var J=D?Object.getOwnPropertyDescriptor(E,C):null;J&&(J.get||J.set)?Object.defineProperty(T,C,J):T[C]=E[C]}return T.default=E,R&&R.set(E,T),T}function h(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(R){return typeof R}:h=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},h(E)}function g(){return g=Object.assign||function(E){for(var R=1;R<arguments.length;R++){var T=arguments[R];for(var D in T)Object.prototype.hasOwnProperty.call(T,D)&&(E[D]=T[D])}return E},g.apply(this,arguments)}function f(E,R){var T=Object.keys(E);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(E);R&&(D=D.filter(function(C){return Object.getOwnPropertyDescriptor(E,C).enumerable})),T.push.apply(T,D)}return T}function p(E){for(var R=1;R<arguments.length;R++){var T=arguments[R]!=null?arguments[R]:{};R%2?f(Object(T),!0).forEach(function(D){k(E,D,T[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(T)):f(Object(T)).forEach(function(D){Object.defineProperty(E,D,Object.getOwnPropertyDescriptor(T,D))})}return E}function m(E,R){if(!(E instanceof R))throw new TypeError("Cannot call a class as a function")}function w(E,R){for(var T=0;T<R.length;T++){var D=R[T];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function y(E,R,T){return R&&w(E.prototype,R),E}function v(E,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(R&&R.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),R&&x(E,R)}function x(E,R){return x=Object.setPrototypeOf||function(T,D){return T.__proto__=D,T},x(E,R)}function I(E){var R=P();return function(){var T=S(E),D;if(R){var C=S(this).constructor;D=Reflect.construct(T,arguments,C)}else D=T.apply(this,arguments);return O(this,D)}}function O(E,R){return R&&(h(R)==="object"||typeof R=="function")?R:M(E)}function M(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(E){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},S(E)}function k(E,R,T){return R in E?Object.defineProperty(E,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):E[R]=T,E}var H=(function(E){v(T,E);var R=I(T);function T(D){var C;m(this,T),C=R.call(this,D),k(M(C),"thumbsRef",void 0),k(M(C),"carouselWrapperRef",void 0),k(M(C),"listRef",void 0),k(M(C),"itemsRef",void 0),k(M(C),"timer",void 0),k(M(C),"animationHandler",void 0),k(M(C),"setThumbsRef",function(W){C.thumbsRef=W}),k(M(C),"setCarouselWrapperRef",function(W){C.carouselWrapperRef=W}),k(M(C),"setListRef",function(W){C.listRef=W}),k(M(C),"setItemsRef",function(W,Z){C.itemsRef||(C.itemsRef=[]),C.itemsRef[Z]=W}),k(M(C),"autoPlay",function(){e.Children.count(C.props.children)<=1||(C.clearAutoPlay(),C.props.autoPlay&&(C.timer=setTimeout(function(){C.increment()},C.props.interval)))}),k(M(C),"clearAutoPlay",function(){C.timer&&clearTimeout(C.timer)}),k(M(C),"resetAutoPlay",function(){C.clearAutoPlay(),C.autoPlay()}),k(M(C),"stopOnHover",function(){C.setState({isMouseEntered:!0},C.clearAutoPlay)}),k(M(C),"startOnLeave",function(){C.setState({isMouseEntered:!1},C.autoPlay)}),k(M(C),"isFocusWithinTheCarousel",function(){return C.carouselWrapperRef?!!((0,o.default)().activeElement===C.carouselWrapperRef||C.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),k(M(C),"navigateWithKeyboard",function(W){if(C.isFocusWithinTheCarousel()){var Z=C.props.axis,ce=Z==="horizontal",te={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},q=ce?te.ArrowRight:te.ArrowDown,ge=ce?te.ArrowLeft:te.ArrowUp;q===W.keyCode?C.increment():ge===W.keyCode&&C.decrement()}}),k(M(C),"updateSizes",function(){if(!(!C.state.initialized||!C.itemsRef||C.itemsRef.length===0)){var W=C.props.axis==="horizontal",Z=C.itemsRef[0];if(Z){var ce=W?Z.clientWidth:Z.clientHeight;C.setState({itemSize:ce}),C.thumbsRef&&C.thumbsRef.updateSizes()}}}),k(M(C),"setMountState",function(){C.setState({hasMount:!0}),C.updateSizes()}),k(M(C),"handleClickItem",function(W,Z){if(e.Children.count(C.props.children)!==0){if(C.state.cancelClick){C.setState({cancelClick:!1});return}C.props.onClickItem(W,Z),W!==C.state.selectedItem&&C.setState({selectedItem:W})}}),k(M(C),"handleOnChange",function(W,Z){e.Children.count(C.props.children)<=1||C.props.onChange(W,Z)}),k(M(C),"handleClickThumb",function(W,Z){C.props.onClickThumb(W,Z),C.moveTo(W)}),k(M(C),"onSwipeStart",function(W){C.setState({swiping:!0}),C.props.onSwipeStart(W)}),k(M(C),"onSwipeEnd",function(W){C.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),C.props.onSwipeEnd(W),C.clearAutoPlay(),C.state.autoPlay&&C.autoPlay()}),k(M(C),"onSwipeMove",function(W,Z){C.props.onSwipeMove(Z);var ce=C.props.swipeAnimationHandler(W,C.props,C.state,C.setState.bind(M(C)));return C.setState(p({},ce)),!!Object.keys(ce).length}),k(M(C),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem-(typeof W=="number"?W:1))}),k(M(C),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem+(typeof W=="number"?W:1))}),k(M(C),"moveTo",function(W){if(typeof W=="number"){var Z=e.Children.count(C.props.children)-1;W<0&&(W=C.props.infiniteLoop?Z:0),W>Z&&(W=C.props.infiniteLoop?0:Z),C.selectItem({selectedItem:W}),C.state.autoPlay&&C.state.isMouseEntered===!1&&C.resetAutoPlay()}}),k(M(C),"onClickNext",function(){C.increment(1)}),k(M(C),"onClickPrev",function(){C.decrement(1)}),k(M(C),"onSwipeForward",function(){C.increment(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),k(M(C),"onSwipeBackwards",function(){C.decrement(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),k(M(C),"changeItem",function(W){return function(Z){(!(0,a.isKeyboardEvent)(Z)||Z.key==="Enter")&&C.moveTo(W)}}),k(M(C),"selectItem",function(W){C.setState(p({previousItem:C.state.selectedItem},W),function(){C.setState(C.animationHandler(C.props,C.state))}),C.handleOnChange(W.selectedItem,e.Children.toArray(C.props.children)[W.selectedItem])}),k(M(C),"getInitialImage",function(){var W=C.props.selectedItem,Z=C.itemsRef&&C.itemsRef[W],ce=Z&&Z.getElementsByTagName("img")||[];return ce[0]}),k(M(C),"getVariableItemHeight",function(W){var Z=C.itemsRef&&C.itemsRef[W];if(C.state.hasMount&&Z&&Z.children.length){var ce=Z.children[0].getElementsByTagName("img")||[];if(ce.length>0){var te=ce[0];if(!te.complete){var q=function fe(){C.forceUpdate(),te.removeEventListener("load",fe)};te.addEventListener("load",q)}}var ge=ce[0]||Z.children[0],ae=ge.clientHeight;return ae>0?ae:null}return null});var J={initialized:!1,previousItem:D.selectedItem,selectedItem:D.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:D.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return C.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,C.state=p(p({},J),C.animationHandler(D,J)),C}return y(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,C){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),C.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(D.selectedItem!==this.props.selectedItem||D.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),D.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var D=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var C=D.getInitialImage();C&&!C.complete?C.addEventListener("load",D.setMountState):D.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.addEventListener("mouseenter",this.stopOnHover),D.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.removeEventListener("mouseenter",this.stopOnHover),D.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var D=this.getInitialImage();D&&D.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var D;(D=this.carouselWrapperRef)===null||D===void 0||D.focus()}},{key:"renderItems",value:function(D){var C=this;return this.props.children?e.Children.map(this.props.children,function(J,W){var Z=W===C.state.selectedItem,ce=W===C.state.previousItem,te=Z&&C.state.selectedStyle||ce&&C.state.prevStyle||C.state.slideStyle||{};C.props.centerMode&&C.props.axis==="horizontal"&&(te=p(p({},te),{},{minWidth:C.props.centerSlidePercentage+"%"})),C.state.swiping&&C.state.swipeMovementStarted&&(te=p(p({},te),{},{pointerEvents:"none"}));var q={ref:function(ge){return C.setItemsRef(ge,W)},key:"itemKey"+W+(D?"clone":""),className:n.default.ITEM(!0,W===C.state.selectedItem,W===C.state.previousItem),onClick:C.handleClickItem.bind(C,W,J),style:te};return e.default.createElement("li",q,C.props.renderItem(J,{isSelected:W===C.state.selectedItem,isPrevious:W===C.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,C=this.props,J=C.showIndicators,W=C.labels,Z=C.renderIndicator,ce=C.children;return J?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ce,function(te,q){return Z&&Z(D.changeItem(q),q===D.state.selectedItem,q,W.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var C=this.props.swipeable&&e.Children.count(this.props.children)>1,J=this.props.axis==="horizontal",W=this.props.showArrows&&e.Children.count(this.props.children)>1,Z=W&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ce=W&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),q=te.shift(),ge=te.pop(),ae={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(J){if(ae.onSwipeLeft=this.onSwipeForward,ae.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var he=this.getVariableItemHeight(this.state.selectedItem);fe.height=he||"auto"}}else ae.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ae.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ae.style=p(p({},ae.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,Z,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},C?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ae,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(oe){return D.setListRef(oe)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q)),this.props.renderArrowNext(this.onClickNext,ce,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T})(e.default.Component);return Ko.default=H,k(H,"displayName","Carousel"),k(H,"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(E,R,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!R),onClick:E})},renderArrowNext:function(E,R,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!R),onClick:E})},renderIndicator:function(E,R,T,D){return e.default.createElement("li",{className:n.default.DOT(R),onClick:E,onKeyDown:E,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(T+1)})},renderItem:function(E){return E},renderThumbs:function(E){var R=e.Children.map(E,function(T){var D=T;if(T.type!=="img"&&(D=e.Children.toArray(T.props.children).find(function(C){return C.type==="img"})),!!D)return D});return R.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"),[]):R},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}),Ko}var hm={};function fm(){return hm}var Hc;function pm(){return Hc||(Hc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(dm()),n=fm(),r=o(Dd());function o(i){return i&&i.__esModule?i:{default:i}}})(xc)),xc}var gm=pm(),ul,zc;function mm(){if(zc)return ul;zc=1;var e=Lp(),t=function(){return e.Date.now()};return ul=t,ul}var dl,Lc;function Hd(){if(Lc)return dl;Lc=1;var e=cd(),t=mm(),n=ud(),r="Expected a function",o=Math.max,i=Math.min;function a(l,s,c){var u,h,g,f,p,m,w=0,y=!1,v=!1,x=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,v="maxWait"in c,g=v?o(n(c.maxWait)||0,s):g,x="trailing"in c?!!c.trailing:x);function I(T){var D=u,C=h;return u=h=void 0,w=T,f=l.apply(C,D),f}function O(T){return w=T,p=setTimeout(S,s),y?I(T):f}function M(T){var D=T-m,C=T-w,J=s-D;return v?i(J,g-C):J}function P(T){var D=T-m,C=T-w;return m===void 0||D>=s||D<0||v&&C>=g}function S(){var T=t();if(P(T))return k(T);p=setTimeout(S,M(T))}function k(T){return p=void 0,x&&u?I(T):(u=h=void 0,f)}function H(){p!==void 0&&clearTimeout(p),w=0,u=m=h=p=void 0}function E(){return p===void 0?f:k(t())}function R(){var T=t(),D=P(T);if(u=arguments,h=this,m=T,D){if(p===void 0)return O(m);if(v)return clearTimeout(p),p=setTimeout(S,s),I(m)}return p===void 0&&(p=setTimeout(S,s)),f}return R.cancel=H,R.flush=E,R}return dl=a,dl}var vm=Hd();const zd=vr(vm);function xn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{i.current?.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Rr(e,t){return e===void 0?void 0:t}const bm=Math.PI;function Ac(e){return e*bm/180}const Ld=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Ad=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Fd=(e,t,n)=>Math.min(e,t-n*2),Vd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,ss=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},ym=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 wm(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const a=d.useRef(zd(l=>{i.current&&o(l)},n));return d.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const xm="֑-߿יִ-﷽ﹰ-ﻼ",km="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Cm=new RegExp("^[^"+km+"]*["+xm+"]");function cs(e){return Cm.test(e)?"rtl":"not-rtl"}let Xi;function _l(){if(typeof document>"u")return 0;if(Xi!==void 0)return Xi;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Xi=n-r,Xi}const jr=Symbol();function Sm(e){const t=d.useRef([jr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(l=>{const s=t.current[0];s!==jr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==jr&&o({}),r(c=>typeof l=="function"?l(s===jr?c:s):l),t.current[0]=jr)},[]),a=d.useCallback(()=>{t.current[0]=jr,o({})},[]);return[t.current[0]===jr?n:t.current[0],i,a]}function _d(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 Mm(e){const t=d.useRef(e);return Oo(e,t.current)||(t.current=e),t.current}const Rm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return d.createElement(am,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(gm.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=o?.(l)??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(ss,null)))};function us(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=us();function $d(e){Jr=e}const Bd=/[&<>"']/,Im=new RegExp(Bd.source,"g"),Nd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Em=new RegExp(Nd.source,"g"),Tm={"&":"&","<":"<",">":">",'"':""","'":"'"},Fc=e=>Tm[e];function An(e,t){if(t){if(Bd.test(e))return e.replace(Im,Fc)}else if(Nd.test(e))return e.replace(Em,Fc);return e}const Om=/(^|[^\[])\^/g;function Pt(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Om,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function Vc(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const di={exec:()=>null};function _c(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function ei(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function Dm(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function $c(e,t,n,r){const o=t.href,i=t.title?An(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:An(a)}}function Pm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-IoEmbFO9-CBCubcQ1.js","assets/index-CI5Lukhr.js","assets/index-Bjs8n_uU.css","assets/withFullScreenWrapper-B2V0S41O-DCzGUvSO.js","assets/Toolbar-BPTl0_g8-DgJSJ3GD.js","assets/FormClearHelper-7XVCWEDh-CHeSF048.js","assets/sprintf-D5E86llw-6tzWM3a-.js","assets/checkbox-4WgCYqx1-Bgkcmn0F.js","assets/createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js","assets/slicedToArray-BwzokRlj-E5mBrutT.js","assets/inherits-Pmi26wgm-BX3RGE7G.js","assets/createSuper-dKmkwP0m-DxhpQ4SI.js","assets/FileDownload.esm-GWMXlTU--nCHLLVVG.js","assets/number-overlay-editor-C_tZpFZY-CxWzCIFN.js","assets/es6--XPcqeHG-r3GRWny2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as me,r as d,c9 as cc,ca as on,aC as St,cb as sp,c8 as ns,bX as cp,cc as sd,l as rs,E as os,_ as Ae,cd as up,ce as cd,cf as ud,X as vr,d as Tr,cg as dp,Q as nl,v as Te,c as Qn,ch as hp,ci as fp,x as ot,cj as dd,C as pp,ck as gp,cl as mp,cm as vp,cn as bp,co as yp,cp as wp,cq as Fl,cr as hd,aB as rn,cs as xp,ct as kp,cu as Cp,cv as Sp,cw as Mp,cx as Rp,cy as Ip,U as li,m as Yr,bg as Oa,bf as Da,cz as fd,M as Pa,F as qn,cA as Ep,bu as pd,cB as Tp,H as Op,e as uc,cC as Dp,cD as Pp,L as Hp,b as gd,cE as zp,cF as Lp,cG as Ap,cH as Fp,cI as Vp,at as md,cJ as si,cK as dc,aH as _p,cL as $p,cM as Bp,cN as vd,ao as xo,cO as Np,cP as Wp,cQ as jp,y as rl,cR as Gp,bZ as ol,cS as Up,cT as bd,cU as Kp,be as Ur,cV as Xp,cW as qp,cX as Zp,cY as Yp,D as Jp,cZ as yd,c_ as Qp,c$ as eg,aD as tg,d0 as ng,d1 as rg,d2 as og,A as ig,B as ag,d3 as lg,d4 as sg,z as cg,d5 as ug,d6 as dg,d7 as hg,d8 as cr,$ as Eo,bH as fg,d9 as pg,da as gg,db as mg,dc as vg,dd as bg,de as yg,df as wg,dg as aa,dh as Uo,di as At,dj as Ct,dk as ha,dl as vn,dm as xg,dn as kg,dp as Cg,dq as Sg,dr as Mg,ds as Rg,dt as Ig,du as Wr,dv as hc,dw as fc,dx as wd,dy as xd,dz as Eg,dA as Vl,dB as Tg,dC as Og,dD as kd,dE as Dg}from"./index-CI5Lukhr.js";import{v as Pg,d as Hg}from"./withFullScreenWrapper-B2V0S41O-DCzGUvSO.js";import{y as zg,X as yo}from"./Toolbar-BPTl0_g8-DgJSJ3GD.js";import{m as Lg}from"./FormClearHelper-7XVCWEDh-CHeSF048.js";import{_ as Ag}from"./sprintf-D5E86llw-6tzWM3a-.js";import{v as Fg,y as Vg,T as _g}from"./checkbox-4WgCYqx1-Bgkcmn0F.js";import{a as $g}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{p as Bg,_ as gr}from"./slicedToArray-BwzokRlj-E5mBrutT.js";import{b as Ng,p as Wg,l as jg}from"./inherits-Pmi26wgm-BX3RGE7G.js";import{i as Gg}from"./createSuper-dKmkwP0m-DxhpQ4SI.js";import{o as Ug,i as Kg}from"./FileDownload.esm-GWMXlTU--nCHLLVVG.js";var Cd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({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"}))});Cd.displayName="Add";var Sd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({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"}))});Sd.displayName="Search";var Md=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({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"}))});Md.displayName="Visibility";var il,pc;function Xg(){if(pc)return il;pc=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return il=n,il}var al,gc;function qg(){if(gc)return al;gc=1;var e=Xg(),t=up();function n(r,o){return r!=null&&t(r,o,e)}return al=n,al}var Zg=qg();const Yg=vr(Zg);function Rd(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return Rd(t)}function mi(e,t){return Rd(t??"Hell froze over")}function Jg(e,t){try{return e()}catch{return t}}const mc=Object.prototype.hasOwnProperty;function Oo(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--&&Oo(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(mc.call(e,n)&&++r&&!mc.call(t,n)||!(n in t)||!Oo(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const fa=null,is=void 0;var Y;(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"})(Y||(Y={}));var vc;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(vc||(vc={}));var pa;(function(e){e.Triangle="triangle",e.Dots="dots"})(pa||(pa={}));function Ki(e){return"width"in e&&typeof e.width=="number"}async function bc(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Y.Loading||e.kind===Y.Bubble||e.kind===Y.RowID||e.kind===Y.Protected||e.kind===Y.Drilldown)}function Mo(e){return e.kind===jn.Marker||e.kind===jn.NewRow}function Co(e){if(!ko(e)||e.kind===Y.Image)return!1;switch(e.kind){case Y.Text:case Y.Number:case Y.Markdown:case Y.Uri:case Y.Custom:case Y.Boolean:return e.readonly!==!0;default:mi(e,"A cell was passed with an invalid kind")}}function Qg(e){return Yg(e,"editor")}function as(e){return!(e.readonly??!1)}var jn;(function(e){e.NewRow="new-row",e.Marker="marker"})(jn||(jn={}));const ga={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function ll(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let yc;class Ye{items;constructor(t){this.items=t}static create=t=>new Ye(ll(t));static empty=()=>yc??(yc=new Ye([]));static fromSingleSelection=t=>Ye.empty().add(t);static fromArray=t=>{if(t.length===0)return Ye.empty();const n=t.map(o=>[o,o+1]),r=ll(n);return new Ye(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Ye(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=ll([...this.items,n]);return new Ye(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new Ye(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var em=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},wc=em,tm=e=>e.toUpperCase()===e,nm=e=>t=>e.indexOf(t)===-1,Id=(e,t)=>{const n={};return Object.keys(e).filter(nm(t)).forEach(r=>{n[r]=e[r]}),n};function rm(e,t,n){const r=Id(t,n);if(!e){const o=typeof ol=="function"?{default:ol}:ol;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var om=(e,t)=>{};function im(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!tm(l[0])):n.propsAsIs,u=rm(c,i,["as","class"]);u.ref=a,u.className=n.atomic?wc(n.class,u.className||s):wc(u.className||s,n.class);const{vars:h}=n;if(h){const g={};for(const m in h){const w=h[m],y=w[0],v=w[1]||"",x=typeof y=="function"?y(i):y;om(x,n.name),g[`--${m}`]=`${x}${v}`}const f=u.style||{},p=Object.keys(f);p.length>0&&p.forEach(m=>{g[m]=f[m]}),u.style=g}return e.__wyw_meta&&e!==l?(u.as=l,d.createElement(e,u)):d.createElement(l,u)},o=d.forwardRef?d.forwardRef(r):(i=>{const a=Id(i,["innerRef"]);return r(a,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var un=im;const am=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var xc={},Ko={},sl={},cl={},kc;function lm(){return kc||(kc=1,(function(e){(function(t,n){n(e,St,tg())})(cl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var o=a(n),i=a(r);function a(v){return v&&v.__esModule?v:{default:v}}var l=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var I=arguments[x];for(var O in I)Object.prototype.hasOwnProperty.call(I,O)&&(v[O]=I[O])}return v};function s(v,x){var I={};for(var O in v)x.indexOf(O)>=0||Object.prototype.hasOwnProperty.call(v,O)&&(I[O]=v[O]);return I}function c(v,x){if(!(v instanceof x))throw new TypeError("Cannot call a class as a function")}var u=(function(){function v(x,I){for(var O=0;O<I.length;O++){var M=I[O];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,I,O){return I&&v(x.prototype,I),O&&v(x,O),x}})();function h(v,x){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:v}function g(v,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);v.prototype=Object.create(x&&x.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(v,x):v.__proto__=x)}var f=!1;function p(v){f=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?v:v.capture}function w(v){if("touches"in v){var x=v.touches[0],I=x.pageX,O=x.pageY;return{x:I,y:O}}var M=v.screenX,P=v.screenY;return{x:M,y:P}}var y=(function(v){g(x,v);function x(){var I;c(this,x);for(var O=arguments.length,M=Array(O),P=0;P<O;P++)M[P]=arguments[P];var S=h(this,(I=x.__proto__||Object.getPrototypeOf(x)).call.apply(I,[this].concat(M)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return u(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(I){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(I))}},{key:"_onMouseMove",value:function(I){this.mouseDown&&this._handleSwipeMove(I)}},{key:"_onMouseUp",value:function(I){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(I)}},{key:"_handleSwipeStart",value:function(I){var O=w(I),M=O.x,P=O.y;this.moveStart={x:M,y:P},this.props.onSwipeStart(I)}},{key:"_handleSwipeMove",value:function(I){if(this.moveStart){var O=w(I),M=O.x,P=O.y,S=M-this.moveStart.x,k=P-this.moveStart.y;this.moving=!0;var H=this.props.onSwipeMove({x:S,y:k},I);H&&I.cancelable&&I.preventDefault(),this.movePosition={deltaX:S,deltaY:k}}}},{key:"_handleSwipeEnd",value:function(I){this.props.onSwipeEnd(I);var O=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-O?this.props.onSwipeLeft(1,I):this.movePosition.deltaX>O&&this.props.onSwipeRight(1,I),this.movePosition.deltaY<-O?this.props.onSwipeUp(1,I):this.movePosition.deltaY>O&&this.props.onSwipeDown(1,I)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(I){this.swiper=I,this.props.innerRef(I)}},{key:"render",value:function(){var I=this.props;I.tagName;var O=I.className,M=I.style,P=I.children;I.allowMouseEvents,I.onSwipeUp,I.onSwipeDown,I.onSwipeLeft,I.onSwipeRight,I.onSwipeStart,I.onSwipeMove,I.onSwipeEnd,I.innerRef,I.tolerance;var S=s(I,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:O,style:M},S),P)}}]),x})(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})})(cl)),cl}var Cc;function Ed(){return Cc||(Cc=1,(function(e){(function(t,n){n(e,lm())})(sl,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(sl)),sl}var Xo={},Sc;function Td(){if(Sc)return Xo;Sc=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=void 0;var e=t(Gp());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,e.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,a){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xo.default=r,Xo}var qo={},Zo={},Mc;function sm(){if(Mc)return Zo;Mc=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Zo.outerWidth=e,Zo}var Yo={},Rc;function ls(){if(Rc)return Yo;Rc=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.default=void 0;var e=function(t,n,r){var o=t===0?t:t+n,i=r==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+i.join(",")+")";return a+l};return Yo.default=e,Yo}var Jo={},Ic;function Od(){if(Ic)return Jo;Ic=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(){return window};return Jo.default=e,Jo}var Ec;function Dd(){if(Ec)return qo;Ec=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e=s(St),t=a(Td()),n=sm(),r=a(ls()),o=a(Ed()),i=a(Od());function a(S){return S&&S.__esModule?S:{default:S}}function l(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return l=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||c(S)!=="object"&&typeof S!="function")return{default:S};var k=l();if(k&&k.has(S))return k.get(S);var H={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in S)if(Object.prototype.hasOwnProperty.call(S,R)){var T=E?Object.getOwnPropertyDescriptor(S,R):null;T&&(T.get||T.set)?Object.defineProperty(H,R,T):H[R]=S[R]}return H.default=S,k&&k.set(S,H),H}function c(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(k){return typeof k}:c=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},c(S)}function u(){return u=Object.assign||function(S){for(var k=1;k<arguments.length;k++){var H=arguments[k];for(var E in H)Object.prototype.hasOwnProperty.call(H,E)&&(S[E]=H[E])}return S},u.apply(this,arguments)}function h(S,k){if(!(S instanceof k))throw new TypeError("Cannot call a class as a function")}function g(S,k){for(var H=0;H<k.length;H++){var E=k[H];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function f(S,k,H){return k&&g(S.prototype,k),S}function p(S,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(k&&k.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),k&&m(S,k)}function m(S,k){return m=Object.setPrototypeOf||function(H,E){return H.__proto__=E,H},m(S,k)}function w(S){var k=x();return function(){var H=I(S),E;if(k){var R=I(this).constructor;E=Reflect.construct(H,arguments,R)}else E=H.apply(this,arguments);return y(this,E)}}function y(S,k){return k&&(c(k)==="object"||typeof k=="function")?k:v(S)}function v(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(S){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(k){return k.__proto__||Object.getPrototypeOf(k)},I(S)}function O(S,k,H){return k in S?Object.defineProperty(S,k,{value:H,enumerable:!0,configurable:!0,writable:!0}):S[k]=H,S}var M=function(S){return S.hasOwnProperty("key")},P=(function(S){p(H,S);var k=w(H);function H(E){var R;return h(this,H),R=k.call(this,E),O(v(R),"itemsWrapperRef",void 0),O(v(R),"itemsListRef",void 0),O(v(R),"thumbsRef",void 0),O(v(R),"setItemsWrapperRef",function(T){R.itemsWrapperRef=T}),O(v(R),"setItemsListRef",function(T){R.itemsListRef=T}),O(v(R),"setThumbsRef",function(T,D){R.thumbsRef||(R.thumbsRef=[]),R.thumbsRef[D]=T}),O(v(R),"updateSizes",function(){if(!(!R.props.children||!R.itemsWrapperRef||!R.thumbsRef)){var T=e.Children.count(R.props.children),D=R.itemsWrapperRef.clientWidth,C=R.props.thumbWidth?R.props.thumbWidth:(0,n.outerWidth)(R.thumbsRef[0]),J=Math.floor(D/C),W=J<T,Z=W?T-J:0;R.setState(function(ce,te){return{itemSize:C,visibleItems:J,firstItem:W?R.getFirstItem(te.selectedItem):0,lastPosition:Z,showArrows:W}})}}),O(v(R),"handleClickItem",function(T,D,C){if(!M(C)||C.key==="Enter"){var J=R.props.onSelectItem;typeof J=="function"&&J(T,D)}}),O(v(R),"onSwipeStart",function(){R.setState({swiping:!0})}),O(v(R),"onSwipeEnd",function(){R.setState({swiping:!1})}),O(v(R),"onSwipeMove",function(T){var D=T.x;if(!R.state.itemSize||!R.itemsWrapperRef||!R.state.visibleItems)return!1;var C=0,J=e.Children.count(R.props.children),W=-(R.state.firstItem*100)/R.state.visibleItems,Z=Math.max(J-R.state.visibleItems,0),ce=-Z*100/R.state.visibleItems;W===C&&D>0&&(D=0),W===ce&&D<0&&(D=0);var te=R.itemsWrapperRef.clientWidth,q=W+100/(te/D);return R.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ge){R.itemsListRef.style[ge]=(0,r.default)(q,"%",R.props.axis)}),!0}),O(v(R),"slideRight",function(T){R.moveTo(R.state.firstItem-(typeof T=="number"?T:1))}),O(v(R),"slideLeft",function(T){R.moveTo(R.state.firstItem+(typeof T=="number"?T:1))}),O(v(R),"moveTo",function(T){T=T<0?0:T,T=T>=R.state.lastPosition?R.state.lastPosition:T,R.setState({firstItem:T})}),R.state={selectedItem:E.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},R}return f(H,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(E){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==E.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(E){var R=E;return E>=this.state.lastPosition&&(R=this.state.lastPosition),E<this.state.firstItem+this.state.visibleItems&&(R=this.state.firstItem),E<this.state.firstItem&&(R=E),R}},{key:"renderItems",value:function(){var E=this;return this.props.children.map(function(R,T){var D=t.default.ITEM(!1,T===E.state.selectedItem),C={key:T,ref:function(J){return E.setThumbsRef(J,T)},className:D,onClick:E.handleClickItem.bind(E,T,E.props.children[T]),onKeyDown:E.handleClickItem.bind(E,T,E.props.children[T]),"aria-label":"".concat(E.props.labels.item," ").concat(T+1),style:{width:E.props.thumbWidth}};return e.default.createElement("li",u({},C,{role:"button",tabIndex:0}),R)})}},{key:"render",value:function(){var E=this;if(!this.props.children)return null;var R=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,C={},J=-this.state.firstItem*(this.state.itemSize||0),W=(0,r.default)(J,"px",this.props.axis),Z=this.props.transitionTime+"ms";return C={WebkitTransform:W,MozTransform:W,MsTransform:W,OTransform:W,transform:W,msTransform:W,WebkitTransitionDuration:Z,MozTransitionDuration:Z,MsTransitionDuration:Z,OTransitionDuration:Z,transitionDuration:Z,msTransitionDuration:Z},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 E.slideRight()},"aria-label":this.props.labels.leftArrow}),R?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:C,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ce){return E.setItemsListRef(ce)},style:C},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return E.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),H})(e.Component);return qo.default=P,O(P,"displayName","Thumbs"),O(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),qo}var Qo={},Tc;function cm(){if(Tc)return Qo;Tc=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var e=function(){return document};return Qo.default=e,Qo}var Ln={},Oc;function Pd(){if(Oc)return Ln;Oc=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=St,t=n(ls());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};Ln.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=i;var a=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,g=u-1;return s&&(s!==g||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===g&&(h+=100-c.centerSlidePercentage),h}return-s*100};Ln.getPosition=a;var l=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return Ln.setPosition=l,Ln}var Xn={},Dc;function um(){if(Dc)return Xn;Dc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fadeAnimationHandler=Xn.slideStopSwipingHandler=Xn.slideSwipeAnimationHandler=Xn.slideAnimationHandler=void 0;var e=St,t=r(ls()),n=Pd();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,p)}return f}function i(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?o(Object(f),!0).forEach(function(p){a(h,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(f,p))})}return h}function a(h,g,f){return g in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}var l=function(h,g){var f={},p=g.selectedItem,m=p,w=e.Children.count(h.children)-1,y=h.infiniteLoop&&(p<0||p>w);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):m>w&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var v=(0,n.getPosition)(p,h),x=(0,t.default)(v,"%",h.axis),I=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:x,msTransform:x,OTransform:x,transform:x},g.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:I,MozTransitionDuration:I,OTransitionDuration:I,transitionDuration:I,msTransitionDuration:I})),f};Xn.slideAnimationHandler=l;var s=function(h,g,f,p){var m={},w=g.axis==="horizontal",y=e.Children.count(g.children),v=0,x=(0,n.getPosition)(f.selectedItem,g),I=g.infiniteLoop?(0,n.getPosition)(y-1,g)-100:(0,n.getPosition)(y-1,g),O=w?h.x:h.y,M=O;x===v&&O>0&&(M=0),x===I&&O<0&&(M=0);var P=x+100/(f.itemSize/M),S=Math.abs(O)>g.swipeScrollTolerance;return g.infiniteLoop&&S&&(f.selectedItem===0&&P>-100?P-=y*100:f.selectedItem===y-1&&P<-y*100&&(P+=y*100)),(!g.preventMovementUntilSwipeScrollTolerance||S||f.swipeMovementStarted)&&(f.swipeMovementStarted||p({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(P,g.axis)),S&&!f.cancelClick&&p({cancelClick:!0}),m};Xn.slideSwipeAnimationHandler=s;var c=function(h,g){var f=(0,n.getPosition)(g.selectedItem,h),p=(0,n.setPosition)(f,h.axis);return{itemListStyle:p}};Xn.slideStopSwipingHandler=c;var u=function(h,g){var f=h.transitionTime+"ms",p="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Xn.fadeAnimationHandler=u,Xn}var Pc;function dm(){if(Pc)return Ko;Pc=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var e=u(St),t=s(Ed()),n=s(Td()),r=s(Dd()),o=s(cm()),i=s(Od()),a=Pd(),l=um();function s(E){return E&&E.__esModule?E:{default:E}}function c(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return c=function(){return E},E}function u(E){if(E&&E.__esModule)return E;if(E===null||h(E)!=="object"&&typeof E!="function")return{default:E};var R=c();if(R&&R.has(E))return R.get(E);var T={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var J=D?Object.getOwnPropertyDescriptor(E,C):null;J&&(J.get||J.set)?Object.defineProperty(T,C,J):T[C]=E[C]}return T.default=E,R&&R.set(E,T),T}function h(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(R){return typeof R}:h=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},h(E)}function g(){return g=Object.assign||function(E){for(var R=1;R<arguments.length;R++){var T=arguments[R];for(var D in T)Object.prototype.hasOwnProperty.call(T,D)&&(E[D]=T[D])}return E},g.apply(this,arguments)}function f(E,R){var T=Object.keys(E);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(E);R&&(D=D.filter(function(C){return Object.getOwnPropertyDescriptor(E,C).enumerable})),T.push.apply(T,D)}return T}function p(E){for(var R=1;R<arguments.length;R++){var T=arguments[R]!=null?arguments[R]:{};R%2?f(Object(T),!0).forEach(function(D){k(E,D,T[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(T)):f(Object(T)).forEach(function(D){Object.defineProperty(E,D,Object.getOwnPropertyDescriptor(T,D))})}return E}function m(E,R){if(!(E instanceof R))throw new TypeError("Cannot call a class as a function")}function w(E,R){for(var T=0;T<R.length;T++){var D=R[T];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function y(E,R,T){return R&&w(E.prototype,R),E}function v(E,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(R&&R.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),R&&x(E,R)}function x(E,R){return x=Object.setPrototypeOf||function(T,D){return T.__proto__=D,T},x(E,R)}function I(E){var R=P();return function(){var T=S(E),D;if(R){var C=S(this).constructor;D=Reflect.construct(T,arguments,C)}else D=T.apply(this,arguments);return O(this,D)}}function O(E,R){return R&&(h(R)==="object"||typeof R=="function")?R:M(E)}function M(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(E){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},S(E)}function k(E,R,T){return R in E?Object.defineProperty(E,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):E[R]=T,E}var H=(function(E){v(T,E);var R=I(T);function T(D){var C;m(this,T),C=R.call(this,D),k(M(C),"thumbsRef",void 0),k(M(C),"carouselWrapperRef",void 0),k(M(C),"listRef",void 0),k(M(C),"itemsRef",void 0),k(M(C),"timer",void 0),k(M(C),"animationHandler",void 0),k(M(C),"setThumbsRef",function(W){C.thumbsRef=W}),k(M(C),"setCarouselWrapperRef",function(W){C.carouselWrapperRef=W}),k(M(C),"setListRef",function(W){C.listRef=W}),k(M(C),"setItemsRef",function(W,Z){C.itemsRef||(C.itemsRef=[]),C.itemsRef[Z]=W}),k(M(C),"autoPlay",function(){e.Children.count(C.props.children)<=1||(C.clearAutoPlay(),C.props.autoPlay&&(C.timer=setTimeout(function(){C.increment()},C.props.interval)))}),k(M(C),"clearAutoPlay",function(){C.timer&&clearTimeout(C.timer)}),k(M(C),"resetAutoPlay",function(){C.clearAutoPlay(),C.autoPlay()}),k(M(C),"stopOnHover",function(){C.setState({isMouseEntered:!0},C.clearAutoPlay)}),k(M(C),"startOnLeave",function(){C.setState({isMouseEntered:!1},C.autoPlay)}),k(M(C),"isFocusWithinTheCarousel",function(){return C.carouselWrapperRef?!!((0,o.default)().activeElement===C.carouselWrapperRef||C.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),k(M(C),"navigateWithKeyboard",function(W){if(C.isFocusWithinTheCarousel()){var Z=C.props.axis,ce=Z==="horizontal",te={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},q=ce?te.ArrowRight:te.ArrowDown,ge=ce?te.ArrowLeft:te.ArrowUp;q===W.keyCode?C.increment():ge===W.keyCode&&C.decrement()}}),k(M(C),"updateSizes",function(){if(!(!C.state.initialized||!C.itemsRef||C.itemsRef.length===0)){var W=C.props.axis==="horizontal",Z=C.itemsRef[0];if(Z){var ce=W?Z.clientWidth:Z.clientHeight;C.setState({itemSize:ce}),C.thumbsRef&&C.thumbsRef.updateSizes()}}}),k(M(C),"setMountState",function(){C.setState({hasMount:!0}),C.updateSizes()}),k(M(C),"handleClickItem",function(W,Z){if(e.Children.count(C.props.children)!==0){if(C.state.cancelClick){C.setState({cancelClick:!1});return}C.props.onClickItem(W,Z),W!==C.state.selectedItem&&C.setState({selectedItem:W})}}),k(M(C),"handleOnChange",function(W,Z){e.Children.count(C.props.children)<=1||C.props.onChange(W,Z)}),k(M(C),"handleClickThumb",function(W,Z){C.props.onClickThumb(W,Z),C.moveTo(W)}),k(M(C),"onSwipeStart",function(W){C.setState({swiping:!0}),C.props.onSwipeStart(W)}),k(M(C),"onSwipeEnd",function(W){C.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),C.props.onSwipeEnd(W),C.clearAutoPlay(),C.state.autoPlay&&C.autoPlay()}),k(M(C),"onSwipeMove",function(W,Z){C.props.onSwipeMove(Z);var ce=C.props.swipeAnimationHandler(W,C.props,C.state,C.setState.bind(M(C)));return C.setState(p({},ce)),!!Object.keys(ce).length}),k(M(C),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem-(typeof W=="number"?W:1))}),k(M(C),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem+(typeof W=="number"?W:1))}),k(M(C),"moveTo",function(W){if(typeof W=="number"){var Z=e.Children.count(C.props.children)-1;W<0&&(W=C.props.infiniteLoop?Z:0),W>Z&&(W=C.props.infiniteLoop?0:Z),C.selectItem({selectedItem:W}),C.state.autoPlay&&C.state.isMouseEntered===!1&&C.resetAutoPlay()}}),k(M(C),"onClickNext",function(){C.increment(1)}),k(M(C),"onClickPrev",function(){C.decrement(1)}),k(M(C),"onSwipeForward",function(){C.increment(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),k(M(C),"onSwipeBackwards",function(){C.decrement(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),k(M(C),"changeItem",function(W){return function(Z){(!(0,a.isKeyboardEvent)(Z)||Z.key==="Enter")&&C.moveTo(W)}}),k(M(C),"selectItem",function(W){C.setState(p({previousItem:C.state.selectedItem},W),function(){C.setState(C.animationHandler(C.props,C.state))}),C.handleOnChange(W.selectedItem,e.Children.toArray(C.props.children)[W.selectedItem])}),k(M(C),"getInitialImage",function(){var W=C.props.selectedItem,Z=C.itemsRef&&C.itemsRef[W],ce=Z&&Z.getElementsByTagName("img")||[];return ce[0]}),k(M(C),"getVariableItemHeight",function(W){var Z=C.itemsRef&&C.itemsRef[W];if(C.state.hasMount&&Z&&Z.children.length){var ce=Z.children[0].getElementsByTagName("img")||[];if(ce.length>0){var te=ce[0];if(!te.complete){var q=function fe(){C.forceUpdate(),te.removeEventListener("load",fe)};te.addEventListener("load",q)}}var ge=ce[0]||Z.children[0],ae=ge.clientHeight;return ae>0?ae:null}return null});var J={initialized:!1,previousItem:D.selectedItem,selectedItem:D.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:D.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return C.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,C.state=p(p({},J),C.animationHandler(D,J)),C}return y(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,C){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),C.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(D.selectedItem!==this.props.selectedItem||D.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),D.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var D=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var C=D.getInitialImage();C&&!C.complete?C.addEventListener("load",D.setMountState):D.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.addEventListener("mouseenter",this.stopOnHover),D.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.removeEventListener("mouseenter",this.stopOnHover),D.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var D=this.getInitialImage();D&&D.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var D;(D=this.carouselWrapperRef)===null||D===void 0||D.focus()}},{key:"renderItems",value:function(D){var C=this;return this.props.children?e.Children.map(this.props.children,function(J,W){var Z=W===C.state.selectedItem,ce=W===C.state.previousItem,te=Z&&C.state.selectedStyle||ce&&C.state.prevStyle||C.state.slideStyle||{};C.props.centerMode&&C.props.axis==="horizontal"&&(te=p(p({},te),{},{minWidth:C.props.centerSlidePercentage+"%"})),C.state.swiping&&C.state.swipeMovementStarted&&(te=p(p({},te),{},{pointerEvents:"none"}));var q={ref:function(ge){return C.setItemsRef(ge,W)},key:"itemKey"+W+(D?"clone":""),className:n.default.ITEM(!0,W===C.state.selectedItem,W===C.state.previousItem),onClick:C.handleClickItem.bind(C,W,J),style:te};return e.default.createElement("li",q,C.props.renderItem(J,{isSelected:W===C.state.selectedItem,isPrevious:W===C.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,C=this.props,J=C.showIndicators,W=C.labels,Z=C.renderIndicator,ce=C.children;return J?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ce,function(te,q){return Z&&Z(D.changeItem(q),q===D.state.selectedItem,q,W.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var C=this.props.swipeable&&e.Children.count(this.props.children)>1,J=this.props.axis==="horizontal",W=this.props.showArrows&&e.Children.count(this.props.children)>1,Z=W&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ce=W&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),q=te.shift(),ge=te.pop(),ae={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(J){if(ae.onSwipeLeft=this.onSwipeForward,ae.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var he=this.getVariableItemHeight(this.state.selectedItem);fe.height=he||"auto"}}else ae.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ae.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ae.style=p(p({},ae.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,Z,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},C?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ae,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(oe){return D.setListRef(oe)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q)),this.props.renderArrowNext(this.onClickNext,ce,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T})(e.default.Component);return Ko.default=H,k(H,"displayName","Carousel"),k(H,"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(E,R,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!R),onClick:E})},renderArrowNext:function(E,R,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!R),onClick:E})},renderIndicator:function(E,R,T,D){return e.default.createElement("li",{className:n.default.DOT(R),onClick:E,onKeyDown:E,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(T+1)})},renderItem:function(E){return E},renderThumbs:function(E){var R=e.Children.map(E,function(T){var D=T;if(T.type!=="img"&&(D=e.Children.toArray(T.props.children).find(function(C){return C.type==="img"})),!!D)return D});return R.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"),[]):R},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}),Ko}var hm={};function fm(){return hm}var Hc;function pm(){return Hc||(Hc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(dm()),n=fm(),r=o(Dd());function o(i){return i&&i.__esModule?i:{default:i}}})(xc)),xc}var gm=pm(),ul,zc;function mm(){if(zc)return ul;zc=1;var e=Lp(),t=function(){return e.Date.now()};return ul=t,ul}var dl,Lc;function Hd(){if(Lc)return dl;Lc=1;var e=cd(),t=mm(),n=ud(),r="Expected a function",o=Math.max,i=Math.min;function a(l,s,c){var u,h,g,f,p,m,w=0,y=!1,v=!1,x=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,v="maxWait"in c,g=v?o(n(c.maxWait)||0,s):g,x="trailing"in c?!!c.trailing:x);function I(T){var D=u,C=h;return u=h=void 0,w=T,f=l.apply(C,D),f}function O(T){return w=T,p=setTimeout(S,s),y?I(T):f}function M(T){var D=T-m,C=T-w,J=s-D;return v?i(J,g-C):J}function P(T){var D=T-m,C=T-w;return m===void 0||D>=s||D<0||v&&C>=g}function S(){var T=t();if(P(T))return k(T);p=setTimeout(S,M(T))}function k(T){return p=void 0,x&&u?I(T):(u=h=void 0,f)}function H(){p!==void 0&&clearTimeout(p),w=0,u=m=h=p=void 0}function E(){return p===void 0?f:k(t())}function R(){var T=t(),D=P(T);if(u=arguments,h=this,m=T,D){if(p===void 0)return O(m);if(v)return clearTimeout(p),p=setTimeout(S,s),I(m)}return p===void 0&&(p=setTimeout(S,s)),f}return R.cancel=H,R.flush=E,R}return dl=a,dl}var vm=Hd();const zd=vr(vm);function xn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{i.current?.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Rr(e,t){return e===void 0?void 0:t}const bm=Math.PI;function Ac(e){return e*bm/180}const Ld=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Ad=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Fd=(e,t,n)=>Math.min(e,t-n*2),Vd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,ss=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},ym=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 wm(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const a=d.useRef(zd(l=>{i.current&&o(l)},n));return d.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const xm="֑-߿יִ-﷽ﹰ-ﻼ",km="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Cm=new RegExp("^[^"+km+"]*["+xm+"]");function cs(e){return Cm.test(e)?"rtl":"not-rtl"}let Xi;function _l(){if(typeof document>"u")return 0;if(Xi!==void 0)return Xi;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Xi=n-r,Xi}const jr=Symbol();function Sm(e){const t=d.useRef([jr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(l=>{const s=t.current[0];s!==jr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==jr&&o({}),r(c=>typeof l=="function"?l(s===jr?c:s):l),t.current[0]=jr)},[]),a=d.useCallback(()=>{t.current[0]=jr,o({})},[]);return[t.current[0]===jr?n:t.current[0],i,a]}function _d(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 Mm(e){const t=d.useRef(e);return Oo(e,t.current)||(t.current=e),t.current}const Rm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return d.createElement(am,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(gm.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=o?.(l)??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(ss,null)))};function us(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=us();function $d(e){Jr=e}const Bd=/[&<>"']/,Im=new RegExp(Bd.source,"g"),Nd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Em=new RegExp(Nd.source,"g"),Tm={"&":"&","<":"<",">":">",'"':""","'":"'"},Fc=e=>Tm[e];function An(e,t){if(t){if(Bd.test(e))return e.replace(Im,Fc)}else if(Nd.test(e))return e.replace(Em,Fc);return e}const Om=/(^|[^\[])\^/g;function Pt(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Om,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function Vc(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const di={exec:()=>null};function _c(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function ei(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function Dm(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function $c(e,t,n,r){const o=t.href,i=t.title?An(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:An(a)}}function Pm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
3
3
|
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
|
|
4
4
|
`)}class ma{options;rules;lexer;constructor(t){this.options=t||Jr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ei(r,`
|
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=Pm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=ei(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:ei(n[0],`
|
|
@@ -179,10 +179,10 @@ Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An err
|
|
|
179
179
|
`?(r.push(e.slice(o,a)),o=a+1,l===`
|
|
180
180
|
`&&(n.push(r),r=[])):l==='"'&&(i=t.inString);break;case t.inString:l==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?i=t.inString:((l===" "||l===`
|
|
181
181
|
`)&&(r.push(uu(e.slice(o,a))),o=a+1,l===`
|
|
182
|
-
`&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push(uu(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function du(e,t,n){const r=kb(e,t),o=l=>{window.navigator.clipboard?.writeText(l)},i=(l,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),a=(l,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",l),n?.clipboardData?.setData("text/html",s)}catch{i(l,s)||o(l)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function xh(e){return e!==!0}function hu(e){return typeof e=="string"?e:`${e}px`}const Mb=()=>e=>e.innerWidth,Rb=()=>e=>e.innerHeight,Ib=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Mb()],"wmyidgi-1":[Rb()]}}),Eb=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(Ib,{innerHeight:hu(n),innerWidth:hu(t),...o},r)},Tb=2,Ob=1300;function Db(e,t,n){const r=St.useRef(0),[o,i]=e??[0,0];St.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{if(!a){if(l===0)l=c;else{const u=c-l;r.current=Math.min(1,r.current+u/Ob);const h=r.current**1.618*u*Tb;t.current?.scrollBy(o*h,i*h),l=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Pb({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,h,g,f]=St.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const p=l/16,m=e,w=ih();return[typeof m=="number"?m*p:y=>Math.ceil(m(y)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*p},Math.ceil((o??0)*p),Math.ceil((i??0)*p)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:g,overscrollY:f}}const Mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function rt(e,t){return e===!0?t:e===!1?"":e}function fu(e){const t=wa.value;return{activateCell:rt(e.activateCell," |Enter|shift+Enter"),clear:rt(e.clear,"any+Escape"),closeOverlay:rt(e.closeOverlay,"any+Escape"),acceptOverlayDown:rt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:rt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:rt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:rt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:rt(e.delete,t?"Backspace|Delete":"Delete"),downFill:rt(e.downFill,"primary+_68"),scrollToSelectedCell:rt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:rt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:rt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:rt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:rt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:rt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:rt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:rt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:rt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:rt(e.goToFirstCell,"primary+Home"),goToFirstColumn:rt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:rt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:rt(e.goToLastCell,"primary+End"),goToLastColumn:rt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:rt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:rt(e.goToNextPage,"PageDown"),goToPreviousPage:rt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:rt(e.rightFill,"primary+_82"),search:rt(e.search,"primary+f"),selectAll:rt(e.selectAll,"primary+a"),selectColumn:rt(e.selectColumn,"ctrl+ "),selectGrowDown:rt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:rt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:rt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:rt(e.selectGrowUp,"shift+ArrowUp"),selectRow:rt(e.selectRow,"shift+ "),selectToFirstCell:rt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:rt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:rt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:rt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:rt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:rt(e.selectToLastRow,"primary+shift+ArrowDown")}}function Hb(e){const t=Mm(e);return St.useMemo(()=>{if(t===void 0)return fu(Mr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Mr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Mr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Mr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Mr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Mr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Mr.selectToLastCell};return fu({...Mr,...n})},[t])}function zb(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function Ss(e,t){const n=[];function r(l,s,c=!1){let u=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(u=l.subGroups[0].headerIndex-l.headerIndex),u--,n.push({rowIndex:-1,headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:u}),l.subGroups)for(let h=0;h<l.subGroups.length;h++){const g=h<l.subGroups.length-1?l.subGroups[h+1].headerIndex:s;r(l.subGroups[h],g,c||l.isCollapsed)}}const o=zb(e.groups);for(let l=0;l<o.length;l++){const s=l<o.length-1?o[l+1].headerIndex:null;r(o[l],s)}let i=0,a=0;for(const l of n)l.contentIndex=a,a+=l.rows,l.rowIndex=i,i+=l.isCollapsed?1:l.rows+1;return n.filter(l=>l.skip===!1).map(l=>{const{skip:s,...c}=l;return c})}function Kl(e,t){if(t===void 0||Ss.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Lb(e,t,n,r){const o=St.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]),i=St.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),a=St.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),l=St.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=St.useCallback(u=>{if(o===void 0)return u;let h=u;for(const g of o){if(h===0)return;if(h--,!g.isCollapsed){if(h<g.rows)return g.contentIndex+h;h-=g.rows}}return u},[o]),c=Rr(r??e?.themeOverride,St.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:g,groupIndex:f}=Kl(u,o);return h?e.themeOverride:r?.(u,f,g)},[o,r,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:a,rowNumberMapper:s,getRowThemeOverride:c}}function Ab(e,t){const n=St.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]);return{getRowGroupingForPath:Ch,updateRowGroupingByPath:kh,mapper:St.useCallback(r=>{if(typeof r=="number")return Kl(r,n);const o=Kl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function kh(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:kh(i.subGroups??[],o,n)}:i)}function Ch(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Ch(e[n].subGroups??[],r)}function Fb(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function Vb(e,t,n,r,o){const[i,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,c,u]=Sm(l),h=d.useRef(o);h.current=o;const g=Fb(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&f){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&u(),h.current()}},[t,f,u,g]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&u(),h.current()}},[e,p,u,g]),{visibleRegion:s,setVisibleRegion:c,scrollRef:g}}const _b=d.lazy(async()=>await ns(()=>import("./data-grid-overlay-editor-KB2z8mJP-C62BT9jT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let $b=0;function Bb(e){return W0(eu(eu(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Yi(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Ji={kind:Y.Loading,allowOverlay:!1},Qi={columns:Ye.empty(),rows:Ye.empty(),current:void 0},Nb=(e,t)=>{const[n,r]=d.useState(Qi),[o,i]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:f,markdownDivCreateNode:p,width:m,height:w,columns:y,rows:v,getCellContent:x,onCellClicked:I,onCellActivated:O,onFillPattern:M,onFinishedEditing:P,coercePasteValue:S,drawHeader:k,drawCell:H,editorBloom:E,onHeaderClicked:R,onColumnProposeMove:T,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:C="default",onGroupHeaderClicked:J,onCellContextMenu:W,className:Z,onHeaderContextMenu:ce,getCellsForSelection:te,onGroupHeaderContextMenu:q,onGroupHeaderRenamed:ge,onCellEdited:ae,onCellsEdited:fe,onSearchResultsChanged:he,searchResults:oe,onSearchValueChange:V,searchValue:z,onKeyDown:G,onKeyUp:re,keybindings:le,editOnType:Ie=!0,onRowAppended:ye,onColumnAppended:at,onColumnMoved:Ce,validateCell:ft,highlightRegions:vt,rangeSelect:Be="rect",columnSelect:ne="multi",rowSelect:ie="multi",rangeSelectionBlending:be="exclusive",columnSelectionBlending:ue="exclusive",rowSelectionBlending:ve="exclusive",onDelete:Fe,onDragStart:Ve,onMouseMove:Je,onPaste:Se,copyHeaders:Ze=!1,freezeColumns:Ee=0,cellActivationBehavior:Me="second-click",rowSelectionMode:Oe="auto",columnSelectionMode:ut="auto",onHeaderMenuClick:Qe,onHeaderIndicatorClick:Ue,getGroupDetails:wt,rowGrouping:gt,onSearchClose:Tt,onItemHovered:Ot,onSelectionCleared:an,showSearch:qt,onVisibleRegionChanged:In,gridSelection:Mt,onGridSelectionChange:dt,minColumnWidth:En=50,maxColumnWidth:mt=500,maxColumnAutoWidth:Zt,provideEditor:kn,trailingRowOptions:De,freezeTrailingRows:et=0,allowedFillDirections:bt="orthogonal",scrollOffsetX:Tn,scrollOffsetY:ln,verticalBorder:sn,onDragOverCell:On,onDrop:Yt,onColumnResize:Jt,onColumnResizeEnd:_e,onColumnResizeStart:xt,customRenderers:Dn,fillHandle:Ht,experimental:ht,fixedShadowX:Cn,fixedShadowY:ur,headerIcons:_n,imageWindowLoader:B,initialSize:$e,isDraggable:Ne,onDragLeave:Dt,onRowMoved:Qt,overscrollX:dn,overscrollY:Sn,preventDiagonalScrolling:bn,rightElement:$t,rightElementProps:Mn,trapFocus:Rn=!1,smoothScrollX:we,smoothScrollY:zt,scaleToRem:Kt=!1,rowHeight:$n=34,headerHeight:Xt=36,groupHeaderHeight:jt=Xt,theme:Gt,isOutsideClick:Pn,renderers:Hn,resizeIndicator:Ii,scrollToActiveCell:Hr=!0,drawFocusRing:Ho=!0,portalElementRef:zo}=e,Lo=Ho==="no-editor"?o===void 0:Ho,Gn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,fn=Gn?.kind??e.rowMarkers??"none",br=Gn?.width??e.rowMarkerWidth,to=Gn?.startIndex??e.rowMarkerStartIndex??1,yr=Gn?.theme??e.rowMarkerTheme,no=Gn?.headerTheme,Ei=Gn?.headerAlwaysVisible,zr=ie!=="multi"||Gn?.headerDisabled===!0,ro=Gn?.checkboxStyle??"square",wr=Math.max(En,20),oo=Math.max(mt,wr),Ti=Math.max(Zt??oo,wr),Ao=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Le,rowNumberMapper:Fo,rowHeight:Fa,getRowThemeOverride:Lr}=Lb(gt,v,$n,f),Va=d.useMemo(()=>Number.parseFloat(Ao.fontSize),[Ao]),{rowHeight:tr,headerHeight:Vo,groupHeaderHeight:io,theme:Oi,overscrollX:_a,overscrollY:$a}=Pb({groupHeaderHeight:jt,headerHeight:Xt,overscrollX:dn,overscrollY:Sn,remSize:Va,rowHeight:Fa,scaleToRem:Kt,theme:Gt}),nr=Hb(le),dr=br??(v>1e4?48:v>1e3?44:v>100?36:32),yn=fn!=="none",j=yn?1:0,Ft=De!==void 0,Ar=De?.sticky===!0,[ao,Di]=d.useState(!1),lo=qt??ao,Ba=d.useCallback(()=>{Tt!==void 0?Tt():Di(!1)},[Tt]),K=d.useMemo(()=>Mt===void 0?void 0:Yi(Mt,j),[Mt,j])??n,_=d.useRef();_.current===void 0&&(_.current=new AbortController),d.useEffect(()=>()=>_?.current.abort(),[]);const[ee,xe]=mb(te,x,j,_.current,Le),Re=d.useCallback((b,L,A)=>{if(ft===void 0)return!0;const $=[b[0]-j,b[1]];return ft?.($,L,A)},[j,ft]),de=d.useRef(Mt),pe=d.useCallback((b,L)=>{L&&(b=Cb(b,ee,j,C,_.current)),dt!==void 0?(de.current=Yi(b,-j),dt(de.current)):r(b)},[dt,ee,j,C]),We=Rr(Jt,d.useCallback((b,L,A,$)=>{Jt?.(y[A-j],L,A-j,$)},[Jt,j,y])),ke=Rr(_e,d.useCallback((b,L,A,$)=>{_e?.(y[A-j],L,A-j,$)},[_e,j,y])),Xe=Rr(xt,d.useCallback((b,L,A,$)=>{xt?.(y[A-j],L,A-j,$)},[xt,j,y])),pt=Rr(k,d.useCallback((b,L)=>k?.({...b,columnIndex:b.columnIndex-j},L)??!1,[k,j])),hn=Rr(H,d.useCallback((b,L)=>H?.({...b,col:b.col-j},L)??!1,[H,j])),Nt=d.useCallback(b=>{if(Fe!==void 0){const L=Fe(Yi(b,-j));return typeof L=="boolean"?L:Yi(L,j)}return!0},[Fe,j]),[kt,lt,je]=gb(K,pe,be,ue,ve,Be,D),ct=d.useMemo(()=>mr(ih(),Oi),[Oi]),[_t,so]=d.useState([0,0,0]),Fr=d.useMemo(()=>{if(Hn===void 0)return{};const b={};for(const L of Hn)b[L.kind]=L;return b},[Hn]),en=d.useCallback(b=>b.kind!==Y.Custom?Fr[b.kind]:Dn?.find(L=>L.isMatch(b)),[Dn,Fr]);let{sizedColumns:cn,nonGrowWidth:Lt}=z0(y,Le,xe,_t[0]-(j===0?0:dr)-_t[2],wr,Ti,ct,en,_.current);fn!=="none"&&(Lt+=dr);const Bn=d.useMemo(()=>cn.some(b=>b.group!==void 0),[cn]),pn=Bn?Vo+io:Vo,hr=K.rows.length,fr=fn==="none"?void 0:hr===0?!1:hr===Le?!0:void 0,st=d.useMemo(()=>fn==="none"?cn:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:yr,rowMarker:ro,rowMarkerChecked:fr,headerRowMarkerTheme:no,headerRowMarkerAlwaysVisible:Ei,headerRowMarkerDisabled:zr},...cn],[fn,cn,dr,yr,ro,fr,no,Ei,zr]),tn=d.useRef({height:1,width:1,x:0,y:0}),rr=d.useRef(!1),{setVisibleRegion:Pi,visibleRegion:pr,scrollRef:Bt}=Vb(Tn,ln,tr,tn,()=>rr.current=!0);tn.current=pr;const Df=pr.x+j,Hi=pr.y,gn=d.useRef(null),wn=d.useCallback(b=>{b===!0?gn.current?.focus():window.requestAnimationFrame(()=>{gn.current?.focus()})},[]),mn=Ft?Le+1:Le,Nn=d.useCallback(b=>{const L=j===0?b:b.map($=>({...$,location:[$.location[0]-j,$.location[1]]})),A=fe?.(L);if(A!==!0)for(const $ of L)ae?.($.location,$.value);return A},[ae,fe,j]),[Vr,Na]=d.useState(),zi=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,qs=Lo?K.current?.cell:void 0,Li=qs?.[0],Ai=qs?.[1],Pf=d.useMemo(()=>{if((vt===void 0||vt.length===0)&&(zi??Li??Ai??Vr)===void 0)return;const b=[];if(vt!==void 0)for(const L of vt){const A=st.length-L.range.x-j;A>0&&b.push({color:L.color,range:{...L.range,x:L.range.x+j,width:Math.min(A,L.range.width)},style:L.style})}return Vr!==void 0&&b.push({color:Zr(ct.accentColor,0),range:Vr,style:"dashed"}),zi!==void 0&&b.push({color:Zr(ct.accentColor,.5),range:zi,style:"solid-outline"}),Li!==void 0&&Ai!==void 0&&b.push({color:ct.accentColor,range:{x:Li,y:Ai,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[Vr,zi,Li,Ai,vt,st.length,ct.accentColor,j]),Zs=d.useRef(st);Zs.current=st;const zn=d.useCallback(([b,L],A=!1)=>{const $=Ft&&L===mn-1;if(b===0&&yn){if($)return Ji;const N=Fo(L);return N===void 0?Ji:{kind:jn.Marker,allowOverlay:!1,checkboxStyle:ro,checked:K?.rows.hasIndex(L)===!0,markerKind:fn==="clickable-number"?"number":fn,row:to+N,drawHandle:Qt!==void 0,cursor:fn==="clickable-number"?"pointer":void 0}}else if($){const N=b===j?De?.hint??"":"",X=Zs.current[b];if(X?.trailingRowOptions?.disabled===!0)return Ji;{const F=X?.trailingRowOptions?.hint??N,U=X?.trailingRowOptions?.addIcon??De?.addIcon;return{kind:jn.NewRow,hint:F,allowOverlay:!1,icon:U}}}else{const N=b-j;if(A||ht?.strict===!0){const F=tn.current,U=F.x>N||N>F.x+F.width||F.y>L||L>F.y+F.height||L>=Ua.current,Q=N===F.extras?.selected?.[0]&&L===F.extras?.selected[1];let se=!1;if(F.extras?.freezeRegions!==void 0){for(const Pe of F.extras.freezeRegions)if(Xr(Pe,N,L)){se=!0;break}}if(U&&!Q&&!se)return Ji}let X=x([N,L]);return j!==0&&X.span!==void 0&&(X={...X,span:[X.span[0]+j,X.span[1]+j]}),X}},[Ft,mn,yn,Fo,ro,K?.rows,fn,to,Qt,j,De?.hint,De?.addIcon,ht?.strict,x]),Wa=d.useCallback(b=>{let L=wt?.(b)??{name:b};return ge!==void 0&&b!==""&&(L={icon:L.icon,name:L.name,overrideTheme:L.overrideTheme,actions:[...L.actions??[],{title:"Rename",icon:"renameIcon",onClick:A=>Xa({group:L.name,bounds:A.bounds})}]}),L},[wt,ge]),Fi=d.useCallback(b=>{const[L,A]=b.cell,$=st[L],N=$?.group!==void 0?Wa($.group)?.overrideTheme:void 0,X=$?.themeOverride,F=Lr?.(A);i({...b,theme:mr(ct,N,X,F,b.content.themeOverride)})},[Lr,st,Wa,ct]),co=d.useCallback((b,L,A)=>{if(K.current===void 0)return;const[$,N]=K.current.cell,X=zn([$,N]);if(X.kind!==Y.Boolean&&X.allowOverlay){let F=X;if(A!==void 0)switch(F.kind){case Y.Number:{const U=Jg(()=>A==="-"?-0:Number.parseFloat(A),0);F={...F,data:Number.isNaN(U)?0:U};break}case Y.Text:case Y.Markdown:case Y.Uri:F={...F,data:A};break}Fi({target:b,content:F,initialValue:A,cell:[$,N],highlight:A===void 0,forceEditMode:A!==void 0,activation:L})}else X.kind===Y.Boolean&&L.inputType==="keyboard"&&X.readonly!==!0&&(Nn([{location:K.current.cell,value:{...X,data:xh(X.data)}}]),gn.current?.damage([{cell:K.current.cell}]))},[zn,K,Nn,Fi]),Ys=d.useCallback((b,L)=>{const A=gn.current?.getBounds(b,L);if(A===void 0||Bt.current===null)return;const $=zn([b,L]);$.allowOverlay&&Fi({target:A,content:$,initialValue:void 0,highlight:!0,cell:[b,L],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[zn,Bt,Fi]),Wt=d.useCallback((b,L,A="both",$=0,N=0,X=void 0)=>{if(Bt.current!==null){const F=gn.current,U=l.current,Q=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,se=typeof L!="number"?L.unit==="cell"?L.amount:void 0:L,Pe=typeof b!="number"&&b.unit==="px"?b.amount:void 0,It=typeof L!="number"&&L.unit==="px"?L.amount:void 0;if(F!==null&&U!==null){let qe={x:0,y:0,width:0,height:0},Ge=0,Ke=0;if((Q!==void 0||se!==void 0)&&(qe=F.getBounds((Q??0)+j,se??0)??qe,qe.width===0||qe.height===0))return;const tt=U.getBoundingClientRect(),yt=tt.width/U.offsetWidth;if(Pe!==void 0&&(qe={...qe,x:Pe-tt.left-Bt.current.scrollLeft,width:1}),It!==void 0&&(qe={...qe,y:It+tt.top-Bt.current.scrollTop,height:1}),qe!==void 0){const nn={x:qe.x-$,y:qe.y-N,width:qe.width+2*$,height:qe.height+2*N};let mo=0;for(let tl=0;tl<Ee;tl++)mo+=cn[tl].width;let ji=0;const Go=et+(Ar?1:0);Go>0&&(ji=eo(mn,Go,tr));let ir=mo*yt+tt.left+j*dr*yt,vo=tt.right,Nr=tt.top+pn*yt,bo=tt.bottom-ji*yt;const Gi=qe.width+$*2;switch(X?.hAlign){case"start":vo=ir+Gi;break;case"end":ir=vo-Gi;break;case"center":ir=Math.floor((ir+vo)/2)-Gi/2,vo=ir+Gi;break}const Ui=qe.height+N*2;switch(X?.vAlign){case"start":bo=Nr+Ui;break;case"end":Nr=bo-Ui;break;case"center":Nr=Math.floor((Nr+bo)/2)-Ui/2,bo=Nr+Ui;break}ir>nn.x?Ge=nn.x-ir:vo<nn.x+nn.width&&(Ge=nn.x+nn.width-vo),Nr>nn.y?Ke=nn.y-Nr:bo<nn.y+nn.height&&(Ke=nn.y+nn.height-bo),A==="vertical"||typeof b=="number"&&b<Ee?Ge=0:(A==="horizontal"||typeof L=="number"&&L>=mn-Go)&&(Ke=0),(Ge!==0||Ke!==0)&&(yt!==1&&(Ge/=yt,Ke/=yt),Bt.current.scrollTo({left:Ge+Bt.current.scrollLeft,top:Ke+Bt.current.scrollTop,behavior:X?.behavior??"auto"}))}}}},[j,et,dr,Bt,pn,Ee,cn,mn,Ar,tr]),ja=d.useRef(Ys),Ga=d.useRef(x);ja.current=Ys,Ga.current=x;const Ua=d.useRef(Le);Ua.current=Le;const Js=d.useRef(st.length);Js.current=st.length;const xr=d.useCallback(async(b,L=!0,A)=>{if(st[b]?.trailingRowOptions?.disabled===!0)return;const $=ye?.();let N,X=!0;$!==void 0&&(N=await $,N==="top"&&(X=!1),typeof N=="number"&&(X=!1));let F=0;const U=()=>{if(Ua.current<=Le){F<500&&window.setTimeout(U,F),F=50+F*2;return}const Q=typeof N=="number"?N:X?Le:0;Wi.current(b-j,Q,"both",0,0,A?{behavior:A}:void 0),kt({cell:[b,Q],range:{x:b,y:Q,width:1,height:1}},!1,!1,"edit");const se=Ga.current([b-j,Q]);se.allowOverlay&&Co(se)&&se.readonly!==!0&&L&&window.setTimeout(()=>{ja.current(b,Q)},0)};U()},[st,ye,j,Le,kt]),Vi=d.useCallback(async(b,L=!0)=>{const A=at?.();let $,N=!0;A!==void 0&&($=await A,$==="left"&&(N=!1),typeof $=="number"&&(N=!1));let X=0;const F=()=>{if(Js.current<=st.length){X<500&&window.setTimeout(F,X),X=50+X*2;return}const U=typeof $=="number"?$:N?st.length:0;Wt(U-j,b),kt({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const Q=Ga.current([U-j,b]);Q.allowOverlay&&Co(Q)&&Q.readonly!==!0&&L&&window.setTimeout(()=>{ja.current(U,b)},0)};F()},[st,at,j,Wt,kt]),uo=d.useCallback(b=>{const L=cn[b]?.trailingRowOptions?.targetColumn??De?.targetColumn;if(typeof L=="number")return L+(yn?1:0);if(typeof L=="object"){const A=y.indexOf(L);if(A>=0)return A+(yn?1:0)}},[cn,y,yn,De?.targetColumn]),kr=d.useRef(),ho=d.useRef(),_o=d.useCallback((b,L)=>{const[A,$]=L;return mr(ct,st[A]?.themeOverride,Lr?.($),b.themeOverride)},[Lr,st,ct]),{mapper:_r}=Ab(gt,v),Un=gt?.navigationBehavior,$o=d.useCallback(b=>{const L=wa.value?b.metaKey:b.ctrlKey,A=L&&ie==="multi",[$,N]=b.location,X=K.columns,F=K.rows,[U,Q]=K.current?.cell??[];if(b.kind==="cell"){if(ho.current=void 0,$r.current=[$,N],$===0&&yn){if(Ft===!0&&N===Le||fn==="number"||ie==="none")return;const se=zn(b.location);if(se.kind!==jn.Marker)return;if(Qt!==void 0){const qe=en(se);Fn(qe?.kind===jn.Marker);const Ge=qe?.onClick?.({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:_o(se,b.location),preventDefault:()=>{}});if(Ge===void 0||Ge.checked===se.checked)return}i(void 0),wn();const Pe=F.hasIndex(N),It=kr.current;if(ie==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&It!==void 0&&F.hasIndex(It)){const qe=[Math.min(It,N),Math.max(It,N)+1];A||Oe==="multi"?lt(void 0,qe,!0):lt(Ye.fromSingleSelection(qe),void 0,A)}else ie==="multi"&&(A||b.isTouch||Oe==="multi")?Pe?lt(F.remove(N),void 0,!0):(lt(void 0,N,!0),kr.current=N):Pe&&F.length===1?lt(Ye.empty(),void 0,L):(lt(Ye.fromSingleSelection(N),void 0,L),kr.current=N)}else if($>=j&&Ft&&N===Le){const se=uo($);xr(se??$)}else if(U!==$||Q!==N){const se=zn(b.location),Pe=en(se);if(Pe?.onSelect!==void 0){let Ge=!1;if(Pe.onSelect({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>Ge=!0,theme:_o(se,b.location)}),Ge)return}if(Un==="block"&&_r(N).isGroupHeader)return;const It=Ar&&N===Le,qe=Ar&&K!==void 0&&K.current?.cell[1]===Le;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&Q!==void 0&&K.current!==void 0&&!qe){if(It)return;const Ge=Math.min($,U),Ke=Math.max($,U),tt=Math.min(N,Q),yt=Math.max(N,Q);kt({...K.current,range:{x:Ge,y:tt,width:Ke-Ge+1,height:yt-tt+1}},!0,L,"click"),kr.current=void 0,wn()}else kt({cell:[$,N],range:{x:$,y:N,width:1,height:1}},!0,L,"click"),kr.current=void 0,i(void 0),wn()}}else if(b.kind==="header")if($r.current=[$,N],i(void 0),yn&&$===0)kr.current=void 0,ho.current=void 0,!zr&&ie==="multi"&&(F.length!==Le?lt(Ye.fromSingleSelection([0,Le]),void 0,L):lt(Ye.empty(),void 0,L),wn());else{const se=ho.current;if(ne==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&se!==void 0&&X.hasIndex(se)){const Pe=[Math.min(se,$),Math.max(se,$)+1];L||b.isTouch||ut==="multi"?je(void 0,Pe,L):je(Ye.fromSingleSelection(Pe),void 0,L)}else ne==="multi"&&(L||b.isTouch||ut==="multi")?(X.hasIndex($)?je(X.remove($),void 0,L):je(void 0,$,L),ho.current=$):ne!=="none"&&(X.hasIndex($)?je(X.remove($),void 0,L):je(Ye.fromSingleSelection($),void 0,L),ho.current=$);kr.current=void 0,wn()}else b.kind===Zn?$r.current=[$,N]:b.kind===xa&&!b.isMaybeScrollbar&&(pe(Qi,!1),i(void 0),wn(),an?.(),kr.current=void 0,ho.current=void 0)},[ie,ne,K,yn,j,Ft,Le,fn,zn,Qt,wn,Oe,ut,en,_o,lt,uo,xr,Un,_r,Ar,kt,zr,je,pe,an]),Bo=d.useRef(!1),$r=d.useRef(),Qs=d.useRef(pr),or=d.useRef(),Hf=d.useCallback(b=>{if(fo.current=!1,Qs.current=tn.current,b.button!==0&&b.button!==1){or.current=void 0;return}const L=performance.now();or.current={button:b.button,time:L,location:b.location},b?.kind==="header"&&(Bo.current=!0);const A=b.kind==="cell"&&b.isFillHandle;!A&&b.kind!=="cell"&&b.isEdge||(c({previousSelection:K,fillHandle:A}),$r.current=void 0,!b.isTouch&&b.button===0&&!A?$o(b):!b.isTouch&&b.button===1&&($r.current=b.location))},[K,$o]),[Ka,Xa]=d.useState(),ec=d.useCallback(b=>{if(b.kind!==Zn||ne!=="multi")return;const L=wa.value?b.metaKey:b.ctrlKey,[A]=b.location,$=K.columns;if(A<j)return;const N=st[A];let X=A,F=A;for(let U=A-1;U>=j&&bi(N.group,st[U].group);U--)X--;for(let U=A+1;U<st.length&&bi(N.group,st[U].group);U++)F++;if(wn(),L||b.isTouch||ut==="multi")if($.hasAll([X,F+1])){let U=$;for(let Q=X;Q<=F;Q++)U=U.remove(Q);je(U,void 0,L)}else je(void 0,[X,F+1],L);else je(Ye.fromSingleSelection([X,F+1]),void 0,L)},[ne,wn,K.columns,st,j,je,ut]),fo=d.useRef(!1),_i=d.useCallback(async b=>{if(ee!==void 0&&We!==void 0){const L=tn.current.y,A=tn.current.height;let $=ee({x:b,y:L,width:1,height:Math.min(A,Le-L)},_.current.signal);typeof $!="object"&&($=await $());const N=cn[b-j],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=ct.baseFontFull;const F=sh(X,ct,N,0,$,wr,oo,!1,en);We?.(N,F.width,b,F.width)}}},[cn,ee,oo,ct,wr,We,j,Le,en]),[zf,qa]=d.useState(),po=d.useCallback(async(b,L)=>{const A=b.current?.range;if(A===void 0||ee===void 0||L.current===void 0)return;const $=L.current.range;if(M!==void 0){let U=!1;if(M({fillDestination:{...$,x:$.x-j},patternSource:{...A,x:A.x-j},preventDefault:()=>U=!0}),U)return}let N=ee(A,_.current.signal);typeof N!="object"&&(N=await N());const X=N,F=[];for(let U=0;U<$.width;U++)for(let Q=0;Q<$.height;Q++){const se=[$.x+U,$.y+Q];if(Zd(se,A))continue;const Pe=X[Q%A.height][U%A.width];Mo(Pe)||!Co(Pe)||F.push({location:se,value:{...Pe}})}Nn(F),gn.current?.damage(F.map(U=>({cell:U.location})))},[ee,Nn,M,j]),tc=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,width:1}}};po(b,K)},[po,K]),nc=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,height:1}}};po(b,K)},[po,K]),Lf=d.useCallback((b,L)=>{const A=s;if(c(void 0),Na(void 0),qa(void 0),Bo.current=!1,L)return;if(A?.fillHandle===!0&&K.current!==void 0&&A.previousSelection?.current!==void 0){if(Vr===void 0)return;const Pe={...K,current:{...K.current,range:fh(A.previousSelection.current.range,Vr)}};po(A.previousSelection,Pe),pe(Pe,!0);return}const[$,N]=b.location,[X,F]=$r.current??[],U=()=>{fo.current=!0},Q=Pe=>{const It=Pe.isTouch||X===$&&F===N;if(It&&I?.([$-j,N],{...Pe,preventDefault:U}),Pe.button===1)return!fo.current;if(!fo.current){const qe=zn(b.location),Ge=en(qe);if(Ge!==void 0&&Ge.onClick!==void 0&&It){const tt=Ge.onClick({...Pe,cell:qe,posX:Pe.localEventX,posY:Pe.localEventY,bounds:Pe.bounds,theme:_o(qe,b.location),preventDefault:U});tt!==void 0&&!Mo(tt)&&ko(tt)&&(Nn([{location:Pe.location,value:tt}]),gn.current?.damage([{cell:Pe.location}]))}if(fo.current||K.current===void 0)return!1;let Ke=!1;switch(qe.activationBehaviorOverride??Me){case"double-click":case"second-click":{if(A?.previousSelection?.current?.cell===void 0)break;const[tt,yt]=K.current.cell,[nn,mo]=A.previousSelection.current.cell;Ke=$===tt&&$===nn&&N===yt&&N===mo&&(Pe.isDoubleClick===!0||Me==="second-click");break}case"single-click":{Ke=!0;break}}if(Ke){const tt={inputType:"pointer",pointerActivation:Pe.isDoubleClick===!0?"double-click":qe.activationBehaviorOverride??Me,pointerType:Pe.isTouch?"touch":"mouse"};return O?.([$-j,N],tt),co(Pe.bounds,tt),!0}}return!1},se=b.location[0]-j;if(b.isTouch){const Pe=tn.current,It=Qs.current;if(Pe.x!==It.x||Pe.y!==It.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&fi(K.current?.cell,b.location)){W?.([se,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&K.columns.hasIndex($)){ce?.(se,{...b,preventDefault:U});return}else if(b.kind===Zn){if(se<0)return;q?.(se,{...b,preventDefault:U});return}}b.kind==="cell"?Q(b)||$o(b):b.kind===Zn?J?.(se,{...b,preventDefault:U}):(b.kind===Ir&&R?.(se,{...b,preventDefault:U}),$o(b));return}if(b.kind==="header"){if(se<0)return;b.isEdge?b.isDoubleClick===!0&&_i($):b.button===0&&$===X&&N===F&&R?.(se,{...b,preventDefault:U})}if(b.kind===Zn){if(se<0)return;b.button===0&&$===X&&N===F&&(J?.(se,{...b,preventDefault:U}),fo.current||ec(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&Q(b),$r.current=void 0},[s,K,j,Vr,po,pe,I,zn,en,Me,_o,Nn,O,co,W,ce,q,$o,J,R,_i,ec]),Af=d.useCallback(b=>{const L={...b,location:[b.location[0]-j,b.location[1]]};Je?.(L),s!==void 0&&b.buttons===0&&(c(void 0),Na(void 0),qa(void 0),Bo.current=!1),qa(A=>Bo.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===A?.[0]&&b.scrollEdge[1]===A[1]?A:s===void 0||(or.current?.location[0]??0)<j?void 0:b.scrollEdge)},[s,Je,j]),Ff=d.useCallback((b,L)=>{Qe?.(b-j,L)},[Qe,j]),Vf=d.useCallback((b,L)=>{Ue?.(b-j,L)},[Ue,j]),go=K?.current?.cell,_f=d.useCallback((b,L,A,$,N,X)=>{rr.current=!1;let F=go;F!==void 0&&(F=[F[0]-j,F[1]]);const U=Ee===0?void 0:{x:0,y:b.y,width:Ee,height:b.height},Q=[];U!==void 0&&Q.push(U),et>0&&(Q.push({x:b.x-j,y:Le-et,width:b.width,height:et}),Ee>0&&Q.push({x:0,y:Le-et,width:Ee,height:et}));const se={x:b.x-j,y:b.y,width:b.width,height:Ft&&b.y+b.height>=Le?b.height-1:b.height,tx:N,ty:X,extras:{selected:F,freezeRegion:U,freezeRegions:Q}};tn.current=se,Pi(se),so([L,A,$]),In?.(se,se.tx,se.ty,se.extras)},[go,j,Ft,Le,Ee,et,Pi,In]),$f=Rr(T,d.useCallback((b,L)=>T?.(b-j,L-j)!==!1,[T,j])),Bf=Rr(Ce,d.useCallback((b,L)=>{Ce?.(b-j,L-j),ne!=="none"&&je(Ye.fromSingleSelection(L),void 0,!0)},[ne,Ce,j,je])),Za=d.useRef(!1),Nf=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}Ve?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(Za.current=!0),c(void 0)},[Ve,j]),Wf=d.useCallback(()=>{Za.current=!1},[]),rc=gt?.selectionBehavior,$i=d.useCallback(b=>{if(rc!=="block-spanning")return;const{isGroupHeader:L,path:A,groupRows:$}=_r(b);if(L)return[b,b];const N=A[A.length-1],X=b-N,F=b+$-N-1;return[X,F]},[_r,rc]),Ya=d.useRef(),Ja=d.useCallback(b=>{if(!yh(b,Ya.current)&&(Ya.current=b,!(or?.current?.button!==void 0&&or.current.button>=1))){if(b.buttons!==0&&s!==void 0&&or.current?.location[0]===0&&j===1&&ie==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(or.current.location[1])&&K.rows.hasIndex(or.current.location[1])){const L=Math.min(or.current.location[1],b.location[1]),A=Math.max(or.current.location[1],b.location[1])+1;lt(Ye.fromSingleSelection([L,A]),void 0,!1)}else if(b.buttons!==0&&s!==void 0&&K.current!==void 0&&!Za.current&&!Bo.current&&(Be==="rect"||Be==="multi-rect")){const[L,A]=K.current.cell;let[$,N]=b.location;if(N<0&&(N=tn.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const X=s.previousSelection.current.range;N=Math.min(N,Ft?Le-1:Le);const F=kv(X,$,N,bt);Na(F)}else{if(Ft&&A===Le)return;if(Ft&&N===Le)if(b.kind===xa)N--;else return;$=Math.max($,j);const X=$i(A);N=X===void 0?N:Wn(N,X[0],X[1]);const F=$-L,U=N-A,Q={x:F>=0?L:$,y:U>=0?A:N,width:Math.abs(F)+1,height:Math.abs(U)+1};kt({...K.current,range:Q},!0,!1,"drag")}}Ot?.({...b,location:[b.location[0]-j,b.location[1]]})}},[s,j,ie,K,Be,Ot,lt,Ft,Le,bt,$i,kt]),jf=d.useCallback(()=>{const b=Ya.current;if(b===void 0)return;const[L,A]=b.scrollEdge;let[$,N]=b.location;const X=tn.current;L===-1?$=X.extras?.freezeRegion?.x??X.x:L===1&&($=X.x+X.width),A===-1?N=Math.max(0,X.y):A===1&&(N=Math.min(Le-1,X.y+X.height)),$=Wn($,0,st.length-1),N=Wn(N,0,Le-1),Ja({...b,location:[$,N]})},[st.length,Ja,Le]);Db(zf,Bt,jf);const Kn=d.useCallback(b=>{if(K.current===void 0)return;const[L,A]=b,[$,N]=K.current.cell,X=K.current.range;let F=X.x,U=X.x+X.width,Q=X.y,se=X.y+X.height;const[Pe,It]=$i(N)??[0,Le-1],qe=It+1;if(A!==0)switch(A){case 2:{se=qe,Q=N,Wt(0,se,"vertical");break}case-2:{Q=Pe,se=N+1,Wt(0,Q,"vertical");break}case 1:{Q<N?(Q++,Wt(0,Q,"vertical")):(se=Math.min(qe,se+1),Wt(0,se,"vertical"));break}case-1:{se>N+1?(se--,Wt(0,se,"vertical")):(Q=Math.max(Pe,Q-1),Wt(0,Q,"vertical"));break}default:mi()}if(L!==0)if(L===2)U=st.length,F=$,Wt(U-1-j,0,"horizontal");else if(L===-2)F=j,U=$+1,Wt(F-j,0,"horizontal");else{let Ge=[];if(ee!==void 0){const Ke=ee({x:F,y:Q,width:U-F-j,height:se-Q},_.current.signal);typeof Ke=="object"&&(Ge=Bb(Ke))}if(L===1){let Ke=!1;if(F<$){if(Ge.length>0){const tt=Tr(F+1,$+1).find(yt=>!Ge.includes(yt-j));tt!==void 0&&(F=tt,Ke=!0)}else F++,Ke=!0;Ke&&Wt(F,0,"horizontal")}Ke||(U=Math.min(st.length,U+1),Wt(U-1-j,0,"horizontal"))}else if(L===-1){let Ke=!1;if(U>$+1){if(Ge.length>0){const tt=Tr(U-1,$,-1).find(yt=>!Ge.includes(yt-j));tt!==void 0&&(U=tt,Ke=!0)}else U--,Ke=!0;Ke&&Wt(U-j,0,"horizontal")}Ke||(F=Math.max(j,F-1),Wt(F-j,0,"horizontal"))}else mi()}kt({cell:K.current.cell,range:{x:F,y:Q,width:U-F,height:se-Q}},!0,!1,"keyboard-select")},[ee,$i,K,st.length,j,Le,Wt,kt]),Qa=d.useRef(Hr);Qa.current=Hr;const Cr=d.useCallback((b,L,A,$)=>{const N=mn-(A?0:1);b=Wn(b,j,cn.length-1+j),L=Wn(L,0,N);const X=go?.[0],F=go?.[1];if(b===X&&L===F)return!1;if($&&K.current!==void 0){const U=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&U.push(K.current.range),pe({...K,current:{cell:[b,L],range:{x:b,y:L,width:1,height:1},rangeStack:U}},!0)}else kt({cell:[b,L],range:{x:b,y:L,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===b&&u.current[1]===L&&(u.current=void 0),Qa.current&&Wt(b-j,L),!0},[mn,j,cn.length,go,K,Wt,pe,kt]),Gf=d.useCallback((b,L)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(Nn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{gn.current?.damage([{cell:o.cell}])})),wn(!0),i(void 0);const[A,$]=L;if(K.current!==void 0&&(A!==0||$!==0)){const N=K.current.cell[1]===mn-1&&b!==void 0,X=K.current.cell[0]===st.length-1&&b!==void 0;let F=!0;if(N&&$===1&&ye!==void 0){F=!1;const U=K.current.cell[0]+A,Q=uo(U);xr(Q??U,!1)}if(X&&A===1&&at!==void 0){F=!1;const U=K.current.cell[1]+$;Vi(U,!1)}F&&Cr(Wn(K.current.cell[0]+A,0,st.length-1),Wn(K.current.cell[1]+$,0,mn-1),N,!1)}P?.(b,L)},[o?.cell,wn,K,P,Nn,mn,Cr,st.length,xr,Vi,ye,at,uo]),Uf=d.useMemo(()=>`gdg-overlay-${$b++}`,[]),Br=d.useCallback(b=>{wn();const L=[];for(let A=b.x;A<b.x+b.width;A++)for(let $=b.y;$<b.y+b.height;$++){const N=x([A-j,$]);if(!N.allowOverlay&&N.kind!==Y.Boolean)continue;let X;if(N.kind===Y.Custom){const F=en(N),U=F?.provideEditor?.({...N,location:[A-j,$]});F?.onDelete!==void 0?X=F.onDelete(N):Qg(U)&&(X=U?.deletedValue?.(N))}else(ko(N)&&N.allowOverlay||N.kind===Y.Boolean)&&(X=en(N)?.onDelete?.(N));X!==void 0&&!Mo(X)&&ko(X)&&L.push({location:[A,$],value:X})}Nn(L),gn.current?.damage(L.map(A=>({cell:A.location})))},[wn,x,en,Nn,j]),No=o!==void 0,oc=d.useCallback(b=>{const L=()=>{b.stopPropagation(),b.preventDefault()},A={didMatch:!1},{bounds:$}=b,N=K.columns,X=K.rows,F=nr;if(!No&&nt(F.clear,b,A))pe(Qi,!1),an?.();else if(!No&&nt(F.selectAll,b,A))pe({columns:Ye.empty(),rows:Ye.empty(),current:{cell:K.current?.cell??[j,0],range:{x:j,y:0,width:y.length,height:Le},rangeStack:[]}},!1);else if(nt(F.search,b,A))a?.current?.focus({preventScroll:!0}),Di(!0);else if(nt(F.delete,b,A)){const Ke=Nt?.(K)??!0;if(Ke!==!1){const tt=Ke===!0?K:Ke;if(tt.current!==void 0){Br(tt.current.range);for(const yt of tt.current.rangeStack)Br(yt)}for(const yt of tt.rows)Br({x:j,y:yt,width:y.length,height:1});for(const yt of tt.columns)Br({x:yt,y:0,width:1,height:Le})}}if(A.didMatch)return L(),!0;if(K.current===void 0)return!1;let[U,Q]=K.current.cell;const[,se]=K.current.cell;let Pe=!1,It=!1;if(nt(F.scrollToSelectedCell,b,A))Wi.current(U-j,Q);else if(ne!=="none"&&nt(F.selectColumn,b,A))N.hasIndex(U)?je(N.remove(U),void 0,!0):ne==="single"?je(Ye.fromSingleSelection(U),void 0,!0):je(void 0,U,!0);else if(ie!=="none"&&nt(F.selectRow,b,A))X.hasIndex(Q)?lt(X.remove(Q),void 0,!0):ie==="single"?lt(Ye.fromSingleSelection(Q),void 0,!0):lt(void 0,Q,!0);else if(!No&&$!==void 0&&nt(F.activateCell,b,A))if(Q===Le&&Ft)window.setTimeout(()=>{const Ke=uo(U);xr(Ke??U)},0);else{const Ke={inputType:"keyboard",key:b.key};O?.([U-j,Q],Ke),co($,Ke)}else K.current.range.height>1&&nt(F.downFill,b,A)?nc():K.current.range.width>1&&nt(F.rightFill,b,A)?tc():nt(F.goToNextPage,b,A)?Q+=Math.max(1,tn.current.height-4):nt(F.goToPreviousPage,b,A)?Q-=Math.max(1,tn.current.height-4):nt(F.goToFirstCell,b,A)?(i(void 0),Q=0,U=0):nt(F.goToLastCell,b,A)?(i(void 0),Q=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):nt(F.selectToFirstCell,b,A)?(i(void 0),Kn([-2,-2])):nt(F.selectToLastCell,b,A)?(i(void 0),Kn([2,2])):No?(nt(F.closeOverlay,b,A)&&i(void 0),nt(F.acceptOverlayDown,b,A)&&(i(void 0),Q++),nt(F.acceptOverlayUp,b,A)&&(i(void 0),Q--),nt(F.acceptOverlayLeft,b,A)&&(i(void 0),U--),nt(F.acceptOverlayRight,b,A)&&(i(void 0),U++)):(nt(F.goDownCell,b,A)?Q+=1:nt(F.goUpCell,b,A)?Q-=1:nt(F.goRightCell,b,A)?U+=1:nt(F.goLeftCell,b,A)?U-=1:nt(F.goDownCellRetainSelection,b,A)?(Q+=1,Pe=!0):nt(F.goUpCellRetainSelection,b,A)?(Q-=1,Pe=!0):nt(F.goRightCellRetainSelection,b,A)?(U+=1,Pe=!0):nt(F.goLeftCellRetainSelection,b,A)?(U-=1,Pe=!0):nt(F.goToLastRow,b,A)?Q=Le-1:nt(F.goToFirstRow,b,A)?Q=Number.MIN_SAFE_INTEGER:nt(F.goToLastColumn,b,A)?U=Number.MAX_SAFE_INTEGER:nt(F.goToFirstColumn,b,A)?U=Number.MIN_SAFE_INTEGER:(Be==="rect"||Be==="multi-rect")&&(nt(F.selectGrowDown,b,A)?Kn([0,1]):nt(F.selectGrowUp,b,A)?Kn([0,-1]):nt(F.selectGrowRight,b,A)?Kn([1,0]):nt(F.selectGrowLeft,b,A)?Kn([-1,0]):nt(F.selectToLastRow,b,A)?Kn([0,2]):nt(F.selectToFirstRow,b,A)?Kn([0,-2]):nt(F.selectToLastColumn,b,A)?Kn([2,0]):nt(F.selectToFirstColumn,b,A)&&Kn([-2,0])),It=A.didMatch);if(Un!==void 0&&Un!=="normal"&&Q!==se){const Ke=Un==="skip-up"||Un==="skip"||Un==="block",tt=Un==="skip-down"||Un==="skip"||Un==="block",yt=Q<se;if(yt&&Ke){for(;Q>=0&&_r(Q).isGroupHeader;)Q--;Q<0&&(Q=se)}else if(!yt&&tt){for(;Q<Le&&_r(Q).isGroupHeader;)Q++;Q>=Le&&(Q=se)}}const qe=Cr(U,Q,!1,Pe),Ge=A.didMatch;return Ge&&(qe||!It||Rn)&&L(),Ge},[Un,No,K,nr,ne,ie,Be,j,_r,Le,Cr,pe,an,y.length,Nt,Rn,Br,je,lt,Ft,uo,xr,O,co,nc,tc,Kn]),Wo=d.useCallback(b=>{let L=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{L=!0}}),L||oc(b)||K.current===void 0)return;const[A,$]=K.current.cell,N=tn.current;if(Ie&&!b.metaKey&&!b.ctrlKey&&K.current!==void 0&&b.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(b.key)&&b.bounds!==void 0&&Co(x([A-j,Math.max(0,Math.min($,Le-1))]))){if((!Ft||$!==Le)&&(N.y>$||$>N.y+N.height||N.x>A||A>N.x+N.width))return;const X={inputType:"keyboard",key:b.key};O?.([A-j,$],X),co(b.bounds,X,b.key),b.stopPropagation(),b.preventDefault()}},[Ie,G,oc,K,x,j,Le,Ft,O,co]),Kf=d.useCallback((b,L)=>{const A=b.location[0]-j;if(b.kind==="header"&&ce?.(A,{...b,preventDefault:L}),b.kind===Zn){if(A<0)return;q?.(A,{...b,preventDefault:L})}if(b.kind==="cell"){const[$,N]=b.location;W?.([A,N],{...b,preventDefault:L}),b0(K,b.location)||Cr($,N,!1,!1)}},[K,W,q,ce,j,Cr]),el=d.useCallback(async b=>{if(!nr.paste)return;function L(F,U,Q,se){const Pe=typeof Q=="object"?Q?.join(`
|
|
182
|
+
`&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push(uu(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function du(e,t,n){const r=kb(e,t),o=l=>{window.navigator.clipboard?.writeText(l)},i=(l,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),a=(l,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",l),n?.clipboardData?.setData("text/html",s)}catch{i(l,s)||o(l)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function xh(e){return e!==!0}function hu(e){return typeof e=="string"?e:`${e}px`}const Mb=()=>e=>e.innerWidth,Rb=()=>e=>e.innerHeight,Ib=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Mb()],"wmyidgi-1":[Rb()]}}),Eb=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(Ib,{innerHeight:hu(n),innerWidth:hu(t),...o},r)},Tb=2,Ob=1300;function Db(e,t,n){const r=St.useRef(0),[o,i]=e??[0,0];St.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{if(!a){if(l===0)l=c;else{const u=c-l;r.current=Math.min(1,r.current+u/Ob);const h=r.current**1.618*u*Tb;t.current?.scrollBy(o*h,i*h),l=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Pb({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,h,g,f]=St.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const p=l/16,m=e,w=ih();return[typeof m=="number"?m*p:y=>Math.ceil(m(y)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*p},Math.ceil((o??0)*p),Math.ceil((i??0)*p)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:g,overscrollY:f}}const Mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function rt(e,t){return e===!0?t:e===!1?"":e}function fu(e){const t=wa.value;return{activateCell:rt(e.activateCell," |Enter|shift+Enter"),clear:rt(e.clear,"any+Escape"),closeOverlay:rt(e.closeOverlay,"any+Escape"),acceptOverlayDown:rt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:rt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:rt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:rt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:rt(e.delete,t?"Backspace|Delete":"Delete"),downFill:rt(e.downFill,"primary+_68"),scrollToSelectedCell:rt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:rt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:rt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:rt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:rt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:rt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:rt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:rt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:rt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:rt(e.goToFirstCell,"primary+Home"),goToFirstColumn:rt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:rt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:rt(e.goToLastCell,"primary+End"),goToLastColumn:rt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:rt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:rt(e.goToNextPage,"PageDown"),goToPreviousPage:rt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:rt(e.rightFill,"primary+_82"),search:rt(e.search,"primary+f"),selectAll:rt(e.selectAll,"primary+a"),selectColumn:rt(e.selectColumn,"ctrl+ "),selectGrowDown:rt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:rt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:rt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:rt(e.selectGrowUp,"shift+ArrowUp"),selectRow:rt(e.selectRow,"shift+ "),selectToFirstCell:rt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:rt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:rt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:rt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:rt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:rt(e.selectToLastRow,"primary+shift+ArrowDown")}}function Hb(e){const t=Mm(e);return St.useMemo(()=>{if(t===void 0)return fu(Mr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Mr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Mr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Mr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Mr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Mr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Mr.selectToLastCell};return fu({...Mr,...n})},[t])}function zb(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function Ss(e,t){const n=[];function r(l,s,c=!1){let u=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(u=l.subGroups[0].headerIndex-l.headerIndex),u--,n.push({rowIndex:-1,headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:u}),l.subGroups)for(let h=0;h<l.subGroups.length;h++){const g=h<l.subGroups.length-1?l.subGroups[h+1].headerIndex:s;r(l.subGroups[h],g,c||l.isCollapsed)}}const o=zb(e.groups);for(let l=0;l<o.length;l++){const s=l<o.length-1?o[l+1].headerIndex:null;r(o[l],s)}let i=0,a=0;for(const l of n)l.contentIndex=a,a+=l.rows,l.rowIndex=i,i+=l.isCollapsed?1:l.rows+1;return n.filter(l=>l.skip===!1).map(l=>{const{skip:s,...c}=l;return c})}function Kl(e,t){if(t===void 0||Ss.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Lb(e,t,n,r){const o=St.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]),i=St.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),a=St.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),l=St.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=St.useCallback(u=>{if(o===void 0)return u;let h=u;for(const g of o){if(h===0)return;if(h--,!g.isCollapsed){if(h<g.rows)return g.contentIndex+h;h-=g.rows}}return u},[o]),c=Rr(r??e?.themeOverride,St.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:g,groupIndex:f}=Kl(u,o);return h?e.themeOverride:r?.(u,f,g)},[o,r,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:a,rowNumberMapper:s,getRowThemeOverride:c}}function Ab(e,t){const n=St.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]);return{getRowGroupingForPath:Ch,updateRowGroupingByPath:kh,mapper:St.useCallback(r=>{if(typeof r=="number")return Kl(r,n);const o=Kl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function kh(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:kh(i.subGroups??[],o,n)}:i)}function Ch(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Ch(e[n].subGroups??[],r)}function Fb(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function Vb(e,t,n,r,o){const[i,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,c,u]=Sm(l),h=d.useRef(o);h.current=o;const g=Fb(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&f){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&u(),h.current()}},[t,f,u,g]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&u(),h.current()}},[e,p,u,g]),{visibleRegion:s,setVisibleRegion:c,scrollRef:g}}const _b=d.lazy(async()=>await ns(()=>import("./data-grid-overlay-editor-IoEmbFO9-CBCubcQ1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let $b=0;function Bb(e){return W0(eu(eu(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Yi(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Ji={kind:Y.Loading,allowOverlay:!1},Qi={columns:Ye.empty(),rows:Ye.empty(),current:void 0},Nb=(e,t)=>{const[n,r]=d.useState(Qi),[o,i]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:f,markdownDivCreateNode:p,width:m,height:w,columns:y,rows:v,getCellContent:x,onCellClicked:I,onCellActivated:O,onFillPattern:M,onFinishedEditing:P,coercePasteValue:S,drawHeader:k,drawCell:H,editorBloom:E,onHeaderClicked:R,onColumnProposeMove:T,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:C="default",onGroupHeaderClicked:J,onCellContextMenu:W,className:Z,onHeaderContextMenu:ce,getCellsForSelection:te,onGroupHeaderContextMenu:q,onGroupHeaderRenamed:ge,onCellEdited:ae,onCellsEdited:fe,onSearchResultsChanged:he,searchResults:oe,onSearchValueChange:V,searchValue:z,onKeyDown:G,onKeyUp:re,keybindings:le,editOnType:Ie=!0,onRowAppended:ye,onColumnAppended:at,onColumnMoved:Ce,validateCell:ft,highlightRegions:vt,rangeSelect:Be="rect",columnSelect:ne="multi",rowSelect:ie="multi",rangeSelectionBlending:be="exclusive",columnSelectionBlending:ue="exclusive",rowSelectionBlending:ve="exclusive",onDelete:Fe,onDragStart:Ve,onMouseMove:Je,onPaste:Se,copyHeaders:Ze=!1,freezeColumns:Ee=0,cellActivationBehavior:Me="second-click",rowSelectionMode:Oe="auto",columnSelectionMode:ut="auto",onHeaderMenuClick:Qe,onHeaderIndicatorClick:Ue,getGroupDetails:wt,rowGrouping:gt,onSearchClose:Tt,onItemHovered:Ot,onSelectionCleared:an,showSearch:qt,onVisibleRegionChanged:In,gridSelection:Mt,onGridSelectionChange:dt,minColumnWidth:En=50,maxColumnWidth:mt=500,maxColumnAutoWidth:Zt,provideEditor:kn,trailingRowOptions:De,freezeTrailingRows:et=0,allowedFillDirections:bt="orthogonal",scrollOffsetX:Tn,scrollOffsetY:ln,verticalBorder:sn,onDragOverCell:On,onDrop:Yt,onColumnResize:Jt,onColumnResizeEnd:_e,onColumnResizeStart:xt,customRenderers:Dn,fillHandle:Ht,experimental:ht,fixedShadowX:Cn,fixedShadowY:ur,headerIcons:_n,imageWindowLoader:B,initialSize:$e,isDraggable:Ne,onDragLeave:Dt,onRowMoved:Qt,overscrollX:dn,overscrollY:Sn,preventDiagonalScrolling:bn,rightElement:$t,rightElementProps:Mn,trapFocus:Rn=!1,smoothScrollX:we,smoothScrollY:zt,scaleToRem:Kt=!1,rowHeight:$n=34,headerHeight:Xt=36,groupHeaderHeight:jt=Xt,theme:Gt,isOutsideClick:Pn,renderers:Hn,resizeIndicator:Ii,scrollToActiveCell:Hr=!0,drawFocusRing:Ho=!0,portalElementRef:zo}=e,Lo=Ho==="no-editor"?o===void 0:Ho,Gn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,fn=Gn?.kind??e.rowMarkers??"none",br=Gn?.width??e.rowMarkerWidth,to=Gn?.startIndex??e.rowMarkerStartIndex??1,yr=Gn?.theme??e.rowMarkerTheme,no=Gn?.headerTheme,Ei=Gn?.headerAlwaysVisible,zr=ie!=="multi"||Gn?.headerDisabled===!0,ro=Gn?.checkboxStyle??"square",wr=Math.max(En,20),oo=Math.max(mt,wr),Ti=Math.max(Zt??oo,wr),Ao=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Le,rowNumberMapper:Fo,rowHeight:Fa,getRowThemeOverride:Lr}=Lb(gt,v,$n,f),Va=d.useMemo(()=>Number.parseFloat(Ao.fontSize),[Ao]),{rowHeight:tr,headerHeight:Vo,groupHeaderHeight:io,theme:Oi,overscrollX:_a,overscrollY:$a}=Pb({groupHeaderHeight:jt,headerHeight:Xt,overscrollX:dn,overscrollY:Sn,remSize:Va,rowHeight:Fa,scaleToRem:Kt,theme:Gt}),nr=Hb(le),dr=br??(v>1e4?48:v>1e3?44:v>100?36:32),yn=fn!=="none",j=yn?1:0,Ft=De!==void 0,Ar=De?.sticky===!0,[ao,Di]=d.useState(!1),lo=qt??ao,Ba=d.useCallback(()=>{Tt!==void 0?Tt():Di(!1)},[Tt]),K=d.useMemo(()=>Mt===void 0?void 0:Yi(Mt,j),[Mt,j])??n,_=d.useRef();_.current===void 0&&(_.current=new AbortController),d.useEffect(()=>()=>_?.current.abort(),[]);const[ee,xe]=mb(te,x,j,_.current,Le),Re=d.useCallback((b,L,A)=>{if(ft===void 0)return!0;const $=[b[0]-j,b[1]];return ft?.($,L,A)},[j,ft]),de=d.useRef(Mt),pe=d.useCallback((b,L)=>{L&&(b=Cb(b,ee,j,C,_.current)),dt!==void 0?(de.current=Yi(b,-j),dt(de.current)):r(b)},[dt,ee,j,C]),We=Rr(Jt,d.useCallback((b,L,A,$)=>{Jt?.(y[A-j],L,A-j,$)},[Jt,j,y])),ke=Rr(_e,d.useCallback((b,L,A,$)=>{_e?.(y[A-j],L,A-j,$)},[_e,j,y])),Xe=Rr(xt,d.useCallback((b,L,A,$)=>{xt?.(y[A-j],L,A-j,$)},[xt,j,y])),pt=Rr(k,d.useCallback((b,L)=>k?.({...b,columnIndex:b.columnIndex-j},L)??!1,[k,j])),hn=Rr(H,d.useCallback((b,L)=>H?.({...b,col:b.col-j},L)??!1,[H,j])),Nt=d.useCallback(b=>{if(Fe!==void 0){const L=Fe(Yi(b,-j));return typeof L=="boolean"?L:Yi(L,j)}return!0},[Fe,j]),[kt,lt,je]=gb(K,pe,be,ue,ve,Be,D),ct=d.useMemo(()=>mr(ih(),Oi),[Oi]),[_t,so]=d.useState([0,0,0]),Fr=d.useMemo(()=>{if(Hn===void 0)return{};const b={};for(const L of Hn)b[L.kind]=L;return b},[Hn]),en=d.useCallback(b=>b.kind!==Y.Custom?Fr[b.kind]:Dn?.find(L=>L.isMatch(b)),[Dn,Fr]);let{sizedColumns:cn,nonGrowWidth:Lt}=z0(y,Le,xe,_t[0]-(j===0?0:dr)-_t[2],wr,Ti,ct,en,_.current);fn!=="none"&&(Lt+=dr);const Bn=d.useMemo(()=>cn.some(b=>b.group!==void 0),[cn]),pn=Bn?Vo+io:Vo,hr=K.rows.length,fr=fn==="none"?void 0:hr===0?!1:hr===Le?!0:void 0,st=d.useMemo(()=>fn==="none"?cn:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:yr,rowMarker:ro,rowMarkerChecked:fr,headerRowMarkerTheme:no,headerRowMarkerAlwaysVisible:Ei,headerRowMarkerDisabled:zr},...cn],[fn,cn,dr,yr,ro,fr,no,Ei,zr]),tn=d.useRef({height:1,width:1,x:0,y:0}),rr=d.useRef(!1),{setVisibleRegion:Pi,visibleRegion:pr,scrollRef:Bt}=Vb(Tn,ln,tr,tn,()=>rr.current=!0);tn.current=pr;const Df=pr.x+j,Hi=pr.y,gn=d.useRef(null),wn=d.useCallback(b=>{b===!0?gn.current?.focus():window.requestAnimationFrame(()=>{gn.current?.focus()})},[]),mn=Ft?Le+1:Le,Nn=d.useCallback(b=>{const L=j===0?b:b.map($=>({...$,location:[$.location[0]-j,$.location[1]]})),A=fe?.(L);if(A!==!0)for(const $ of L)ae?.($.location,$.value);return A},[ae,fe,j]),[Vr,Na]=d.useState(),zi=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,qs=Lo?K.current?.cell:void 0,Li=qs?.[0],Ai=qs?.[1],Pf=d.useMemo(()=>{if((vt===void 0||vt.length===0)&&(zi??Li??Ai??Vr)===void 0)return;const b=[];if(vt!==void 0)for(const L of vt){const A=st.length-L.range.x-j;A>0&&b.push({color:L.color,range:{...L.range,x:L.range.x+j,width:Math.min(A,L.range.width)},style:L.style})}return Vr!==void 0&&b.push({color:Zr(ct.accentColor,0),range:Vr,style:"dashed"}),zi!==void 0&&b.push({color:Zr(ct.accentColor,.5),range:zi,style:"solid-outline"}),Li!==void 0&&Ai!==void 0&&b.push({color:ct.accentColor,range:{x:Li,y:Ai,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[Vr,zi,Li,Ai,vt,st.length,ct.accentColor,j]),Zs=d.useRef(st);Zs.current=st;const zn=d.useCallback(([b,L],A=!1)=>{const $=Ft&&L===mn-1;if(b===0&&yn){if($)return Ji;const N=Fo(L);return N===void 0?Ji:{kind:jn.Marker,allowOverlay:!1,checkboxStyle:ro,checked:K?.rows.hasIndex(L)===!0,markerKind:fn==="clickable-number"?"number":fn,row:to+N,drawHandle:Qt!==void 0,cursor:fn==="clickable-number"?"pointer":void 0}}else if($){const N=b===j?De?.hint??"":"",X=Zs.current[b];if(X?.trailingRowOptions?.disabled===!0)return Ji;{const F=X?.trailingRowOptions?.hint??N,U=X?.trailingRowOptions?.addIcon??De?.addIcon;return{kind:jn.NewRow,hint:F,allowOverlay:!1,icon:U}}}else{const N=b-j;if(A||ht?.strict===!0){const F=tn.current,U=F.x>N||N>F.x+F.width||F.y>L||L>F.y+F.height||L>=Ua.current,Q=N===F.extras?.selected?.[0]&&L===F.extras?.selected[1];let se=!1;if(F.extras?.freezeRegions!==void 0){for(const Pe of F.extras.freezeRegions)if(Xr(Pe,N,L)){se=!0;break}}if(U&&!Q&&!se)return Ji}let X=x([N,L]);return j!==0&&X.span!==void 0&&(X={...X,span:[X.span[0]+j,X.span[1]+j]}),X}},[Ft,mn,yn,Fo,ro,K?.rows,fn,to,Qt,j,De?.hint,De?.addIcon,ht?.strict,x]),Wa=d.useCallback(b=>{let L=wt?.(b)??{name:b};return ge!==void 0&&b!==""&&(L={icon:L.icon,name:L.name,overrideTheme:L.overrideTheme,actions:[...L.actions??[],{title:"Rename",icon:"renameIcon",onClick:A=>Xa({group:L.name,bounds:A.bounds})}]}),L},[wt,ge]),Fi=d.useCallback(b=>{const[L,A]=b.cell,$=st[L],N=$?.group!==void 0?Wa($.group)?.overrideTheme:void 0,X=$?.themeOverride,F=Lr?.(A);i({...b,theme:mr(ct,N,X,F,b.content.themeOverride)})},[Lr,st,Wa,ct]),co=d.useCallback((b,L,A)=>{if(K.current===void 0)return;const[$,N]=K.current.cell,X=zn([$,N]);if(X.kind!==Y.Boolean&&X.allowOverlay){let F=X;if(A!==void 0)switch(F.kind){case Y.Number:{const U=Jg(()=>A==="-"?-0:Number.parseFloat(A),0);F={...F,data:Number.isNaN(U)?0:U};break}case Y.Text:case Y.Markdown:case Y.Uri:F={...F,data:A};break}Fi({target:b,content:F,initialValue:A,cell:[$,N],highlight:A===void 0,forceEditMode:A!==void 0,activation:L})}else X.kind===Y.Boolean&&L.inputType==="keyboard"&&X.readonly!==!0&&(Nn([{location:K.current.cell,value:{...X,data:xh(X.data)}}]),gn.current?.damage([{cell:K.current.cell}]))},[zn,K,Nn,Fi]),Ys=d.useCallback((b,L)=>{const A=gn.current?.getBounds(b,L);if(A===void 0||Bt.current===null)return;const $=zn([b,L]);$.allowOverlay&&Fi({target:A,content:$,initialValue:void 0,highlight:!0,cell:[b,L],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[zn,Bt,Fi]),Wt=d.useCallback((b,L,A="both",$=0,N=0,X=void 0)=>{if(Bt.current!==null){const F=gn.current,U=l.current,Q=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,se=typeof L!="number"?L.unit==="cell"?L.amount:void 0:L,Pe=typeof b!="number"&&b.unit==="px"?b.amount:void 0,It=typeof L!="number"&&L.unit==="px"?L.amount:void 0;if(F!==null&&U!==null){let qe={x:0,y:0,width:0,height:0},Ge=0,Ke=0;if((Q!==void 0||se!==void 0)&&(qe=F.getBounds((Q??0)+j,se??0)??qe,qe.width===0||qe.height===0))return;const tt=U.getBoundingClientRect(),yt=tt.width/U.offsetWidth;if(Pe!==void 0&&(qe={...qe,x:Pe-tt.left-Bt.current.scrollLeft,width:1}),It!==void 0&&(qe={...qe,y:It+tt.top-Bt.current.scrollTop,height:1}),qe!==void 0){const nn={x:qe.x-$,y:qe.y-N,width:qe.width+2*$,height:qe.height+2*N};let mo=0;for(let tl=0;tl<Ee;tl++)mo+=cn[tl].width;let ji=0;const Go=et+(Ar?1:0);Go>0&&(ji=eo(mn,Go,tr));let ir=mo*yt+tt.left+j*dr*yt,vo=tt.right,Nr=tt.top+pn*yt,bo=tt.bottom-ji*yt;const Gi=qe.width+$*2;switch(X?.hAlign){case"start":vo=ir+Gi;break;case"end":ir=vo-Gi;break;case"center":ir=Math.floor((ir+vo)/2)-Gi/2,vo=ir+Gi;break}const Ui=qe.height+N*2;switch(X?.vAlign){case"start":bo=Nr+Ui;break;case"end":Nr=bo-Ui;break;case"center":Nr=Math.floor((Nr+bo)/2)-Ui/2,bo=Nr+Ui;break}ir>nn.x?Ge=nn.x-ir:vo<nn.x+nn.width&&(Ge=nn.x+nn.width-vo),Nr>nn.y?Ke=nn.y-Nr:bo<nn.y+nn.height&&(Ke=nn.y+nn.height-bo),A==="vertical"||typeof b=="number"&&b<Ee?Ge=0:(A==="horizontal"||typeof L=="number"&&L>=mn-Go)&&(Ke=0),(Ge!==0||Ke!==0)&&(yt!==1&&(Ge/=yt,Ke/=yt),Bt.current.scrollTo({left:Ge+Bt.current.scrollLeft,top:Ke+Bt.current.scrollTop,behavior:X?.behavior??"auto"}))}}}},[j,et,dr,Bt,pn,Ee,cn,mn,Ar,tr]),ja=d.useRef(Ys),Ga=d.useRef(x);ja.current=Ys,Ga.current=x;const Ua=d.useRef(Le);Ua.current=Le;const Js=d.useRef(st.length);Js.current=st.length;const xr=d.useCallback(async(b,L=!0,A)=>{if(st[b]?.trailingRowOptions?.disabled===!0)return;const $=ye?.();let N,X=!0;$!==void 0&&(N=await $,N==="top"&&(X=!1),typeof N=="number"&&(X=!1));let F=0;const U=()=>{if(Ua.current<=Le){F<500&&window.setTimeout(U,F),F=50+F*2;return}const Q=typeof N=="number"?N:X?Le:0;Wi.current(b-j,Q,"both",0,0,A?{behavior:A}:void 0),kt({cell:[b,Q],range:{x:b,y:Q,width:1,height:1}},!1,!1,"edit");const se=Ga.current([b-j,Q]);se.allowOverlay&&Co(se)&&se.readonly!==!0&&L&&window.setTimeout(()=>{ja.current(b,Q)},0)};U()},[st,ye,j,Le,kt]),Vi=d.useCallback(async(b,L=!0)=>{const A=at?.();let $,N=!0;A!==void 0&&($=await A,$==="left"&&(N=!1),typeof $=="number"&&(N=!1));let X=0;const F=()=>{if(Js.current<=st.length){X<500&&window.setTimeout(F,X),X=50+X*2;return}const U=typeof $=="number"?$:N?st.length:0;Wt(U-j,b),kt({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const Q=Ga.current([U-j,b]);Q.allowOverlay&&Co(Q)&&Q.readonly!==!0&&L&&window.setTimeout(()=>{ja.current(U,b)},0)};F()},[st,at,j,Wt,kt]),uo=d.useCallback(b=>{const L=cn[b]?.trailingRowOptions?.targetColumn??De?.targetColumn;if(typeof L=="number")return L+(yn?1:0);if(typeof L=="object"){const A=y.indexOf(L);if(A>=0)return A+(yn?1:0)}},[cn,y,yn,De?.targetColumn]),kr=d.useRef(),ho=d.useRef(),_o=d.useCallback((b,L)=>{const[A,$]=L;return mr(ct,st[A]?.themeOverride,Lr?.($),b.themeOverride)},[Lr,st,ct]),{mapper:_r}=Ab(gt,v),Un=gt?.navigationBehavior,$o=d.useCallback(b=>{const L=wa.value?b.metaKey:b.ctrlKey,A=L&&ie==="multi",[$,N]=b.location,X=K.columns,F=K.rows,[U,Q]=K.current?.cell??[];if(b.kind==="cell"){if(ho.current=void 0,$r.current=[$,N],$===0&&yn){if(Ft===!0&&N===Le||fn==="number"||ie==="none")return;const se=zn(b.location);if(se.kind!==jn.Marker)return;if(Qt!==void 0){const qe=en(se);Fn(qe?.kind===jn.Marker);const Ge=qe?.onClick?.({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:_o(se,b.location),preventDefault:()=>{}});if(Ge===void 0||Ge.checked===se.checked)return}i(void 0),wn();const Pe=F.hasIndex(N),It=kr.current;if(ie==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&It!==void 0&&F.hasIndex(It)){const qe=[Math.min(It,N),Math.max(It,N)+1];A||Oe==="multi"?lt(void 0,qe,!0):lt(Ye.fromSingleSelection(qe),void 0,A)}else ie==="multi"&&(A||b.isTouch||Oe==="multi")?Pe?lt(F.remove(N),void 0,!0):(lt(void 0,N,!0),kr.current=N):Pe&&F.length===1?lt(Ye.empty(),void 0,L):(lt(Ye.fromSingleSelection(N),void 0,L),kr.current=N)}else if($>=j&&Ft&&N===Le){const se=uo($);xr(se??$)}else if(U!==$||Q!==N){const se=zn(b.location),Pe=en(se);if(Pe?.onSelect!==void 0){let Ge=!1;if(Pe.onSelect({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>Ge=!0,theme:_o(se,b.location)}),Ge)return}if(Un==="block"&&_r(N).isGroupHeader)return;const It=Ar&&N===Le,qe=Ar&&K!==void 0&&K.current?.cell[1]===Le;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&Q!==void 0&&K.current!==void 0&&!qe){if(It)return;const Ge=Math.min($,U),Ke=Math.max($,U),tt=Math.min(N,Q),yt=Math.max(N,Q);kt({...K.current,range:{x:Ge,y:tt,width:Ke-Ge+1,height:yt-tt+1}},!0,L,"click"),kr.current=void 0,wn()}else kt({cell:[$,N],range:{x:$,y:N,width:1,height:1}},!0,L,"click"),kr.current=void 0,i(void 0),wn()}}else if(b.kind==="header")if($r.current=[$,N],i(void 0),yn&&$===0)kr.current=void 0,ho.current=void 0,!zr&&ie==="multi"&&(F.length!==Le?lt(Ye.fromSingleSelection([0,Le]),void 0,L):lt(Ye.empty(),void 0,L),wn());else{const se=ho.current;if(ne==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&se!==void 0&&X.hasIndex(se)){const Pe=[Math.min(se,$),Math.max(se,$)+1];L||b.isTouch||ut==="multi"?je(void 0,Pe,L):je(Ye.fromSingleSelection(Pe),void 0,L)}else ne==="multi"&&(L||b.isTouch||ut==="multi")?(X.hasIndex($)?je(X.remove($),void 0,L):je(void 0,$,L),ho.current=$):ne!=="none"&&(X.hasIndex($)?je(X.remove($),void 0,L):je(Ye.fromSingleSelection($),void 0,L),ho.current=$);kr.current=void 0,wn()}else b.kind===Zn?$r.current=[$,N]:b.kind===xa&&!b.isMaybeScrollbar&&(pe(Qi,!1),i(void 0),wn(),an?.(),kr.current=void 0,ho.current=void 0)},[ie,ne,K,yn,j,Ft,Le,fn,zn,Qt,wn,Oe,ut,en,_o,lt,uo,xr,Un,_r,Ar,kt,zr,je,pe,an]),Bo=d.useRef(!1),$r=d.useRef(),Qs=d.useRef(pr),or=d.useRef(),Hf=d.useCallback(b=>{if(fo.current=!1,Qs.current=tn.current,b.button!==0&&b.button!==1){or.current=void 0;return}const L=performance.now();or.current={button:b.button,time:L,location:b.location},b?.kind==="header"&&(Bo.current=!0);const A=b.kind==="cell"&&b.isFillHandle;!A&&b.kind!=="cell"&&b.isEdge||(c({previousSelection:K,fillHandle:A}),$r.current=void 0,!b.isTouch&&b.button===0&&!A?$o(b):!b.isTouch&&b.button===1&&($r.current=b.location))},[K,$o]),[Ka,Xa]=d.useState(),ec=d.useCallback(b=>{if(b.kind!==Zn||ne!=="multi")return;const L=wa.value?b.metaKey:b.ctrlKey,[A]=b.location,$=K.columns;if(A<j)return;const N=st[A];let X=A,F=A;for(let U=A-1;U>=j&&bi(N.group,st[U].group);U--)X--;for(let U=A+1;U<st.length&&bi(N.group,st[U].group);U++)F++;if(wn(),L||b.isTouch||ut==="multi")if($.hasAll([X,F+1])){let U=$;for(let Q=X;Q<=F;Q++)U=U.remove(Q);je(U,void 0,L)}else je(void 0,[X,F+1],L);else je(Ye.fromSingleSelection([X,F+1]),void 0,L)},[ne,wn,K.columns,st,j,je,ut]),fo=d.useRef(!1),_i=d.useCallback(async b=>{if(ee!==void 0&&We!==void 0){const L=tn.current.y,A=tn.current.height;let $=ee({x:b,y:L,width:1,height:Math.min(A,Le-L)},_.current.signal);typeof $!="object"&&($=await $());const N=cn[b-j],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=ct.baseFontFull;const F=sh(X,ct,N,0,$,wr,oo,!1,en);We?.(N,F.width,b,F.width)}}},[cn,ee,oo,ct,wr,We,j,Le,en]),[zf,qa]=d.useState(),po=d.useCallback(async(b,L)=>{const A=b.current?.range;if(A===void 0||ee===void 0||L.current===void 0)return;const $=L.current.range;if(M!==void 0){let U=!1;if(M({fillDestination:{...$,x:$.x-j},patternSource:{...A,x:A.x-j},preventDefault:()=>U=!0}),U)return}let N=ee(A,_.current.signal);typeof N!="object"&&(N=await N());const X=N,F=[];for(let U=0;U<$.width;U++)for(let Q=0;Q<$.height;Q++){const se=[$.x+U,$.y+Q];if(Zd(se,A))continue;const Pe=X[Q%A.height][U%A.width];Mo(Pe)||!Co(Pe)||F.push({location:se,value:{...Pe}})}Nn(F),gn.current?.damage(F.map(U=>({cell:U.location})))},[ee,Nn,M,j]),tc=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,width:1}}};po(b,K)},[po,K]),nc=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,height:1}}};po(b,K)},[po,K]),Lf=d.useCallback((b,L)=>{const A=s;if(c(void 0),Na(void 0),qa(void 0),Bo.current=!1,L)return;if(A?.fillHandle===!0&&K.current!==void 0&&A.previousSelection?.current!==void 0){if(Vr===void 0)return;const Pe={...K,current:{...K.current,range:fh(A.previousSelection.current.range,Vr)}};po(A.previousSelection,Pe),pe(Pe,!0);return}const[$,N]=b.location,[X,F]=$r.current??[],U=()=>{fo.current=!0},Q=Pe=>{const It=Pe.isTouch||X===$&&F===N;if(It&&I?.([$-j,N],{...Pe,preventDefault:U}),Pe.button===1)return!fo.current;if(!fo.current){const qe=zn(b.location),Ge=en(qe);if(Ge!==void 0&&Ge.onClick!==void 0&&It){const tt=Ge.onClick({...Pe,cell:qe,posX:Pe.localEventX,posY:Pe.localEventY,bounds:Pe.bounds,theme:_o(qe,b.location),preventDefault:U});tt!==void 0&&!Mo(tt)&&ko(tt)&&(Nn([{location:Pe.location,value:tt}]),gn.current?.damage([{cell:Pe.location}]))}if(fo.current||K.current===void 0)return!1;let Ke=!1;switch(qe.activationBehaviorOverride??Me){case"double-click":case"second-click":{if(A?.previousSelection?.current?.cell===void 0)break;const[tt,yt]=K.current.cell,[nn,mo]=A.previousSelection.current.cell;Ke=$===tt&&$===nn&&N===yt&&N===mo&&(Pe.isDoubleClick===!0||Me==="second-click");break}case"single-click":{Ke=!0;break}}if(Ke){const tt={inputType:"pointer",pointerActivation:Pe.isDoubleClick===!0?"double-click":qe.activationBehaviorOverride??Me,pointerType:Pe.isTouch?"touch":"mouse"};return O?.([$-j,N],tt),co(Pe.bounds,tt),!0}}return!1},se=b.location[0]-j;if(b.isTouch){const Pe=tn.current,It=Qs.current;if(Pe.x!==It.x||Pe.y!==It.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&fi(K.current?.cell,b.location)){W?.([se,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&K.columns.hasIndex($)){ce?.(se,{...b,preventDefault:U});return}else if(b.kind===Zn){if(se<0)return;q?.(se,{...b,preventDefault:U});return}}b.kind==="cell"?Q(b)||$o(b):b.kind===Zn?J?.(se,{...b,preventDefault:U}):(b.kind===Ir&&R?.(se,{...b,preventDefault:U}),$o(b));return}if(b.kind==="header"){if(se<0)return;b.isEdge?b.isDoubleClick===!0&&_i($):b.button===0&&$===X&&N===F&&R?.(se,{...b,preventDefault:U})}if(b.kind===Zn){if(se<0)return;b.button===0&&$===X&&N===F&&(J?.(se,{...b,preventDefault:U}),fo.current||ec(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&Q(b),$r.current=void 0},[s,K,j,Vr,po,pe,I,zn,en,Me,_o,Nn,O,co,W,ce,q,$o,J,R,_i,ec]),Af=d.useCallback(b=>{const L={...b,location:[b.location[0]-j,b.location[1]]};Je?.(L),s!==void 0&&b.buttons===0&&(c(void 0),Na(void 0),qa(void 0),Bo.current=!1),qa(A=>Bo.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===A?.[0]&&b.scrollEdge[1]===A[1]?A:s===void 0||(or.current?.location[0]??0)<j?void 0:b.scrollEdge)},[s,Je,j]),Ff=d.useCallback((b,L)=>{Qe?.(b-j,L)},[Qe,j]),Vf=d.useCallback((b,L)=>{Ue?.(b-j,L)},[Ue,j]),go=K?.current?.cell,_f=d.useCallback((b,L,A,$,N,X)=>{rr.current=!1;let F=go;F!==void 0&&(F=[F[0]-j,F[1]]);const U=Ee===0?void 0:{x:0,y:b.y,width:Ee,height:b.height},Q=[];U!==void 0&&Q.push(U),et>0&&(Q.push({x:b.x-j,y:Le-et,width:b.width,height:et}),Ee>0&&Q.push({x:0,y:Le-et,width:Ee,height:et}));const se={x:b.x-j,y:b.y,width:b.width,height:Ft&&b.y+b.height>=Le?b.height-1:b.height,tx:N,ty:X,extras:{selected:F,freezeRegion:U,freezeRegions:Q}};tn.current=se,Pi(se),so([L,A,$]),In?.(se,se.tx,se.ty,se.extras)},[go,j,Ft,Le,Ee,et,Pi,In]),$f=Rr(T,d.useCallback((b,L)=>T?.(b-j,L-j)!==!1,[T,j])),Bf=Rr(Ce,d.useCallback((b,L)=>{Ce?.(b-j,L-j),ne!=="none"&&je(Ye.fromSingleSelection(L),void 0,!0)},[ne,Ce,j,je])),Za=d.useRef(!1),Nf=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}Ve?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(Za.current=!0),c(void 0)},[Ve,j]),Wf=d.useCallback(()=>{Za.current=!1},[]),rc=gt?.selectionBehavior,$i=d.useCallback(b=>{if(rc!=="block-spanning")return;const{isGroupHeader:L,path:A,groupRows:$}=_r(b);if(L)return[b,b];const N=A[A.length-1],X=b-N,F=b+$-N-1;return[X,F]},[_r,rc]),Ya=d.useRef(),Ja=d.useCallback(b=>{if(!yh(b,Ya.current)&&(Ya.current=b,!(or?.current?.button!==void 0&&or.current.button>=1))){if(b.buttons!==0&&s!==void 0&&or.current?.location[0]===0&&j===1&&ie==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(or.current.location[1])&&K.rows.hasIndex(or.current.location[1])){const L=Math.min(or.current.location[1],b.location[1]),A=Math.max(or.current.location[1],b.location[1])+1;lt(Ye.fromSingleSelection([L,A]),void 0,!1)}else if(b.buttons!==0&&s!==void 0&&K.current!==void 0&&!Za.current&&!Bo.current&&(Be==="rect"||Be==="multi-rect")){const[L,A]=K.current.cell;let[$,N]=b.location;if(N<0&&(N=tn.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const X=s.previousSelection.current.range;N=Math.min(N,Ft?Le-1:Le);const F=kv(X,$,N,bt);Na(F)}else{if(Ft&&A===Le)return;if(Ft&&N===Le)if(b.kind===xa)N--;else return;$=Math.max($,j);const X=$i(A);N=X===void 0?N:Wn(N,X[0],X[1]);const F=$-L,U=N-A,Q={x:F>=0?L:$,y:U>=0?A:N,width:Math.abs(F)+1,height:Math.abs(U)+1};kt({...K.current,range:Q},!0,!1,"drag")}}Ot?.({...b,location:[b.location[0]-j,b.location[1]]})}},[s,j,ie,K,Be,Ot,lt,Ft,Le,bt,$i,kt]),jf=d.useCallback(()=>{const b=Ya.current;if(b===void 0)return;const[L,A]=b.scrollEdge;let[$,N]=b.location;const X=tn.current;L===-1?$=X.extras?.freezeRegion?.x??X.x:L===1&&($=X.x+X.width),A===-1?N=Math.max(0,X.y):A===1&&(N=Math.min(Le-1,X.y+X.height)),$=Wn($,0,st.length-1),N=Wn(N,0,Le-1),Ja({...b,location:[$,N]})},[st.length,Ja,Le]);Db(zf,Bt,jf);const Kn=d.useCallback(b=>{if(K.current===void 0)return;const[L,A]=b,[$,N]=K.current.cell,X=K.current.range;let F=X.x,U=X.x+X.width,Q=X.y,se=X.y+X.height;const[Pe,It]=$i(N)??[0,Le-1],qe=It+1;if(A!==0)switch(A){case 2:{se=qe,Q=N,Wt(0,se,"vertical");break}case-2:{Q=Pe,se=N+1,Wt(0,Q,"vertical");break}case 1:{Q<N?(Q++,Wt(0,Q,"vertical")):(se=Math.min(qe,se+1),Wt(0,se,"vertical"));break}case-1:{se>N+1?(se--,Wt(0,se,"vertical")):(Q=Math.max(Pe,Q-1),Wt(0,Q,"vertical"));break}default:mi()}if(L!==0)if(L===2)U=st.length,F=$,Wt(U-1-j,0,"horizontal");else if(L===-2)F=j,U=$+1,Wt(F-j,0,"horizontal");else{let Ge=[];if(ee!==void 0){const Ke=ee({x:F,y:Q,width:U-F-j,height:se-Q},_.current.signal);typeof Ke=="object"&&(Ge=Bb(Ke))}if(L===1){let Ke=!1;if(F<$){if(Ge.length>0){const tt=Tr(F+1,$+1).find(yt=>!Ge.includes(yt-j));tt!==void 0&&(F=tt,Ke=!0)}else F++,Ke=!0;Ke&&Wt(F,0,"horizontal")}Ke||(U=Math.min(st.length,U+1),Wt(U-1-j,0,"horizontal"))}else if(L===-1){let Ke=!1;if(U>$+1){if(Ge.length>0){const tt=Tr(U-1,$,-1).find(yt=>!Ge.includes(yt-j));tt!==void 0&&(U=tt,Ke=!0)}else U--,Ke=!0;Ke&&Wt(U-j,0,"horizontal")}Ke||(F=Math.max(j,F-1),Wt(F-j,0,"horizontal"))}else mi()}kt({cell:K.current.cell,range:{x:F,y:Q,width:U-F,height:se-Q}},!0,!1,"keyboard-select")},[ee,$i,K,st.length,j,Le,Wt,kt]),Qa=d.useRef(Hr);Qa.current=Hr;const Cr=d.useCallback((b,L,A,$)=>{const N=mn-(A?0:1);b=Wn(b,j,cn.length-1+j),L=Wn(L,0,N);const X=go?.[0],F=go?.[1];if(b===X&&L===F)return!1;if($&&K.current!==void 0){const U=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&U.push(K.current.range),pe({...K,current:{cell:[b,L],range:{x:b,y:L,width:1,height:1},rangeStack:U}},!0)}else kt({cell:[b,L],range:{x:b,y:L,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===b&&u.current[1]===L&&(u.current=void 0),Qa.current&&Wt(b-j,L),!0},[mn,j,cn.length,go,K,Wt,pe,kt]),Gf=d.useCallback((b,L)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(Nn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{gn.current?.damage([{cell:o.cell}])})),wn(!0),i(void 0);const[A,$]=L;if(K.current!==void 0&&(A!==0||$!==0)){const N=K.current.cell[1]===mn-1&&b!==void 0,X=K.current.cell[0]===st.length-1&&b!==void 0;let F=!0;if(N&&$===1&&ye!==void 0){F=!1;const U=K.current.cell[0]+A,Q=uo(U);xr(Q??U,!1)}if(X&&A===1&&at!==void 0){F=!1;const U=K.current.cell[1]+$;Vi(U,!1)}F&&Cr(Wn(K.current.cell[0]+A,0,st.length-1),Wn(K.current.cell[1]+$,0,mn-1),N,!1)}P?.(b,L)},[o?.cell,wn,K,P,Nn,mn,Cr,st.length,xr,Vi,ye,at,uo]),Uf=d.useMemo(()=>`gdg-overlay-${$b++}`,[]),Br=d.useCallback(b=>{wn();const L=[];for(let A=b.x;A<b.x+b.width;A++)for(let $=b.y;$<b.y+b.height;$++){const N=x([A-j,$]);if(!N.allowOverlay&&N.kind!==Y.Boolean)continue;let X;if(N.kind===Y.Custom){const F=en(N),U=F?.provideEditor?.({...N,location:[A-j,$]});F?.onDelete!==void 0?X=F.onDelete(N):Qg(U)&&(X=U?.deletedValue?.(N))}else(ko(N)&&N.allowOverlay||N.kind===Y.Boolean)&&(X=en(N)?.onDelete?.(N));X!==void 0&&!Mo(X)&&ko(X)&&L.push({location:[A,$],value:X})}Nn(L),gn.current?.damage(L.map(A=>({cell:A.location})))},[wn,x,en,Nn,j]),No=o!==void 0,oc=d.useCallback(b=>{const L=()=>{b.stopPropagation(),b.preventDefault()},A={didMatch:!1},{bounds:$}=b,N=K.columns,X=K.rows,F=nr;if(!No&&nt(F.clear,b,A))pe(Qi,!1),an?.();else if(!No&&nt(F.selectAll,b,A))pe({columns:Ye.empty(),rows:Ye.empty(),current:{cell:K.current?.cell??[j,0],range:{x:j,y:0,width:y.length,height:Le},rangeStack:[]}},!1);else if(nt(F.search,b,A))a?.current?.focus({preventScroll:!0}),Di(!0);else if(nt(F.delete,b,A)){const Ke=Nt?.(K)??!0;if(Ke!==!1){const tt=Ke===!0?K:Ke;if(tt.current!==void 0){Br(tt.current.range);for(const yt of tt.current.rangeStack)Br(yt)}for(const yt of tt.rows)Br({x:j,y:yt,width:y.length,height:1});for(const yt of tt.columns)Br({x:yt,y:0,width:1,height:Le})}}if(A.didMatch)return L(),!0;if(K.current===void 0)return!1;let[U,Q]=K.current.cell;const[,se]=K.current.cell;let Pe=!1,It=!1;if(nt(F.scrollToSelectedCell,b,A))Wi.current(U-j,Q);else if(ne!=="none"&&nt(F.selectColumn,b,A))N.hasIndex(U)?je(N.remove(U),void 0,!0):ne==="single"?je(Ye.fromSingleSelection(U),void 0,!0):je(void 0,U,!0);else if(ie!=="none"&&nt(F.selectRow,b,A))X.hasIndex(Q)?lt(X.remove(Q),void 0,!0):ie==="single"?lt(Ye.fromSingleSelection(Q),void 0,!0):lt(void 0,Q,!0);else if(!No&&$!==void 0&&nt(F.activateCell,b,A))if(Q===Le&&Ft)window.setTimeout(()=>{const Ke=uo(U);xr(Ke??U)},0);else{const Ke={inputType:"keyboard",key:b.key};O?.([U-j,Q],Ke),co($,Ke)}else K.current.range.height>1&&nt(F.downFill,b,A)?nc():K.current.range.width>1&&nt(F.rightFill,b,A)?tc():nt(F.goToNextPage,b,A)?Q+=Math.max(1,tn.current.height-4):nt(F.goToPreviousPage,b,A)?Q-=Math.max(1,tn.current.height-4):nt(F.goToFirstCell,b,A)?(i(void 0),Q=0,U=0):nt(F.goToLastCell,b,A)?(i(void 0),Q=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):nt(F.selectToFirstCell,b,A)?(i(void 0),Kn([-2,-2])):nt(F.selectToLastCell,b,A)?(i(void 0),Kn([2,2])):No?(nt(F.closeOverlay,b,A)&&i(void 0),nt(F.acceptOverlayDown,b,A)&&(i(void 0),Q++),nt(F.acceptOverlayUp,b,A)&&(i(void 0),Q--),nt(F.acceptOverlayLeft,b,A)&&(i(void 0),U--),nt(F.acceptOverlayRight,b,A)&&(i(void 0),U++)):(nt(F.goDownCell,b,A)?Q+=1:nt(F.goUpCell,b,A)?Q-=1:nt(F.goRightCell,b,A)?U+=1:nt(F.goLeftCell,b,A)?U-=1:nt(F.goDownCellRetainSelection,b,A)?(Q+=1,Pe=!0):nt(F.goUpCellRetainSelection,b,A)?(Q-=1,Pe=!0):nt(F.goRightCellRetainSelection,b,A)?(U+=1,Pe=!0):nt(F.goLeftCellRetainSelection,b,A)?(U-=1,Pe=!0):nt(F.goToLastRow,b,A)?Q=Le-1:nt(F.goToFirstRow,b,A)?Q=Number.MIN_SAFE_INTEGER:nt(F.goToLastColumn,b,A)?U=Number.MAX_SAFE_INTEGER:nt(F.goToFirstColumn,b,A)?U=Number.MIN_SAFE_INTEGER:(Be==="rect"||Be==="multi-rect")&&(nt(F.selectGrowDown,b,A)?Kn([0,1]):nt(F.selectGrowUp,b,A)?Kn([0,-1]):nt(F.selectGrowRight,b,A)?Kn([1,0]):nt(F.selectGrowLeft,b,A)?Kn([-1,0]):nt(F.selectToLastRow,b,A)?Kn([0,2]):nt(F.selectToFirstRow,b,A)?Kn([0,-2]):nt(F.selectToLastColumn,b,A)?Kn([2,0]):nt(F.selectToFirstColumn,b,A)&&Kn([-2,0])),It=A.didMatch);if(Un!==void 0&&Un!=="normal"&&Q!==se){const Ke=Un==="skip-up"||Un==="skip"||Un==="block",tt=Un==="skip-down"||Un==="skip"||Un==="block",yt=Q<se;if(yt&&Ke){for(;Q>=0&&_r(Q).isGroupHeader;)Q--;Q<0&&(Q=se)}else if(!yt&&tt){for(;Q<Le&&_r(Q).isGroupHeader;)Q++;Q>=Le&&(Q=se)}}const qe=Cr(U,Q,!1,Pe),Ge=A.didMatch;return Ge&&(qe||!It||Rn)&&L(),Ge},[Un,No,K,nr,ne,ie,Be,j,_r,Le,Cr,pe,an,y.length,Nt,Rn,Br,je,lt,Ft,uo,xr,O,co,nc,tc,Kn]),Wo=d.useCallback(b=>{let L=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{L=!0}}),L||oc(b)||K.current===void 0)return;const[A,$]=K.current.cell,N=tn.current;if(Ie&&!b.metaKey&&!b.ctrlKey&&K.current!==void 0&&b.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(b.key)&&b.bounds!==void 0&&Co(x([A-j,Math.max(0,Math.min($,Le-1))]))){if((!Ft||$!==Le)&&(N.y>$||$>N.y+N.height||N.x>A||A>N.x+N.width))return;const X={inputType:"keyboard",key:b.key};O?.([A-j,$],X),co(b.bounds,X,b.key),b.stopPropagation(),b.preventDefault()}},[Ie,G,oc,K,x,j,Le,Ft,O,co]),Kf=d.useCallback((b,L)=>{const A=b.location[0]-j;if(b.kind==="header"&&ce?.(A,{...b,preventDefault:L}),b.kind===Zn){if(A<0)return;q?.(A,{...b,preventDefault:L})}if(b.kind==="cell"){const[$,N]=b.location;W?.([A,N],{...b,preventDefault:L}),b0(K,b.location)||Cr($,N,!1,!1)}},[K,W,q,ce,j,Cr]),el=d.useCallback(async b=>{if(!nr.paste)return;function L(F,U,Q,se){const Pe=typeof Q=="object"?Q?.join(`
|
|
183
183
|
`)??"":Q?.toString()??"";if(!Mo(F)&&Co(F)&&F.readonly!==!0){const It=S?.(Pe,F);if(It!==void 0&&ko(It))return{location:U,value:It};const qe=en(F);if(qe===void 0)return;if(qe.kind===Y.Custom){Fn(F.kind===Y.Custom);const Ge=qe.onPaste?.(Pe,F.data);return Ge===void 0?void 0:{location:U,value:{...F,data:Ge}}}else{const Ge=qe.onPaste?.(Pe,F,{formatted:se,formattedString:typeof se=="string"?se:se?.join(`
|
|
184
184
|
`),rawValue:Q});return Ge===void 0?void 0:(Fn(Ge.kind===F.kind),{location:U,value:Ge})}}}const A=K.columns,$=K.rows,N=Bt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0;let X;if(K.current!==void 0?X=[K.current.range.x,K.current.range.y]:A.length===1?X=[A.first()??0,0]:$.length===1&&(X=[j,$.first()??0]),N&&X!==void 0){let F,U;const Q="text/plain",se="text/html";if(navigator.clipboard.read!==void 0){const Ge=await navigator.clipboard.read();for(const Ke of Ge){if(Ke.types.includes(se)){const tt=await(await Ke.getType(se)).text(),yt=cu(tt);if(yt!==void 0){F=yt;break}}Ke.types.includes(Q)&&(U=await(await Ke.getType(Q)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(b!==void 0&&b?.clipboardData!==null){if(b.clipboardData.types.includes(se)){const Ge=b.clipboardData.getData(se);F=cu(Ge)}F===void 0&&b.clipboardData.types.includes(Q)&&(U=b.clipboardData.getData(Q))}else return;const[Pe,It]=X,qe=[];do{if(Se===void 0){const Ge=zn(X),Ke=U??F?.map(yt=>yt.map(nn=>nn.rawValue).join(" ")).join(" ")??"",tt=L(Ge,X,Ke,void 0);tt!==void 0&&qe.push(tt);break}if(F===void 0){if(U===void 0)return;F=Sb(U)}if(Se===!1||typeof Se=="function"&&Se?.([X[0]-j,X[1]],F.map(Ge=>Ge.map(Ke=>Ke.rawValue?.toString()??"")))!==!0)return;for(const[Ge,Ke]of F.entries()){if(Ge+It>=Le)break;for(const[tt,yt]of Ke.entries()){const nn=[tt+Pe,Ge+It],[mo,ji]=nn;if(mo>=st.length||ji>=mn)continue;const Go=zn(nn),ir=L(Go,nn,yt.rawValue,yt.formatted);ir!==void 0&&qe.push(ir)}}}while(!1);Nn(qe),gn.current?.damage(qe.map(Ge=>({cell:Ge.location})))}},[S,en,zn,K,nr.paste,Bt,st.length,Nn,mn,Se,j,Le]);xn("paste",el,h,!1,!0);const jo=d.useCallback(async(b,L)=>{if(!nr.copy)return;const A=L===!0||Bt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0,$=K.columns,N=K.rows,X=(F,U)=>{if(!Ze)du(F,U,b);else{const Q=U.map(se=>({kind:Y.Text,data:y[se].title,displayData:y[se].title,allowOverlay:!1}));du([Q,...F],U,b)}};if(A&&ee!==void 0){if(K.current!==void 0){let F=ee(K.current.range,_.current.signal);typeof F!="object"&&(F=await F()),X(F,Tr(K.current.range.x-j,K.current.range.x+K.current.range.width-j))}else if(N!==void 0&&N.length>0){const F=[...N].map(U=>{const Q=ee({x:j,y:U,width:y.length,height:1},_.current.signal);return typeof Q=="object"?Q[0]:Q().then(se=>se[0])});if(F.some(U=>U instanceof Promise)){const U=await Promise.all(F);X(U,Tr(y.length))}else X(F,Tr(y.length))}else if($.length>0){const F=[],U=[];for(const Q of $){let se=ee({x:Q,y:0,width:1,height:Le},_.current.signal);typeof se!="object"&&(se=await se()),F.push(se),U.push(Q-j)}if(F.length===1)X(F[0],U);else{const Q=F.reduce((se,Pe)=>se.map((It,qe)=>[...It,...Pe[qe]]));X(Q,U)}}}},[y,ee,K,nr.copy,j,Bt,Le,Ze]);xn("copy",jo,h,!1,!1);const Xf=d.useCallback(async b=>{if(!(!nr.cut||!(Bt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0))&&(await jo(b),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:Ye.empty(),columns:Ye.empty()};const A=Nt?.(L);if(A===!1||(L=A===!0?L:A,L.current===void 0))return;Br(L.current.range)}},[Br,K,nr.cut,jo,Bt,Nt]);xn("cut",Xf,h,!1,!1);const qf=d.useCallback((b,L)=>{if(he!==void 0){j!==0&&(b=b.map(N=>[N[0]-j,N[1]])),he(b,L);return}if(b.length===0||L===-1)return;const[A,$]=b[L];u.current!==void 0&&u.current[0]===A&&u.current[1]===$||(u.current=[A,$],Cr(A,$,!1,!1))},[he,j,Cr]),[Bi,Ni]=Mt?.current?.cell??[],Wi=d.useRef(Wt);Wi.current=Wt,d.useLayoutEffect(()=>{Qa.current&&!rr.current&&Bi!==void 0&&Ni!==void 0&&(Bi!==de.current?.current?.cell[0]||Ni!==de.current?.current?.cell[1])&&Wi.current(Bi,Ni),rr.current=!1},[Bi,Ni]);const ic=K.current!==void 0&&(K.current.cell[0]>=st.length||K.current.cell[1]>=mn);d.useLayoutEffect(()=>{ic&&pe(Qi,!1)},[ic,pe]);const Zf=d.useMemo(()=>Ft===!0&&De?.tint===!0?Ye.fromSingleSelection(mn-1):Ye.empty(),[mn,Ft,De?.tint]),Yf=d.useCallback(b=>typeof sn=="boolean"?sn:sn?.(b-j)??!0,[j,sn]),Jf=d.useMemo(()=>{if(Ka===void 0||l.current===null)return null;const{bounds:b,group:L}=Ka,A=l.current.getBoundingClientRect();return d.createElement(fb,{bounds:b,group:L,canvasBounds:A,onClose:()=>Xa(void 0),onFinish:$=>{Xa(void 0),ge?.(L,$)}})},[ge,Ka]),Qf=Math.min(st.length,Ee+(yn?1:0));d.useImperativeHandle(t,()=>({appendRow:(b,L)=>xr(b+j,L),appendColumn:(b,L)=>Vi(b,L),updateCells:b=>(j!==0&&(b=b.map(L=>({cell:[L.cell[0]+j,L.cell[1]]}))),gn.current?.damage(b)),getBounds:(b,L)=>{if(!(l?.current===null||Bt?.current===null)){if(b===void 0&&L===void 0){const A=l.current.getBoundingClientRect(),$=A.width/Bt.current.clientWidth;return{x:A.x-Bt.current.scrollLeft*$,y:A.y-Bt.current.scrollTop*$,width:Bt.current.scrollWidth*$,height:Bt.current.scrollHeight*$}}return gn.current?.getBounds((b??0)+j,L)}},focus:()=>gn.current?.focus(),emit:async b=>{switch(b){case"delete":Wo({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":Wo({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":Wo({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 jo(void 0,!0);break;case"paste":await el();break}},scrollTo:Wt,remeasureColumns:b=>{for(const L of b)_i(L+j)},getMouseArgsForPosition:(b,L,A)=>{if(gn?.current===null)return;const $=gn.current.getMouseArgsForPosition(b,L,A);if($!==void 0)return{...$,location:[$.location[0]-j,$.location[1]]}}}),[xr,Vi,_i,Bt,jo,Wo,el,j,Wt]);const[ac,lc]=go??[],ep=d.useCallback(b=>{const[L,A]=b;if(A===-1){ne!=="none"&&(je(Ye.fromSingleSelection(L),void 0,!1),wn());return}ac===L&&lc===A||(kt({cell:b,range:{x:L,y:A,width:1,height:1}},!0,!1,"keyboard-nav"),Wt(L,A))},[ne,wn,Wt,ac,lc,kt,je]),[tp,np]=d.useState(!1),sc=d.useRef(zd(b=>{np(b)},5)),rp=d.useCallback(()=>{sc.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&s===void 0&&kt({cell:[j,Hi],range:{x:j,y:Hi,width:1,height:1}},!0,!1,"keyboard-select")},[Hi,K,s,j,kt]),op=d.useCallback(()=>{sc.current(!1)},[]),[ip,ap]=d.useMemo(()=>{let b;const L=ht?.scrollbarWidthOverride??_l(),A=Le+(Ft?1:0);if(typeof tr=="number")b=pn+A*tr;else{let N=0;const X=Math.min(A,10);for(let F=0;F<X;F++)N+=tr(F);N=Math.floor(N/X),b=pn+A*N}b+=L;const $=st.reduce((N,X)=>X.width+N,0)+L;return[`${Math.min(1e5,$)}px`,`${Math.min(1e5,b)}px`]},[st,ht?.scrollbarWidthOverride,tr,Le,Ft,pn]),lp=d.useMemo(()=>P0(ct),[ct]);return d.createElement(ah.Provider,{value:ct},d.createElement(Eb,{style:lp,className:Z,inWidth:m??ip,inHeight:w??ap},d.createElement(cb,{fillHandle:Ht,drawFocusRing:Lo,experimental:ht,fixedShadowX:Cn,fixedShadowY:ur,getRowThemeOverride:Lr,headerIcons:_n,imageWindowLoader:B,initialSize:$e,isDraggable:Ne,onDragLeave:Dt,onRowMoved:Qt,overscrollX:_a,overscrollY:$a,preventDiagonalScrolling:bn,rightElement:$t,rightElementProps:Mn,smoothScrollX:we,smoothScrollY:zt,className:Z,enableGroups:Bn,onCanvasFocused:rp,onCanvasBlur:op,canvasRef:l,onContextMenu:Kf,theme:ct,cellXOffset:Df,cellYOffset:Hi,accessibilityHeight:pr.height,onDragEnd:Wf,columns:st,nonGrowWidth:Lt,drawHeader:pt,onColumnProposeMove:$f,drawCell:hn,disabledRows:Zf,freezeColumns:Qf,lockColumns:j,firstColAccessible:j===0,getCellContent:zn,minColumnWidth:wr,maxColumnWidth:oo,searchInputRef:a,showSearch:lo,onSearchClose:Ba,highlightRegions:Pf,getCellsForSelection:ee,getGroupDetails:Wa,headerHeight:Vo,isFocused:tp,groupHeaderHeight:Bn?io:0,freezeTrailingRows:et+(Ft&&De?.sticky===!0?1:0),hasAppendRow:Ft,onColumnResize:We,onColumnResizeEnd:ke,onColumnResizeStart:Xe,onCellFocused:ep,onColumnMoved:Bf,onDragStart:Nf,onHeaderMenuClick:Ff,onHeaderIndicatorClick:Vf,onItemHovered:Ja,isFilling:s?.fillHandle===!0,onMouseMove:Af,onKeyDown:Wo,onKeyUp:re,onMouseDown:Hf,onMouseUp:Lf,onDragOverCell:On,onDrop:Yt,onSearchResultsChanged:qf,onVisibleRegionChanged:_f,clientSize:_t,rowHeight:tr,searchResults:oe,searchValue:z,onSearchValueChange:V,rows:mn,scrollRef:Bt,selection:K,translateX:pr.tx,translateY:pr.ty,verticalBorder:Yf,gridRef:gn,getCellRenderer:en,resizeIndicator:Ii}),Jf,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(_b,{...o,validateCell:Re,bloom:E,id:Uf,getCellRenderer:en,className:ht?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:kn,imageEditorOverride:g,portalElementRef:zo,onFinishEditing:Gf,markdownDivCreateNode:p,isOutsideClick:Pn,customEventTarget:ht?.eventTarget}))))},Wb=d.forwardRef(Nb);function pu(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:a,height:l,x:s,y:c}=o,u=t.maxSize??i.checkboxMaxSize,h=Math.floor(o.y+l/2),g=Fd(u,l,i.cellVerticalPadding),f=Ad(t.contentAlign??"center",s,a,i.cellHorizontalPadding,g),p=Ld(f,h,g),m=Vd(s+n,c+r,p);return as(t)&&m}const jb={getAccessibilityString:e=>e.data?.toString()??"false",kind:Y.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Gb(e,e.cell.data,as(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{pu(e)&&e.preventDefault()},onClick:e=>{if(pu(e))return{...e.cell,data:xh(e.cell.data)}},onPaste:(e,t)=>{let n=fa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=is),n===t.data?void 0:{...t,data:n}}};function Gb(e,t,n,r,o){if(!n&&t===fa)return;const{ctx:i,hoverAmount:a,theme:l,rect:s,highlighted:c,hoverX:u,hoverY:h,cell:{contentAlign:g}}=e,{x:f,y:p,width:m,height:w}=s;let y=!1;if(o>0){let v=n?1-o+o*a:.4;if(t===fa&&(v*=a),v===0)return;v<1&&(y=!0,i.globalAlpha=v)}ks(i,l,t,f,p,m,w,c,u,h,r,g),y&&(i.globalAlpha=1)}const Ub=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Kb=e=>{const{bubbles:t}=e;return d.createElement(Ub,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Xb={getAccessibilityString:e=>_d(e.data),kind:Y.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>qb(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Kb,{bubbles:t.data})},onPaste:()=>{}};function qb(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:a,y:l,width:s,height:c}=n;let u=a+r.cellHorizontalPadding;const h=[];for(const g of t){if(u>a+s)break;const f=Dr(g,o,r.baseFontFull).width;h.push({x:u,width:f}),u+=f+r.bubblePadding*2+r.bubbleMargin}o.beginPath();for(const g of h)Jn(o,g.x,l+(c-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);o.fillStyle=i?r.bgBubbleSelected:r.bgBubble,o.fill();for(const[g,f]of h.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[g],f.x+r.bubblePadding,l+c/2+er(o,r))}const Zb=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Yb=e=>{const{drilldowns:t}=e;return d.createElement(Zb,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))))},Jb={getAccessibilityString:e=>_d(e.data.map(t=>t.text)),kind:Y.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+n.bubblePadding*2+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>e1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Yb,{drilldowns:t.data})},onPaste:()=>{}},kl={};function Qb(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,l=4,s=n*o,c=r+i,u=r*3,h=(u+i*2)*o,g=`${e},${t},${o},${n}`;if(kl[g]!==void 0)return{el:kl[g],height:s,width:h,middleWidth:l*o,sideWidth:c*o,padding:i*o,dpr:o};const f=document.createElement("canvas"),p=f.getContext("2d");return p===null?null:(f.width=h,f.height=s,p.scale(o,o),kl[g]=f,p.beginPath(),Jn(p,i,i,u,a,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),Jn(p,i+.5,i+.5,u,a,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:f,height:s,width:h,sideWidth:c*o,middleWidth:r*o,padding:i*o,dpr:o})}function e1(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:a,row:l}=e,{x:s,width:c}=n,u=r.baseFontFull,h=bs(o,u),g=Math.min(n.height,Math.max(16,Math.ceil(h*r.lineHeight)*2)),f=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,w=r.bubbleMargin;let y=s+r.cellHorizontalPadding;const v=r.roundingRadius??6,x=Qb(r.bgCell,r.drilldownBorder,g,v),I=[];for(const O of t){if(y>s+c)break;const M=Dr(O.text,o,u).width;let P=0;O.img!==void 0&&i.loadOrGetImage(O.img,a,l)!==void 0&&(P=p-8+4);const S=M+P+m*2;I.push({x:y,width:S}),y+=S+w}if(x!==null){const{el:O,height:M,middleWidth:P,sideWidth:S,width:k,dpr:H,padding:E}=x,R=S/H,T=E/H;for(const D of I){const C=Math.floor(D.x),J=Math.floor(D.width),W=J-(R-T)*2;o.imageSmoothingEnabled=!1,o.drawImage(O,0,0,S,M,C-T,f,R,g),W>0&&o.drawImage(O,S,0,P,M,C+(R-T),f,W,g),o.drawImage(O,k-S,0,S,M,C+J-(R-T),f,R,g),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[O,M]of I.entries()){const P=t[O];let S=M.x+m;if(P.img!==void 0){const k=i.loadOrGetImage(P.img,a,l);if(k!==void 0){const H=p-8;let E=0,R=0,T=k.width,D=k.height;T>D?(E+=(T-D)/2,T=D):D>T&&(R+=(D-T)/2,D=T),o.beginPath(),Jn(o,S,f+g/2-H/2,H,H,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(k,E,R,T,D,S,f+g/2-H/2,H,H),o.restore(),S+=H+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(P.text,S,f+g/2+er(o,r))}}const t1={getAccessibilityString:e=>e.data.join(", "),kind:Y.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>n1(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??Rm;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const n=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(n.length===t.data.length&&n.every((r,o)=>r===t.data[o])))return{...t,data:n}}},Cl=4;function n1(e,t,n,r){const{rect:o,col:i,row:a,theme:l,ctx:s,imageLoader:c}=e,{x:u,y:h,height:g,width:f}=o,p=g-l.cellVerticalPadding*2,m=[];let w=0;for(let v=0;v<t.length;v++){const x=t[v];if(x.length===0)continue;const I=c.loadOrGetImage(x,i,a);if(I!==void 0){m[v]=I;const O=I.width*(p/I.height);w+=O+Cl}}if(w===0)return;w-=Cl;let y=u+l.cellHorizontalPadding;r==="right"?y=Math.floor(u+f-l.cellHorizontalPadding-w):r==="center"&&(y=Math.floor(u+f/2-w/2));for(const v of m){if(v===void 0)continue;const x=v.width*(p/v.height);n>0&&(s.beginPath(),Jn(s,y,h+l.cellVerticalPadding,x,p,n),s.save(),s.clip()),s.drawImage(v,y,h+l.cellVerticalPadding,x,p),n>0&&s.restore(),y+=x+Cl}}function r1(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const o1={getAccessibilityString:()=>"",kind:Y.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(r1(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=i.width&&(l=i.width-s*2-1);const c=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);Jn(o,i.x+s,i.y+(i.height-c)/2,l,c,a.roundingRadius??3),o.fillStyle=Zr(a.textDark,.1),o.fill()},onPaste:()=>{}},i1=()=>e=>e.targetWidth,gu=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[i1(),"px"]}}),a1=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:a,validatedSelection:l}=e,s=t.data,c=t.readonly===!0,[u,h]=d.useState(s===""||r),g=d.useCallback(()=>{h(p=>!p)},[]),f=s?"gdg-ml-6":"";return u?d.createElement(gu,{targetWidth:i.width-20},d.createElement(Qr,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>a(t)},d.createElement(ym,null))):d.createElement(gu,{targetWidth:i.width},d.createElement(l0,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:g},d.createElement(ss,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},l1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Ri,measure:(e,t,n)=>{const r=t.data.split(`
|
|
185
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return d.createElement(a1,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},s1={getAccessibilityString:e=>e.row.toString(),kind:jn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:c1,measure:()=>44,draw:e=>d1(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function c1(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return i?.font!==o&&(n.font=o,i.font=o),i.deprep=u1,n.textAlign="center",i}function u1(e){const{ctx:t}=e;t.textAlign="start"}function d1(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:h,width:g,height:f}=l,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){a.globalAlpha=p;const m=7*(n?s:1);if(ks(a,c,n,o?u+m:u,h,o?g-m:g,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){a.globalAlpha=s,a.beginPath();for(const w of[3,6])for(const y of[-5,-1,3])a.rect(u+w,h+f/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=c.markerFontFull,y=u+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=w,a.fillText(m,y,h+f/2+er(a,w)),s!==0&&(a.globalAlpha=1)}}const h1={getAccessibilityString:()=>"",kind:jn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>f1(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function f1(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let f=0;if(n!==void 0){const p=h-8,m=s+8/2,w=c+8/2;l.drawSprite(n,"normal",r,m,w,p,a,g?1:i),f=p}else{f=24;const p=12,m=g?p:i*p,w=g?0:(1-i)*p*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+w,c+h/2),r.lineTo(s+y+w+m,c+h/2),r.moveTo(s+y+w+m*.5,c+h/2-m*.5),r.lineTo(s+y+w+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,c+h/2+er(r,a)),r.beginPath()}function Sh(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=p1(e,o,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Zr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a?.("text")}function p1(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const g1=d.lazy(async()=>await ns(()=>import("./number-overlay-editor-
|
|
185
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return d.createElement(a1,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},s1={getAccessibilityString:e=>e.row.toString(),kind:jn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:c1,measure:()=>44,draw:e=>d1(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function c1(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return i?.font!==o&&(n.font=o,i.font=o),i.deprep=u1,n.textAlign="center",i}function u1(e){const{ctx:t}=e;t.textAlign="start"}function d1(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:h,width:g,height:f}=l,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){a.globalAlpha=p;const m=7*(n?s:1);if(ks(a,c,n,o?u+m:u,h,o?g-m:g,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){a.globalAlpha=s,a.beginPath();for(const w of[3,6])for(const y of[-5,-1,3])a.rect(u+w,h+f/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=c.markerFontFull,y=u+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=w,a.fillText(m,y,h+f/2+er(a,w)),s!==0&&(a.globalAlpha=1)}}const h1={getAccessibilityString:()=>"",kind:jn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>f1(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function f1(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let f=0;if(n!==void 0){const p=h-8,m=s+8/2,w=c+8/2;l.drawSprite(n,"normal",r,m,w,p,a,g?1:i),f=p}else{f=24;const p=12,m=g?p:i*p,w=g?0:(1-i)*p*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+w,c+h/2),r.lineTo(s+y+w+m,c+h/2),r.moveTo(s+y+w+m*.5,c+h/2-m*.5),r.lineTo(s+y+w+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,c+h/2+er(r,a)),r.beginPath()}function Sh(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=p1(e,o,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Zr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a?.("text")}function p1(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const g1=d.lazy(async()=>await ns(()=>import("./number-overlay-editor-C_tZpFZY-CxWzCIFN.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]))),m1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Ri,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:c}=n;l===!0&&t>0&&Sh(r,o,c,s,i,t,a),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(g1,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},v1={getAccessibilityString:()=>"",measure:()=>108,kind:Y.Protected,needsHover:!1,needsHoverPosition:!1,draw:b1,onPaste:()=>{}};function b1(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:a}=r;t.beginPath();const l=2.5;let s=o+n.cellHorizontalPadding+l;const c=i+a/2,u=Math.cos(Ac(30))*l,h=Math.sin(Ac(30))*l;for(let g=0;g<12;g++)t.moveTo(s,c-l),t.lineTo(s,c+l),t.moveTo(s+u,c-h),t.lineTo(s-u,c+h),t.moveTo(s-u,c-h),t.lineTo(s+u,c+h),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const y1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Ri(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return St.createElement(Qr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},w1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Ri,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:c,hoverEffect:u,allowWrapping:h,hoverEffectTheme:g}=t;u===!0&&n>0&&Sh(o,a,g,s,i,n,l),ar(e,s,c,h,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
|
186
186
|
`,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(Qr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:a=>r({...o,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},x1=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),k1=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:a}=e,[l,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return l?d.createElement(Qr,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(x1,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(ss,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Mh(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?o=t.width-a-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-a/2),{x:o,y:i,width:a,height:l}}function mu(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=eh(a,i.baseFontFull);if(l===void 0)return!1;const s=Mh(l,n,i,t.contentAlign);return Xr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const C1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Ri,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:a,ctx:l}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const u=Dr(s,l,n.baseFontFull),h=Mh(u,a,n,t.contentAlign),{x:g,y:f,width:p,height:m}=h;if(o>=g-4&&o<=g-4+p+8&&i>=f-4&&i<=f-4+m+8){const w=er(l,n.baseFontFull);r("pointer");const y=5,v=f-w;l.beginPath(),l.moveTo(a.x+g,Math.floor(a.y+v+m+y)+.5),l.lineTo(a.x+g+p,Math.floor(a.y+v+m+y)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,ar({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=c?n.linkColor:n.textDark,ar(e,s,t.contentAlign)},onSelect:e=>{mu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;mu(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(k1,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},S1=[s1,h1,jb,Xb,Jb,t1,o1,l1,m1,v1,y1,w1,C1];var Sl,vu;function M1(){if(vu)return Sl;vu=1;var e=Hd(),t=cd(),n="Expected a function";function r(o,i,a){var l=!0,s=!0;if(typeof o!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(o,i,{leading:l,maxWait:i,trailing:s})}return Sl=r,Sl}var R1=M1();const I1=vr(R1),Ml=[];class E1 extends rh{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=I1(()=>{this.imageLoaded(new gi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let o=!1;for(let i=0;i<r.cells.length;i++){const a=r.cells[i];if(this.isInWindow(a)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,o){let i=!1;const a=Ml.pop()??new Image;let l=!1;const s={img:void 0,cells:[Yn(n,r)],url:t,cancel:()=>{l||(l=!0,Ml.length<12?Ml.unshift(a):i||(a.src=""))}},c=new Promise(u=>a.addEventListener("load",()=>u(null)));requestAnimationFrame(async()=>{try{a.src=t,await c,await a.decode();const u=this.cache[o];if(u!==void 0&&!l){u.img=a;for(const h of u.cells)this.loadedLocations.push(xs(h));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[o]=s}loadOrGetImage(t,n,r){const o=t,i=this.cache[o];if(i!==void 0){const a=Yn(n,r);return i.cells.includes(a)||i.cells.push(a),i.img}else this.loadImage(t,n,r,o)}}const T1=(e,t)=>{const n=d.useMemo(()=>({...yv,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??S1,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new E1,[e.imageWindowLoader]);return d.createElement(Wb,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})},O1=d.forwardRef(T1);function bu(e,t){const n=d.useRef(null),r=d.useRef(),o=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>o,[o]),{debouncedCallback:d.useCallback((...i)=>{r.current=i,o(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,o]),cancel:o}}var D1=cp();const P1=vr(D1);var Xl={exports:{}},H1=Xl.exports,yu;function z1(){return yu||(yu=1,(function(e,t){(function(n,r){try{e.exports=r(dp)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(H1,function(n){var r=!1,o=!1,i=!1,a=!1,l="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function c(V,z){return z.length>V.length?!1:V.indexOf(z)!==-1}function u(V){for(var z="";V;)z+="0",V-=1;return z}function h(V){for(var z=V.split("").reverse(),G=0,re=!0;re&&G<z.length;)G?z[G]==="9"?z[G]="0":(z[G]=(parseInt(z[G],10)+1).toString(),re=!1):(parseInt(z[G],10)<5&&(re=!1),z[G]="0"),G+=1;return re&&z.push("1"),z.reverse().join("")}function g(V,z){var G=P(C(z).sort(),function(le){return le+":"+z[le]}).join(","),re=V+"+"+G;return g.cache[re]||(g.cache[re]=Intl.NumberFormat(V,z)),g.cache[re]}g.cache={};function f(V,z,G){var re=z.useToLocaleString,le=z.useGrouping,Ie=le&&z.grouping.slice(),ye=z.maximumSignificantDigits,at=z.minimumIntegerDigits||1,Ce=z.fractionDigits||0,ft=z.groupingSeparator,vt=z.decimalSeparator;if(re&&G){var Be={minimumIntegerDigits:at,useGrouping:le};if(Ce&&(Be.maximumFractionDigits=Ce,Be.minimumFractionDigits=Ce),ye&&V>0&&(Be.maximumSignificantDigits=ye),i){if(!a){var ne=D({},z);ne.useGrouping=!1,ne.decimalSeparator=".",V=parseFloat(f(V,ne),10)}return g(G,Be).format(V)}else{if(!o){var ne=D({},z);ne.useGrouping=!1,ne.decimalSeparator=".",V=parseFloat(f(V,ne),10)}return V.toLocaleString(G,Be)}}var ie;ye?ie=V.toPrecision(ye+1):ie=V.toFixed(Ce+1);var be,ue,ve,Fe=ie.split("e");ve=Fe[1]||"",Fe=Fe[0].split("."),ue=Fe[1]||"",be=Fe[0]||"";var Ve=be.length,Je=ue.length,Se=Ve+Je,Ze=be+ue;(ye&&Se===ye+1||!ye&&Je===Ce+1)&&(Ze=h(Ze),Ze.length===Se+1&&(Ve=Ve+1),Je&&(Ze=Ze.slice(0,-1)),be=Ze.slice(0,Ve),ue=Ze.slice(Ve)),ye&&(ue=ue.replace(/0*$/,""));var Ee=parseInt(ve,10);Ee>0?ue.length<=Ee?(ue=ue+u(Ee-ue.length),be=be+ue,ue=""):(be=be+ue.slice(0,Ee),ue=ue.slice(Ee)):Ee<0&&(ue=u(Math.abs(Ee)-be.length)+be+ue,be="0"),ye||(ue=ue.slice(0,Ce),ue.length<Ce&&(ue=ue+u(Ce-ue.length)),be.length<at&&(be=u(at-be.length)+be));var Me="";if(le){Fe=be;for(var Oe;Fe.length;)Ie.length&&(Oe=Ie.shift()),Me&&(Me=ft+Me),Me=Fe.slice(-Oe)+Me,Fe=Fe.slice(0,-Oe)}else Me=be;return ue&&(Me=Me+vt+ue),Me}function p(V,z){return V.label.length>z.label.length?-1:V.label.length<z.label.length?1:0}function m(V,z){var G=[];return M(C(z),function(re){if(re.slice(0,15)==="_durationLabels"){var le=re.slice(15).toLowerCase();M(C(z[re]),function(Ie){Ie.slice(0,1)===V&&G.push({type:le,key:Ie,label:z[re][Ie]})})}}),G}function w(V,z,G){return z===1&&G===null?V:V+V}var y={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:w};function v(V){return Object.prototype.toString.call(V)==="[object Array]"}function x(V){return Object.prototype.toString.call(V)==="[object Object]"}function I(V,z){for(var G=V.length;G-=1;)if(z(V[G]))return V[G]}function O(V,z){var G=0,re=V&&V.length||0,le;for(typeof z!="function"&&(le=z,z=function(Ie){return Ie===le});G<re;){if(z(V[G]))return V[G];G+=1}}function M(V,z){var G=0,re=V.length;if(!(!V||!re))for(;G<re;){if(z(V[G],G)===!1)return;G+=1}}function P(V,z){var G=0,re=V.length,le=[];if(!V||!re)return le;for(;G<re;)le[G]=z(V[G],G),G+=1;return le}function S(V,z){return P(V,function(G){return G[z]})}function k(V){var z=[];return M(V,function(G){G&&z.push(G)}),z}function H(V){var z=[];return M(V,function(G){O(z,G)||z.push(G)}),z}function E(V,z){var G=[];return M(V,function(re){M(z,function(le){re===le&&G.push(re)})}),H(G)}function R(V,z){var G=[];return M(V,function(re,le){if(!z(re))return G=V.slice(le),!1}),G}function T(V,z){var G=V.slice().reverse();return R(G,z).reverse()}function D(V,z){for(var G in z)z.hasOwnProperty(G)&&(V[G]=z[G]);return V}function C(V){var z=[];for(var G in V)V.hasOwnProperty(G)&&z.push(G);return z}function J(V,z){var G=0,re=V.length;if(!V||!re)return!1;for(;G<re;){if(z(V[G],G)===!0)return!0;G+=1}return!1}function W(V){var z=[];return M(V,function(G){z=z.concat(G)}),z}function Z(){var V=0;try{V.toLocaleString("i")}catch(z){return z.name==="RangeError"}return!1}function ce(V){return V(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function te(V){var z=!0;return z=z&&V(1,"en",{minimumIntegerDigits:1})==="1",z=z&&V(1,"en",{minimumIntegerDigits:2})==="01",z=z&&V(1,"en",{minimumIntegerDigits:3})==="001",!(!z||(z=z&&V(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",z=z&&V(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",z=z&&V(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",z=z&&V(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!z)||(z=z&&V(99.99,"en",{maximumSignificantDigits:1})==="100",z=z&&V(99.99,"en",{maximumSignificantDigits:2})==="100",z=z&&V(99.99,"en",{maximumSignificantDigits:3})==="100",z=z&&V(99.99,"en",{maximumSignificantDigits:4})==="99.99",z=z&&V(99.99,"en",{maximumSignificantDigits:5})==="99.99",!z)||(z=z&&V(1e3,"en",{useGrouping:!0})==="1,000",z=z&&V(1e3,"en",{useGrouping:!1})==="1000",!z))}function q(){var V=[].slice.call(arguments),z={},G;if(M(V,function(ye,at){if(!at){if(!v(ye))throw"Expected array as the first argument to durationsFormat.";G=ye}if(typeof ye=="string"||typeof ye=="function"){z.template=ye;return}if(typeof ye=="number"){z.precision=ye;return}x(ye)&&D(z,ye)}),!G||!G.length)return[];z.returnMomentTypes=!0;var re=P(G,function(ye){return ye.format(z)}),le=E(l,H(S(W(re),"type"))),Ie=z.largest;return Ie&&(le=le.slice(0,Ie)),z.returnMomentTypes=!1,z.outputTypes=le,P(G,function(ye){return ye.format(z)})}function ge(){var V=[].slice.call(arguments),z=D({},this.format.defaults),G=this.asMilliseconds(),re=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,re=0);var le=G<0,Ie=n.duration(Math.abs(G),"milliseconds"),ye=n.duration(Math.abs(re),"months");M(V,function(B){if(typeof B=="string"||typeof B=="function"){z.template=B;return}if(typeof B=="number"){z.precision=B;return}x(B)&&D(z,B)});var at={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Ce={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};z.types=l;var ft=function(B){return O(l,function($e){return Ce[$e].test(B)})},vt=new RegExp(P(l,function(B){return Ce[B].source}).join("|"),"g");z.duration=this;var Be=typeof z.template=="function"?z.template.apply(z):z.template,ne=z.outputTypes,ie=z.returnMomentTypes,be=z.largest,ue=[];ne||(v(z.stopTrim)&&(z.stopTrim=z.stopTrim.join("")),z.stopTrim&&M(z.stopTrim.match(vt),function(B){var $e=ft(B);$e==="escape"||$e==="general"||ue.push($e)}));var ve=n.localeData();ve||(ve={}),M(C(y),function(B){if(typeof y[B]=="function"){ve[B]||(ve[B]=y[B]);return}ve["_"+B]||(ve["_"+B]=y[B])}),M(C(ve._durationTimeTemplates),function(B){Be=Be.replace("_"+B+"_",ve._durationTimeTemplates[B])});var Fe=z.userLocale||n.locale(),Ve=z.useLeftUnits,Je=z.usePlural,Se=z.precision,Ze=z.forceLength,Ee=z.useGrouping,Me=z.trunc,Oe=z.useSignificantDigits&&Se>0,ut=Oe?z.precision:0,Qe=ut,Ue=z.minValue,wt=!1,gt=z.maxValue,Tt=!1,Ot=z.useToLocaleString,an=z.groupingSeparator,qt=z.decimalSeparator,In=z.grouping;Ot=Ot&&(r||i);var Mt=z.trim;v(Mt)&&(Mt=Mt.join(" ")),Mt===null&&(be||gt||Oe)&&(Mt="all"),(Mt===null||Mt===!0||Mt==="left"||Mt==="right")&&(Mt="large"),Mt===!1&&(Mt="");var dt=function(B){return B.test(Mt)},En=/large/,mt=/small/,Zt=/both/,kn=/mid/,De=/^all|[^sm]all/,et=/final/,bt=be>0||J([En,Zt,De],dt),Tn=J([mt,Zt,De],dt),ln=J([kn,De],dt),sn=J([et,De],dt),On=P(Be.match(vt),function(B,$e){var Ne=ft(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ne!=="escape"&&Ne!=="general"&&ue.push(Ne)),{index:$e,length:B.length,text:"",token:Ne==="escape"?B.replace(Ce.escape,"$1"):B,type:Ne==="escape"||Ne==="general"?null:Ne}}),Yt={index:0,length:0,token:"",text:"",type:null},Jt=[];Ve&&On.reverse(),M(On,function(B){if(B.type){(Yt.type||Yt.text)&&Jt.push(Yt),Yt=B;return}Ve?Yt.text=B.token+Yt.text:Yt.text+=B.token}),(Yt.type||Yt.text)&&Jt.push(Yt),Ve&&Jt.reverse();var _e=E(l,H(k(S(Jt,"type"))));if(!_e.length)return S(Jt,"text").join("");_e=P(_e,function(B,$e){var Ne=$e+1===_e.length,Dt=!$e,Qt;B==="years"||B==="months"?Qt=ye.as(B):Qt=Ie.as(B);var dn=Math.floor(Qt),Sn=Qt-dn,bn=O(Jt,function($t){return B===$t.type});return Dt&>&&Qt>gt&&(Tt=!0),Ne&&Ue&&Math.abs(z.duration.as(B))<Ue&&(wt=!0),Dt&&Ze===null&&bn.length>1&&(Ze=!0),Ie.subtract(dn,B),ye.subtract(dn,B),{rawValue:Qt,wholeValue:dn,decimalValue:Ne?Sn:0,isSmallest:Ne,isLargest:Dt,type:B,tokenLength:bn.length}});var xt=Me?Math.floor:Math.round,Dn=function(B,$e){var Ne=Math.pow(10,$e);return xt(B*Ne)/Ne},Ht=!1,ht=!1,Cn=function(B,$e){var Ne={useGrouping:Ee,groupingSeparator:an,decimalSeparator:qt,grouping:In,useToLocaleString:Ot};return Oe&&(ut<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ne.maximumSignificantDigits=ut,B.significantDigits=ut)),Tt&&!ht&&(B.isLargest?(B.wholeValue=gt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),wt&&!ht&&(B.isSmallest?(B.wholeValue=Ue,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Se<0?B.value=Dn(B.wholeValue,Se):Se===0?B.value=xt(B.wholeValue+B.decimalValue):Oe?(Me?B.value=Dn(B.rawValue,ut-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ut-=B.wholeValue.toString().length)):(Ne.fractionDigits=Se,Me?B.value=B.wholeValue+Dn(B.decimalValue,Se):B.value=B.wholeValue+B.decimalValue):Oe&&B.wholeValue?(B.value=Math.round(Dn(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ut-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Ze||Ht)&&(Ne.minimumIntegerDigits=B.tokenLength,ht&&Ne.maximumSignificantDigits<B.tokenLength&&delete Ne.maximumSignificantDigits),!Ht&&(B.value>0||Mt===""||O(ue,B.type)||O(ne,B.type))&&(Ht=!0),B.formattedValue=f(B.value,Ne,Fe),Ne.useGrouping=!1,Ne.decimalSeparator=".",B.formattedValueEn=f(B.value,Ne,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=f(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(_e=P(_e,Cn),_e=k(_e),_e.length>1){var ur=function(B){return O(_e,function($e){return $e.type===B})},_n=function(B){var $e=ur(B.type);$e&&M(B.targets,function(Ne){var Dt=ur(Ne.type);Dt&&parseInt($e.formattedValueEn,10)===Ne.value&&($e.rawValue=0,$e.wholeValue=0,$e.decimalValue=0,Dt.rawValue+=1,Dt.wholeValue+=1,Dt.decimalValue=0,Dt.formattedValueEn=Dt.wholeValue.toString(),ht=!0)})};M(s,_n)}return ht&&(Ht=!1,ut=Qe,_e=P(_e,Cn),_e=k(_e)),ne&&!(Tt&&!z.trim)?(_e=P(_e,function(B){return O(ne,function($e){return B.type===$e})?B:null}),_e=k(_e)):(bt&&(_e=R(_e,function(B){return!B.isSmallest&&!B.wholeValue&&!O(ue,B.type)})),be&&_e.length&&(_e=_e.slice(0,be)),Tn&&_e.length>1&&(_e=T(_e,function(B){return!B.wholeValue&&!O(ue,B.type)&&!B.isLargest})),ln&&(_e=P(_e,function(B,$e){return $e>0&&$e<_e.length-1&&!B.wholeValue?null:B}),_e=k(_e)),sn&&_e.length===1&&!_e[0].wholeValue&&!(!Me&&_e[0].isSmallest&&_e[0].rawValue<Ue)&&(_e=[])),ie?_e:(M(Jt,function(B){var $e=at[B.type],Ne=O(_e,function($t){return $t.type===B.type});if(!(!$e||!Ne)){var Dt=Ne.formattedValueEn.split(".");Dt[0]=parseInt(Dt[0],10),Dt[1]?Dt[1]=parseFloat("0."+Dt[1],10):Dt[1]=null;var Qt=ve.durationPluralKey($e,Dt[0],Dt[1]),dn=m($e,ve),Sn=!1,bn={};M(ve._durationLabelTypes,function($t){var Mn=O(dn,function(Rn){return Rn.type===$t.type&&Rn.key===Qt});Mn&&(bn[Mn.type]=Mn.label,c(B.text,$t.string)&&(B.text=B.text.replace($t.string,Mn.label),Sn=!0))}),Je&&!Sn&&(dn.sort(p),M(dn,function($t){if(bn[$t.type]===$t.label)return c(B.text,$t.label)?!1:void 0;if(c(B.text,$t.label))return B.text=B.text.replace($t.label,bn[$t.type]),!1}))}}),Jt=P(Jt,function(B){if(!B.type)return B.text;var $e=O(_e,function(Dt){return Dt.type===B.type});if(!$e)return"";var Ne="";return Ve&&(Ne+=B.text),(le&&Tt||!le&&wt)&&(Ne+="< ",Tt=!1,wt=!1),(le&&wt||!le&&Tt)&&(Ne+="> ",Tt=!1,wt=!1),le&&($e.value>0||Mt===""||O(ue,$e.type)||O(ne,$e.type))&&(Ne+="-",le=!1),B.type==="milliseconds"&&$e.formattedValueMS?Ne+=$e.formattedValueMS:Ne+=$e.formattedValue,Ve||(Ne+=B.text),Ne}),Jt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var V=this.duration,z=function(le){return V._data[le]},G=O(this.types,z),re=I(this.types,z);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===re)return"d __";case"weeks":return G===re?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===re)return"M __";case"years":return G===re?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function fe(V){if(!V)throw"Moment Duration Format init cannot find moment instance.";V.duration.format=q,V.duration.fn.format=ge,V.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ae,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},V.updateLocale("en",y)}var he=function(V,z,G){return V.toLocaleString(z,G)};r=Z()&&te(he),o=r&&ce(he);var oe=function(V,z,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(z,G).format(V)};return i=te(oe),a=i&&ce(oe),fe(n),fe})})(Xl)),Xl.exports}z1();const L1=["true","t","yes","y","on","1"],A1=["false","f","no","n","off","0"];function Rt(e,t=""){return{kind:Y.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function To(e){return Object.hasOwn(e,"isError")&&e.isError}function F1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Ms(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function ql(e=!1){return e?{kind:Y.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Y.Loading,allowOverlay:!1,copyData:""}}function V1(e,t){const n=t?"faded":"normal";return{kind:Y.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Zl(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function Po(e,t){return Te(e)?t||{}:Te(t)?e||{}:md(e,t)}function Rs(e){if(Te(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:it(n)):[it(t)]}catch{return[it(e)]}}function Rh(e){return typeof e=="string"||e instanceof String?!0:(e instanceof $p&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function _1(e){return e?.startsWith("{")&&e.endsWith("}")}function it(e){try{try{return P1(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function Ih(e){if(Te(e))return null;if(typeof e=="boolean")return e;const t=it(e).toLowerCase().trim();if(t==="")return null;if(L1.includes(t))return!0;if(A1.includes(t))return!1}function wi(e){if(Te(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=si.unformat(e.trim());if(ot(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Eh(e){return Te(e)?"":it(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ka(e){if(Te(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return it(e)}}function $1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const t=e.toExponential().split("e");return Math.abs(parseInt(t[1],10))}function Gr(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function Ca(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Te(t)||t===""?ot(n)?(n===0&&(e=Math.round(e)),si(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):si(e).format({thousandSeparated:!1,mantissa:$1(e),trimMantissa:!0}):t==="plain"?si(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Gr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Gr(e,{style:"percent",minimumFractionDigits:ot(n)?Math.max(n-2,0):0,maximumFractionDigits:ot(n)?Math.max(n-2,0):2}):t==="dollar"?Gr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Gr(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Gr(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Gr(e,{notation:t}):t==="accounting"?si(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Gr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):Ag.sprintf(t,e)}function wu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,o=n==="time"?void 0:"medium",i=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:o,timeStyle:i}).format(e.toDate())}catch(a){if(a instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:o,timeStyle:i}).format(e.toDate());throw a}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function ea(e){if(Te(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Ur.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Ur.utc(e);if(n.isValid())return n.toDate();const r=Ur.utc(e,[Ur.HTML5_FMT.TIME_MS,Ur.HTML5_FMT.TIME_SECONDS,Ur.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Th(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function B1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,o=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*o)/n}const N1=new RegExp(/(\r\n|\n|\r)/gm);function xi(e){return e.indexOf(`
|
|
187
187
|
`)!==-1?e.replace(N1," "):e}function W1(e,t){if(Te(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const j1=Qn("div",{target:"en99xsi0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}}),""),Is=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?nl.parse(e):nl.parse(nl.stringify(e))}catch{n=void 0}return Te(n)?me.jsx(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:ka(e)??"",onChange:()=>{}}):me.jsx(j1,{"data-testid":"stJsonColumnViewer",children:me.jsx(hp,{src:n,collapsed:2,theme:fp(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})};d.memo(Is);const G1=e=>{const t=e.theme,n=e.value.data;return me.jsx(Is,{jsonValue:n.value||n.displayValue,theme:t})},U1=e=>{const t=e.theme,n=e.value;return me.jsx(Is,{jsonValue:n.data,theme:t})},K1={kind:Y.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return vs(e,r??ka(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:o}=t.data,i=o??ka(r)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:G1})},Oh="line_chart",X1="area_chart",Dh="bar_chart",q1=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Es(e,t,n,r){const o=Po({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),i=q1(r);let a;o.color==="auto"||o.color==="auto-inverse"?a=r.colors.greenColor:a=o.color?i.get(o.color)??o.color:void 0;const l={kind:Y.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:a,yAxis:[o.y_min??0,o.y_max??1]}};return{...t,kind:e,typeIcon:e===Oh?":material/show_chart:":e===Dh?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(s){if(Te(s))return ql();const c=Rs(s),u=[];let h=[];if(c.length===0)return ql();let g=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER;for(let y=0;y<c.length;y++){const v=wi(c[y]);if(Number.isNaN(v)||Te(v))return Rt(it(c),`The value cannot be interpreted as a numeric array. ${it(v)} is not a number.`);v>g&&(g=v),v<f&&(f=v),u.push(v)}let p,m;if(c.length===1){let y;g<=0?y=g===0?1:0:y=g,p=o.y_max??y,m=o.y_min??(g>=0?0:g)}else p=o.y_max??g,m=o.y_min??f;if(Te(m)||Te(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Rt("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);u.length>0&&(g>p||f<m)?h=u.map(y=>g-f===0?g>(p||1)?p:m:(p-m)*((y-f)/(g-f))+m):h=u;let w=a;return(o.color==="auto"&&h[0]>h[h.length-1]||o.color==="auto-inverse"&&h[0]<h[h.length-1])&&(w=r.colors.redColor),{...l,copyData:u.join(","),data:{...l.data,values:h,displayValues:u.map(y=>Ca(y)),yAxis:[m,p],color:w},isMissingValue:Te(s)}},getCellValue(s){return s.kind===Y.Loading||s.data?.values===void 0?null:s.data?.values}}}function Ph(e,t){return Es(Oh,e,"line",t)}Ph.isEditableType=!1;function Hh(e,t){return Es(Dh,e,"bar",t)}Hh.isEditableType=!1;function zh(e,t){return Es(X1,e,"area",t)}zh.isEditableType=!1;function Ts(e,t){const n={kind:Y.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(rn(t.radii.md),rn(t.radii.maxCheckbox)))},getCell(r){let o=null;return o=Ih(r),o===void 0?Rt(it(r),"The value cannot be interpreted as boolean."):{...n,data:o,isMissingValue:Te(o)}},getCellValue(r){return r.data===void 0?null:r.data}}}Ts.isEditableType=!0;function xu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function Os(e,t,n,r,o,i,a){const l=Po({format:n,step:r,timezone:a},t.columnTypeOptions);let s;if(ot(l.timezone))try{s=xu(dc(),l.timezone)?.utcOffset()||void 0}catch{}let c;ot(l.min_value)&&(c=ea(l.min_value)||void 0);let u;ot(l.max_value)&&(u=ea(l.max_value)||void 0);const h={kind:Y.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:l.step?.toString()||"1",format:o,min:c,max:u}},g=f=>{const p=ea(f);return p===null?!t.isRequired:!(p===void 0||ot(c)&&i(p)<i(c)||ot(u)&&i(p)>i(u))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(f,p){if(p===!0){const x=g(f);if(x===!1)return Rt(it(f),"Invalid input.");x instanceof Date&&(f=x)}const m=ea(f);let w="",y="",v=s;if(m===void 0)return Rt(it(f),"The value cannot be interpreted as a datetime object.");if(m!==null){let x=dc.utc(m);if(!x.isValid())return Rt(it(m),`Invalid moment date. This should never happen. Please report this bug.
|
|
188
188
|
Error: ${x.toString()}`);if(l.timezone){try{x=xu(x,l.timezone)}catch(I){return Rt(x.toISOString(),`Failed to adjust to the provided timezone: ${l.timezone}.
|
|
@@ -194,5 +194,5 @@ Error: ${i}`}const r={kind:Y.Text,data:"",displayData:"",allowOverlay:!0,content
|
|
|
194
194
|
40% { opacity: 1; }
|
|
195
195
|
`]))),ex=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return He({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},El=function(e){var t=e.delay,n=e.offset;return ze("span",{css:$s({animation:"".concat(Qw," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},tx=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=cr(e,Gw);return ze("div",Ae({},Ut(He(He({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ze(El,{delay:0,offset:n}),ze(El,{delay:160,offset:!0}),ze(El,{delay:320,offset:!n}))},nx=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return He({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},rx=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return ze("div",Ae({ref:o},Ut(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},ox=rx,ix=["data"],ax=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},lx=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return ze("div",Ae({},Ut(e,"group",{group:!0}),l),ze(i,Ae({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),ze("div",null,t))},sx=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return He({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},cx=function(e){var t=ef(e);t.data;var n=cr(t,ix);return ze("div",Ae({},Ut(e,"groupHeading",{"group-heading":!0}),n))},ux=lx,dx=["innerRef","isDisabled","isHidden","inputClassName"],hx=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return He(He({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},fx),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},uf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},fx={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":He({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},uf)},px=function(e){return He({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},uf)},gx=function(e){var t=e.cx,n=e.value,r=ef(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=cr(r,dx);return ze("div",Ae({},Ut(e,"input",{"input-container":!0}),{"data-value":n||""}),ze("input",Ae({className:t({input:!0},l),ref:o,style:px(a),disabled:i},s)))},mx=gx,vx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return He({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},bx=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return He({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},yx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return He({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},df=function(e){var t=e.children,n=e.innerProps;return ze("div",n,t)},wx=df,xx=df;function kx(e){var t=e.children,n=e.innerProps;return ze("div",Ae({role:"button"},n),t||ze(js,{size:14}))}var Cx=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return ze(s,{data:r,innerProps:He(He({},Ut(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},ze(c,{data:r,innerProps:He({},Ut(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),ze(u,{data:r,innerProps:He(He({},Ut(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},Sx=Cx,Mx=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return He({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},Rx=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return ze("div",Ae({},Ut(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Ix=Rx,Ex=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return He({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Tx=function(e){var t=e.children,n=e.innerProps;return ze("div",Ae({},Ut(e,"placeholder",{placeholder:!0}),n),t)},Ox=Tx,Dx=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return He({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Px=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return ze("div",Ae({},Ut(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},Hx=Px,Gs={ClearIndicator:Zw,Control:ox,DropdownIndicator:Xw,DownChevron:sf,CrossIcon:js,Group:ux,GroupHeading:cx,IndicatorsContainer:Ww,IndicatorSeparator:Jw,Input:mx,LoadingIndicator:tx,Menu:Tw,MenuList:Dw,MenuPortal:Fw,LoadingMessage:Lw,NoOptionsMessage:zw,MultiValue:Sx,MultiValueContainer:wx,MultiValueLabel:xx,MultiValueRemove:kx,Option:Ix,Placeholder:Ox,SelectContainer:_w,SingleValue:Hx,ValueContainer:Bw},zx=function(e){return He(He({},Gs),e.components)},$u=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Lx(e,t){return!!(e===t||$u(e)&&$u(t))}function Ax(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Lx(e[n],t[n]))return!1;return!0}function Fx(e,t){t===void 0&&(t=Ax);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var a=e.apply(this,o);return n={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){n=null},r}var Vx={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"},_x=function(e){return ze("span",Ae({css:Vx},e))},Bu=_x,$x={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=n===void 0?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(f,p){return f&&f.length?"".concat(f.indexOf(p)+1," of ").concat(f.length):""};if(t==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if(t==="menu"&&c){var h=l?" disabled":"",g="".concat(s?" selected":"").concat(h);return"".concat(i).concat(g,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Bx=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,s=e.id,c=e.isAppleDevice,u=l.ariaLiveMessages,h=l.getOptionLabel,g=l.inputValue,f=l.isMulti,p=l.isOptionDisabled,m=l.isSearchable,w=l.menuIsOpen,y=l.options,v=l.screenReaderStatus,x=l.tabSelectsValue,I=l.isLoading,O=l["aria-label"],M=l["aria-live"],P=d.useMemo(function(){return He(He({},$x),u||{})},[u]),S=d.useMemo(function(){var D="";if(t&&P.onChange){var C=t.option,J=t.options,W=t.removedValue,Z=t.removedValues,ce=t.value,te=function(oe){return Array.isArray(oe)?null:oe},q=W||C||te(ce),ge=q?h(q):"",ae=J||Z||void 0,fe=ae?ae.map(h):[],he=He({isDisabled:q&&p(q,a),label:ge,labels:fe},t);D=P.onChange(he)}return D},[t,P,p,a,h]),k=d.useMemo(function(){var D="",C=n||r,J=!!(n&&a&&a.includes(n));if(C&&P.onFocus){var W={focused:C,label:h(C),isDisabled:p(C,a),isSelected:J,options:o,context:C===n?"menu":"value",selectValue:a,isAppleDevice:c};D=P.onFocus(W)}return D},[n,r,h,p,P,o,a,c]),H=d.useMemo(function(){var D="";if(w&&y.length&&!I&&P.onFilter){var C=v({count:o.length});D=P.onFilter({inputValue:g,resultsMessage:C})}return D},[o,g,w,P,y,v,I]),E=t?.action==="initial-input-focus",R=d.useMemo(function(){var D="";if(P.guidance){var C=r?"value":w?"menu":"input";D=P.guidance({"aria-label":O,context:C,isDisabled:n&&p(n,a),isMulti:f,isSearchable:m,tabSelectsValue:x,isInitialFocus:E})}return D},[O,n,r,f,p,m,w,P,a,x,E]),T=ze(d.Fragment,null,ze("span",{id:"aria-selection"},S),ze("span",{id:"aria-focused"},k),ze("span",{id:"aria-results"},H),ze("span",{id:"aria-guidance"},R));return ze(d.Fragment,null,ze(Bu,{id:s},E&&T),ze(Bu,{"aria-live":M,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!E&&T))},Nx=Bx,ts=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Wx=new RegExp("["+ts.map(function(e){return e.letters}).join("")+"]","g"),hf={};for(var Tl=0;Tl<ts.length;Tl++)for(var Ol=ts[Tl],Dl=0;Dl<Ol.letters.length;Dl++)hf[Ol.letters[Dl]]=Ol.base;var ff=function(e){return e.replace(Wx,function(t){return hf[t]})},jx=Fx(ff),Nu=function(e){return e.replace(/^\s+|\s+$/g,"")},Gx=function(e){return"".concat(e.label," ").concat(e.value)},Ux=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=He({ignoreCase:!0,ignoreAccents:!0,stringify:Gx,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,s=r.matchFrom,c=l?Nu(n):n,u=l?Nu(a(t)):a(t);return o&&(c=c.toLowerCase(),u=u.toLowerCase()),i&&(c=jx(c),u=ff(u)),s==="start"?u.substr(0,c.length)===c:u.indexOf(c)>-1}},Kx=["innerRef"];function Xx(e){var t=e.innerRef,n=cr(e,Kx),r=xw(n,"onExited","in","enter","exit","appear");return ze("input",Ae({ref:t},r,{css:$s({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 qx=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Zx(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,a=d.useRef(!1),l=d.useRef(!1),s=d.useRef(0),c=d.useRef(null),u=d.useCallback(function(w,y){if(c.current!==null){var v=c.current,x=v.scrollTop,I=v.scrollHeight,O=v.clientHeight,M=c.current,P=y>0,S=I-O-x,k=!1;S>y&&a.current&&(r&&r(w),a.current=!1),P&&l.current&&(i&&i(w),l.current=!1),P&&y>S?(n&&!a.current&&n(w),M.scrollTop=I,k=!0,a.current=!0):!P&&-y>x&&(o&&!l.current&&o(w),M.scrollTop=0,k=!0,l.current=!0),k&&qx(w)}},[n,r,o,i]),h=d.useCallback(function(w){u(w,w.deltaY)},[u]),g=d.useCallback(function(w){s.current=w.changedTouches[0].clientY},[]),f=d.useCallback(function(w){var y=s.current-w.changedTouches[0].clientY;u(w,y)},[u]),p=d.useCallback(function(w){if(w){var y=bw?{passive:!1}:!1;w.addEventListener("wheel",h,y),w.addEventListener("touchstart",g,y),w.addEventListener("touchmove",f,y)}},[f,g,h]),m=d.useCallback(function(w){w&&(w.removeEventListener("wheel",h,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",f,!1))},[f,g,h]);return d.useEffect(function(){if(t){var w=c.current;return p(w),function(){m(w)}}},[t,p,m]),function(w){c.current=w}}var Wu=["boxSizing","height","overflow","paddingRight","position"],ju={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Gu(e){e.cancelable&&e.preventDefault()}function Uu(e){e.stopPropagation()}function Ku(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Xu(){return"ontouchstart"in window||navigator.maxTouchPoints}var qu=!!(typeof window<"u"&&window.document&&window.document.createElement),ai=0,wo={capture:!1,passive:!1};function Yx(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=d.useRef({}),i=d.useRef(null),a=d.useCallback(function(s){if(qu){var c=document.body,u=c&&c.style;if(r&&Wu.forEach(function(p){var m=u&&u[p];o.current[p]=m}),r&&ai<1){var h=parseInt(o.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,f=window.innerWidth-g+h||0;Object.keys(ju).forEach(function(p){var m=ju[p];u&&(u[p]=m)}),u&&(u.paddingRight="".concat(f,"px"))}c&&Xu()&&(c.addEventListener("touchmove",Gu,wo),s&&(s.addEventListener("touchstart",Ku,wo),s.addEventListener("touchmove",Uu,wo))),ai+=1}},[r]),l=d.useCallback(function(s){if(qu){var c=document.body,u=c&&c.style;ai=Math.max(ai-1,0),r&&ai<1&&Wu.forEach(function(h){var g=o.current[h];u&&(u[h]=g)}),c&&Xu()&&(c.removeEventListener("touchmove",Gu,wo),s&&(s.removeEventListener("touchstart",Ku,wo),s.removeEventListener("touchmove",Uu,wo)))}},[r]);return d.useEffect(function(){if(t){var s=i.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){i.current=s}}var Jx=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Qx={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ek(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,c=Zx({isEnabled:o,onBottomArrive:i,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),u=Yx({isEnabled:n}),h=function(g){c(g),u(g)};return ze(d.Fragment,null,n&&ze("div",{onClick:Jx,css:Qx}),t(h))}var tk={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},nk=function(e){var t=e.name,n=e.onFocus;return ze("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:tk,value:"",onChange:function(){}})},rk=nk;function Us(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ok(){return Us(/^iPhone/i)}function pf(){return Us(/^Mac/i)}function ik(){return Us(/^iPad/i)||pf()&&navigator.maxTouchPoints>1}function ak(){return ok()||ik()}function lk(){return pf()||ak()}var sk=function(e){return e.label},gf=function(e){return e.label},mf=function(e){return e.value},ck=function(e){return!!e.isDisabled},uk={clearIndicator:qw,container:Vw,control:nx,dropdownIndicator:Kw,group:ax,groupHeading:sx,indicatorsContainer:Nw,indicatorSeparator:Yw,input:hx,loadingIndicator:ex,loadingMessage:Hw,menu:Rw,menuList:Ow,menuPortal:Aw,multiValue:vx,multiValueLabel:bx,multiValueRemove:yx,noOptionsMessage:Pw,option:Mx,placeholder:Ex,singleValue:Dx,valueContainer:$w},dk={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%)"},hk=4,vf=4,fk=38,pk=vf*2,gk={baseUnit:vf,controlHeight:fk,menuGutter:pk},Pl={borderRadius:hk,colors:dk,spacing:gk},mk={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Vu(),captureMenuScroll:!Vu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Ux(),formatGroupLabel:sk,getOptionLabel:gf,getOptionValue:mf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ck,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!mw(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Zu(e,t,n,r){var o=wf(e,t,n),i=xf(e,t,n),a=yf(e,t),l=Ta(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:a,value:l,index:r}}function ua(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(a,l){return Zu(e,a,t,l)}).filter(function(a){return Ju(e,a)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Zu(e,n,t,r);return Ju(e,i)?i:void 0}).filter(yw)}function bf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Eo(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Yu(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Eo(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function vk(e,t){return bf(ua(e,t))}function Ju(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!Cf(e)||!i)&&kf(e,{label:a,value:l,data:o},r)}function bk(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o<t.length)return t[o]}return null}function yk(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Hl=function(e,t){var n,r=(n=e.find(function(o){return o.data===t}))===null||n===void 0?void 0:n.id;return r||null},yf=function(e,t){return e.getOptionLabel(t)},Ta=function(e,t){return e.getOptionValue(t)};function wf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function xf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ta(e,t);return n.some(function(o){return Ta(e,o)===r})}function kf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Cf=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},wk=1,Ks=(function(e){Ng(n,e);var t=Gg(n);function n(r){var o;if(Wg(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.controlRef=null,o.getControlRef=function(s){o.controlRef=s},o.focusedOptionRef=null,o.getFocusedOptionRef=function(s){o.focusedOptionRef=s},o.menuListRef=null,o.getMenuListRef=function(s){o.menuListRef=s},o.inputRef=null,o.getInputRef=function(s){o.inputRef=s},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(s,c){var u=o.props,h=u.onChange,g=u.name;c.name=g,o.ariaOnChange(s,c),h(s,c)},o.setValue=function(s,c,u){var h=o.props,g=h.closeMenuOnSelect,f=h.isMulti,p=h.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(o.setState({inputIsHiddenAfterUpdate:!f}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(s,{action:c,option:u})},o.selectOption=function(s){var c=o.props,u=c.blurInputOnSelect,h=c.isMulti,g=c.name,f=o.state.selectValue,p=h&&o.isOptionSelected(s,f),m=o.isOptionDisabled(s,f);if(p){var w=o.getOptionValue(s);o.setValue(f.filter(function(y){return o.getOptionValue(y)!==w}),"deselect-option",s)}else if(!m)h?o.setValue([].concat(Eo(f),[s]),"select-option",s):o.setValue(s,"select-option");else{o.ariaOnChange(s,{action:"select-option",option:s,name:g});return}u&&o.blurInput()},o.removeValue=function(s){var c=o.props.isMulti,u=o.state.selectValue,h=o.getOptionValue(s),g=u.filter(function(p){return o.getOptionValue(p)!==h}),f=ci(c,g,g[0]||null);o.onChange(f,{action:"remove-value",removedValue:s}),o.focusInput()},o.clearValue=function(){var s=o.state.selectValue;o.onChange(ci(o.props.isMulti,[],null),{action:"clear",removedValues:s})},o.popValue=function(){var s=o.props.isMulti,c=o.state.selectValue,u=c[c.length-1],h=c.slice(0,c.length-1),g=ci(s,h,h[0]||null);u&&o.onChange(g,{action:"pop-value",removedValue:u})},o.getFocusedOptionId=function(s){return Hl(o.state.focusableOptionsWithIds,s)},o.getFocusableOptionsWithIds=function(){return Yu(ua(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return dw.apply(void 0,[o.props.classNamePrefix].concat(c))},o.getOptionLabel=function(s){return yf(o.props,s)},o.getOptionValue=function(s){return Ta(o.props,s)},o.getStyles=function(s,c){var u=o.props.unstyled,h=uk[s](c,u);h.boxSizing="border-box";var g=o.props.styles[s];return g?g(h,c):h},o.getClassNames=function(s,c){var u,h;return(u=(h=o.props.classNames)[s])===null||u===void 0?void 0:u.call(h,c)},o.getElementId=function(s){return"".concat(o.state.instancePrefix,"-").concat(s)},o.getComponents=function(){return zx(o.props)},o.buildCategorizedOptions=function(){return ua(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return bf(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(s,c){o.setState({ariaSelection:He({value:s},c)})},o.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(s){o.blockOptionHover=!1},o.onControlMouseDown=function(s){if(!s.defaultPrevented){var c=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&o.onMenuClose():c&&o.openMenu("first"):(c&&(o.openAfterFocus=!0),o.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},o.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!o.props.isDisabled){var c=o.props,u=c.isMulti,h=c.menuIsOpen;o.focusInput(),h?(o.setState({inputIsHiddenAfterUpdate:!u}),o.onMenuClose()):o.openMenu("first"),s.preventDefault()}},o.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(o.clearValue(),s.preventDefault(),o.openAfterFocus=!1,s.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(s){typeof o.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Aa(s.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(s)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(s){var c=s.touches,u=c&&c.item(0);u&&(o.initialTouchX=u.clientX,o.initialTouchY=u.clientY,o.userIsDragging=!1)},o.onTouchMove=function(s){var c=s.touches,u=c&&c.item(0);if(u){var h=Math.abs(u.clientX-o.initialTouchX),g=Math.abs(u.clientY-o.initialTouchY),f=5;o.userIsDragging=h>f||g>f}},o.onTouchEnd=function(s){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(s.target)&&o.menuListRef&&!o.menuListRef.contains(s.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(s){o.userIsDragging||o.onControlMouseDown(s)},o.onClearIndicatorTouchEnd=function(s){o.userIsDragging||o.onClearIndicatorMouseDown(s)},o.onDropdownIndicatorTouchEnd=function(s){o.userIsDragging||o.onDropdownIndicatorMouseDown(s)},o.handleInputChange=function(s){var c=o.props.inputValue,u=s.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(u,{action:"input-change",prevInputValue:c}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(s){o.props.onFocus&&o.props.onFocus(s),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(s){var c=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(s),o.onInputChange("",{action:"input-blur",prevInputValue:c}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(s){if(!(o.blockOptionHover||o.state.focusedOption===s)){var c=o.getFocusableOptions(),u=c.indexOf(s);o.setState({focusedOption:s,focusedOptionId:u>-1?o.getFocusedOptionId(s):null})}},o.shouldHideSelectedOptions=function(){return Cf(o.props)},o.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),o.focus()},o.onKeyDown=function(s){var c=o.props,u=c.isMulti,h=c.backspaceRemovesValue,g=c.escapeClearsValue,f=c.inputValue,p=c.isClearable,m=c.isDisabled,w=c.menuIsOpen,y=c.onKeyDown,v=c.tabSelectsValue,x=c.openMenuOnFocus,I=o.state,O=I.focusedOption,M=I.focusedValue,P=I.selectValue;if(!m&&!(typeof y=="function"&&(y(s),s.defaultPrevented))){switch(o.blockOptionHover=!0,s.key){case"ArrowLeft":if(!u||f)return;o.focusValue("previous");break;case"ArrowRight":if(!u||f)return;o.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(M)o.removeValue(M);else{if(!h)return;u?o.popValue():p&&o.clearValue()}break;case"Tab":if(o.isComposing||s.shiftKey||!w||!v||!O||x&&o.isOptionSelected(O,P))return;o.selectOption(O);break;case"Enter":if(s.keyCode===229)break;if(w){if(!O||o.isComposing)return;o.selectOption(O);break}return;case"Escape":w?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:f}),o.onMenuClose()):p&&g&&o.clearValue();break;case" ":if(f)return;if(!w){o.openMenu("first");break}if(!O)return;o.selectOption(O);break;case"ArrowUp":w?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":w?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!w)return;o.focusOption("pageup");break;case"PageDown":if(!w)return;o.focusOption("pagedown");break;case"Home":if(!w)return;o.focusOption("first");break;case"End":if(!w)return;o.focusOption("last");break;default:return}s.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++wk),o.state.selectValue=Ia(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),a=o.buildFocusableOptions(),l=a.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=a[l],o.state.focusedOptionId=Hl(i,a[l])}return o}return jg(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&&Fu(this.menuListRef,this.focusedOptionRef),lk()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Fu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,i=this.state,a=i.selectValue,l=i.isFocused,s=this.buildFocusableOptions(),c=r==="first"?0:s.length-1;if(!this.props.isMulti){var u=s.indexOf(a[0]);u>-1&&(c=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var s=i.length-1,c=-1;if(i.length){switch(r){case"previous":l===0?c=0:l===-1?c=s:c=l-1;break;case"next":l>-1&&l<s&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:i[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,s=a.indexOf(i);i||(s=-1),r==="up"?l=s>0?s-1:a.length-1:r==="down"?l=(s+1)%a.length:r==="pageup"?(l=s-o,l<0&&(l=0)):r==="pagedown"?(l=s+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Pl):He(He({},Pl),this.props.theme):Pl})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,s=this.selectOption,c=this.setValue,u=this.props,h=u.isMulti,g=u.isRtl,f=u.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:h,isRtl:g,options:f,selectOption:s,selectProps:u,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,i=r.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(r,o){return wf(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return xf(this.props,r,o)}},{key:"filterOption",value:function(r,o){return kf(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:i,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var r=this.props,o=r.isDisabled,i=r.isSearchable,a=r.inputId,l=r.inputValue,s=r.tabIndex,c=r.form,u=r.menuIsOpen,h=r.required,g=this.getComponents(),f=g.Input,p=this.state,m=p.inputIsHidden,w=p.ariaSelection,y=this.commonProps,v=a||this.getElementId("input"),x=He(He(He({"aria-autocomplete":"list","aria-expanded":u,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?d.createElement(f,Ae({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:o,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:c,type:"text",value:l},x)):d.createElement(Xx,Ae({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ra,onFocus:this.onInputFocus,disabled:o,tabIndex:s,inputMode:"none",form:c,value:""},x))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,s=o.MultiValueRemove,c=o.SingleValue,u=o.Placeholder,h=this.commonProps,g=this.props,f=g.controlShouldRenderValue,p=g.isDisabled,m=g.isMulti,w=g.inputValue,y=g.placeholder,v=this.state,x=v.selectValue,I=v.focusedValue,O=v.isFocused;if(!this.hasValue()||!f)return w?null:d.createElement(u,Ae({},h,{key:"placeholder",isDisabled:p,isFocused:O,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return x.map(function(P,S){var k=P===I,H="".concat(r.getOptionLabel(P),"-").concat(r.getOptionValue(P));return d.createElement(i,Ae({},h,{components:{Container:a,Label:l,Remove:s},isFocused:k,isDisabled:p,key:H,index:S,removeProps:{onClick:function(){return r.removeValue(P)},onTouchEnd:function(){return r.removeValue(P)},onMouseDown:function(E){E.preventDefault()}},data:P}),r.formatOptionLabel(P,"value"))});if(w)return null;var M=x[0];return d.createElement(c,Ae({},h,{data:M,isDisabled:p}),this.formatOptionLabel(M,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||s)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:u,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!o||!s)return null;var u={"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,i=r.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused;return d.createElement(i,Ae({},a,{isDisabled:l,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:s,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,s=o.MenuList,c=o.MenuPortal,u=o.LoadingMessage,h=o.NoOptionsMessage,g=o.Option,f=this.commonProps,p=this.state.focusedOption,m=this.props,w=m.captureMenuScroll,y=m.inputValue,v=m.isLoading,x=m.loadingMessage,I=m.minMenuHeight,O=m.maxMenuHeight,M=m.menuIsOpen,P=m.menuPlacement,S=m.menuPosition,k=m.menuPortalTarget,H=m.menuShouldBlockScroll,E=m.menuShouldScrollIntoView,R=m.noOptionsMessage,T=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!M)return null;var C=function(q,ge){var ae=q.type,fe=q.data,he=q.isDisabled,oe=q.isSelected,V=q.label,z=q.value,G=p===fe,re=he?void 0:function(){return r.onOptionHover(fe)},le=he?void 0:function(){return r.selectOption(fe)},Ie="".concat(r.getElementId("option"),"-").concat(ge),ye={id:Ie,onClick:le,onMouseMove:re,onMouseOver:re,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:oe};return d.createElement(g,Ae({},f,{innerProps:ye,data:fe,isDisabled:he,isSelected:oe,key:Ie,label:V,type:ae,value:z,isFocused:G,innerRef:G?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(q.data,"menu"))},J;if(this.hasOptions())J=this.getCategorizedOptions().map(function(q){if(q.type==="group"){var ge=q.data,ae=q.options,fe=q.index,he="".concat(r.getElementId("group"),"-").concat(fe),oe="".concat(he,"-heading");return d.createElement(i,Ae({},f,{key:he,data:ge,options:ae,Heading:a,headingProps:{id:oe,data:q.data},label:r.formatGroupLabel(q.data)}),q.options.map(function(V){return C(V,"".concat(fe,"-").concat(V.index))}))}else if(q.type==="option")return C(q,"".concat(q.index))});else if(v){var W=x({inputValue:y});if(W===null)return null;J=d.createElement(u,f,W)}else{var Z=R({inputValue:y});if(Z===null)return null;J=d.createElement(h,f,Z)}var ce={minMenuHeight:I,maxMenuHeight:O,menuPlacement:P,menuPosition:S,menuShouldScrollIntoView:E},te=d.createElement(Iw,Ae({},f,ce),function(q){var ge=q.ref,ae=q.placerProps,fe=ae.placement,he=ae.maxHeight;return d.createElement(l,Ae({},f,ce,{innerRef:ge,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:fe}),d.createElement(ek,{captureEnabled:w,onTopArrive:T,onBottomArrive:D,lockEnabled:H},function(oe){return d.createElement(s,Ae({},f,{innerRef:function(V){r.getMenuListRef(V),oe(V)},innerProps:{role:"listbox","aria-multiselectable":f.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:he,focusedOption:p}),J)}))});return k||S==="fixed"?d.createElement(c,Ae({},f,{appendTo:k,controlElement:this.controlRef,menuPlacement:P,menuPosition:S}),te):te}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,s=o.name,c=o.required,u=this.state.selectValue;if(c&&!this.hasValue()&&!a)return d.createElement(rk,{name:s,onFocus:this.onValueInputFocus});if(!(!s||a))if(l)if(i){var h=u.map(function(p){return r.getOptionValue(p)}).join(i);return d.createElement("input",{name:s,type:"hidden",value:h})}else{var g=u.length>0?u.map(function(p,m){return d.createElement("input",{key:"i-".concat(m),name:s,type:"hidden",value:r.getOptionValue(p)})}):d.createElement("input",{name:s,type:"hidden",value:""});return d.createElement("div",null,g)}else{var f=u[0]?this.getOptionValue(u[0]):"";return d.createElement("input",{name:s,type:"hidden",value:f})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,s=o.isFocused,c=o.selectValue,u=this.getFocusableOptions();return d.createElement(Nx,Ae({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:s,selectValue:c,focusableOptions:u,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,s=this.props,c=s.className,u=s.id,h=s.isDisabled,g=s.menuIsOpen,f=this.state.isFocused,p=this.commonProps=this.getCommonProps();return d.createElement(a,Ae({},p,{className:c,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:f}),this.renderLiveRegion(),d.createElement(o,Ae({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:f,menuIsOpen:g}),d.createElement(l,Ae({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(i,Ae({},p,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,s=o.ariaSelection,c=o.isFocused,u=o.prevWasFocused,h=o.instancePrefix,g=r.options,f=r.value,p=r.menuIsOpen,m=r.inputValue,w=r.isMulti,y=Ia(f),v={};if(i&&(f!==i.value||g!==i.options||p!==i.menuIsOpen||m!==i.inputValue)){var x=p?vk(r,y):[],I=p?Yu(ua(r,y),"".concat(h,"-option")):[],O=a?bk(o,y):null,M=yk(o,x),P=Hl(I,M);v={selectValue:y,focusedOption:M,focusedOptionId:P,focusableOptionsWithIds:I,focusedValue:O,clearFocusValueOnUpdate:!1}}var S=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},k=s,H=c&&u;return c&&!H&&(k={value:ci(w,y,y[0]||null),options:y,action:"initial-input-focus"},H=!u),s?.action==="initial-input-focus"&&(k=null),He(He(He({},v),S),{},{prevProps:r,ariaSelection:k,prevWasFocused:H})}}]),n})(d.Component);Ks.defaultProps=mk;var xk=d.forwardRef(function(e,t){var n=Gh(e);return d.createElement(Ks,Ae({ref:t},n))}),Sf=xk;const kk=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},Ck=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Sk=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Mk=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Rk=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:o}=e,{allowedValues:i,value:a}=t.data,[l,s]=d.useState(a),[c,u]=d.useState(r??""),h=lh(),g=d.useMemo(()=>i.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:f?.toString()??""}:f),[i]);return t.readonly?d.createElement(Mk,null,d.createElement(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):d.createElement(Ck,null,d.createElement(Sf,{className:"glide-select",inputValue:c,onInputChange:u,menuPlacement:"auto",value:g.find(f=>f.value===l),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:p})=>({...f,fontSize:h.editorFontSize,fontFamily:h.fontFamily,cursor:p?"pointer":void 0,paddingLeft:h.cellHorizontalPadding,paddingRight:h.cellHorizontalPadding,":active":{...f[":active"],color:h.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:h.bgCell,neutral5:h.bgCell,neutral10:h.bgCell,neutral20:h.bgCellMedium,neutral30:h.bgCellMedium,neutral40:h.bgCellMedium,neutral50:h.textLight,neutral60:h.textMedium,neutral70:h.textMedium,neutral80:h.textDark,neutral90:h.textDark,neutral100:h.textDark,primary:h.accentColor,primary75:h.accentColor,primary50:h.accentColor,primary25:h.accentLight}}),menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>d.createElement(Sk,null,d.createElement(kk,{className:"click-outside-ignore",...f}))},options:g,onChange:async f=>{f!==null&&(s(f.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:f.value}}))}}))},Ik={kind:Y.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{value:i}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===i:s.value===i),l=typeof a=="string"?a:a?.label??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,o.x+r.cellHorizontalPadding,o.y+o.height/2+er(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Rk,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function Ek(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const o=parseFloat(r[1]),i=r[2],a=o*t;return e.replace(n,`${Number(a.toPrecision(3))}${i}`)}return e}const Tk={marginRight:8},Ok={display:"flex",alignItems:"center",flexGrow:1},Dk={kind:Y.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{min:i,max:a,value:l,label:s,measureLabel:c}=t.data,u=o.x+r.cellHorizontalPadding,h=o.y+o.height/2,g=a-i,f=(l-i)/g,p=`${Ek(r.baseFontStyle,.9)} ${r.fontFamily}`,m=bs(n,p)/2;n.save();let w=0;s!==void 0&&(n.font=p,w=Dr(c??s,n,p).width+r.cellHorizontalPadding);const y=o.width-r.cellHorizontalPadding*2-w;if(y>=m){const v=n.createLinearGradient(u,h,u+y,h);v.addColorStop(0,r.accentColor),v.addColorStop(f,r.accentColor),v.addColorStop(f,r.bgBubble),v.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=v,Du(n,u,h-m/2,y,m,m/2),n.fill(),n.beginPath(),Du(n,u+.5,h-m/2+.5,y-1,m-1,(m-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,o.x+o.width-r.cellHorizontalPadding,h+er(n,p))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),o=t.min.toString(),i=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return d.createElement("label",{style:Ok},d.createElement("input",{style:Tk,type:"range",value:r,min:o,max:i,step:a,onChange:l,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Pk=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),zl=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Hk=e=>{const t=e.value.data,{format:n,displayDate:r}=t,o=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,i=t.timezoneOffset?t.timezoneOffset*60*1e3:0,a=t.min instanceof Date?zl(n,t.min,i):t.min,l=t.max instanceof Date?zl(n,t.max,i):t.max,s=zl(n,t.date,i);return e.value.readonly?St.createElement(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):St.createElement(Pk,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:a,max:l,step:o,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-i)}})}})},zk={kind:Y.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return vs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Hk}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}};var Lk=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Qu=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),o=String(n.getOptionValue(t)).toLowerCase(),i=String(n.getOptionLabel(t)).toLowerCase();return o===r||i===r},Ll={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(o){return Qu(e,o,r)})||n.some(function(o){return Qu(e,o,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function Ak(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,i=e.formatCreateLabel,a=i===void 0?Ll.formatCreateLabel:i,l=e.isValidNewOption,s=l===void 0?Ll.isValidNewOption:l,c=e.getNewOptionData,u=c===void 0?Ll.getNewOptionData:c,h=e.onCreateOption,g=e.options,f=g===void 0?[]:g,p=e.onChange,m=cr(e,Lk),w=m.getOptionValue,y=w===void 0?mf:w,v=m.getOptionLabel,x=v===void 0?gf:v,I=m.inputValue,O=m.isLoading,M=m.isMulti,P=m.value,S=m.name,k=d.useMemo(function(){return s(I,Ia(P),f,{getOptionValue:y,getOptionLabel:x})?u(I,a(I)):void 0},[a,u,x,y,I,s,f,P]),H=d.useMemo(function(){return(n||!O)&&k?o==="first"?[k].concat(Eo(f)):[].concat(Eo(f),[k]):f},[n,o,O,k,f]),E=d.useCallback(function(R,T){if(T.action!=="select-option")return p(R,T);var D=Array.isArray(R)?R:[R];if(D[D.length-1]===k){if(h)h(I);else{var C=u(I,I),J={action:"create-option",name:S,option:C};p(ci(M,[].concat(Eo(Ia(P)),[C]),C),J)}return}p(R,T)},[u,I,M,S,k,h,p,P]);return He(He({},m),{},{options:H,onChange:E})}var Fk=d.forwardRef(function(e,t){var n=Gh(e),r=Ak(n);return d.createElement(Ks,Ae({ref:t},r))}),Vk=Fk;const Xs="__value",_k=new RegExp(`^${Xs}\\d+__`),$k=un("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),Bk=un("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),da=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),Mf=(e,t,n)=>e==null?[]:e.map((r,o)=>{const i=n?`${Xs}${o}__`:"",a=t.find(l=>l.value===r);return a?{...a,value:`${i}${a.value}`}:{value:`${i}${r}`,label:r}}),Nk=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},Wk=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:o,portalElementRef:i}=e,{options:a,values:l,allowCreation:s,allowDuplicates:c}=t.data,u=lh(),[h,g]=d.useState(l),[f,p]=d.useState(!0),[m,w]=d.useState(n??""),y=d.useMemo(()=>da(a??[]),[a]),v=s&&c&&y.length===0,x=d.useCallback(S=>{f&&S.stopPropagation()},[f]),I={control:(S,k)=>({...S,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:k.isDisabled?"auto":S.pointerEvents,cursor:k.isDisabled?"default":S.cursor}),valueContainer:S=>({...S,flexWrap:S.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:S=>({...S,backgroundColor:u.bgCell}),option:(S,k)=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...k.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{},":active":{...S[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(S,{isDisabled:k})=>k?{display:"none"}:{...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:S=>({...S,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(S,{data:k})=>({...S,backgroundColor:k.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(S,{data:k,isDisabled:H})=>({...S,paddingRight:H?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:k.color?Bl(k.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(S,{data:k,isDisabled:H,isFocused:E})=>H?{display:"none"}:{...S,color:k.color?Bl(k.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:E?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},O=d.useCallback(S=>{const k=S.map(H=>c&&H.startsWith(Xs)?H.replace(new RegExp(_k),""):H);g(k),r({...t,data:{...t.data,values:k}})},[t,r,c]),M=S=>{switch(S.key){case"Enter":case"Tab":if(!m){o(t,[0,1]);return}c&&s&&(w(""),O([...h??[],m]),p(!1),S.preventDefault())}},P=s?Vk:Sf;return d.createElement($k,{onKeyDown:x,"data-testid":"multi-select-cell"},d.createElement(P,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:w,options:y,placeholder:t.readonly?"":s?"Add...":void 0,noOptionsMessage:S=>s&&c&&S.inputValue?`Create "${S.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:f,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:Mf(h,y,c),onKeyDown:t.readonly?void 0:M,menuPlacement:"auto",menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:I,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:S=>v?null:d.createElement(Bk,null,d.createElement(Nk,{className:"click-outside-ignore",...S}))},onChange:async S=>{S!==null&&O(S.map(k=>k.value))}}))},jk={kind:Y.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o,highlighted:i}=e,{values:a,options:l}=t.data;if(a==null)return!0;const s=da(l??[]),c={x:o.x+r.cellHorizontalPadding,y:o.y+r.cellVerticalPadding,width:o.width-2*r.cellHorizontalPadding,height:o.height-2*r.cellVerticalPadding},u=Math.max(1,Math.floor(c.height/(r.bubbleHeight+r.bubblePadding)));let{x:h}=c,g=1,f=u===1?c.y+(c.height-r.bubbleHeight)/2:c.y+(c.height-u*r.bubbleHeight-(u-1)*r.bubblePadding)/2;for(const p of a){const m=s.find(I=>I.value===p),w=m?.color??(i?r.bgBubbleSelected:r.bgBubble),y=m?.label??p,v=Dr(y,n).width+r.bubblePadding*2,x=r.bubbleHeight/2;if(h!==c.x&&h+v>c.x+c.width&&g<u&&(g++,f+=r.bubbleHeight+r.bubblePadding,h=c.x),n.fillStyle=w,n.beginPath(),Jn(n,h,f,v,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Bl(w)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(y,h+r.bubblePadding,f+x+er(n,r)),h+=v+r.bubbleMargin,h>c.x+c.width+r.cellHorizontalPadding&&g>=u)break}return!0},measure:(e,t,n)=>{const{values:r,options:o}=t.data;if(!r)return n.cellHorizontalPadding*2;const i=Mf(r,da(o??[]),t.data.allowDuplicates).map(l=>l.label??l.value),a=i.reduce((l,s)=>e.measureText(s).width+l+n.bubblePadding*2+n.bubbleMargin,0);return i.length===0?n.cellHorizontalPadding*2:a+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:Wk,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,o)=>n.indexOf(r)===o)),!t.allowCreation){const r=da(t.options??[]);n=n.filter(o=>r.find(i=>i.value===o))}if(n.length!==0)return{...t,values:n}}},Gk="None";function ed(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Uk=e=>{const{cell:t,theme:n,ctx:r}=e;vs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Gk,t.contentAlign),r.fillStyle=n.textDark};function Kk(e){const t=d.useCallback((r,o)=>{const{cell:i,theme:a,ctx:l,rect:s}=r,c=r.col;if(To(i))ed(l,s,a);else if(Ms(i)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?o():Uk(r),u.isRequired&&u.isEditable&&ed(l,s,a);return}o()},[e]),n=d.useMemo(()=>[Ey,Ik,Dk,zk,jk,...ey],[]);return{drawCell:t,customRenderers:n}}function Xk(){const e=Yr();return d.useMemo(()=>{const t={editable:n=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${n.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:xo(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:xo(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:xo(e.colors.darkenedBgMix100,.9),bgHeaderHovered:xo(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(rn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:xo(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(rn(e.spacing.sm)),cellVerticalPadding:Math.round(rn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Wp(e.colors.secondaryBg,.1),bubbleHeight:Math.round(rn("1.25rem")),bubblePadding:Math.round(rn(e.spacing.sm)),bubbleMargin:Math.round(rn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(rn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(rn("25rem")),minColumnWidth:Math.round(rn("3.125rem")),maxColumnWidth:Math.round(rn("62.5rem")),maxColumnAutoWidth:Math.round(rn("31.25rem")),defaultRowHeight:Math.round(rn("2.1875rem")),defaultHeaderHeight:Math.round(rn("2.1875rem")),bgRowHovered:Np(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const qk=rs.getLogger("useDataEditor");function Zk(e,t,n,r,o,i,a,l,s){const c=d.useCallback(([m,w],y)=>{const v=e[m];if(!v.isEditable)return;const x=v.indexNumber,I=n.current.getOriginalRowIndex(o(w)),O=r([m,w]),M=v.getCellValue(O),P=v.getCellValue(y);if(!To(O)&&P===M)return;const S=v.getCell(P,!0);To(S)?qk.warn(`Not applying the cell edit since it causes this error:
|
|
196
196
|
${S.data}`):(n.current.setCell(x,I,{...S,lastUpdated:performance.now()}),l())},[e,n,o,r,l]),u=d.useCallback(()=>{if(t)return;const m=new Map;e.forEach(w=>{m.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(m),a()},[e,n,t,a]),h=d.useCallback(()=>{t||(u(),l())},[u,l,t]),g=d.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const w=m.rows.toArray().map(y=>n.current.getOriginalRowIndex(o(y)));return n.current.deleteRows(w),a(),s(),l(),!1}if(m.current?.range){const w=[],y=m.current.range;for(let v=y.y;v<y.y+y.height;v++)for(let x=y.x;x<y.x+y.width;x++){const I=e[x];I.isEditable&&!I.isRequired&&(w.push({cell:[x,v]}),c([x,v],I.getCell(null)))}return w.length>0&&(l(),i(w)),!1}return!0},[e,n,t,i,o,l,c,s,a]),f=d.useCallback((m,w)=>{const[y,v]=m,x=[];for(let I=0;I<w.length;I++){const O=w[I];if(I+v>=n.current.getNumRows()){if(t)break;u()}for(let M=0;M<O.length;M++){const P=O[M],S=I+v,k=M+y;if(k>=e.length)break;const H=e[k];if(H.isEditable){const E=H.getCell(P,!0);if(ot(E)&&!To(E)){const R=H.indexNumber,T=n.current.getOriginalRowIndex(o(S)),D=H.getCellValue(r([k,S]));H.getCellValue(E)!==D&&(n.current.setCell(R,T,{...E,lastUpdated:performance.now()}),x.push({cell:[k,S]}))}}}x.length>0&&(l(),i(x))}return!1},[e,n,t,o,r,u,l,i]),p=d.useCallback((m,w)=>{const y=m[0];if(y>=e.length)return!0;const v=e[y];if(v.validateInput){const x=v.validateInput(v.getCellValue(w));return x===!0||x===!1?x:v.getCell(x)}return!0},[e]);return{onCellEdited:c,onPaste:f,onRowAppended:h,onDelete:g,validateCell:p}}const Rf=",",ui='"',Yk='"',If=`
|
|
197
|
-
`,Jk="\uFEFF",Qk=new RegExp(`[${[Rf,ui,If].join("")}]`),td=rs.getLogger("useDataExporter");function nd(e){return e.map(t=>e2(t)).join(Rf)+If}function e2(e){if(Te(e))return"";const t=it(e);return Qk.test(t)?`${ui}${t.replace(new RegExp(ui,"g"),Yk+ui)}${ui}`:t}async function rd(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(Jk));const i=n.map(a=>a.name);await e.write(o.encode(nd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(nd(l)))}await e.close()}function t2(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await ns(()=>import("./es6--XPcqeHG-
|
|
197
|
+
`,Jk="\uFEFF",Qk=new RegExp(`[${[Rf,ui,If].join("")}]`),td=rs.getLogger("useDataExporter");function nd(e){return e.map(t=>e2(t)).join(Rf)+If}function e2(e){if(Te(e))return"";const t=it(e);return Qk.test(t)?`${ui}${t.replace(new RegExp(ui,"g"),Yk+ui)}${ui}`:t}async function rd(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(Jk));const i=n.map(a=>a.name);await e.write(o.encode(nd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(nd(l)))}await e.close()}function t2(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await ns(()=>import("./es6--XPcqeHG-r3GRWny2.js"),__vite__mapDeps([14,1,2])).then(a=>a.a)).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await rd(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{td.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let a="";const l=new WritableStream({write:h=>{a+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await rd(l.getWriter(),e,t,n);const s=new Blob([a],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),u=$g({enforceDownloadInNewTab:r,url:c,filename:o});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(a){td.error("Failed to export data as CSV",a)}}},[t,n,e,r])}}function n2(e,t,n,r){return{getCellContent:d.useCallback(([o,i])=>{if(o>t.length-1)return Rt("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Rt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,s=r.current.getOriginalRowIndex(i),c=r.current.isAddedRow(s);if(a.isEditable||c){const g=r.current.getCell(l,s);if(ot(g))return{...a.getCell(a.getCellValue(g),!1),lastUpdated:g.lastUpdated};if(c)return Rt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${s}`)}const u=e.getCell(s,l),h=jp(e,s,l);return uy(a,u,h,e.styler?.cssStyles)}catch(a){return Rt("Error during cell creation",`This error should never happen. Please report this bug.
|
|
198
198
|
Error: ${a}`)}},[t,n,e,r])}}function r2(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,i]=o.location;n(i)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function o2(e,t,n,r,o){const[i,a]=d.useState({columns:Ye.empty(),rows:Ye.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.MULTI_ROW)||e.selectionMode.includes(on.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(on.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN),h=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(on.SelectionMode.MULTI_CELL)),g=h&&e.selectionMode.includes(on.SelectionMode.MULTI_CELL),f=i.rows.length>0,p=i.columns.length>0,m=i.current!==void 0,w=d.useCallback(v=>{const x=!rl(v.rows.toArray(),i.rows.toArray()),I=!rl(v.columns.toArray(),i.columns.toArray()),O=!rl(v.current,i.current),M=l&&x||c&&I||h&&O;let P=v;if(I&&P.columns.length>=0){let S=P.columns;r.forEach((k,H)=>{k.isIndex&&(S=S.remove(H))}),S.length<P.columns.length&&(P={...P,columns:S})}a(P),M&&o(P,h)},[i,l,c,h,o,r]),y=d.useCallback((v=!1,x=!1)=>{const I={columns:x?i.columns:Ye.empty(),rows:v?i.rows:Ye.empty(),current:void 0};a(I),(!v&&l||!x&&c||h)&&o(I,h)},[i,l,c,h,o]);return{gridSelection:i,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isCellSelectionActivated:h,isMultiCellSelectionActivated:g,isRowSelected:f,isColumnSelected:p,isCellSelected:m,clearSelection:y,processSelectionChange:w}}function i2(e,t,n,r,o,i,a,l,s){const c=e.rowHeight??t.defaultRowHeight,u=t.defaultHeaderHeight+c+2*t.tableBorderWidth,h=r?2:1,g=e.editingMode===on.EditingMode.DYNAMIC?1:0,f=n+g;let p=Math.max(f*c+h*t.defaultHeaderHeight+2*t.tableBorderWidth,u),m=Math.min(p,t.defaultTableHeight);const w=hy(e,s);w&&(m=Math.max(w,u),p=Math.max(w,p)),i&&(m=Math.min(m,i),p=Math.min(p,i),w||(m=p));const y=t.minColumnWidth+2*t.tableBorderWidth,v=Math.max(o,y);let x,I=v;const O=Nh(e,l),M=Wh(e,l),P=dy(l);O?x=v:M?(x=Math.min(Math.max(M,y),v),I=Math.min(Math.max(M,I),v)):P&&(x=void 0);const[S,k]=d.useState({width:x||"100%",height:m});return d.useLayoutEffect(()=>{O&&S.width==="100%"&&k(H=>({...H,width:v}))},[v]),d.useLayoutEffect(()=>{k(H=>({...H,width:x||"100%"}))},[x]),d.useLayoutEffect(()=>{k(H=>({...H,height:m}))},[m,n]),d.useLayoutEffect(()=>{if(a){const H=O||ot(M)&&M>0;k({width:H?I:"100%",height:p})}else k({width:x||"100%",height:m})},[a]),{minHeight:u,maxHeight:p,minWidth:y,maxWidth:I,rowHeight:c,resizableSize:S,setResizableSize:k}}const a2=600,l2="⚠️ Please fill out this cell.";function s2(e,t,n=[]){const[r,o]=d.useState(),i=d.useRef(null),a=d.useCallback(s=>{if(clearTimeout(i.current),i.current=0,o(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const c=s.location[0],u=s.location[1];let h;if(c<0||c>=e.length||n.includes(u))return;const g=e[c];if(s.kind==="header"&&ot(g))h=g.help;else if(s.kind==="cell"){const f=t([c,u]);To(f)?h=f.errorDetails:g.isRequired&&g.isEditable&&Ms(f)?h=l2:F1(f)&&(h=f.tooltip)}h&&(i.current=setTimeout(()=>{h&&o({content:h,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},a2))}},[e,t,o,i,n]),l=d.useCallback(()=>{o(void 0)},[o]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}const Ef=Qn("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),Er=Qn("div",{target:"e1hnsd046"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}}),""),Tf=Qn("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),c2=Qn("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS}),""),u2=Qn("div",{target:"e1hnsd043"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"}),""),d2=Qn("div",{target:"e1hnsd042"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"}),""),h2=Qn("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),f2=Qn("button",{target:"e1hnsd040"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}}),""),od=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],p2={number:od,progress:od,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 g2({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:o,onCloseMenu:i,children:a}){const l=Yr(),{colors:s,fontSizes:c,radii:u,fontWeights:h}=l,g=p2[e]||[];return g.length===0?me.jsx(me.Fragment,{}):me.jsx(Oa,{triggerType:fd.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:me.jsx(Ef,{role:"menu",children:g.map(f=>me.jsxs(Er,{onClick:()=>{o(f.format),i()},role:"menuitem",children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:f.icon}),f.label]},f.format))}),placement:Da.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Pa(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:c.sm,fontWeight:h.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:a})}const m2=d.memo(g2);function v2({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:o,onCloseMenu:i,onSortColumn:a,onHideColumn:l,column:s,onChangeFormat:c,onAutosize:u}){const h=Yr(),[g,f]=d.useState(!1),{colors:p,fontSizes:m,radii:w,fontWeights:y}=h,{isCopied:v,copyToClipboard:x}=Ep();d.useEffect(()=>{function M(P){P.preventDefault()}return document.addEventListener("wheel",M,{passive:!1}),document.addEventListener("touchmove",M,{passive:!1}),()=>{document.removeEventListener("wheel",M),document.removeEventListener("touchmove",M)}},[]);const I=d.useCallback(()=>{i()},[i]),O=d.useCallback(()=>{x(s.title)},[s.title,x]);return me.jsx(Oa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:me.jsxs(Ef,{children:[me.jsxs(c2,{children:[me.jsx(u2,{title:s.kind,children:me.jsx(qn,{iconValue:s.typeIcon||":material/notes:",size:"base",color:"inherit"})}),me.jsxs(d2,{title:s.title,children:[me.jsx(h2,{children:s.title}),me.jsx(f2,{onClick:O,title:"Copy column name","aria-label":"Copy column name",children:me.jsx(qn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),a&&me.jsxs(me.Fragment,{children:[me.jsxs(Er,{onClick:()=>{a("asc"),I()},role:"menuitem",children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),me.jsxs(Er,{onClick:()=>{a("desc"),I()},role:"menuitem",children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),me.jsx(Tf,{})]}),c&&me.jsx(m2,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:c,onCloseMenu:I,children:me.jsxs(Er,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:g,hasSubmenu:!0,children:[me.jsxs("div",{children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),u&&me.jsxs(Er,{onClick:()=>{u(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&me.jsxs(Er,{onClick:()=>{o(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&me.jsxs(Er,{onClick:()=>{r(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),l&&me.jsxs(Er,{onClick:()=>{l(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Da.bottomRight,accessibilityType:pd.menu,showArrow:!1,popoverMargin:rn("0.375rem"),onClickOutside:g?void 0:I,onEsc:I,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${h.sizes.borderWidth} solid ${h.colors.borderColor}`,backgroundColor:Pa(h)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:y.normal,borderTopLeftRadius:w.default,borderTopRightRadius:w.default,borderBottomLeftRadius:w.default,borderBottomRightRadius:w.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:me.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const b2=d.memo(v2),y2="(index)";function Al(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const id=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const o=Yr();return me.jsx(Fg,{isIndeterminate:n,checked:t,onChange:i=>{r(i.target.checked)},"aria-label":e,checkmarkType:_g.default,labelPlacement:Vg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:o.spacing.none,marginTop:o.spacing.none,paddingLeft:o.spacing.md,paddingRight:o.spacing.md,paddingTop:o.spacing.twoXS,paddingBottom:o.spacing.twoXS,backgroundColor:i?o.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:a,$isIndeterminate:l})=>{const s=a||l?o.colors.primary:o.colors.fadedText40;return{outline:0,width:o.sizes.checkbox,height:o.sizes.checkbox,marginTop:o.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&(a||l)?`0 0 0 0.2rem ${xo(o.colors.primary,.5)}`:"",borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:o.lineHeights.small,paddingLeft:o.spacing.sm,position:"relative",color:o.colors.bodyText,fontSize:o.fontSizes.sm,fontWeight:o.fontWeights.normal}}},children:e})},w2=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:o,children:i,isOpen:a,onClose:l})=>{const s=Yr(),c=f=>!(f.isHidden===!0||Al(f,t)),u=e.every(c),h=e.some(c)&&!u,g=f=>{e.forEach(p=>{const m=Al(p,t);f?(o(p.id),m&&n(w=>[...w,p.id])):r(p.id)})};return me.jsx(Oa,{triggerType:fd.click,placement:Da.bottomRight,autoFocus:!0,focusLock:!0,content:()=>me.jsxs("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto"},children:[me.jsx(id,{label:"Select all",isIndeterminate:h,initialValue:u,onChange:f=>{g(f)}}),me.jsx(Tf,{}),me.jsx("div",{children:e.map(f=>{const p=Al(f,t);return me.jsx(id,{label:!f.title&&f.isIndex?y2:f.title,initialValue:!(f.isHidden===!0||p),onChange:m=>{m?(o(f.id),p&&n(w=>[...w,f.id])):r(f.id)}},f.id)})})]}),isOpen:a,onClickOutside:l,onClick:()=>a?l():void 0,onEsc:l,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Pa(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:me.jsx("div",{children:i})})},x2=d.memo(w2),ad=Qn("div",{target:"e1w7nams0"})(({theme:e,isInHorizontalLayout:t})=>({position:"relative",display:t?"flex":"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}),"");function k2({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=d.useState(!0),a=Yr(),{colors:l,fontSizes:s,radii:c,fontWeights:u}=a,h=d.useCallback(()=>{i(!1),r()},[r,i]);return me.jsx(Oa,{content:me.jsx(Tp,{"data-testid":"stDataFrameTooltipContent",children:me.jsx(Op,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Da.top,accessibilityType:pd.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:h,onEsc:h,overrides:{Body:{style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Pa(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:me.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const C2=d.memo(k2),ld=150,S2=15e4,M2="0.5rem";function R2({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i,customToolbarActions:a,widthConfig:l,heightConfig:s}){const{expanded:c,expand:u,collapse:h,width:g,height:f}=uc(Hg),{isInHorizontalLayout:p}=uc(Dp),m=d.useRef(null),w=d.useRef(null),y=d.useRef(null),v=Pp(),x=Xk(),{getRowThemeOverride:I,onItemHovered:O}=r2(x),{libConfig:{enforceDownloadInNewTab:M=!1}}=d.useContext(Hp),[P,S]=d.useState(!0),[k,H]=d.useState(!1),[E,R]=d.useState(!1),[T,D]=d.useState(!1),[C,J]=d.useState(),[W,Z]=d.useState(!1),ce=d.useCallback(()=>Z(we=>!we),[]),te=d.useCallback(()=>Z(!1),[]),q=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Te(e.editingMode)&&(e.editingMode=on.EditingMode.READ_ONLY);const{READ_ONLY:ge,DYNAMIC:ae}=on.EditingMode,fe=t.dimensions,he=Math.max(0,fe.numDataRows),oe=he===0&&!(e.editingMode===ae&&fe.numDataColumns>0),V=he>S2,z=!V&&!oe&&e.editingMode!==ae,G=!oe&&e.editingMode===ae&&!n,re=d.useRef(new na(he)),[le,Ie]=d.useState(re.current.getNumRows());d.useEffect(()=>{re.current=new na(he),Ie(re.current.getNumRows())},[he]);const ye=d.useCallback(()=>{re.current=new na(he),Ie(re.current.getNumRows())},[he]),[at,Ce]=d.useState(e.columnOrder);d.useEffect(()=>{Ce(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ft,allColumns:vt,setColumnConfigMapping:Be}=gy(e,t,n,at,l);d.useEffect(()=>{if(e.editingMode===ge||!r)return;const we=r.getStringValue({id:e.id,formId:e.formId});we&&(re.current.fromJson(we,ft),Ie(re.current.getNumRows()))},[]);const{getCellContent:ne}=n2(t,ft,le,re),{columns:ie,sortColumn:be,getOriginalIndex:ue,getCellContent:ve}=My(he,ft,ne),Fe=d.useCallback((we,zt)=>{if(!r)return;const Kt={selection:{rows:[],columns:[],cells:[]}};if(Kt.selection.rows=we.rows.toArray().map(jt=>ue(jt)),Kt.selection.columns=we.columns.toArray().map(jt=>Kr(ie[jt])),zt&&we.current){const{cell:jt,range:Gt}=we.current;if(Gt)for(let Pn=Gt.y;Pn<Gt.y+Gt.height;Pn++)for(let Hn=Gt.x;Hn<Gt.x+Gt.width;Hn++)ie[Hn].isIndex||Kt.selection.cells.push([ue(Pn),Kr(ie[Hn])]);else if(jt){const[Pn,Hn]=jt;ie[Pn].isIndex||Kt.selection.cells.push([ue(Hn),Kr(ie[Pn])])}}const $n=JSON.stringify(Kt),Xt=r.getStringValue({id:e.id,formId:e.formId});(Xt===void 0||Xt!==$n)&&r.setStringValue({id:e.id,formId:e.formId},$n,{fromUi:!0},i)},[ie,e.id,e.formId,r,i,ue]),{debouncedCallback:Ve}=bu(Fe,ld),{gridSelection:Je,isRowSelectionActivated:Se,isMultiRowSelectionActivated:Ze,isColumnSelectionActivated:Ee,isMultiColumnSelectionActivated:Me,isCellSelectionActivated:Oe,isMultiCellSelectionActivated:ut,isRowSelected:Qe,isColumnSelected:Ue,isCellSelected:wt,clearSelection:gt,processSelectionChange:Tt}=o2(e,oe,n,ie,Ve);d.useEffect(()=>{Oe||gt(!0,!0)},[c]);const Ot=d.useCallback(we=>{w.current?.updateCells(we)},[]);d.useEffect(()=>{if(!Se&&!Ee&&!Oe||!r)return;const we=r.getStringValue({id:e.id,formId:e.formId});if(we){const zt=ie.map(Gt=>Kr(Gt)),Kt=JSON.parse(we);let $n=Ye.empty(),Xt=Ye.empty(),jt;if(Kt.selection?.rows?.forEach(Gt=>{$n=$n.add(Gt)}),Kt.selection?.columns?.forEach(Gt=>{Xt=Xt.add(zt.indexOf(Gt))}),Oe&&!ut){const[Gt,Pn]=Kt.selection?.cells?.[0]??[];Gt!==void 0&&Pn!==void 0&&(jt=[zt.indexOf(Pn),Gt])}if($n.length>0||Xt.length>0||jt!==void 0){const Gt={rows:$n,columns:Xt,current:jt?{cell:jt,range:{x:jt[0],y:jt[1],width:1,height:1},rangeStack:[]}:void 0};Tt(Gt)}}},[]);const an=d.useCallback(()=>{le!==re.current.getNumRows()&&Ie(re.current.getNumRows())},[le]),qt=d.useCallback(()=>{if(!r)return;const we=re.current.toJson(ie);let zt=r.getStringValue({id:e.id,formId:e.formId});zt===void 0&&(zt=new na(0).toJson([])),we!==zt&&r.setStringValue({id:e.id,formId:e.formId},we,{fromUi:!0},i)},[ie,e.id,e.formId,r,i]),{debouncedCallback:In}=bu(qt,ld),{exportToCsv:Mt}=t2(ve,ie,le,M),{onCellEdited:dt,onPaste:En,onRowAppended:mt,onDelete:Zt,validateCell:kn}=Zk(ie,e.editingMode!==ae,re,ve,ue,Ot,an,In,gt),De=d.useMemo(()=>oe?[0]:G?[le]:[],[oe,G,le]),{tooltip:et,clearTooltip:bt,onItemHovered:Tn}=s2(ie,ve,De),{drawCell:ln,customRenderers:sn}=Kk(ie),{provideEditor:On}=Iy(),Yt=d.useCallback(we=>({...we,hasMenu:!oe}),[oe]),Jt=d.useMemo(()=>ie.map(we=>Yt(Zl(we))),[ie,Yt]),{columns:_e,onColumnResize:xt}=yy(Jt),Dn=t.dimensions.numHeaderRows>1,{minHeight:Ht,maxHeight:ht,minWidth:Cn,maxWidth:ur,rowHeight:_n,resizableSize:B,setResizableSize:$e}=i2(e,x,le,Dn,g||0,f,c,l,s),Ne=d.useCallback(([we,zt])=>({...V1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:x.glideTheme.textLight},span:[0,Math.max(ie.length-1,0)]}),[ie,x.glideTheme.textLight]),Dt=d.useCallback(()=>{ye(),gt()},[ye,gt]);Lg({element:e,widgetMgr:r,onFormCleared:Dt});const{pinColumn:Qt,unpinColumn:dn,freezeColumns:Sn}=vy(ie,oe,g||0,x.minColumnWidth,gt,Be),{changeColumnFormat:bn}=my(Be),{hideColumn:$t,showColumn:Mn}=Ry(gt,Be),{onColumnMoved:Rn}=by(ie,Sn,Qt,dn,Ce);return d.useEffect(()=>{let we;const zt=requestAnimationFrame(()=>{we=setTimeout(()=>{if(y.current&&w.current){const Kt=y.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Kt&&(R(Kt.height>y.current.clientHeight),D(Kt.width>y.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(zt),we&&clearTimeout(we)}},[B,le,_e]),d.useEffect(()=>{vt.length==ie.length&&Z(!1)},[vt.length,ie.length]),me.jsxs(ad,{className:"stDataFrame","data-testid":"stDataFrame",ref:y,isInHorizontalLayout:p,onPointerDown:we=>{if(y.current){const zt=y.current.getBoundingClientRect(),Kt=(v||Math.round(rn(M2)))+1;T&&zt.height-Kt<we.clientY-zt.top&&we.stopPropagation(),E&&zt.width-Kt<we.clientX-zt.left&&we.stopPropagation()}},onBlur:we=>{!P&&!q&&!we.currentTarget.contains(we.relatedTarget)&&!Oe&>(!0,!0)},children:[me.jsxs(zg,{isFullScreen:c,disableFullscreenMode:o,locked:Qe&&!Se||wt||q&&P||W,onExpand:u,onCollapse:h,target:ad,children:[a?.map(we=>we),(Se&&Qe||Ee&&Ue||Oe&&wt)&&me.jsx(yo,{label:"Clear selection",icon:Bg,onClick:()=>{gt(),bt()}}),G&&Qe&&me.jsx(yo,{label:"Delete row(s)",icon:Ug,onClick:()=>{Zt&&(Zt(Je),bt())}}),G&&!Qe&&me.jsx(yo,{label:"Add row",icon:Cd,onClick:()=>{mt&&(S(!0),mt(),bt(),w.current?.scrollTo(0,le,"vertical"))}}),!oe&&vt.length>ie.length&&me.jsx(x2,{columns:vt,columnOrder:at,setColumnOrder:Ce,hideColumn:$t,showColumn:Mn,isOpen:W,onClose:te,children:me.jsx(yo,{label:"Show/hide columns",icon:Md,onClick:ce})}),!V&&!oe&&me.jsx(yo,{label:"Download as CSV",icon:Kg,onClick:Mt}),!oe&&me.jsx(yo,{label:"Search",icon:Sd,onClick:()=>{k?H(!1):(S(!0),H(!0)),bt()}})]}),me.jsx(zp,{"data-testid":"stDataFrameResizable",ref:m,defaultSize:B,style:{border:`${x.tableBorderWidth}px solid ${x.glideTheme.borderColor}`,borderRadius:`${x.tableBorderRadius}`},minHeight:Ht,maxHeight:ht,minWidth:Cn,maxWidth:p?void 0:ur,size:B,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!p,bottomLeft:!1,topLeft:!1},grid:[1,_n],snapGap:_n/3,onResizeStop:(we,zt,Kt,$n)=>{if(m.current){const Xt=2*x.tableBorderWidth;$e({width:m.current.size.width,height:ht-m.current.size.height===Xt?m.current.size.height+Xt:m.current.size.height})}},children:me.jsx(O1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:w,columns:_e,rows:oe?1:le,minColumnWidth:x.minColumnWidth,maxColumnWidth:x.maxColumnWidth,maxColumnAutoWidth:x.maxColumnAutoWidth,rowHeight:_n,headerHeight:x.defaultHeaderHeight,getCellContent:oe?Ne:ve,onColumnResize:q?void 0:xt,resizeIndicator:"header",freezeColumns:Sn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:q?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Ee?void 0:Rn,onItemHovered:we=>{O?.(we),Tn?.(we)},keybindings:{downFill:!0,...Oe||V?{selectAll:!1}:{}},onKeyDown:we=>{(we.ctrlKey||we.metaKey)&&we.key==="f"&&(H(zt=>!zt),we.stopPropagation(),we.preventDefault())},showSearch:k,searchResults:k?void 0:[],onSearchClose:()=>{H(!1),bt()},onHeaderClicked:(we,zt)=>{!z||Ee||(k&&H(!1),Se&&Qe?gt():gt(!0,!0),be(we,"auto"))},gridSelection:Je,onGridSelectionChange:we=>{(P||q)&&(Tt(we),et!==void 0&&bt(),J(void 0),Z(!1))},theme:x.glideTheme,getRowThemeOverride:I,onMouseMove:we=>{we.kind==="out-of-bounds"&&P?S(!1):we.kind!=="out-of-bounds"&&!P&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:T?-v:void 0,paddingRight:E?-v:void 0},provideEditor:On,drawCell:ln,customRenderers:sn,imageEditorOverride:Q1,headerIcons:x.headerIcons,validateCell:kn,onHeaderMenuClick:(we,zt)=>{W||J({columnIdx:we,headerBounds:zt})},onPaste:!1,...Se&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:x.glideTheme.bgHeader,bgCellMedium:x.glideTheme.bgHeader,textMedium:x.glideTheme.textLight}},rowSelectionMode:Ze?"multi":"auto",rowSelect:n?"none":Ze?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...Ee&&{columnSelect:n?"none":Me?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Me?"multi":"auto",rangeSelectionBlending:"additive"},...Oe&&{rangeSelect:ut?"rect":"cell",rangeSelectionBlending:"additive"},...!oe&&e.editingMode!==ge&&!n&&{fillHandle:!q,onCellEdited:dt,onPaste:En,onDelete:Zt},...!oe&&e.editingMode===ae&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:x.glideTheme.bgHeader,bgCellMedium:x.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:mt,onHeaderClicked:void 0}})}),et?.content&&me.jsx(C2,{top:et.top,left:et.left,content:et.content,clearTooltip:bt}),C&&gd.createPortal(me.jsx(b2,{top:C.headerBounds.y+C.headerBounds.height,left:C.headerBounds.x+C.headerBounds.width,column:ft[C.columnIdx],onCloseMenu:()=>J(void 0),onSortColumn:z?we=>{k&&H(!1),gt(!(Se&&Qe),!0),be(C.columnIdx,we,!0)}:void 0,isColumnPinned:ft[C.columnIdx].isPinned,onUnpinColumn:()=>{dn(ft[C.columnIdx].id)},onPinColumn:()=>{Qt(ft[C.columnIdx].id)},onHideColumn:()=>{$t(ft[C.columnIdx].id)},onChangeFormat:we=>{bn(ft[C.columnIdx].id,we),setTimeout(()=>{w.current?.remeasureColumns(Ye.fromSingleSelection(C.columnIdx))},100)},onAutosize:()=>{w.current?.remeasureColumns(Ye.fromSingleSelection(C.columnIdx))}}),document.querySelector("#portal"))]})}const I2=Pg(R2),Of=d.memo(I2),E2=({data:e,height:t,customToolbarActions:n})=>me.jsx(Of,{element:new on({useContainerWidth:!0,editingMode:on.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:n,widthConfig:new cc.WidthConfig({useStretch:!0}),heightConfig:t?new cc.HeightConfig({pixelHeight:t}):void 0}),$2=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:E2,default:Of},Symbol.toStringTag,{value:"Module"}));export{ko as B,Mo as F,ah as H,E2 as T,Qg as a,un as h,$2 as i,P0 as s,ub as z};
|