@stlite/desktop 0.90.12 → 0.90.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/assets/{ErrorOutline.esm-CGVP5MR5.js → ErrorOutline.esm-CJGMKtXr.js} +1 -1
- package/build/assets/{FileDownload.esm-DRw0GU4W.js → FileDownload.esm-DVbGfwz7.js} +1 -1
- package/build/assets/{FileHelper-DPutc5L1.js → FileHelper-BAjDG49X.js} +1 -1
- package/build/assets/{FormClearHelper-CNtDBzvU.js → FormClearHelper-CaLJK07N.js} +1 -1
- package/build/assets/{Hooks-DEqVt10P.js → Hooks-D54IehuR.js} +1 -1
- package/build/assets/{InputInstructions-CYN5pWtc.js → InputInstructions-BLplNLW9.js} +1 -1
- package/build/assets/{Particles-BFhdwScH.js → Particles-VYhfVp_p.js} +1 -1
- package/build/assets/{ProgressBar-BxIGBDpX.js → ProgressBar-DX8k7XSZ.js} +1 -1
- package/build/assets/{Toolbar-DZSYfgER.js → Toolbar-BbbydoLD.js} +1 -1
- package/build/assets/{base-input-CDtHdiX2.js → base-input-d4WKPeU6.js} +1 -1
- package/build/assets/{checkbox-BWPUCDzk.js → checkbox-DUA9ewQT.js} +1 -1
- package/build/assets/{createSuper-DRBibar_.js → createSuper-CoIMxZYP.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-d9lrfvrX.js → data-grid-overlay-editor-cvHWuOOd.js} +1 -1
- package/build/assets/{downloader-CadyDzLl.js → downloader-CR6bzPv-.js} +1 -1
- package/build/assets/{es6-DXJfyb4B.js → es6-BCBcAdQS.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-BHAHPBQS.js → iframeResizer.contentWindow-CEqjsNrn.js} +1 -1
- package/build/assets/{index-CehLOm7L.js → index-B3GOsGpL.js} +1 -1
- package/build/assets/{index-FcCBykqI.js → index-B58bWjQH.js} +1 -1
- package/build/assets/{index-wWX1T45-.js → index-B7yzG-4X.js} +5 -5
- package/build/assets/{index-CrjEhyMB.js → index-BD2ZweM9.js} +1 -1
- package/build/assets/{index-i0_Oh-Dl.js → index-BGUuVZft.js} +1 -1
- package/build/assets/{index-CrJrTvHb.js → index-BJK2Ym_S.js} +1 -1
- package/build/assets/{index-sq5xGN6c.js → index-BMSSeqlt.js} +1 -1
- package/build/assets/{index-C-z83jR8.js → index-BRiK5gVx.js} +1 -1
- package/build/assets/{index-cja8oZxE.js → index-BdVfRySM.js} +1 -1
- package/build/assets/{index-CdQSBtKU.js → index-Bhgfj5y5.js} +1 -1
- package/build/assets/{index-BayeI3Y8.js → index-Bwfh73dd.js} +1 -1
- package/build/assets/{index-CzHgae1d.js → index-C91sP-jG.js} +1 -1
- package/build/assets/{index-Y5GMER81.js → index-CD0SY35r.js} +1 -1
- package/build/assets/{index-xRpExM0P.js → index-CHBxMYoz.js} +1 -1
- package/build/assets/{index--6Tmibu-.js → index-CIRTE79j.js} +1 -1
- package/build/assets/{index-C5CelRVp.js → index-CJWk1YT9.js} +1 -1
- package/build/assets/{index-CDOZLgUW.js → index-CTZrIDfL.js} +1 -1
- package/build/assets/{index-S2M1jZve.js → index-CdAXvPf5.js} +1 -1
- package/build/assets/{index-C5Vs7DkV.js → index-CeNNLDtJ.js} +1 -1
- package/build/assets/{index-DKFOxClg.js → index-CwPp5UqK.js} +1 -1
- package/build/assets/{index-B4-tzIvm.js → index-D9P3ZYiC.js} +1 -1
- package/build/assets/{index-C0h1sWt9.js → index-DCv3Ovf7.js} +1 -1
- package/build/assets/{index-BphPDeJU.js → index-DOiS7VE9.js} +1 -1
- package/build/assets/{index-DpCruM_r.js → index-D_4iXBI5.js} +1 -1
- package/build/assets/{index-rCaYGFp-.js → index-DoQHaClc.js} +1 -1
- package/build/assets/{index-aw1dvFXB.js → index-Dynm-1sH.js} +1 -1
- package/build/assets/{index-D_h3I9YJ.js → index-HqlJZ3Ag.js} +1 -1
- package/build/assets/{index-6pmK9B6A.js → index-NigQ67t-.js} +1 -1
- package/build/assets/{index-BdtyI7rR.js → index-PHqcnj3c.js} +1 -1
- package/build/assets/{index-H4N5vz5u.js → index-VVwti7cA.js} +1 -1
- package/build/assets/{index-BAYa9u17.js → index-XsxWL5x-.js} +1 -1
- package/build/assets/{index-Pi0boTQ1.js → index-gb2ePejP.js} +1 -1
- package/build/assets/{index-BbEq8Tl6.js → index-j6pFDYKO.js} +1 -1
- package/build/assets/{index-CFC41peg.js → index-mHvUvPYI.js} +1 -1
- package/build/assets/{index-CR1sLAOp.js → index-vLb3c1eZ.js} +1 -1
- package/build/assets/{index-CZdeBPWU.js → index-wUVGuFfU.js} +1 -1
- package/build/assets/{index-cuFX1NrA.js → index-wnKDraWU.js} +4 -4
- package/build/assets/{inherits-uBK3kmcZ.js → inherits-xHSaJdUZ.js} +1 -1
- package/build/assets/{input-1w6Mjo5w.js → input-PliHooUw.js} +1 -1
- package/build/assets/{memory-C-EiHSeQ.js → memory-BJMhKXeY.js} +1 -1
- package/build/assets/{number-overlay-editor-CPu7tgwQ.js → number-overlay-editor-DRf5xgI3.js} +1 -1
- package/build/assets/{sandbox-Dgl94q2K.js → sandbox-DBdCCxaG.js} +1 -1
- package/build/assets/{slicedToArray-BxUjdsw4.js → slicedToArray-Cuk3tbTR.js} +1 -1
- package/build/assets/{timepicker-YeO3C7Qg.js → timepicker-DjzHzJAt.js} +1 -1
- package/build/assets/{uniqueId-Dp_tGnBE.js → uniqueId-ikSpJ9AP.js} +1 -1
- package/build/assets/{useBasicWidgetState-DD4anr8V.js → useBasicWidgetState-raTjAqZP.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-DwrFHugV.js → useTextInputAutoExpand-Uac3U0I_.js} +1 -1
- package/build/assets/{useUpdateUiValue-B6SPuk_P.js → useUpdateUiValue-BbEmiOZQ.js} +1 -1
- package/build/assets/{withFullScreenWrapper-Db_tqc32.js → withFullScreenWrapper-C7u7nPsK.js} +1 -1
- package/build/index.html +1 -1
- package/package.json +4 -4
- 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{r as d,E as Zs,_ as ze,ca as Qh,a3 as vr,bG as es,b1 as xo,b2 as eg,cb as tg,cc as ng,cd as nd,ce as rd,al as Bt,cf as rg,cg as id,ch as ig,ci as og,cj as ag,ck as sg,cl as lg,cm as ug,a9 as Dr,be as Js,a2 as cg,cn as dg,k as Pe,b4 as od,n as st,co as ao,bu as Xr,cp as fg,c7 as ts,j as me,s as tr,cq as hg,cr as gg,aE as an,aT as pg,cs as eu,ct as mg,cu as vg,cv as bg,bx as wg,cw as yg,cx as Cg,cy as ad,cz as Sg,cA as xg,cB as Ls,cC as sd,cD as ld,cE as kg,cF as Mg,cG as Rg,cH as Eg,cI as Ig,cJ as Tg,cK as Dg,cL as Og,cM as Pg,cN as ud,cO as _g,cP as Lg,cQ as Fg,cR as Ag,cS as Hg,aR as zg,aS as Vg,cT as $g,cU as Ng,aQ as Bg,cV as Wg,cW as Ug,cX as jg,aP as qg,u as Qr,cY as sn,x as Qs,cZ as Gg,bO as so,c_ as lr,c$ as Yg,d0 as Xg,d1 as Kg,d2 as Zg,d3 as Jg,d4 as Qg,d5 as ra,d6 as Gi,d7 as Ht,d8 as ep,d9 as tp,da as np,db as rp,dc as qr,dd as It,de as bn,df as tu,dg as nu,dh as ca,di as ip,dj as cd,dk as dd,dl as op,dm as Fs,dn as ap,dp as sp,dq as fd,dr as lp,ds as ru,dt as up,du as hd,dv as cp,dw as dp,aA as fp,a8 as gd,c4 as Oi,dx as hp,t as ki,dy as gp,dz as pp,aV as ns,bK as Ea,bM as Ia,dA as pd,h as Ta,y as Zn,dB as mp,bN as md,dC as vp,f as bp,J as iu,dD as wp,dE as yp,L as Cp,dF as Sp,dG as ou}from"./index-cuFX1NrA.js";import{w as xp,E as kp}from"./withFullScreenWrapper-Db_tqc32.js";import{T as Mp,a as Si}from"./Toolbar-DZSYfgER.js";import{u as Rp}from"./FormClearHelper-CNtDBzvU.js";import{s as Ep}from"./sprintf-DpPCfzXw.js";import{S as Ip,L as Tp,a as Dp}from"./checkbox-BWPUCDzk.js";import{c as Op}from"./createDownloadLinkElement-ZaXNnPK4.js";import{_ as gr,C as Pp}from"./slicedToArray-BxUjdsw4.js";import{b as _p,d as Lp,c as Fp}from"./inherits-uBK3kmcZ.js";import{_ as Ap}from"./createSuper-DRBibar_.js";import{D as Hp,F as zp}from"./FileDownload.esm-DRw0GU4W.js";var vd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Zs,ze({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"}))});vd.displayName="Add";var bd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Zs,ze({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"}))});bd.displayName="Search";var wd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Zs,ze({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"}))});wd.displayName="Visibility";var rs,au;function Vp(){if(au)return rs;au=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return rs=n,rs}var is,su;function $p(){if(su)return is;su=1;var e=Vp(),t=Qh();function n(r,i){return r!=null&&t(r,i,e)}return is=n,is}var Np=$p();const Bp=vr(Np);function yd(e="This should not happen"){throw new Error(e)}function Vn(e,t="Assertion failed"){if(!e)return yd(t)}function po(e,t){return yd(t??"Hell froze over")}function Wp(e,t){try{return e()}catch{return t}}const lu=Object.prototype.hasOwnProperty;function _i(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--&&_i(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(lu.call(e,n)&&++r&&!lu.call(t,n)||!(n in t)||!_i(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const da=null,el=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var uu;(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"})(uu||(uu={}));var fa;(function(e){e.Triangle="triangle",e.Dots="dots"})(fa||(fa={}));function Bo(e){return"width"in e&&typeof e.width=="number"}async function cu(e){return typeof e=="object"?e:await e()}function Mi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Ii(e){return e.kind===qn.Marker||e.kind===qn.NewRow}function Ri(e){if(!Mi(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:po(e,"A cell was passed with an invalid kind")}}function Up(e){return Bp(e,"editor")}function tl(e){return!(e.readonly??!1)}var qn;(function(e){e.NewRow="new-row",e.Marker="marker"})(qn||(qn={}));const ha={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function os(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let du;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(os(t));static empty=()=>du??(du=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=os(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=os([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new Qe(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var jp=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},fu=jp,qp=e=>e.toUpperCase()===e,Gp=e=>t=>e.indexOf(t)===-1,Cd=(e,t)=>{const n={};return Object.keys(e).filter(Gp(t)).forEach(r=>{n[r]=e[r]}),n};function Yp(e,t,n){const r=Cd(t,n);if(!e){const i=typeof es=="function"?{default:es}:es;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Xp=(e,t)=>{};function Kp(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!qp(a[0])):n.propsAsIs,c=Yp(u,o,["as","class"]);c.ref=s,c.className=n.atomic?fu(n.class,c.className||l):fu(c.className||l,n.class);const{vars:f}=n;if(f){const g={};for(const m in f){const w=f[m],b=w[0],v=w[1]||"",C=typeof b=="function"?b(o):b;Xp(C,n.name),g[`--${m}`]=`${C}${v}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,d.createElement(e,c)):d.createElement(a,c)},i=d.forwardRef?d.forwardRef(r):(o=>{const s=Cd(o,["innerRef"]);return r(s,o.innerRef)});return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var fn=Kp;const Zp=fn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var as={},Yi={},Wo={},Uo={},hu;function Jp(){return hu||(hu=1,(function(e){(function(t,n){n(e,xo(),eg())})(Uo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var E in I)Object.prototype.hasOwnProperty.call(I,E)&&(v[E]=I[E])}return v};function l(v,C){var I={};for(var E in v)C.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(v,E)&&(I[E]=v[E]);return I}function u(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var c=(function(){function v(C,I){for(var E=0;E<I.length;E++){var R=I[E];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(C,R.key,R)}}return function(C,I,E){return I&&v(C.prototype,I),E&&v(C,E),C}})();function f(v,C){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:v}function g(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);v.prototype=Object.create(C&&C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(v,C):v.__proto__=C)}var h=!1;function p(v){h=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 h?v:v.capture}function w(v){if("touches"in v){var C=v.touches[0],I=C.pageX,E=C.pageY;return{x:I,y:E}}var R=v.screenX,P=v.screenY;return{x:R,y:P}}var b=(function(v){g(C,v);function C(){var I;u(this,C);for(var E=arguments.length,R=Array(E),P=0;P<E;P++)R[P]=arguments[P];var x=f(this,(I=C.__proto__||Object.getPrototypeOf(C)).call.apply(I,[this].concat(R)));return x._handleSwipeStart=x._handleSwipeStart.bind(x),x._handleSwipeMove=x._handleSwipeMove.bind(x),x._handleSwipeEnd=x._handleSwipeEnd.bind(x),x._onMouseDown=x._onMouseDown.bind(x),x._onMouseMove=x._onMouseMove.bind(x),x._onMouseUp=x._onMouseUp.bind(x),x._setSwiperRef=x._setSwiperRef.bind(x),x}return c(C,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(E){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(E))}},{key:"_onMouseMove",value:function(E){this.mouseDown&&this._handleSwipeMove(E)}},{key:"_onMouseUp",value:function(E){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(E)}},{key:"_handleSwipeStart",value:function(E){var R=w(E),P=R.x,x=R.y;this.moveStart={x:P,y:x},this.props.onSwipeStart(E)}},{key:"_handleSwipeMove",value:function(E){if(this.moveStart){var R=w(E),P=R.x,x=R.y,S=P-this.moveStart.x,L=x-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:S,y:L},E);D&&E.cancelable&&E.preventDefault(),this.movePosition={deltaX:S,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(E){this.props.onSwipeEnd(E);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,E):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,E),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,E):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,E)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(E){this.swiper=E,this.props.innerRef(E)}},{key:"render",value:function(){var E=this.props;E.tagName;var R=E.className,P=E.style,x=E.children;E.allowMouseEvents,E.onSwipeUp,E.onSwipeDown,E.onSwipeLeft,E.onSwipeRight,E.onSwipeStart,E.onSwipeMove,E.onSwipeEnd,E.innerRef,E.tolerance;var S=l(E,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},S),x)}}]),C})(n.Component);b.displayName="ReactSwipe",b.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},b.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=b})})(Uo)),Uo}var gu;function Sd(){return gu||(gu=1,(function(e){(function(t,n){n(e,Jp())})(Wo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})})(Wo)),Wo}var Xi={},pu;function xd(){if(pu)return Xi;pu=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=t(tg());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xi.default=r,Xi}var Ki={},Zi={},mu;function Qp(){if(mu)return Zi;mu=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Zi.outerWidth=e,Zi}var Ji={},vu;function nl(){if(vu)return Ji;vu=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Ji.default=e,Ji}var Qi={},bu;function kd(){if(bu)return Qi;bu=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.default=void 0;var e=function(){return window};return Qi.default=e,Qi}var wu;function Md(){if(wu)return Ki;wu=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=l(xo()),t=s(xd()),n=Qp(),r=s(nl()),i=s(Sd()),o=s(kd());function s(x){return x&&x.__esModule?x:{default:x}}function a(){if(typeof WeakMap!="function")return null;var x=new WeakMap;return a=function(){return x},x}function l(x){if(x&&x.__esModule)return x;if(x===null||u(x)!=="object"&&typeof x!="function")return{default:x};var S=a();if(S&&S.has(x))return S.get(x);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in x)if(Object.prototype.hasOwnProperty.call(x,M)){var T=D?Object.getOwnPropertyDescriptor(x,M):null;T&&(T.get||T.set)?Object.defineProperty(L,M,T):L[M]=x[M]}return L.default=x,S&&S.set(x,L),L}function u(x){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(x)}function c(){return c=Object.assign||function(x){for(var S=1;S<arguments.length;S++){var L=arguments[S];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(x[D]=L[D])}return x},c.apply(this,arguments)}function f(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function g(x,S){for(var L=0;L<S.length;L++){var D=S[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(x,D.key,D)}}function h(x,S,L){return S&&g(x.prototype,S),x}function p(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(S&&S.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),S&&m(x,S)}function m(x,S){return m=Object.setPrototypeOf||function(D,M){return D.__proto__=M,D},m(x,S)}function w(x){var S=C();return function(){var D=I(x),M;if(S){var T=I(this).constructor;M=Reflect.construct(D,arguments,T)}else M=D.apply(this,arguments);return b(this,M)}}function b(x,S){return S&&(u(S)==="object"||typeof S=="function")?S:v(x)}function v(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function C(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(x){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},I(x)}function E(x,S,L){return S in x?Object.defineProperty(x,S,{value:L,enumerable:!0,configurable:!0,writable:!0}):x[S]=L,x}var R=function(S){return S.hasOwnProperty("key")},P=(function(x){p(L,x);var S=w(L);function L(D){var M;return f(this,L),M=S.call(this,D),E(v(M),"itemsWrapperRef",void 0),E(v(M),"itemsListRef",void 0),E(v(M),"thumbsRef",void 0),E(v(M),"setItemsWrapperRef",function(T){M.itemsWrapperRef=T}),E(v(M),"setItemsListRef",function(T){M.itemsListRef=T}),E(v(M),"setThumbsRef",function(T,O){M.thumbsRef||(M.thumbsRef=[]),M.thumbsRef[O]=T}),E(v(M),"updateSizes",function(){if(!(!M.props.children||!M.itemsWrapperRef||!M.thumbsRef)){var T=e.Children.count(M.props.children),O=M.itemsWrapperRef.clientWidth,k=M.props.thumbWidth?M.props.thumbWidth:(0,n.outerWidth)(M.thumbsRef[0]),N=Math.floor(O/k),q=N<T,Y=q?T-N:0;M.setState(function(ue,ee){return{itemSize:k,visibleItems:N,firstItem:q?M.getFirstItem(ee.selectedItem):0,lastPosition:Y,showArrows:q}})}}),E(v(M),"handleClickItem",function(T,O,k){if(!R(k)||k.key==="Enter"){var N=M.props.onSelectItem;typeof N=="function"&&N(T,O)}}),E(v(M),"onSwipeStart",function(){M.setState({swiping:!0})}),E(v(M),"onSwipeEnd",function(){M.setState({swiping:!1})}),E(v(M),"onSwipeMove",function(T){var O=T.x;if(!M.state.itemSize||!M.itemsWrapperRef||!M.state.visibleItems)return!1;var k=0,N=e.Children.count(M.props.children),q=-(M.state.firstItem*100)/M.state.visibleItems,Y=Math.max(N-M.state.visibleItems,0),ue=-Y*100/M.state.visibleItems;q===k&&O>0&&(O=0),q===ue&&O<0&&(O=0);var ee=M.itemsWrapperRef.clientWidth,te=q+100/(ee/O);return M.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ce){M.itemsListRef.style[ce]=(0,r.default)(te,"%",M.props.axis)}),!0}),E(v(M),"slideRight",function(T){M.moveTo(M.state.firstItem-(typeof T=="number"?T:1))}),E(v(M),"slideLeft",function(T){M.moveTo(M.state.firstItem+(typeof T=="number"?T:1))}),E(v(M),"moveTo",function(T){T=T<0?0:T,T=T>=M.state.lastPosition?M.state.lastPosition:T,M.setState({firstItem:T})}),M.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},M}return h(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(M){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==M.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(M){var T=M;return M>=this.state.lastPosition&&(T=this.state.lastPosition),M<this.state.firstItem+this.state.visibleItems&&(T=this.state.firstItem),M<this.state.firstItem&&(T=M),T}},{key:"renderItems",value:function(){var M=this;return this.props.children.map(function(T,O){var k=t.default.ITEM(!1,O===M.state.selectedItem),N={key:O,ref:function(Y){return M.setThumbsRef(Y,O)},className:k,onClick:M.handleClickItem.bind(M,O,M.props.children[O]),onKeyDown:M.handleClickItem.bind(M,O,M.props.children[O]),"aria-label":"".concat(M.props.labels.item," ").concat(O+1),style:{width:M.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),T)})}},{key:"render",value:function(){var M=this;if(!this.props.children)return null;var T=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},q=-this.state.firstItem*(this.state.itemSize||0),Y=(0,r.default)(q,"px",this.props.axis),ue=this.props.transitionTime+"ms";return N={WebkitTransform:Y,MozTransform:Y,MsTransform:Y,OTransform:Y,transform:Y,msTransform:Y,WebkitTransitionDuration:ue,MozTransitionDuration:ue,MsTransitionDuration:ue,OTransitionDuration:ue,transitionDuration:ue,msTransitionDuration:ue},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return M.slideRight()},"aria-label":this.props.labels.leftArrow}),T?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(te){return M.setItemsListRef(te)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return M.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L})(e.Component);return Ki.default=P,E(P,"displayName","Thumbs"),E(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Ki}var eo={},yu;function em(){if(yu)return eo;yu=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.default=void 0;var e=function(){return document};return eo.default=e,eo}var zn={},Cu;function Rd(){if(Cu)return zn;Cu=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.setPosition=zn.getPosition=zn.isKeyboardEvent=zn.defaultStatusFormatter=zn.noop=void 0;var e=xo(),t=n(nl());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};zn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};zn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};zn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var f=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=f-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};zn.getPosition=s;var a=function(u,c){var f={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){f[g]=(0,t.default)(u,"%",c)}),f};return zn.setPosition=a,zn}var Kn={},Su;function tm(){if(Su)return Kn;Su=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.fadeAnimationHandler=Kn.slideStopSwipingHandler=Kn.slideSwipeAnimationHandler=Kn.slideAnimationHandler=void 0;var e=xo(),t=r(nl()),n=Rd();function r(f){return f&&f.__esModule?f:{default:f}}function i(f,g){var h=Object.keys(f);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(f);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(f,m).enumerable})),h.push.apply(h,p)}return h}function o(f){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){s(f,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(f,p,Object.getOwnPropertyDescriptor(h,p))})}return f}function s(f,g,h){return g in f?Object.defineProperty(f,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[g]=h,f}var a=function(g,h){var p={},m=h.selectedItem,w=m,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(m<0||m>b);if(v)return w<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):w>b&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var C=(0,n.getPosition)(m,g),I=(0,t.default)(C,"%",g.axis),E=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:I,msTransform:I,OTransform:I,transform:I},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:E,MozTransitionDuration:E,OTransitionDuration:E,transitionDuration:E,msTransitionDuration:E})),p};Kn.slideAnimationHandler=a;var l=function(g,h,p,m){var w={},b=h.axis==="horizontal",v=e.Children.count(h.children),C=0,I=(0,n.getPosition)(p.selectedItem,h),E=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,P=R;I===C&&R>0&&(P=0),I===E&&R<0&&(P=0);var x=I+100/(p.itemSize/P),S=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&S&&(p.selectedItem===0&&x>-100?x-=v*100:p.selectedItem===v-1&&x<-v*100&&(x+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||S||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),w.itemListStyle=(0,n.setPosition)(x,h.axis)),S&&!p.cancelClick&&m({cancelClick:!0}),w};Kn.slideSwipeAnimationHandler=l;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Kn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",w={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(w=o(o({},w),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:w,selectedStyle:o(o({},w),{},{opacity:1,position:"relative"}),prevStyle:o({},w)}};return Kn.fadeAnimationHandler=c,Kn}var xu;function nm(){if(xu)return Yi;xu=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=c(xo()),t=l(Sd()),n=l(xd()),r=l(Md()),i=l(em()),o=l(kd()),s=Rd(),a=tm();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||f(D)!=="object"&&typeof D!="function")return{default:D};var M=u();if(M&&M.has(D))return M.get(D);var T={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var N=O?Object.getOwnPropertyDescriptor(D,k):null;N&&(N.get||N.set)?Object.defineProperty(T,k,N):T[k]=D[k]}return T.default=D,M&&M.set(D,T),T}function f(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(T){return typeof T}:f=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},f(D)}function g(){return g=Object.assign||function(D){for(var M=1;M<arguments.length;M++){var T=arguments[M];for(var O in T)Object.prototype.hasOwnProperty.call(T,O)&&(D[O]=T[O])}return D},g.apply(this,arguments)}function h(D,M){var T=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);M&&(O=O.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),T.push.apply(T,O)}return T}function p(D){for(var M=1;M<arguments.length;M++){var T=arguments[M]!=null?arguments[M]:{};M%2?h(Object(T),!0).forEach(function(O){S(D,O,T[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(T,O))})}return D}function m(D,M){if(!(D instanceof M))throw new TypeError("Cannot call a class as a function")}function w(D,M){for(var T=0;T<M.length;T++){var O=M[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function b(D,M,T){return M&&w(D.prototype,M),D}function v(D,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(M&&M.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),M&&C(D,M)}function C(D,M){return C=Object.setPrototypeOf||function(O,k){return O.__proto__=k,O},C(D,M)}function I(D){var M=P();return function(){var O=x(D),k;if(M){var N=x(this).constructor;k=Reflect.construct(O,arguments,N)}else k=O.apply(this,arguments);return E(this,k)}}function E(D,M){return M&&(f(M)==="object"||typeof M=="function")?M:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function 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 x(D){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},x(D)}function S(D,M,T){return M in D?Object.defineProperty(D,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):D[M]=T,D}var L=(function(D){v(T,D);var M=I(T);function T(O){var k;m(this,T),k=M.call(this,O),S(R(k),"thumbsRef",void 0),S(R(k),"carouselWrapperRef",void 0),S(R(k),"listRef",void 0),S(R(k),"itemsRef",void 0),S(R(k),"timer",void 0),S(R(k),"animationHandler",void 0),S(R(k),"setThumbsRef",function(q){k.thumbsRef=q}),S(R(k),"setCarouselWrapperRef",function(q){k.carouselWrapperRef=q}),S(R(k),"setListRef",function(q){k.listRef=q}),S(R(k),"setItemsRef",function(q,Y){k.itemsRef||(k.itemsRef=[]),k.itemsRef[Y]=q}),S(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),S(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),S(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),S(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),S(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),S(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),S(R(k),"navigateWithKeyboard",function(q){if(k.isFocusWithinTheCarousel()){var Y=k.props.axis,ue=Y==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},te=ue?ee.ArrowRight:ee.ArrowDown,ce=ue?ee.ArrowLeft:ee.ArrowUp;te===q.keyCode?k.increment():ce===q.keyCode&&k.decrement()}}),S(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var q=k.props.axis==="horizontal",Y=k.itemsRef[0];if(Y){var ue=q?Y.clientWidth:Y.clientHeight;k.setState({itemSize:ue}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),S(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),S(R(k),"handleClickItem",function(q,Y){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(q,Y),q!==k.state.selectedItem&&k.setState({selectedItem:q})}}),S(R(k),"handleOnChange",function(q,Y){e.Children.count(k.props.children)<=1||k.props.onChange(q,Y)}),S(R(k),"handleClickThumb",function(q,Y){k.props.onClickThumb(q,Y),k.moveTo(q)}),S(R(k),"onSwipeStart",function(q){k.setState({swiping:!0}),k.props.onSwipeStart(q)}),S(R(k),"onSwipeEnd",function(q){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(q),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),S(R(k),"onSwipeMove",function(q,Y){k.props.onSwipeMove(Y);var ue=k.props.swipeAnimationHandler(q,k.props,k.state,k.setState.bind(R(k)));return k.setState(p({},ue)),!!Object.keys(ue).length}),S(R(k),"decrement",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof q=="number"?q:1))}),S(R(k),"increment",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof q=="number"?q:1))}),S(R(k),"moveTo",function(q){if(typeof q=="number"){var Y=e.Children.count(k.props.children)-1;q<0&&(q=k.props.infiniteLoop?Y:0),q>Y&&(q=k.props.infiniteLoop?0:Y),k.selectItem({selectedItem:q}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),S(R(k),"onClickNext",function(){k.increment(1)}),S(R(k),"onClickPrev",function(){k.decrement(1)}),S(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"changeItem",function(q){return function(Y){(!(0,s.isKeyboardEvent)(Y)||Y.key==="Enter")&&k.moveTo(q)}}),S(R(k),"selectItem",function(q){k.setState(p({previousItem:k.state.selectedItem},q),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(q.selectedItem,e.Children.toArray(k.props.children)[q.selectedItem])}),S(R(k),"getInitialImage",function(){var q=k.props.selectedItem,Y=k.itemsRef&&k.itemsRef[q],ue=Y&&Y.getElementsByTagName("img")||[];return ue[0]}),S(R(k),"getVariableItemHeight",function(q){var Y=k.itemsRef&&k.itemsRef[q];if(k.state.hasMount&&Y&&Y.children.length){var ue=Y.children[0].getElementsByTagName("img")||[];if(ue.length>0){var ee=ue[0];if(!ee.complete){var te=function he(){k.forceUpdate(),ee.removeEventListener("load",he)};ee.addEventListener("load",te)}}var ce=ue[0]||Y.children[0],le=ce.clientHeight;return le>0?le:null}return null});var N={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,k.state=p(p({},N),k.animationHandler(O,N)),k}return b(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,N){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var N=k.getInitialImage();N&&!N.complete?N.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var N=this;return this.props.children?e.Children.map(this.props.children,function(q,Y){var ue=Y===N.state.selectedItem,ee=Y===N.state.previousItem,te=ue&&N.state.selectedStyle||ee&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(te=p(p({},te),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(te=p(p({},te),{},{pointerEvents:"none"}));var ce={ref:function(he){return N.setItemsRef(he,Y)},key:"itemKey"+Y+(k?"clone":""),className:n.default.ITEM(!0,Y===N.state.selectedItem,Y===N.state.previousItem),onClick:N.handleClickItem.bind(N,Y,q),style:te};return e.default.createElement("li",ce,N.props.renderItem(q,{isSelected:Y===N.state.selectedItem,isPrevious:Y===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,N=this.props,q=N.showIndicators,Y=N.labels,ue=N.renderIndicator,ee=N.children;return q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(te,ce){return ue&&ue(k.changeItem(ce),ce===k.state.selectedItem,ce,Y.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,q=this.props.axis==="horizontal",Y=this.props.showArrows&&e.Children.count(this.props.children)>1,ue=Y&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=Y&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),ce=te.shift(),le=te.pop(),he={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},de={};if(q){if(he.onSwipeLeft=this.onSwipeForward,he.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ie=this.getVariableItemHeight(this.state.selectedItem);de.height=ie||"auto"}}else he.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,he.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,he.style=p(p({},he.style),{},{height:this.state.itemSize}),de.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ue,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},he,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&le,this.renderItems(),this.props.infiniteLoop&&ce):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(_){return k.setListRef(_)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&le,this.renderItems(),this.props.infiniteLoop&&ce)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T})(e.default.Component);return Yi.default=L,S(L,"displayName","Carousel"),S(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!T),onClick:M})},renderArrowNext:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!T),onClick:M})},renderIndicator:function(M,T,O,k){return e.default.createElement("li",{className:n.default.DOT(T),onClick:M,onKeyDown:M,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(O+1)})},renderItem:function(M){return M},renderThumbs:function(M){var T=e.Children.map(M,function(O){var k=O;if(O.type!=="img"&&(k=e.Children.toArray(O.props.children).find(function(N){return N.type==="img"})),!!k)return k});return T.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):T},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Yi}var ku={},Mu;function rm(){return Mu||(Mu=1),ku}var Ru;function im(){return Ru||(Ru=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(nm()),n=rm(),r=i(Md());function i(o){return o&&o.__esModule?o:{default:o}}})(as)),as}var om=im(),ss,Eu;function am(){if(Eu)return ss;Eu=1;var e=ng(),t=function(){return e.Date.now()};return ss=t,ss}var ls,Iu;function Ed(){if(Iu)return ls;Iu=1;var e=nd(),t=am(),n=rd(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,f,g,h,p,m,w=0,b=!1,v=!1,C=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,C="trailing"in u?!!u.trailing:C);function I(T){var O=c,k=f;return c=f=void 0,w=T,h=a.apply(k,O),h}function E(T){return w=T,p=setTimeout(x,l),b?I(T):h}function R(T){var O=T-m,k=T-w,N=l-O;return v?o(N,g-k):N}function P(T){var O=T-m,k=T-w;return m===void 0||O>=l||O<0||v&&k>=g}function x(){var T=t();if(P(T))return S(T);p=setTimeout(x,R(T))}function S(T){return p=void 0,C&&c?I(T):(c=f=void 0,h)}function L(){p!==void 0&&clearTimeout(p),w=0,c=m=f=p=void 0}function D(){return p===void 0?h:S(t())}function M(){var T=t(),O=P(T);if(c=arguments,f=this,m=T,O){if(p===void 0)return E(m);if(v)return clearTimeout(p),p=setTimeout(x,l),I(m)}return p===void 0&&(p=setTimeout(x,l)),h}return M.cancel=L,M.flush=D,M}return ls=s,ls}var sm=Ed();const Id=vr(sm);function xn(e,t,n,r,i=!1){const o=d.useRef();o.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Er(e,t){return e===void 0?void 0:t}const lm=Math.PI;function Tu(e){return e*lm/180}const Td=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Dd=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},Od=(e,t,n)=>Math.min(e,t-n*2),Pd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,rl=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"}))},um=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function cm(e,t,n){const[r,i]=d.useState(e),o=d.useRef(!0);d.useEffect(()=>()=>{o.current=!1},[]);const s=d.useRef(Id(a=>{o.current&&i(a)},n));return d.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const dm="֑-߿יִ-﷽ﹰ-ﻼ",fm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",hm=new RegExp("^[^"+fm+"]*["+dm+"]");function il(e){return hm.test(e)?"rtl":"not-rtl"}let jo;function As(){if(typeof document>"u")return 0;if(jo!==void 0)return jo;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(),jo=n-r,jo}const Gr=Symbol();function gm(e){const t=d.useRef([Gr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,i]=d.useState(),o=d.useCallback(a=>{const l=t.current[0];l!==Gr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Gr&&i({}),r(u=>typeof a=="function"?a(l===Gr?u:l):a),t.current[0]=Gr)},[]),s=d.useCallback(()=>{t.current[0]=Gr,i({})},[]);return[t.current[0]===Gr?n:t.current[0],o,s]}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 pm(e){const t=d.useRef(e);return _i(e,t.current)||(t.current=e),t.current}const mm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return d.createElement(Zp,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(om.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(rl,null)))};function Ld(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ei=Ld();function vm(e){ei=e}const Fd=/[&<>"']/,bm=new RegExp(Fd.source,"g"),Ad=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,wm=new RegExp(Ad.source,"g"),ym={"&":"&","<":"<",">":">",'"':""","'":"'"},Du=e=>ym[e];function wn(e,t){if(t){if(Fd.test(e))return e.replace(bm,Du)}else if(Ad.test(e))return e.replace(wm,Du);return e}const Cm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Hd(e){return e.replace(Cm,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Sm=/(^|[^\[])\^/g;function zt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Sm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const xm=/[^\w:]/g,km=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ou(e,t,n){if(e){let r;try{r=decodeURIComponent(Hd(n)).replace(xm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!km.test(n)&&(n=Im(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const qo={},Mm=/^[^:]+:\/*[^/]*$/,Rm=/^([^:]+:)[\s\S]*$/,Em=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Im(e,t){qo[" "+e]||(Mm.test(e)?qo[" "+e]=e+"/":qo[" "+e]=ia(e,"/",!0)),e=qo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Rm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Em,"$1")+t:e+t}const ga={exec:function(){}};function Pu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function ia(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Tm(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Dm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function _u(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Lu(e,t,n,r){const i=t.href,o=t.title?wn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:wn(s)}}function Om(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-cvHWuOOd.js","assets/index-wnKDraWU.js","assets/index.BGUxDbb1.css","assets/withFullScreenWrapper-C7u7nPsK.js","assets/Toolbar-BbbydoLD.js","assets/FormClearHelper-CaLJK07N.js","assets/sprintf-DpPCfzXw.js","assets/checkbox-DUA9ewQT.js","assets/createDownloadLinkElement-ZaXNnPK4.js","assets/slicedToArray-Cuk3tbTR.js","assets/inherits-xHSaJdUZ.js","assets/createSuper-CoIMxZYP.js","assets/FileDownload.esm-DVbGfwz7.js","assets/number-overlay-editor-DRf5xgI3.js","assets/es6-BCBcAdQS.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as d,E as Zs,_ as ze,ca as Qh,a3 as vr,bG as es,b1 as xo,b2 as eg,cb as tg,cc as ng,cd as nd,ce as rd,al as Bt,cf as rg,cg as id,ch as ig,ci as og,cj as ag,ck as sg,cl as lg,cm as ug,a9 as Dr,be as Js,a2 as cg,cn as dg,k as Pe,b4 as od,n as st,co as ao,bu as Xr,cp as fg,c7 as ts,j as me,s as tr,cq as hg,cr as gg,aE as an,aT as pg,cs as eu,ct as mg,cu as vg,cv as bg,bx as wg,cw as yg,cx as Cg,cy as ad,cz as Sg,cA as xg,cB as Ls,cC as sd,cD as ld,cE as kg,cF as Mg,cG as Rg,cH as Eg,cI as Ig,cJ as Tg,cK as Dg,cL as Og,cM as Pg,cN as ud,cO as _g,cP as Lg,cQ as Fg,cR as Ag,cS as Hg,aR as zg,aS as Vg,cT as $g,cU as Ng,aQ as Bg,cV as Wg,cW as Ug,cX as jg,aP as qg,u as Qr,cY as sn,x as Qs,cZ as Gg,bO as so,c_ as lr,c$ as Yg,d0 as Xg,d1 as Kg,d2 as Zg,d3 as Jg,d4 as Qg,d5 as ra,d6 as Gi,d7 as Ht,d8 as ep,d9 as tp,da as np,db as rp,dc as qr,dd as It,de as bn,df as tu,dg as nu,dh as ca,di as ip,dj as cd,dk as dd,dl as op,dm as Fs,dn as ap,dp as sp,dq as fd,dr as lp,ds as ru,dt as up,du as hd,dv as cp,dw as dp,aA as fp,a8 as gd,c4 as Oi,dx as hp,t as ki,dy as gp,dz as pp,aV as ns,bK as Ea,bM as Ia,dA as pd,h as Ta,y as Zn,dB as mp,bN as md,dC as vp,f as bp,J as iu,dD as wp,dE as yp,L as Cp,dF as Sp,dG as ou}from"./index-wnKDraWU.js";import{w as xp,E as kp}from"./withFullScreenWrapper-C7u7nPsK.js";import{T as Mp,a as Si}from"./Toolbar-BbbydoLD.js";import{u as Rp}from"./FormClearHelper-CaLJK07N.js";import{s as Ep}from"./sprintf-DpPCfzXw.js";import{S as Ip,L as Tp,a as Dp}from"./checkbox-DUA9ewQT.js";import{c as Op}from"./createDownloadLinkElement-ZaXNnPK4.js";import{_ as gr,C as Pp}from"./slicedToArray-Cuk3tbTR.js";import{b as _p,d as Lp,c as Fp}from"./inherits-xHSaJdUZ.js";import{_ as Ap}from"./createSuper-CoIMxZYP.js";import{D as Hp,F as zp}from"./FileDownload.esm-DVbGfwz7.js";var vd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Zs,ze({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"}))});vd.displayName="Add";var bd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Zs,ze({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"}))});bd.displayName="Search";var wd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Zs,ze({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"}))});wd.displayName="Visibility";var rs,au;function Vp(){if(au)return rs;au=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return rs=n,rs}var is,su;function $p(){if(su)return is;su=1;var e=Vp(),t=Qh();function n(r,i){return r!=null&&t(r,i,e)}return is=n,is}var Np=$p();const Bp=vr(Np);function yd(e="This should not happen"){throw new Error(e)}function Vn(e,t="Assertion failed"){if(!e)return yd(t)}function po(e,t){return yd(t??"Hell froze over")}function Wp(e,t){try{return e()}catch{return t}}const lu=Object.prototype.hasOwnProperty;function _i(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--&&_i(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(lu.call(e,n)&&++r&&!lu.call(t,n)||!(n in t)||!_i(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const da=null,el=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var uu;(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"})(uu||(uu={}));var fa;(function(e){e.Triangle="triangle",e.Dots="dots"})(fa||(fa={}));function Bo(e){return"width"in e&&typeof e.width=="number"}async function cu(e){return typeof e=="object"?e:await e()}function Mi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Ii(e){return e.kind===qn.Marker||e.kind===qn.NewRow}function Ri(e){if(!Mi(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:po(e,"A cell was passed with an invalid kind")}}function Up(e){return Bp(e,"editor")}function tl(e){return!(e.readonly??!1)}var qn;(function(e){e.NewRow="new-row",e.Marker="marker"})(qn||(qn={}));const ha={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function os(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let du;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(os(t));static empty=()=>du??(du=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=os(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=os([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new Qe(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var jp=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},fu=jp,qp=e=>e.toUpperCase()===e,Gp=e=>t=>e.indexOf(t)===-1,Cd=(e,t)=>{const n={};return Object.keys(e).filter(Gp(t)).forEach(r=>{n[r]=e[r]}),n};function Yp(e,t,n){const r=Cd(t,n);if(!e){const i=typeof es=="function"?{default:es}:es;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Xp=(e,t)=>{};function Kp(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!qp(a[0])):n.propsAsIs,c=Yp(u,o,["as","class"]);c.ref=s,c.className=n.atomic?fu(n.class,c.className||l):fu(c.className||l,n.class);const{vars:f}=n;if(f){const g={};for(const m in f){const w=f[m],b=w[0],v=w[1]||"",C=typeof b=="function"?b(o):b;Xp(C,n.name),g[`--${m}`]=`${C}${v}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,d.createElement(e,c)):d.createElement(a,c)},i=d.forwardRef?d.forwardRef(r):(o=>{const s=Cd(o,["innerRef"]);return r(s,o.innerRef)});return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var fn=Kp;const Zp=fn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var as={},Yi={},Wo={},Uo={},hu;function Jp(){return hu||(hu=1,(function(e){(function(t,n){n(e,xo(),eg())})(Uo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var E in I)Object.prototype.hasOwnProperty.call(I,E)&&(v[E]=I[E])}return v};function l(v,C){var I={};for(var E in v)C.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(v,E)&&(I[E]=v[E]);return I}function u(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var c=(function(){function v(C,I){for(var E=0;E<I.length;E++){var R=I[E];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(C,R.key,R)}}return function(C,I,E){return I&&v(C.prototype,I),E&&v(C,E),C}})();function f(v,C){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:v}function g(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);v.prototype=Object.create(C&&C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(v,C):v.__proto__=C)}var h=!1;function p(v){h=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 h?v:v.capture}function w(v){if("touches"in v){var C=v.touches[0],I=C.pageX,E=C.pageY;return{x:I,y:E}}var R=v.screenX,P=v.screenY;return{x:R,y:P}}var b=(function(v){g(C,v);function C(){var I;u(this,C);for(var E=arguments.length,R=Array(E),P=0;P<E;P++)R[P]=arguments[P];var x=f(this,(I=C.__proto__||Object.getPrototypeOf(C)).call.apply(I,[this].concat(R)));return x._handleSwipeStart=x._handleSwipeStart.bind(x),x._handleSwipeMove=x._handleSwipeMove.bind(x),x._handleSwipeEnd=x._handleSwipeEnd.bind(x),x._onMouseDown=x._onMouseDown.bind(x),x._onMouseMove=x._onMouseMove.bind(x),x._onMouseUp=x._onMouseUp.bind(x),x._setSwiperRef=x._setSwiperRef.bind(x),x}return c(C,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(E){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(E))}},{key:"_onMouseMove",value:function(E){this.mouseDown&&this._handleSwipeMove(E)}},{key:"_onMouseUp",value:function(E){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(E)}},{key:"_handleSwipeStart",value:function(E){var R=w(E),P=R.x,x=R.y;this.moveStart={x:P,y:x},this.props.onSwipeStart(E)}},{key:"_handleSwipeMove",value:function(E){if(this.moveStart){var R=w(E),P=R.x,x=R.y,S=P-this.moveStart.x,L=x-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:S,y:L},E);D&&E.cancelable&&E.preventDefault(),this.movePosition={deltaX:S,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(E){this.props.onSwipeEnd(E);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,E):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,E),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,E):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,E)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(E){this.swiper=E,this.props.innerRef(E)}},{key:"render",value:function(){var E=this.props;E.tagName;var R=E.className,P=E.style,x=E.children;E.allowMouseEvents,E.onSwipeUp,E.onSwipeDown,E.onSwipeLeft,E.onSwipeRight,E.onSwipeStart,E.onSwipeMove,E.onSwipeEnd,E.innerRef,E.tolerance;var S=l(E,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},S),x)}}]),C})(n.Component);b.displayName="ReactSwipe",b.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},b.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=b})})(Uo)),Uo}var gu;function Sd(){return gu||(gu=1,(function(e){(function(t,n){n(e,Jp())})(Wo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})})(Wo)),Wo}var Xi={},pu;function xd(){if(pu)return Xi;pu=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=t(tg());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xi.default=r,Xi}var Ki={},Zi={},mu;function Qp(){if(mu)return Zi;mu=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Zi.outerWidth=e,Zi}var Ji={},vu;function nl(){if(vu)return Ji;vu=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Ji.default=e,Ji}var Qi={},bu;function kd(){if(bu)return Qi;bu=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.default=void 0;var e=function(){return window};return Qi.default=e,Qi}var wu;function Md(){if(wu)return Ki;wu=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=l(xo()),t=s(xd()),n=Qp(),r=s(nl()),i=s(Sd()),o=s(kd());function s(x){return x&&x.__esModule?x:{default:x}}function a(){if(typeof WeakMap!="function")return null;var x=new WeakMap;return a=function(){return x},x}function l(x){if(x&&x.__esModule)return x;if(x===null||u(x)!=="object"&&typeof x!="function")return{default:x};var S=a();if(S&&S.has(x))return S.get(x);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in x)if(Object.prototype.hasOwnProperty.call(x,M)){var T=D?Object.getOwnPropertyDescriptor(x,M):null;T&&(T.get||T.set)?Object.defineProperty(L,M,T):L[M]=x[M]}return L.default=x,S&&S.set(x,L),L}function u(x){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(x)}function c(){return c=Object.assign||function(x){for(var S=1;S<arguments.length;S++){var L=arguments[S];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(x[D]=L[D])}return x},c.apply(this,arguments)}function f(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function g(x,S){for(var L=0;L<S.length;L++){var D=S[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(x,D.key,D)}}function h(x,S,L){return S&&g(x.prototype,S),x}function p(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(S&&S.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),S&&m(x,S)}function m(x,S){return m=Object.setPrototypeOf||function(D,M){return D.__proto__=M,D},m(x,S)}function w(x){var S=C();return function(){var D=I(x),M;if(S){var T=I(this).constructor;M=Reflect.construct(D,arguments,T)}else M=D.apply(this,arguments);return b(this,M)}}function b(x,S){return S&&(u(S)==="object"||typeof S=="function")?S:v(x)}function v(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function C(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(x){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},I(x)}function E(x,S,L){return S in x?Object.defineProperty(x,S,{value:L,enumerable:!0,configurable:!0,writable:!0}):x[S]=L,x}var R=function(S){return S.hasOwnProperty("key")},P=(function(x){p(L,x);var S=w(L);function L(D){var M;return f(this,L),M=S.call(this,D),E(v(M),"itemsWrapperRef",void 0),E(v(M),"itemsListRef",void 0),E(v(M),"thumbsRef",void 0),E(v(M),"setItemsWrapperRef",function(T){M.itemsWrapperRef=T}),E(v(M),"setItemsListRef",function(T){M.itemsListRef=T}),E(v(M),"setThumbsRef",function(T,O){M.thumbsRef||(M.thumbsRef=[]),M.thumbsRef[O]=T}),E(v(M),"updateSizes",function(){if(!(!M.props.children||!M.itemsWrapperRef||!M.thumbsRef)){var T=e.Children.count(M.props.children),O=M.itemsWrapperRef.clientWidth,k=M.props.thumbWidth?M.props.thumbWidth:(0,n.outerWidth)(M.thumbsRef[0]),N=Math.floor(O/k),q=N<T,Y=q?T-N:0;M.setState(function(ue,ee){return{itemSize:k,visibleItems:N,firstItem:q?M.getFirstItem(ee.selectedItem):0,lastPosition:Y,showArrows:q}})}}),E(v(M),"handleClickItem",function(T,O,k){if(!R(k)||k.key==="Enter"){var N=M.props.onSelectItem;typeof N=="function"&&N(T,O)}}),E(v(M),"onSwipeStart",function(){M.setState({swiping:!0})}),E(v(M),"onSwipeEnd",function(){M.setState({swiping:!1})}),E(v(M),"onSwipeMove",function(T){var O=T.x;if(!M.state.itemSize||!M.itemsWrapperRef||!M.state.visibleItems)return!1;var k=0,N=e.Children.count(M.props.children),q=-(M.state.firstItem*100)/M.state.visibleItems,Y=Math.max(N-M.state.visibleItems,0),ue=-Y*100/M.state.visibleItems;q===k&&O>0&&(O=0),q===ue&&O<0&&(O=0);var ee=M.itemsWrapperRef.clientWidth,te=q+100/(ee/O);return M.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ce){M.itemsListRef.style[ce]=(0,r.default)(te,"%",M.props.axis)}),!0}),E(v(M),"slideRight",function(T){M.moveTo(M.state.firstItem-(typeof T=="number"?T:1))}),E(v(M),"slideLeft",function(T){M.moveTo(M.state.firstItem+(typeof T=="number"?T:1))}),E(v(M),"moveTo",function(T){T=T<0?0:T,T=T>=M.state.lastPosition?M.state.lastPosition:T,M.setState({firstItem:T})}),M.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},M}return h(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(M){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==M.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(M){var T=M;return M>=this.state.lastPosition&&(T=this.state.lastPosition),M<this.state.firstItem+this.state.visibleItems&&(T=this.state.firstItem),M<this.state.firstItem&&(T=M),T}},{key:"renderItems",value:function(){var M=this;return this.props.children.map(function(T,O){var k=t.default.ITEM(!1,O===M.state.selectedItem),N={key:O,ref:function(Y){return M.setThumbsRef(Y,O)},className:k,onClick:M.handleClickItem.bind(M,O,M.props.children[O]),onKeyDown:M.handleClickItem.bind(M,O,M.props.children[O]),"aria-label":"".concat(M.props.labels.item," ").concat(O+1),style:{width:M.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),T)})}},{key:"render",value:function(){var M=this;if(!this.props.children)return null;var T=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},q=-this.state.firstItem*(this.state.itemSize||0),Y=(0,r.default)(q,"px",this.props.axis),ue=this.props.transitionTime+"ms";return N={WebkitTransform:Y,MozTransform:Y,MsTransform:Y,OTransform:Y,transform:Y,msTransform:Y,WebkitTransitionDuration:ue,MozTransitionDuration:ue,MsTransitionDuration:ue,OTransitionDuration:ue,transitionDuration:ue,msTransitionDuration:ue},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return M.slideRight()},"aria-label":this.props.labels.leftArrow}),T?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(te){return M.setItemsListRef(te)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return M.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L})(e.Component);return Ki.default=P,E(P,"displayName","Thumbs"),E(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Ki}var eo={},yu;function em(){if(yu)return eo;yu=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.default=void 0;var e=function(){return document};return eo.default=e,eo}var zn={},Cu;function Rd(){if(Cu)return zn;Cu=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.setPosition=zn.getPosition=zn.isKeyboardEvent=zn.defaultStatusFormatter=zn.noop=void 0;var e=xo(),t=n(nl());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};zn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};zn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};zn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var f=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=f-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};zn.getPosition=s;var a=function(u,c){var f={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){f[g]=(0,t.default)(u,"%",c)}),f};return zn.setPosition=a,zn}var Kn={},Su;function tm(){if(Su)return Kn;Su=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.fadeAnimationHandler=Kn.slideStopSwipingHandler=Kn.slideSwipeAnimationHandler=Kn.slideAnimationHandler=void 0;var e=xo(),t=r(nl()),n=Rd();function r(f){return f&&f.__esModule?f:{default:f}}function i(f,g){var h=Object.keys(f);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(f);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(f,m).enumerable})),h.push.apply(h,p)}return h}function o(f){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){s(f,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(f,p,Object.getOwnPropertyDescriptor(h,p))})}return f}function s(f,g,h){return g in f?Object.defineProperty(f,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[g]=h,f}var a=function(g,h){var p={},m=h.selectedItem,w=m,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(m<0||m>b);if(v)return w<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):w>b&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var C=(0,n.getPosition)(m,g),I=(0,t.default)(C,"%",g.axis),E=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:I,msTransform:I,OTransform:I,transform:I},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:E,MozTransitionDuration:E,OTransitionDuration:E,transitionDuration:E,msTransitionDuration:E})),p};Kn.slideAnimationHandler=a;var l=function(g,h,p,m){var w={},b=h.axis==="horizontal",v=e.Children.count(h.children),C=0,I=(0,n.getPosition)(p.selectedItem,h),E=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,P=R;I===C&&R>0&&(P=0),I===E&&R<0&&(P=0);var x=I+100/(p.itemSize/P),S=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&S&&(p.selectedItem===0&&x>-100?x-=v*100:p.selectedItem===v-1&&x<-v*100&&(x+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||S||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),w.itemListStyle=(0,n.setPosition)(x,h.axis)),S&&!p.cancelClick&&m({cancelClick:!0}),w};Kn.slideSwipeAnimationHandler=l;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Kn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",w={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(w=o(o({},w),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:w,selectedStyle:o(o({},w),{},{opacity:1,position:"relative"}),prevStyle:o({},w)}};return Kn.fadeAnimationHandler=c,Kn}var xu;function nm(){if(xu)return Yi;xu=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=c(xo()),t=l(Sd()),n=l(xd()),r=l(Md()),i=l(em()),o=l(kd()),s=Rd(),a=tm();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||f(D)!=="object"&&typeof D!="function")return{default:D};var M=u();if(M&&M.has(D))return M.get(D);var T={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var N=O?Object.getOwnPropertyDescriptor(D,k):null;N&&(N.get||N.set)?Object.defineProperty(T,k,N):T[k]=D[k]}return T.default=D,M&&M.set(D,T),T}function f(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(T){return typeof T}:f=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},f(D)}function g(){return g=Object.assign||function(D){for(var M=1;M<arguments.length;M++){var T=arguments[M];for(var O in T)Object.prototype.hasOwnProperty.call(T,O)&&(D[O]=T[O])}return D},g.apply(this,arguments)}function h(D,M){var T=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);M&&(O=O.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),T.push.apply(T,O)}return T}function p(D){for(var M=1;M<arguments.length;M++){var T=arguments[M]!=null?arguments[M]:{};M%2?h(Object(T),!0).forEach(function(O){S(D,O,T[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(T,O))})}return D}function m(D,M){if(!(D instanceof M))throw new TypeError("Cannot call a class as a function")}function w(D,M){for(var T=0;T<M.length;T++){var O=M[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function b(D,M,T){return M&&w(D.prototype,M),D}function v(D,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(M&&M.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),M&&C(D,M)}function C(D,M){return C=Object.setPrototypeOf||function(O,k){return O.__proto__=k,O},C(D,M)}function I(D){var M=P();return function(){var O=x(D),k;if(M){var N=x(this).constructor;k=Reflect.construct(O,arguments,N)}else k=O.apply(this,arguments);return E(this,k)}}function E(D,M){return M&&(f(M)==="object"||typeof M=="function")?M:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function 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 x(D){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},x(D)}function S(D,M,T){return M in D?Object.defineProperty(D,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):D[M]=T,D}var L=(function(D){v(T,D);var M=I(T);function T(O){var k;m(this,T),k=M.call(this,O),S(R(k),"thumbsRef",void 0),S(R(k),"carouselWrapperRef",void 0),S(R(k),"listRef",void 0),S(R(k),"itemsRef",void 0),S(R(k),"timer",void 0),S(R(k),"animationHandler",void 0),S(R(k),"setThumbsRef",function(q){k.thumbsRef=q}),S(R(k),"setCarouselWrapperRef",function(q){k.carouselWrapperRef=q}),S(R(k),"setListRef",function(q){k.listRef=q}),S(R(k),"setItemsRef",function(q,Y){k.itemsRef||(k.itemsRef=[]),k.itemsRef[Y]=q}),S(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),S(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),S(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),S(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),S(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),S(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),S(R(k),"navigateWithKeyboard",function(q){if(k.isFocusWithinTheCarousel()){var Y=k.props.axis,ue=Y==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},te=ue?ee.ArrowRight:ee.ArrowDown,ce=ue?ee.ArrowLeft:ee.ArrowUp;te===q.keyCode?k.increment():ce===q.keyCode&&k.decrement()}}),S(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var q=k.props.axis==="horizontal",Y=k.itemsRef[0];if(Y){var ue=q?Y.clientWidth:Y.clientHeight;k.setState({itemSize:ue}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),S(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),S(R(k),"handleClickItem",function(q,Y){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(q,Y),q!==k.state.selectedItem&&k.setState({selectedItem:q})}}),S(R(k),"handleOnChange",function(q,Y){e.Children.count(k.props.children)<=1||k.props.onChange(q,Y)}),S(R(k),"handleClickThumb",function(q,Y){k.props.onClickThumb(q,Y),k.moveTo(q)}),S(R(k),"onSwipeStart",function(q){k.setState({swiping:!0}),k.props.onSwipeStart(q)}),S(R(k),"onSwipeEnd",function(q){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(q),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),S(R(k),"onSwipeMove",function(q,Y){k.props.onSwipeMove(Y);var ue=k.props.swipeAnimationHandler(q,k.props,k.state,k.setState.bind(R(k)));return k.setState(p({},ue)),!!Object.keys(ue).length}),S(R(k),"decrement",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof q=="number"?q:1))}),S(R(k),"increment",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof q=="number"?q:1))}),S(R(k),"moveTo",function(q){if(typeof q=="number"){var Y=e.Children.count(k.props.children)-1;q<0&&(q=k.props.infiniteLoop?Y:0),q>Y&&(q=k.props.infiniteLoop?0:Y),k.selectItem({selectedItem:q}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),S(R(k),"onClickNext",function(){k.increment(1)}),S(R(k),"onClickPrev",function(){k.decrement(1)}),S(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"changeItem",function(q){return function(Y){(!(0,s.isKeyboardEvent)(Y)||Y.key==="Enter")&&k.moveTo(q)}}),S(R(k),"selectItem",function(q){k.setState(p({previousItem:k.state.selectedItem},q),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(q.selectedItem,e.Children.toArray(k.props.children)[q.selectedItem])}),S(R(k),"getInitialImage",function(){var q=k.props.selectedItem,Y=k.itemsRef&&k.itemsRef[q],ue=Y&&Y.getElementsByTagName("img")||[];return ue[0]}),S(R(k),"getVariableItemHeight",function(q){var Y=k.itemsRef&&k.itemsRef[q];if(k.state.hasMount&&Y&&Y.children.length){var ue=Y.children[0].getElementsByTagName("img")||[];if(ue.length>0){var ee=ue[0];if(!ee.complete){var te=function he(){k.forceUpdate(),ee.removeEventListener("load",he)};ee.addEventListener("load",te)}}var ce=ue[0]||Y.children[0],le=ce.clientHeight;return le>0?le:null}return null});var N={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,k.state=p(p({},N),k.animationHandler(O,N)),k}return b(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,N){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var N=k.getInitialImage();N&&!N.complete?N.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var N=this;return this.props.children?e.Children.map(this.props.children,function(q,Y){var ue=Y===N.state.selectedItem,ee=Y===N.state.previousItem,te=ue&&N.state.selectedStyle||ee&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(te=p(p({},te),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(te=p(p({},te),{},{pointerEvents:"none"}));var ce={ref:function(he){return N.setItemsRef(he,Y)},key:"itemKey"+Y+(k?"clone":""),className:n.default.ITEM(!0,Y===N.state.selectedItem,Y===N.state.previousItem),onClick:N.handleClickItem.bind(N,Y,q),style:te};return e.default.createElement("li",ce,N.props.renderItem(q,{isSelected:Y===N.state.selectedItem,isPrevious:Y===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,N=this.props,q=N.showIndicators,Y=N.labels,ue=N.renderIndicator,ee=N.children;return q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(te,ce){return ue&&ue(k.changeItem(ce),ce===k.state.selectedItem,ce,Y.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,q=this.props.axis==="horizontal",Y=this.props.showArrows&&e.Children.count(this.props.children)>1,ue=Y&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=Y&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),ce=te.shift(),le=te.pop(),he={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},de={};if(q){if(he.onSwipeLeft=this.onSwipeForward,he.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ie=this.getVariableItemHeight(this.state.selectedItem);de.height=ie||"auto"}}else he.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,he.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,he.style=p(p({},he.style),{},{height:this.state.itemSize}),de.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ue,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},he,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&le,this.renderItems(),this.props.infiniteLoop&&ce):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(_){return k.setListRef(_)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&le,this.renderItems(),this.props.infiniteLoop&&ce)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T})(e.default.Component);return Yi.default=L,S(L,"displayName","Carousel"),S(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!T),onClick:M})},renderArrowNext:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!T),onClick:M})},renderIndicator:function(M,T,O,k){return e.default.createElement("li",{className:n.default.DOT(T),onClick:M,onKeyDown:M,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(O+1)})},renderItem:function(M){return M},renderThumbs:function(M){var T=e.Children.map(M,function(O){var k=O;if(O.type!=="img"&&(k=e.Children.toArray(O.props.children).find(function(N){return N.type==="img"})),!!k)return k});return T.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):T},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Yi}var ku={},Mu;function rm(){return Mu||(Mu=1),ku}var Ru;function im(){return Ru||(Ru=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(nm()),n=rm(),r=i(Md());function i(o){return o&&o.__esModule?o:{default:o}}})(as)),as}var om=im(),ss,Eu;function am(){if(Eu)return ss;Eu=1;var e=ng(),t=function(){return e.Date.now()};return ss=t,ss}var ls,Iu;function Ed(){if(Iu)return ls;Iu=1;var e=nd(),t=am(),n=rd(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,f,g,h,p,m,w=0,b=!1,v=!1,C=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,C="trailing"in u?!!u.trailing:C);function I(T){var O=c,k=f;return c=f=void 0,w=T,h=a.apply(k,O),h}function E(T){return w=T,p=setTimeout(x,l),b?I(T):h}function R(T){var O=T-m,k=T-w,N=l-O;return v?o(N,g-k):N}function P(T){var O=T-m,k=T-w;return m===void 0||O>=l||O<0||v&&k>=g}function x(){var T=t();if(P(T))return S(T);p=setTimeout(x,R(T))}function S(T){return p=void 0,C&&c?I(T):(c=f=void 0,h)}function L(){p!==void 0&&clearTimeout(p),w=0,c=m=f=p=void 0}function D(){return p===void 0?h:S(t())}function M(){var T=t(),O=P(T);if(c=arguments,f=this,m=T,O){if(p===void 0)return E(m);if(v)return clearTimeout(p),p=setTimeout(x,l),I(m)}return p===void 0&&(p=setTimeout(x,l)),h}return M.cancel=L,M.flush=D,M}return ls=s,ls}var sm=Ed();const Id=vr(sm);function xn(e,t,n,r,i=!1){const o=d.useRef();o.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Er(e,t){return e===void 0?void 0:t}const lm=Math.PI;function Tu(e){return e*lm/180}const Td=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Dd=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},Od=(e,t,n)=>Math.min(e,t-n*2),Pd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,rl=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"}))},um=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function cm(e,t,n){const[r,i]=d.useState(e),o=d.useRef(!0);d.useEffect(()=>()=>{o.current=!1},[]);const s=d.useRef(Id(a=>{o.current&&i(a)},n));return d.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const dm="֑-߿יִ-﷽ﹰ-ﻼ",fm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",hm=new RegExp("^[^"+fm+"]*["+dm+"]");function il(e){return hm.test(e)?"rtl":"not-rtl"}let jo;function As(){if(typeof document>"u")return 0;if(jo!==void 0)return jo;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(),jo=n-r,jo}const Gr=Symbol();function gm(e){const t=d.useRef([Gr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,i]=d.useState(),o=d.useCallback(a=>{const l=t.current[0];l!==Gr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Gr&&i({}),r(u=>typeof a=="function"?a(l===Gr?u:l):a),t.current[0]=Gr)},[]),s=d.useCallback(()=>{t.current[0]=Gr,i({})},[]);return[t.current[0]===Gr?n:t.current[0],o,s]}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 pm(e){const t=d.useRef(e);return _i(e,t.current)||(t.current=e),t.current}const mm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return d.createElement(Zp,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(om.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(rl,null)))};function Ld(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ei=Ld();function vm(e){ei=e}const Fd=/[&<>"']/,bm=new RegExp(Fd.source,"g"),Ad=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,wm=new RegExp(Ad.source,"g"),ym={"&":"&","<":"<",">":">",'"':""","'":"'"},Du=e=>ym[e];function wn(e,t){if(t){if(Fd.test(e))return e.replace(bm,Du)}else if(Ad.test(e))return e.replace(wm,Du);return e}const Cm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Hd(e){return e.replace(Cm,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Sm=/(^|[^\[])\^/g;function zt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Sm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const xm=/[^\w:]/g,km=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ou(e,t,n){if(e){let r;try{r=decodeURIComponent(Hd(n)).replace(xm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!km.test(n)&&(n=Im(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const qo={},Mm=/^[^:]+:\/*[^/]*$/,Rm=/^([^:]+:)[\s\S]*$/,Em=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Im(e,t){qo[" "+e]||(Mm.test(e)?qo[" "+e]=e+"/":qo[" "+e]=ia(e,"/",!0)),e=qo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Rm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Em,"$1")+t:e+t}const ga={exec:function(){}};function Pu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function ia(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Tm(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Dm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function _u(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Lu(e,t,n,r){const i=t.href,o=t.title?wn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:wn(s)}}function Om(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
3
3
|
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=r.length?i.slice(r.length):i}).join(`
|
|
4
4
|
`)}class ol{constructor(t){this.options=t||ei}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:ia(r,`
|
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Om(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=ia(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,s,a,l,u,c,f,g,h,p,m=n[1].trim();const w=m.length>1,b={type:"list",raw:"",ordered:w,start:w?+m.slice(0,-1):"",loose:!1,items:[]};m=w?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=w?m:"[*+-]");const v=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
|
|
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
|
|
|
169
169
|
`?(r.push(e.slice(i,s)),i=s+1,a===`
|
|
170
170
|
`&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
|
|
171
171
|
`)&&(r.push(ic(e.slice(i,s))),i=s+1,a===`
|
|
172
|
-
`&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(ic(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function oc(e,t,n){const r=Kv(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function hf(e){return e!==!0}function ac(e){return typeof e=="string"?e:`${e}px`}const Qv=()=>e=>e.innerWidth,eb=()=>e=>e.innerHeight,tb=fn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Qv()],"wmyidgi-1":[eb()]}}),nb=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return d.createElement(tb,{innerHeight:ac(n),innerWidth:ac(t),...i},r)},rb=2,ib=1300;function ob(e,t,n){const r=Bt.useRef(0),[i,o]=e??[0,0];Bt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/ib);const f=r.current**1.618*c*rb;t.current?.scrollBy(i*f,o*f),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function ab({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,f,g,h]=Bt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,w=Kd();return[typeof m=="number"?m*p:b=>Math.ceil(m(b)*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((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:f,overscrollX:g,overscrollY:h}}const Rr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function at(e,t){return e===!0?t:e===!1?"":e}function sc(e){const t=ma.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function sb(e){const t=pm(e);return Bt.useMemo(()=>{if(t===void 0)return sc(Rr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Rr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Rr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Rr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Rr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Rr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Rr.selectToLastCell};return sc({...Rr,...n})},[t])}function lb(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function gl(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let f=0;f<a.subGroups.length;f++){const g=f<a.subGroups.length-1?a.subGroups[f+1].headerIndex:l;r(a.subGroups[f],g,u||a.isCollapsed)}}const i=lb(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Us(e,t){if(t===void 0||gl.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 ub(e,t,n,r){const i=Bt.useMemo(()=>e===void 0?void 0:gl(e,t),[e,t]),o=Bt.useMemo(()=>i?.reduce((c,f)=>(c[f.rowIndex]=f,c),{}),[i]),s=Bt.useMemo(()=>i===void 0?t:i.reduce((c,f)=>c+(f.isCollapsed?1:f.rows+1),0),[i,t]),a=Bt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Bt.useCallback(c=>{if(i===void 0)return c;let f=c;for(const g of i){if(f===0)return;if(f--,!g.isCollapsed){if(f<g.rows)return g.contentIndex+f;f-=g.rows}}return c},[i]),u=Er(r??e?.themeOverride,Bt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:f,contentIndex:g,groupIndex:h}=Us(c,i);return f?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function cb(e,t){const n=Bt.useMemo(()=>e===void 0?void 0:gl(e,t),[e,t]);return{getRowGroupingForPath:pf,updateRowGroupingByPath:gf,mapper:Bt.useCallback(r=>{if(typeof r=="number")return Us(r,n);const i=Us(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function gf(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:gf(o.subGroups??[],i,n)}:o)}function pf(e,t){const[n,...r]=t;return r[0]===-1?e[n]:pf(e[n].subGroups??[],r)}function db(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function fb(e,t,n,r,i){const[o,s]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=gm(a),f=d.useRef(i);f.current=i;const g=db(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(l.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),f.current()}},[t,h,c,g]);const p=(l.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&&c(),f.current()}},[e,p,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const hb=d.lazy(async()=>await Js(()=>import("./data-grid-overlay-editor-d9lrfvrX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let gb=0;function pb(e){return v0(Yu(Yu(e).filter(t=>t.span!==void 0).map(t=>Dr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Yo(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 Xo={kind:Z.Loading,allowOverlay:!1},Ko={columns:Qe.empty(),rows:Qe.empty(),current:void 0},mb=(e,t)=>{const[n,r]=d.useState(Ko),[i,o]=d.useState(),s=d.useRef(null),a=d.useRef(null),[l,u]=d.useState(),c=d.useRef(),f=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:w,columns:b,rows:v,getCellContent:C,onCellClicked:I,onCellActivated:E,onFillPattern:R,onFinishedEditing:P,coercePasteValue:x,drawHeader:S,drawCell:L,editorBloom:D,onHeaderClicked:M,onColumnProposeMove:T,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:N,onCellContextMenu:q,className:Y,onHeaderContextMenu:ue,getCellsForSelection:ee,onGroupHeaderContextMenu:te,onGroupHeaderRenamed:ce,onCellEdited:le,onCellsEdited:he,onSearchResultsChanged:de,searchResults:ie,onSearchValueChange:H,searchValue:_,onKeyDown:G,onKeyUp:ne,keybindings:oe,editOnType:xe=!0,onRowAppended:ve,onColumnAppended:et,onColumnMoved:ke,validateCell:bt,highlightRegions:St,rangeSelect:Ue="rect",columnSelect:re="multi",rowSelect:se="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:fe="exclusive",rowSelectionBlending:ye="exclusive",onDelete:$e,onDragStart:Fe,onMouseMove:tt,onPaste:Re,copyHeaders:qe=!1,freezeColumns:De=0,cellActivationBehavior:Ie="second-click",rowSelectionMode:_e="auto",columnSelectionMode:ht="auto",onHeaderMenuClick:nt,onHeaderIndicatorClick:Xe,getGroupDetails:kt,rowGrouping:wt,onSearchClose:Ot,onItemHovered:Pt,onSelectionCleared:ln,showSearch:Jt,onVisibleRegionChanged:Dn,gridSelection:Tt,onGridSelectionChange:gt,minColumnWidth:On=50,maxColumnWidth:yt=500,maxColumnAutoWidth:Qt,provideEditor:kn,trailingRowOptions:Oe,freezeTrailingRows:ct=0,allowedFillDirections:pt="orthogonal",scrollOffsetX:Pn,scrollOffsetY:un,verticalBorder:cn,onDragOverCell:_n,onDrop:en,onColumnResize:tn,onColumnResizeEnd:Be,onColumnResizeStart:Mt,customRenderers:Ln,fillHandle:Lt,experimental:mt,fixedShadowX:Mn,fixedShadowY:ur,headerIcons:Nn,imageWindowLoader:B,initialSize:We,isDraggable:Ge,onDragLeave:_t,onRowMoved:nn,overscrollX:hn,overscrollY:Rn,preventDiagonalScrolling:yn,rightElement:Ut,rightElementProps:En,trapFocus:In=!1,smoothScrollX:Ce,smoothScrollY:Ft,scaleToRem:Kt=!1,rowHeight:Bn=34,headerHeight:Zt=36,groupHeaderHeight:Gt=Zt,theme:Yt,isOutsideClick:Fn,renderers:Tn,resizeIndicator:Mo,scrollToActiveCell:Fr=!0,drawFocusRing:_a=!0,portalElementRef:Ro}=e,ri=_a==="no-editor"?i===void 0:_a,Gn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Cn=Gn?.kind??e.rowMarkers??"none",ii=Gn?.width??e.rowMarkerWidth,cr=Gn?.startIndex??e.rowMarkerStartIndex??1,oi=Gn?.theme??e.rowMarkerTheme,br=Gn?.headerTheme,ai=Gn?.headerAlwaysVisible,si=se!=="multi"||Gn?.headerDisabled===!0,Ar=Gn?.checkboxStyle??"square",wr=Math.max(On,20),li=Math.max(yt,wr),La=Math.max(Qt??li,wr),Ai=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:He,rowNumberMapper:Hi,rowHeight:Eo,getRowThemeOverride:Hr}=ub(wt,v,Bn,h),Fa=d.useMemo(()=>Number.parseFloat(Ai.fontSize),[Ai]),{rowHeight:rr,headerHeight:zi,groupHeaderHeight:Io,theme:ui,overscrollX:Aa,overscrollY:Ha}=ab({groupHeaderHeight:Gt,headerHeight:Zt,overscrollX:hn,overscrollY:Rn,remSize:Fa,rowHeight:Eo,scaleToRem:Kt,theme:Yt}),ir=sb(oe),yr=ii??(v>1e4?48:v>1e3?44:v>100?36:32),An=Cn!=="none",U=An?1:0,Vt=Oe!==void 0,dr=Oe?.sticky===!0,[za,zr]=d.useState(!1),Va=Jt??za,ci=d.useCallback(()=>{Ot!==void 0?Ot():zr(!1)},[Ot]),X=d.useMemo(()=>Tt===void 0?void 0:Yo(Tt,U),[Tt,U])??n,V=d.useRef();V.current===void 0&&(V.current=new AbortController),d.useEffect(()=>()=>V?.current.abort(),[]);const[Q,Me]=Uv(ee,C,U,V.current,He),Te=d.useCallback((y,A,F)=>{if(bt===void 0)return!0;const $=[y[0]-U,y[1]];return bt?.($,A,F)},[U,bt]),ge=d.useRef(Tt),pe=d.useCallback((y,A)=>{A&&(y=Zv(y,Q,U,k,V.current)),gt!==void 0?(ge.current=Yo(y,-U),gt(ge.current)):r(y)},[gt,Q,U,k]),je=Er(tn,d.useCallback((y,A,F,$)=>{tn?.(b[F-U],A,F-U,$)},[tn,U,b])),Ee=Er(Be,d.useCallback((y,A,F,$)=>{Be?.(b[F-U],A,F-U,$)},[Be,U,b])),Ze=Er(Mt,d.useCallback((y,A,F,$)=>{Mt?.(b[F-U],A,F-U,$)},[Mt,U,b])),vt=Er(S,d.useCallback((y,A)=>S?.({...y,columnIndex:y.columnIndex-U},A)??!1,[S,U])),gn=Er(L,d.useCallback((y,A)=>L?.({...y,col:y.col-U},A)??!1,[L,U])),jt=d.useCallback(y=>{if($e!==void 0){const A=$e(Yo(y,-U));return typeof A=="boolean"?A:Yo(A,U)}return!0},[$e,U]),[Rt,ut,Ye]=Wv(X,pe,we,fe,ye,Ue,O),dt=d.useMemo(()=>pr(Kd(),ui),[ui]),[$t,di]=d.useState([0,0,0]),Vr=d.useMemo(()=>{if(Tn===void 0)return{};const y={};for(const A of Tn)y[A.kind]=A;return y},[Tn]),rn=d.useCallback(y=>y.kind!==Z.Custom?Vr[y.kind]:Ln?.find(A=>A.isMatch(y)),[Ln,Vr]);let{sizedColumns:dn,nonGrowWidth:At}=l0(b,He,Me,$t[0]-(U===0?0:yr)-$t[2],wr,La,dt,rn,V.current);Cn!=="none"&&(At+=yr);const Wn=d.useMemo(()=>dn.some(y=>y.group!==void 0),[dn]),pn=Wn?zi+Io:zi,fi=X.rows.length,fr=Cn==="none"?void 0:fi===0?!1:fi===He?!0:void 0,rt=d.useMemo(()=>Cn==="none"?dn:[{title:"",width:yr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:oi,rowMarker:Ar,rowMarkerChecked:fr,headerRowMarkerTheme:br,headerRowMarkerAlwaysVisible:ai,headerRowMarkerDisabled:si},...dn],[Cn,dn,yr,oi,Ar,fr,br,ai,si]),on=d.useRef({height:1,width:1,x:0,y:0}),$r=d.useRef(!1),{setVisibleRegion:Cr,visibleRegion:hr,scrollRef:Nt}=fb(Pn,un,rr,on,()=>$r.current=!0);on.current=hr;const Sh=hr.x+U,To=hr.y,mn=d.useRef(null),Sn=d.useCallback(y=>{y===!0?mn.current?.focus():window.requestAnimationFrame(()=>{mn.current?.focus()})},[]),vn=Vt?He+1:He,Un=d.useCallback(y=>{const A=U===0?y:y.map($=>({...$,location:[$.location[0]-U,$.location[1]]})),F=he?.(A);if(F!==!0)for(const $ of A)le?.($.location,$.value);return F},[le,he,U]),[Nr,$a]=d.useState(),Do=X.current!==void 0&&X.current.range.width*X.current.range.height>1?X.current.range:void 0,$l=ri?X.current?.cell:void 0,Oo=$l?.[0],Po=$l?.[1],xh=d.useMemo(()=>{if((St===void 0||St.length===0)&&(Do??Oo??Po??Nr)===void 0)return;const y=[];if(St!==void 0)for(const A of St){const F=rt.length-A.range.x-U;F>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(F,A.range.width)},style:A.style})}return Nr!==void 0&&y.push({color:Jr(dt.accentColor,0),range:Nr,style:"dashed"}),Do!==void 0&&y.push({color:Jr(dt.accentColor,.5),range:Do,style:"solid-outline"}),Oo!==void 0&&Po!==void 0&&y.push({color:dt.accentColor,range:{x:Oo,y:Po,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Nr,Do,Oo,Po,St,rt.length,dt.accentColor,U]),Nl=d.useRef(rt);Nl.current=rt;const Hn=d.useCallback(([y,A],F=!1)=>{const $=Vt&&A===vn-1;if(y===0&&An){if($)return Xo;const K=Hi(A);return K===void 0?Xo:{kind:qn.Marker,allowOverlay:!1,checkboxStyle:Ar,checked:X?.rows.hasIndex(A)===!0,markerKind:Cn==="clickable-number"?"number":Cn,row:cr+K,drawHandle:nn!==void 0,cursor:Cn==="clickable-number"?"pointer":void 0}}else if($){const z=y===U?Oe?.hint??"":"",W=Nl.current[y];if(W?.trailingRowOptions?.disabled===!0)return Xo;{const J=W?.trailingRowOptions?.hint??z,ae=W?.trailingRowOptions?.addIcon??Oe?.addIcon;return{kind:qn.NewRow,hint:J,allowOverlay:!1,icon:ae}}}else{const K=y-U;if(F||mt?.strict===!0){const W=on.current,J=W.x>K||K>W.x+W.width||W.y>A||A>W.y+W.height||A>=Ua.current,ae=K===W.extras?.selected?.[0]&&A===W.extras?.selected[1];let Se=!1;if(W.extras?.freezeRegions!==void 0){for(const Et of W.extras.freezeRegions)if(Zr(Et,K,A)){Se=!0;break}}if(J&&!ae&&!Se)return Xo}let z=C([K,A]);return U!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+U,z.span[1]+U]}),z}},[Vt,vn,An,Hi,Ar,X?.rows,Cn,cr,nn,U,Oe?.hint,Oe?.addIcon,mt?.strict,C]),Na=d.useCallback(y=>{let A=kt?.(y)??{name:y};return ce!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>qa({group:A.name,bounds:F.bounds})}]}),A},[kt,ce]),_o=d.useCallback(y=>{const[A,F]=y.cell,$=rt[A],j=$?.group!==void 0?Na($.group)?.overrideTheme:void 0,K=$?.themeOverride,z=Hr?.(F);o({...y,theme:pr(dt,j,K,z,y.content.themeOverride)})},[Hr,rt,Na,dt]),hi=d.useCallback((y,A,F)=>{if(X.current===void 0)return;const[$,j]=X.current.cell,K=Hn([$,j]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(F!==void 0)switch(z.kind){case Z.Number:{const W=Wp(()=>F==="-"?-0:Number.parseFloat(F),0);z={...z,data:Number.isNaN(W)?0:W};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:F};break}_o({target:y,content:z,initialValue:F,cell:[$,j],highlight:F===void 0,forceEditMode:F!==void 0,activation:A})}else K.kind===Z.Boolean&&A.inputType==="keyboard"&&K.readonly!==!0&&(Un([{location:X.current.cell,value:{...K,data:hf(K.data)}}]),mn.current?.damage([{cell:X.current.cell}]))},[Hn,X,Un,_o]),Bl=d.useCallback((y,A)=>{const F=mn.current?.getBounds(y,A);if(F===void 0||Nt.current===null)return;const $=Hn([y,A]);$.allowOverlay&&_o({target:F,content:$,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Hn,Nt,_o]),qt=d.useCallback((y,A,F="both",$=0,j=0,K=void 0)=>{if(Nt.current!==null){const z=mn.current,W=a.current,J=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,ae=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,Se=typeof y!="number"&&y.unit==="px"?y.amount:void 0,Et=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&W!==null){let Je={x:0,y:0,width:0,height:0},Ke=0,ft=0;if((J!==void 0||ae!==void 0)&&(Je=z.getBounds((J??0)+U,ae??0)??Je,Je.width===0||Je.height===0))return;const it=W.getBoundingClientRect(),Ct=it.width/W.offsetWidth;if(Se!==void 0&&(Je={...Je,x:Se-it.left-Nt.current.scrollLeft,width:1}),Et!==void 0&&(Je={...Je,y:Et+it.top-Nt.current.scrollTop,height:1}),Je!==void 0){const xt={x:Je.x-$,y:Je.y-j,width:Je.width+2*$,height:Je.height+2*j};let wi=0;for(let Qa=0;Qa<De;Qa++)wi+=dn[Qa].width;let ji=0;const qi=ct+(dr?1:0);qi>0&&(ji=ni(vn,qi,rr));let ar=wi*Ct+it.left+U*yr*Ct,yi=it.right,jr=it.top+pn*Ct,Ci=it.bottom-ji*Ct;const $o=Je.width+$*2;switch(K?.hAlign){case"start":yi=ar+$o;break;case"end":ar=yi-$o;break;case"center":ar=Math.floor((ar+yi)/2)-$o/2,yi=ar+$o;break}const No=Je.height+j*2;switch(K?.vAlign){case"start":Ci=jr+No;break;case"end":jr=Ci-No;break;case"center":jr=Math.floor((jr+Ci)/2)-No/2,Ci=jr+No;break}ar>xt.x?Ke=xt.x-ar:yi<xt.x+xt.width&&(Ke=xt.x+xt.width-yi),jr>xt.y?ft=xt.y-jr:Ci<xt.y+xt.height&&(ft=xt.y+xt.height-Ci),F==="vertical"||typeof y=="number"&&y<De?Ke=0:(F==="horizontal"||typeof A=="number"&&A>=vn-qi)&&(ft=0),(Ke!==0||ft!==0)&&(Ct!==1&&(Ke/=Ct,ft/=Ct),Nt.current.scrollTo({left:Ke+Nt.current.scrollLeft,top:ft+Nt.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[U,ct,yr,Nt,pn,De,dn,vn,dr,rr]),Ba=d.useRef(Bl),Wa=d.useRef(C);Ba.current=Bl,Wa.current=C;const Ua=d.useRef(He);Ua.current=He;const Wl=d.useRef(rt.length);Wl.current=rt.length;const Sr=d.useCallback(async(y,A=!0,F)=>{if(rt[y]?.trailingRowOptions?.disabled===!0)return;const j=ve?.();let K,z=!0;j!==void 0&&(K=await j,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let W=0;const J=()=>{if(Ua.current<=He){W<500&&window.setTimeout(J,W),W=50+W*2;return}const ae=typeof K=="number"?K:z?He:0;Vo.current(y-U,ae,"both",0,0,F?{behavior:F}:void 0),Rt({cell:[y,ae],range:{x:y,y:ae,width:1,height:1}},!1,!1,"edit");const Se=Wa.current([y-U,ae]);Se.allowOverlay&&Ri(Se)&&Se.readonly!==!0&&A&&window.setTimeout(()=>{Ba.current(y,ae)},0)};J()},[rt,ve,U,He,Rt]),Lo=d.useCallback(async(y,A=!0)=>{const F=et?.();let $,j=!0;F!==void 0&&($=await F,$==="left"&&(j=!1),typeof $=="number"&&(j=!1));let K=0;const z=()=>{if(Wl.current<=rt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const W=typeof $=="number"?$:j?rt.length:0;qt(W-U,y),Rt({cell:[W,y],range:{x:W,y,width:1,height:1}},!1,!1,"edit");const J=Wa.current([W-U,y]);J.allowOverlay&&Ri(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{Ba.current(W,y)},0)};z()},[rt,et,U,qt,Rt]),gi=d.useCallback(y=>{const A=dn[y]?.trailingRowOptions?.targetColumn??Oe?.targetColumn;if(typeof A=="number")return A+(An?1:0);if(typeof A=="object"){const F=b.indexOf(A);if(F>=0)return F+(An?1:0)}},[dn,b,An,Oe?.targetColumn]),xr=d.useRef(),pi=d.useRef(),Vi=d.useCallback((y,A)=>{const[F,$]=A;return pr(dt,rt[F]?.themeOverride,Hr?.($),y.themeOverride)},[Hr,rt,dt]),{mapper:Br}=cb(wt,v),Yn=wt?.navigationBehavior,$i=d.useCallback(y=>{const A=ma.value?y.metaKey:y.ctrlKey,F=A&&se==="multi",[$,j]=y.location,K=X.columns,z=X.rows,[W,J]=X.current?.cell??[];if(y.kind==="cell"){if(pi.current=void 0,Wr.current=[$,j],$===0&&An){if(Vt===!0&&j===He||Cn==="number"||se==="none")return;const ae=Hn(y.location);if(ae.kind!==qn.Marker)return;if(nn!==void 0){const Je=rn(ae);Vn(Je?.kind===qn.Marker);const Ke=Je?.onClick?.({...y,cell:ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Vi(ae,y.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ae.checked)return}o(void 0),Sn();const Se=z.hasIndex(j),Et=xr.current;if(se==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Et!==void 0&&z.hasIndex(Et)){const Je=[Math.min(Et,j),Math.max(Et,j)+1];F||_e==="multi"?ut(void 0,Je,!0):ut(Qe.fromSingleSelection(Je),void 0,F)}else se==="multi"&&(F||y.isTouch||_e==="multi")?Se?ut(z.remove(j),void 0,!0):(ut(void 0,j,!0),xr.current=j):Se&&z.length===1?ut(Qe.empty(),void 0,A):(ut(Qe.fromSingleSelection(j),void 0,A),xr.current=j)}else if($>=U&&Vt&&j===He){const ae=gi($);Sr(ae??$)}else if(W!==$||J!==j){const ae=Hn(y.location),Se=rn(ae);if(Se?.onSelect!==void 0){let Ke=!1;if(Se.onSelect({...y,cell:ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Ke=!0,theme:Vi(ae,y.location)}),Ke)return}if(Yn==="block"&&Br(j).isGroupHeader)return;const Et=dr&&j===He,Je=dr&&X!==void 0&&X.current?.cell[1]===He;if((y.shiftKey||y.isLongTouch===!0)&&W!==void 0&&J!==void 0&&X.current!==void 0&&!Je){if(Et)return;const Ke=Math.min($,W),ft=Math.max($,W),it=Math.min(j,J),Ct=Math.max(j,J);Rt({...X.current,range:{x:Ke,y:it,width:ft-Ke+1,height:Ct-it+1}},!0,A,"click"),xr.current=void 0,Sn()}else Rt({cell:[$,j],range:{x:$,y:j,width:1,height:1}},!0,A,"click"),xr.current=void 0,o(void 0),Sn()}}else if(y.kind==="header")if(Wr.current=[$,j],o(void 0),An&&$===0)xr.current=void 0,pi.current=void 0,!si&&se==="multi"&&(z.length!==He?ut(Qe.fromSingleSelection([0,He]),void 0,A):ut(Qe.empty(),void 0,A),Sn());else{const ae=pi.current;if(re==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&ae!==void 0&&K.hasIndex(ae)){const Se=[Math.min(ae,$),Math.max(ae,$)+1];A||y.isTouch||ht==="multi"?Ye(void 0,Se,A):Ye(Qe.fromSingleSelection(Se),void 0,A)}else re==="multi"&&(A||y.isTouch||ht==="multi")?(K.hasIndex($)?Ye(K.remove($),void 0,A):Ye(void 0,$,A),pi.current=$):re!=="none"&&(K.hasIndex($)?Ye(K.remove($),void 0,A):Ye(Qe.fromSingleSelection($),void 0,A),pi.current=$);xr.current=void 0,Sn()}else y.kind===Jn?Wr.current=[$,j]:y.kind===va&&!y.isMaybeScrollbar&&(pe(Ko,!1),o(void 0),Sn(),ln?.(),xr.current=void 0,pi.current=void 0)},[se,re,X,An,U,Vt,He,Cn,Hn,nn,Sn,_e,ht,rn,Vi,ut,gi,Sr,Yn,Br,dr,Rt,si,Ye,pe,ln]),Ni=d.useRef(!1),Wr=d.useRef(),Ul=d.useRef(hr),or=d.useRef(),kh=d.useCallback(y=>{if(mi.current=!1,Ul.current=on.current,y.button!==0&&y.button!==1){or.current=void 0;return}const A=performance.now();or.current={button:y.button,time:A,location:y.location},y?.kind==="header"&&(Ni.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:X,fillHandle:F}),Wr.current=void 0,!y.isTouch&&y.button===0&&!F?$i(y):!y.isTouch&&y.button===1&&(Wr.current=y.location))},[X,$i]),[ja,qa]=d.useState(),jl=d.useCallback(y=>{if(y.kind!==Jn||re!=="multi")return;const A=ma.value?y.metaKey:y.ctrlKey,[F]=y.location,$=X.columns;if(F<U)return;const j=rt[F];let K=F,z=F;for(let W=F-1;W>=U&&vo(j.group,rt[W].group);W--)K--;for(let W=F+1;W<rt.length&&vo(j.group,rt[W].group);W++)z++;if(Sn(),A||y.isTouch||ht==="multi")if($.hasAll([K,z+1])){let W=$;for(let J=K;J<=z;J++)W=W.remove(J);Ye(W,void 0,A)}else Ye(void 0,[K,z+1],A);else Ye(Qe.fromSingleSelection([K,z+1]),void 0,A)},[re,Sn,X.columns,rt,U,Ye,ht]),mi=d.useRef(!1),Fo=d.useCallback(async y=>{if(Q!==void 0&&je!==void 0){const A=on.current.y,F=on.current.height;let $=Q({x:y,y:A,width:1,height:Math.min(F,He-A)},V.current.signal);typeof $!="object"&&($=await $());const j=dn[y-U],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=dt.baseFontFull;const W=Qd(z,dt,j,0,$,wr,li,!1,rn);je?.(j,W.width,y,W.width)}}},[dn,Q,li,dt,wr,je,U,He,rn]),[Mh,Ga]=d.useState(),vi=d.useCallback(async(y,A)=>{const F=y.current?.range;if(F===void 0||Q===void 0||A.current===void 0)return;const $=A.current.range;if(R!==void 0){let W=!1;if(R({fillDestination:{...$,x:$.x-U},patternSource:{...F,x:F.x-U},preventDefault:()=>W=!0}),W)return}let j=Q(F,V.current.signal);typeof j!="object"&&(j=await j());const K=j,z=[];for(let W=0;W<$.width;W++)for(let J=0;J<$.height;J++){const ae=[$.x+W,$.y+J];if(Nd(ae,F))continue;const Se=K[J%F.height][W%F.width];Ii(Se)||!Ri(Se)||z.push({location:ae,value:{...Se}})}Un(z),mn.current?.damage(z.map(W=>({cell:W.location})))},[Q,Un,R,U]),ql=d.useCallback(()=>{if(X.current===void 0||X.current.range.width<=1)return;const y={...X,current:{...X.current,range:{...X.current.range,width:1}}};vi(y,X)},[vi,X]),Gl=d.useCallback(()=>{if(X.current===void 0||X.current.range.height<=1)return;const y={...X,current:{...X.current,range:{...X.current.range,height:1}}};vi(y,X)},[vi,X]),Rh=d.useCallback((y,A)=>{const F=l;if(u(void 0),$a(void 0),Ga(void 0),Ni.current=!1,A)return;if(F?.fillHandle===!0&&X.current!==void 0&&F.previousSelection?.current!==void 0){if(Nr===void 0)return;const Se={...X,current:{...X.current,range:of(F.previousSelection.current.range,Nr)}};vi(F.previousSelection,Se),pe(Se,!0);return}const[$,j]=y.location,[K,z]=Wr.current??[],W=()=>{mi.current=!0},J=Se=>{const Et=Se.isTouch||K===$&&z===j;if(Et&&I?.([$-U,j],{...Se,preventDefault:W}),Se.button===1)return!mi.current;if(!mi.current){const Je=Hn(y.location),Ke=rn(Je);if(Ke!==void 0&&Ke.onClick!==void 0&&Et){const it=Ke.onClick({...Se,cell:Je,posX:Se.localEventX,posY:Se.localEventY,bounds:Se.bounds,theme:Vi(Je,y.location),preventDefault:W});it!==void 0&&!Ii(it)&&Mi(it)&&(Un([{location:Se.location,value:it}]),mn.current?.damage([{cell:Se.location}]))}if(mi.current||X.current===void 0)return!1;let ft=!1;switch(Je.activationBehaviorOverride??Ie){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[it,Ct]=X.current.cell,[xt,wi]=F.previousSelection.current.cell;ft=$===it&&$===xt&&j===Ct&&j===wi&&(Se.isDoubleClick===!0||Ie==="second-click");break}case"single-click":{ft=!0;break}}if(ft){const Ct={inputType:"pointer",pointerActivation:Se.isDoubleClick===!0?"double-click":Je.activationBehaviorOverride??Ie,pointerType:Se.isTouch?"touch":"mouse"};return E?.([$-U,j],Ct),hi(Se.bounds,Ct),!0}}return!1},ae=y.location[0]-U;if(y.isTouch){const Se=on.current,Et=Ul.current;if(Se.x!==Et.x||Se.y!==Et.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&fo(X.current?.cell,y.location)){q?.([ae,y.location[1]],{...y,preventDefault:W});return}else if(y.kind==="header"&&X.columns.hasIndex($)){ue?.(ae,{...y,preventDefault:W});return}else if(y.kind===Jn){if(ae<0)return;te?.(ae,{...y,preventDefault:W});return}}y.kind==="cell"?J(y)||$i(y):y.kind===Jn?N?.(ae,{...y,preventDefault:W}):(y.kind===Ir&&M?.(ae,{...y,preventDefault:W}),$i(y));return}if(y.kind==="header"){if(ae<0)return;y.isEdge?y.isDoubleClick===!0&&Fo($):y.button===0&&$===K&&j===z&&M?.(ae,{...y,preventDefault:W})}if(y.kind===Jn){if(ae<0)return;y.button===0&&$===K&&j===z&&(N?.(ae,{...y,preventDefault:W}),mi.current||jl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&J(y),Wr.current=void 0},[l,X,U,Nr,vi,pe,I,Hn,rn,Ie,Vi,Un,E,hi,q,ue,te,$i,N,M,Fo,jl]),Eh=d.useCallback(y=>{const A={...y,location:[y.location[0]-U,y.location[1]]};tt?.(A),l!==void 0&&y.buttons===0&&(u(void 0),$a(void 0),Ga(void 0),Ni.current=!1),Ga(F=>Ni.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===F?.[0]&&y.scrollEdge[1]===F[1]?F:l===void 0||(or.current?.location[0]??0)<U?void 0:y.scrollEdge)},[l,tt,U]),Ih=d.useCallback((y,A)=>{nt?.(y-U,A)},[nt,U]),Th=d.useCallback((y,A)=>{Xe?.(y-U,A)},[Xe,U]),bi=X?.current?.cell,Dh=d.useCallback((y,A,F,$,j,K)=>{$r.current=!1;let z=bi;z!==void 0&&(z=[z[0]-U,z[1]]);const W=De===0?void 0:{x:0,y:y.y,width:De,height:y.height},J=[];W!==void 0&&J.push(W),ct>0&&(J.push({x:y.x-U,y:He-ct,width:y.width,height:ct}),De>0&&J.push({x:0,y:He-ct,width:De,height:ct}));const ae={x:y.x-U,y:y.y,width:y.width,height:Vt&&y.y+y.height>=He?y.height-1:y.height,tx:j,ty:K,extras:{selected:z,freezeRegion:W,freezeRegions:J}};on.current=ae,Cr(ae),di([A,F,$]),Dn?.(ae,ae.tx,ae.ty,ae.extras)},[bi,U,Vt,He,De,ct,Cr,Dn]),Oh=Er(T,d.useCallback((y,A)=>T?.(y-U,A-U)!==!1,[T,U])),Ph=Er(ke,d.useCallback((y,A)=>{ke?.(y-U,A-U),re!=="none"&&Ye(Qe.fromSingleSelection(A),void 0,!0)},[re,ke,U,Ye])),Ya=d.useRef(!1),_h=d.useCallback(y=>{if(y.location[0]===0&&U>0){y.preventDefault();return}Fe?.({...y,location:[y.location[0]-U,y.location[1]]}),y.defaultPrevented()||(Ya.current=!0),u(void 0)},[Fe,U]),Lh=d.useCallback(()=>{Ya.current=!1},[]),Yl=wt?.selectionBehavior,Ao=d.useCallback(y=>{if(Yl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:$}=Br(y);if(A)return[y,y];const j=F[F.length-1],K=y-j,z=y+$-j-1;return[K,z]},[Br,Yl]),Xa=d.useRef(),Ka=d.useCallback(y=>{if(!df(y,Xa.current)&&(Xa.current=y,!(or?.current?.button!==void 0&&or.current.button>=1))){if(y.buttons!==0&&l!==void 0&&or.current?.location[0]===0&&U===1&&se==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(or.current.location[1])&&X.rows.hasIndex(or.current.location[1])){const A=Math.min(or.current.location[1],y.location[1]),F=Math.max(or.current.location[1],y.location[1])+1;ut(Qe.fromSingleSelection([A,F]),void 0,!1)}else if(y.buttons!==0&&l!==void 0&&X.current!==void 0&&!Ya.current&&!Ni.current&&(Ue==="rect"||Ue==="multi-rect")){const[A,F]=X.current.cell;let[$,j]=y.location;if(j<0&&(j=on.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const K=l.previousSelection.current.range;j=Math.min(j,Vt?He-1:He);const z=K0(K,$,j,pt);$a(z)}else{if(Vt&&F===He)return;if(Vt&&j===He)if(y.kind===va)j--;else return;$=Math.max($,U);const W=Ao(F);j=W===void 0?j:jn(j,W[0],W[1]);const J=$-A,ae=j-F,Se={x:J>=0?A:$,y:ae>=0?F:j,width:Math.abs(J)+1,height:Math.abs(ae)+1};Rt({...X.current,range:Se},!0,!1,"drag")}}Pt?.({...y,location:[y.location[0]-U,y.location[1]]})}},[l,U,se,X,Ue,Pt,ut,Vt,He,pt,Ao,Rt]),Fh=d.useCallback(()=>{const y=Xa.current;if(y===void 0)return;const[A,F]=y.scrollEdge;let[$,j]=y.location;const K=on.current;A===-1?$=K.extras?.freezeRegion?.x??K.x:A===1&&($=K.x+K.width),F===-1?j=Math.max(0,K.y):F===1&&(j=Math.min(He-1,K.y+K.height)),$=jn($,0,rt.length-1),j=jn(j,0,He-1),Ka({...y,location:[$,j]})},[rt.length,Ka,He]);ob(Mh,Nt,Fh);const Xn=d.useCallback(y=>{if(X.current===void 0)return;const[A,F]=y,[$,j]=X.current.cell,K=X.current.range;let z=K.x,W=K.x+K.width,J=K.y,ae=K.y+K.height;const[Se,Et]=Ao(j)??[0,He-1],Je=Et+1;if(F!==0)switch(F){case 2:{ae=Je,J=j,qt(0,ae,"vertical");break}case-2:{J=Se,ae=j+1,qt(0,J,"vertical");break}case 1:{J<j?(J++,qt(0,J,"vertical")):(ae=Math.min(Je,ae+1),qt(0,ae,"vertical"));break}case-1:{ae>j+1?(ae--,qt(0,ae,"vertical")):(J=Math.max(Se,J-1),qt(0,J,"vertical"));break}default:po()}if(A!==0)if(A===2)W=rt.length,z=$,qt(W-1-U,0,"horizontal");else if(A===-2)z=U,W=$+1,qt(z-U,0,"horizontal");else{let Ke=[];if(Q!==void 0){const ft=Q({x:z,y:J,width:W-z-U,height:ae-J},V.current.signal);typeof ft=="object"&&(Ke=pb(ft))}if(A===1){let ft=!1;if(z<$){if(Ke.length>0){const it=Dr(z+1,$+1).find(Ct=>!Ke.includes(Ct-U));it!==void 0&&(z=it,ft=!0)}else z++,ft=!0;ft&&qt(z,0,"horizontal")}ft||(W=Math.min(rt.length,W+1),qt(W-1-U,0,"horizontal"))}else if(A===-1){let ft=!1;if(W>$+1){if(Ke.length>0){const it=Dr(W-1,$,-1).find(Ct=>!Ke.includes(Ct-U));it!==void 0&&(W=it,ft=!0)}else W--,ft=!0;ft&&qt(W-U,0,"horizontal")}ft||(z=Math.max(U,z-1),qt(z-U,0,"horizontal"))}else po()}Rt({cell:X.current.cell,range:{x:z,y:J,width:W-z,height:ae-J}},!0,!1,"keyboard-select")},[Q,Ao,X,rt.length,U,He,qt,Rt]),Za=d.useRef(Fr);Za.current=Fr;const kr=d.useCallback((y,A,F,$)=>{const j=vn-(F?0:1);y=jn(y,U,dn.length-1+U),A=jn(A,0,j);const K=bi?.[0],z=bi?.[1];if(y===K&&A===z)return!1;if($&&X.current!==void 0){const W=[...X.current.rangeStack];(X.current.range.width>1||X.current.range.height>1)&&W.push(X.current.range),pe({...X,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:W}},!0)}else Rt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Za.current&&qt(y-U,A),!0},[vn,U,dn.length,bi,X,qt,pe,Rt]),Ah=d.useCallback((y,A)=>{i?.cell!==void 0&&y!==void 0&&Mi(y)&&(Un([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{mn.current?.damage([{cell:i.cell}])})),Sn(!0),o(void 0);const[F,$]=A;if(X.current!==void 0&&(F!==0||$!==0)){const j=X.current.cell[1]===vn-1&&y!==void 0,K=X.current.cell[0]===rt.length-1&&y!==void 0;let z=!0;if(j&&$===1&&ve!==void 0){z=!1;const W=X.current.cell[0]+F,J=gi(W);Sr(J??W,!1)}if(K&&F===1&&et!==void 0){z=!1;const W=X.current.cell[1]+$;Lo(W,!1)}z&&kr(jn(X.current.cell[0]+F,0,rt.length-1),jn(X.current.cell[1]+$,0,vn-1),j,!1)}P?.(y,A)},[i?.cell,Sn,X,P,Un,vn,kr,rt.length,Sr,Lo,ve,et,gi]),Hh=d.useMemo(()=>`gdg-overlay-${gb++}`,[]),Ur=d.useCallback(y=>{Sn();const A=[];for(let F=y.x;F<y.x+y.width;F++)for(let $=y.y;$<y.y+y.height;$++){const j=C([F-U,$]);if(!j.allowOverlay&&j.kind!==Z.Boolean)continue;let K;if(j.kind===Z.Custom){const z=rn(j),W=z?.provideEditor?.({...j,location:[F-U,$]});z?.onDelete!==void 0?K=z.onDelete(j):Up(W)&&(K=W?.deletedValue?.(j))}else(Mi(j)&&j.allowOverlay||j.kind===Z.Boolean)&&(K=rn(j)?.onDelete?.(j));K!==void 0&&!Ii(K)&&Mi(K)&&A.push({location:[F,$],value:K})}Un(A),mn.current?.damage(A.map(F=>({cell:F.location})))},[Sn,C,rn,Un,U]),Bi=i!==void 0,Xl=d.useCallback(y=>{const A=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:$}=y,j=X.columns,K=X.rows,z=ir;if(!Bi&&ot(z.clear,y,F))pe(Ko,!1),ln?.();else if(!Bi&&ot(z.selectAll,y,F))pe({columns:Qe.empty(),rows:Qe.empty(),current:{cell:X.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:He},rangeStack:[]}},!1);else if(ot(z.search,y,F))s?.current?.focus({preventScroll:!0}),zr(!0);else if(ot(z.delete,y,F)){const it=jt?.(X)??!0;if(it!==!1){const Ct=it===!0?X:it;if(Ct.current!==void 0){Ur(Ct.current.range);for(const xt of Ct.current.rangeStack)Ur(xt)}for(const xt of Ct.rows)Ur({x:U,y:xt,width:b.length,height:1});for(const xt of Ct.columns)Ur({x:xt,y:0,width:1,height:He})}}if(F.didMatch)return A(),!0;if(X.current===void 0)return!1;let[W,J]=X.current.cell;const[,ae]=X.current.cell;let Se=!1,Et=!1;if(ot(z.scrollToSelectedCell,y,F))Vo.current(W-U,J);else if(re!=="none"&&ot(z.selectColumn,y,F))j.hasIndex(W)?Ye(j.remove(W),void 0,!0):re==="single"?Ye(Qe.fromSingleSelection(W),void 0,!0):Ye(void 0,W,!0);else if(se!=="none"&&ot(z.selectRow,y,F))K.hasIndex(J)?ut(K.remove(J),void 0,!0):se==="single"?ut(Qe.fromSingleSelection(J),void 0,!0):ut(void 0,J,!0);else if(!Bi&&$!==void 0&&ot(z.activateCell,y,F))if(J===He&&Vt)window.setTimeout(()=>{const it=gi(W);Sr(it??W)},0);else{const it={inputType:"keyboard",key:y.key};E?.([W-U,J],it),hi($,it)}else X.current.range.height>1&&ot(z.downFill,y,F)?Gl():X.current.range.width>1&&ot(z.rightFill,y,F)?ql():ot(z.goToNextPage,y,F)?J+=Math.max(1,on.current.height-4):ot(z.goToPreviousPage,y,F)?J-=Math.max(1,on.current.height-4):ot(z.goToFirstCell,y,F)?(o(void 0),J=0,W=0):ot(z.goToLastCell,y,F)?(o(void 0),J=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER):ot(z.selectToFirstCell,y,F)?(o(void 0),Xn([-2,-2])):ot(z.selectToLastCell,y,F)?(o(void 0),Xn([2,2])):Bi?(ot(z.closeOverlay,y,F)&&o(void 0),ot(z.acceptOverlayDown,y,F)&&(o(void 0),J++),ot(z.acceptOverlayUp,y,F)&&(o(void 0),J--),ot(z.acceptOverlayLeft,y,F)&&(o(void 0),W--),ot(z.acceptOverlayRight,y,F)&&(o(void 0),W++)):(ot(z.goDownCell,y,F)?J+=1:ot(z.goUpCell,y,F)?J-=1:ot(z.goRightCell,y,F)?W+=1:ot(z.goLeftCell,y,F)?W-=1:ot(z.goDownCellRetainSelection,y,F)?(J+=1,Se=!0):ot(z.goUpCellRetainSelection,y,F)?(J-=1,Se=!0):ot(z.goRightCellRetainSelection,y,F)?(W+=1,Se=!0):ot(z.goLeftCellRetainSelection,y,F)?(W-=1,Se=!0):ot(z.goToLastRow,y,F)?J=He-1:ot(z.goToFirstRow,y,F)?J=Number.MIN_SAFE_INTEGER:ot(z.goToLastColumn,y,F)?W=Number.MAX_SAFE_INTEGER:ot(z.goToFirstColumn,y,F)?W=Number.MIN_SAFE_INTEGER:(Ue==="rect"||Ue==="multi-rect")&&(ot(z.selectGrowDown,y,F)?Xn([0,1]):ot(z.selectGrowUp,y,F)?Xn([0,-1]):ot(z.selectGrowRight,y,F)?Xn([1,0]):ot(z.selectGrowLeft,y,F)?Xn([-1,0]):ot(z.selectToLastRow,y,F)?Xn([0,2]):ot(z.selectToFirstRow,y,F)?Xn([0,-2]):ot(z.selectToLastColumn,y,F)?Xn([2,0]):ot(z.selectToFirstColumn,y,F)&&Xn([-2,0])),Et=F.didMatch);if(Yn!==void 0&&Yn!=="normal"&&J!==ae){const it=Yn==="skip-up"||Yn==="skip"||Yn==="block",Ct=Yn==="skip-down"||Yn==="skip"||Yn==="block",xt=J<ae;if(xt&&it){for(;J>=0&&Br(J).isGroupHeader;)J--;J<0&&(J=ae)}else if(!xt&&Ct){for(;J<He&&Br(J).isGroupHeader;)J++;J>=He&&(J=ae)}}const Ke=kr(W,J,!1,Se),ft=F.didMatch;return ft&&(Ke||!Et||In)&&A(),ft},[Yn,Bi,X,ir,re,se,Ue,U,Br,He,kr,pe,ln,b.length,jt,In,Ur,Ye,ut,Vt,gi,Sr,E,hi,Gl,ql,Xn]),Wi=d.useCallback(y=>{let A=!1;if(G!==void 0&&G({...y,...y.location&&{location:[y.location[0]-U,y.location[1]]},cancel:()=>{A=!0}}),A||Xl(y)||X.current===void 0)return;const[F,$]=X.current.cell,j=on.current;if(xe&&!y.metaKey&&!y.ctrlKey&&X.current!==void 0&&y.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(y.key)&&y.bounds!==void 0&&Ri(C([F-U,Math.max(0,Math.min($,He-1))]))){if((!Vt||$!==He)&&(j.y>$||$>j.y+j.height||j.x>F||F>j.x+j.width))return;const K={inputType:"keyboard",key:y.key};E?.([F-U,$],K),hi(y.bounds,K,y.key),y.stopPropagation(),y.preventDefault()}},[xe,G,Xl,X,C,U,He,Vt,E,hi]),zh=d.useCallback((y,A)=>{const F=y.location[0]-U;if(y.kind==="header"&&ue?.(F,{...y,preventDefault:A}),y.kind===Jn){if(F<0)return;te?.(F,{...y,preventDefault:A})}if(y.kind==="cell"){const[$,j]=y.location;q?.([F,j],{...y,preventDefault:A}),qm(X,y.location)||kr($,j,!1,!1)}},[X,q,te,ue,U,kr]),Ja=d.useCallback(async y=>{if(!ir.paste)return;function A(z,W,J,ae){const Se=typeof J=="object"?J?.join(`
|
|
172
|
+
`&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(ic(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function oc(e,t,n){const r=Kv(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function hf(e){return e!==!0}function ac(e){return typeof e=="string"?e:`${e}px`}const Qv=()=>e=>e.innerWidth,eb=()=>e=>e.innerHeight,tb=fn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Qv()],"wmyidgi-1":[eb()]}}),nb=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return d.createElement(tb,{innerHeight:ac(n),innerWidth:ac(t),...i},r)},rb=2,ib=1300;function ob(e,t,n){const r=Bt.useRef(0),[i,o]=e??[0,0];Bt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/ib);const f=r.current**1.618*c*rb;t.current?.scrollBy(i*f,o*f),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function ab({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,f,g,h]=Bt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,w=Kd();return[typeof m=="number"?m*p:b=>Math.ceil(m(b)*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((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:f,overscrollX:g,overscrollY:h}}const Rr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function at(e,t){return e===!0?t:e===!1?"":e}function sc(e){const t=ma.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function sb(e){const t=pm(e);return Bt.useMemo(()=>{if(t===void 0)return sc(Rr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Rr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Rr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Rr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Rr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Rr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Rr.selectToLastCell};return sc({...Rr,...n})},[t])}function lb(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function gl(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let f=0;f<a.subGroups.length;f++){const g=f<a.subGroups.length-1?a.subGroups[f+1].headerIndex:l;r(a.subGroups[f],g,u||a.isCollapsed)}}const i=lb(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Us(e,t){if(t===void 0||gl.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 ub(e,t,n,r){const i=Bt.useMemo(()=>e===void 0?void 0:gl(e,t),[e,t]),o=Bt.useMemo(()=>i?.reduce((c,f)=>(c[f.rowIndex]=f,c),{}),[i]),s=Bt.useMemo(()=>i===void 0?t:i.reduce((c,f)=>c+(f.isCollapsed?1:f.rows+1),0),[i,t]),a=Bt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Bt.useCallback(c=>{if(i===void 0)return c;let f=c;for(const g of i){if(f===0)return;if(f--,!g.isCollapsed){if(f<g.rows)return g.contentIndex+f;f-=g.rows}}return c},[i]),u=Er(r??e?.themeOverride,Bt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:f,contentIndex:g,groupIndex:h}=Us(c,i);return f?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function cb(e,t){const n=Bt.useMemo(()=>e===void 0?void 0:gl(e,t),[e,t]);return{getRowGroupingForPath:pf,updateRowGroupingByPath:gf,mapper:Bt.useCallback(r=>{if(typeof r=="number")return Us(r,n);const i=Us(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function gf(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:gf(o.subGroups??[],i,n)}:o)}function pf(e,t){const[n,...r]=t;return r[0]===-1?e[n]:pf(e[n].subGroups??[],r)}function db(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function fb(e,t,n,r,i){const[o,s]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=gm(a),f=d.useRef(i);f.current=i;const g=db(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(l.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),f.current()}},[t,h,c,g]);const p=(l.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&&c(),f.current()}},[e,p,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const hb=d.lazy(async()=>await Js(()=>import("./data-grid-overlay-editor-cvHWuOOd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let gb=0;function pb(e){return v0(Yu(Yu(e).filter(t=>t.span!==void 0).map(t=>Dr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Yo(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 Xo={kind:Z.Loading,allowOverlay:!1},Ko={columns:Qe.empty(),rows:Qe.empty(),current:void 0},mb=(e,t)=>{const[n,r]=d.useState(Ko),[i,o]=d.useState(),s=d.useRef(null),a=d.useRef(null),[l,u]=d.useState(),c=d.useRef(),f=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:w,columns:b,rows:v,getCellContent:C,onCellClicked:I,onCellActivated:E,onFillPattern:R,onFinishedEditing:P,coercePasteValue:x,drawHeader:S,drawCell:L,editorBloom:D,onHeaderClicked:M,onColumnProposeMove:T,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:N,onCellContextMenu:q,className:Y,onHeaderContextMenu:ue,getCellsForSelection:ee,onGroupHeaderContextMenu:te,onGroupHeaderRenamed:ce,onCellEdited:le,onCellsEdited:he,onSearchResultsChanged:de,searchResults:ie,onSearchValueChange:H,searchValue:_,onKeyDown:G,onKeyUp:ne,keybindings:oe,editOnType:xe=!0,onRowAppended:ve,onColumnAppended:et,onColumnMoved:ke,validateCell:bt,highlightRegions:St,rangeSelect:Ue="rect",columnSelect:re="multi",rowSelect:se="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:fe="exclusive",rowSelectionBlending:ye="exclusive",onDelete:$e,onDragStart:Fe,onMouseMove:tt,onPaste:Re,copyHeaders:qe=!1,freezeColumns:De=0,cellActivationBehavior:Ie="second-click",rowSelectionMode:_e="auto",columnSelectionMode:ht="auto",onHeaderMenuClick:nt,onHeaderIndicatorClick:Xe,getGroupDetails:kt,rowGrouping:wt,onSearchClose:Ot,onItemHovered:Pt,onSelectionCleared:ln,showSearch:Jt,onVisibleRegionChanged:Dn,gridSelection:Tt,onGridSelectionChange:gt,minColumnWidth:On=50,maxColumnWidth:yt=500,maxColumnAutoWidth:Qt,provideEditor:kn,trailingRowOptions:Oe,freezeTrailingRows:ct=0,allowedFillDirections:pt="orthogonal",scrollOffsetX:Pn,scrollOffsetY:un,verticalBorder:cn,onDragOverCell:_n,onDrop:en,onColumnResize:tn,onColumnResizeEnd:Be,onColumnResizeStart:Mt,customRenderers:Ln,fillHandle:Lt,experimental:mt,fixedShadowX:Mn,fixedShadowY:ur,headerIcons:Nn,imageWindowLoader:B,initialSize:We,isDraggable:Ge,onDragLeave:_t,onRowMoved:nn,overscrollX:hn,overscrollY:Rn,preventDiagonalScrolling:yn,rightElement:Ut,rightElementProps:En,trapFocus:In=!1,smoothScrollX:Ce,smoothScrollY:Ft,scaleToRem:Kt=!1,rowHeight:Bn=34,headerHeight:Zt=36,groupHeaderHeight:Gt=Zt,theme:Yt,isOutsideClick:Fn,renderers:Tn,resizeIndicator:Mo,scrollToActiveCell:Fr=!0,drawFocusRing:_a=!0,portalElementRef:Ro}=e,ri=_a==="no-editor"?i===void 0:_a,Gn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Cn=Gn?.kind??e.rowMarkers??"none",ii=Gn?.width??e.rowMarkerWidth,cr=Gn?.startIndex??e.rowMarkerStartIndex??1,oi=Gn?.theme??e.rowMarkerTheme,br=Gn?.headerTheme,ai=Gn?.headerAlwaysVisible,si=se!=="multi"||Gn?.headerDisabled===!0,Ar=Gn?.checkboxStyle??"square",wr=Math.max(On,20),li=Math.max(yt,wr),La=Math.max(Qt??li,wr),Ai=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:He,rowNumberMapper:Hi,rowHeight:Eo,getRowThemeOverride:Hr}=ub(wt,v,Bn,h),Fa=d.useMemo(()=>Number.parseFloat(Ai.fontSize),[Ai]),{rowHeight:rr,headerHeight:zi,groupHeaderHeight:Io,theme:ui,overscrollX:Aa,overscrollY:Ha}=ab({groupHeaderHeight:Gt,headerHeight:Zt,overscrollX:hn,overscrollY:Rn,remSize:Fa,rowHeight:Eo,scaleToRem:Kt,theme:Yt}),ir=sb(oe),yr=ii??(v>1e4?48:v>1e3?44:v>100?36:32),An=Cn!=="none",U=An?1:0,Vt=Oe!==void 0,dr=Oe?.sticky===!0,[za,zr]=d.useState(!1),Va=Jt??za,ci=d.useCallback(()=>{Ot!==void 0?Ot():zr(!1)},[Ot]),X=d.useMemo(()=>Tt===void 0?void 0:Yo(Tt,U),[Tt,U])??n,V=d.useRef();V.current===void 0&&(V.current=new AbortController),d.useEffect(()=>()=>V?.current.abort(),[]);const[Q,Me]=Uv(ee,C,U,V.current,He),Te=d.useCallback((y,A,F)=>{if(bt===void 0)return!0;const $=[y[0]-U,y[1]];return bt?.($,A,F)},[U,bt]),ge=d.useRef(Tt),pe=d.useCallback((y,A)=>{A&&(y=Zv(y,Q,U,k,V.current)),gt!==void 0?(ge.current=Yo(y,-U),gt(ge.current)):r(y)},[gt,Q,U,k]),je=Er(tn,d.useCallback((y,A,F,$)=>{tn?.(b[F-U],A,F-U,$)},[tn,U,b])),Ee=Er(Be,d.useCallback((y,A,F,$)=>{Be?.(b[F-U],A,F-U,$)},[Be,U,b])),Ze=Er(Mt,d.useCallback((y,A,F,$)=>{Mt?.(b[F-U],A,F-U,$)},[Mt,U,b])),vt=Er(S,d.useCallback((y,A)=>S?.({...y,columnIndex:y.columnIndex-U},A)??!1,[S,U])),gn=Er(L,d.useCallback((y,A)=>L?.({...y,col:y.col-U},A)??!1,[L,U])),jt=d.useCallback(y=>{if($e!==void 0){const A=$e(Yo(y,-U));return typeof A=="boolean"?A:Yo(A,U)}return!0},[$e,U]),[Rt,ut,Ye]=Wv(X,pe,we,fe,ye,Ue,O),dt=d.useMemo(()=>pr(Kd(),ui),[ui]),[$t,di]=d.useState([0,0,0]),Vr=d.useMemo(()=>{if(Tn===void 0)return{};const y={};for(const A of Tn)y[A.kind]=A;return y},[Tn]),rn=d.useCallback(y=>y.kind!==Z.Custom?Vr[y.kind]:Ln?.find(A=>A.isMatch(y)),[Ln,Vr]);let{sizedColumns:dn,nonGrowWidth:At}=l0(b,He,Me,$t[0]-(U===0?0:yr)-$t[2],wr,La,dt,rn,V.current);Cn!=="none"&&(At+=yr);const Wn=d.useMemo(()=>dn.some(y=>y.group!==void 0),[dn]),pn=Wn?zi+Io:zi,fi=X.rows.length,fr=Cn==="none"?void 0:fi===0?!1:fi===He?!0:void 0,rt=d.useMemo(()=>Cn==="none"?dn:[{title:"",width:yr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:oi,rowMarker:Ar,rowMarkerChecked:fr,headerRowMarkerTheme:br,headerRowMarkerAlwaysVisible:ai,headerRowMarkerDisabled:si},...dn],[Cn,dn,yr,oi,Ar,fr,br,ai,si]),on=d.useRef({height:1,width:1,x:0,y:0}),$r=d.useRef(!1),{setVisibleRegion:Cr,visibleRegion:hr,scrollRef:Nt}=fb(Pn,un,rr,on,()=>$r.current=!0);on.current=hr;const Sh=hr.x+U,To=hr.y,mn=d.useRef(null),Sn=d.useCallback(y=>{y===!0?mn.current?.focus():window.requestAnimationFrame(()=>{mn.current?.focus()})},[]),vn=Vt?He+1:He,Un=d.useCallback(y=>{const A=U===0?y:y.map($=>({...$,location:[$.location[0]-U,$.location[1]]})),F=he?.(A);if(F!==!0)for(const $ of A)le?.($.location,$.value);return F},[le,he,U]),[Nr,$a]=d.useState(),Do=X.current!==void 0&&X.current.range.width*X.current.range.height>1?X.current.range:void 0,$l=ri?X.current?.cell:void 0,Oo=$l?.[0],Po=$l?.[1],xh=d.useMemo(()=>{if((St===void 0||St.length===0)&&(Do??Oo??Po??Nr)===void 0)return;const y=[];if(St!==void 0)for(const A of St){const F=rt.length-A.range.x-U;F>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(F,A.range.width)},style:A.style})}return Nr!==void 0&&y.push({color:Jr(dt.accentColor,0),range:Nr,style:"dashed"}),Do!==void 0&&y.push({color:Jr(dt.accentColor,.5),range:Do,style:"solid-outline"}),Oo!==void 0&&Po!==void 0&&y.push({color:dt.accentColor,range:{x:Oo,y:Po,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Nr,Do,Oo,Po,St,rt.length,dt.accentColor,U]),Nl=d.useRef(rt);Nl.current=rt;const Hn=d.useCallback(([y,A],F=!1)=>{const $=Vt&&A===vn-1;if(y===0&&An){if($)return Xo;const K=Hi(A);return K===void 0?Xo:{kind:qn.Marker,allowOverlay:!1,checkboxStyle:Ar,checked:X?.rows.hasIndex(A)===!0,markerKind:Cn==="clickable-number"?"number":Cn,row:cr+K,drawHandle:nn!==void 0,cursor:Cn==="clickable-number"?"pointer":void 0}}else if($){const z=y===U?Oe?.hint??"":"",W=Nl.current[y];if(W?.trailingRowOptions?.disabled===!0)return Xo;{const J=W?.trailingRowOptions?.hint??z,ae=W?.trailingRowOptions?.addIcon??Oe?.addIcon;return{kind:qn.NewRow,hint:J,allowOverlay:!1,icon:ae}}}else{const K=y-U;if(F||mt?.strict===!0){const W=on.current,J=W.x>K||K>W.x+W.width||W.y>A||A>W.y+W.height||A>=Ua.current,ae=K===W.extras?.selected?.[0]&&A===W.extras?.selected[1];let Se=!1;if(W.extras?.freezeRegions!==void 0){for(const Et of W.extras.freezeRegions)if(Zr(Et,K,A)){Se=!0;break}}if(J&&!ae&&!Se)return Xo}let z=C([K,A]);return U!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+U,z.span[1]+U]}),z}},[Vt,vn,An,Hi,Ar,X?.rows,Cn,cr,nn,U,Oe?.hint,Oe?.addIcon,mt?.strict,C]),Na=d.useCallback(y=>{let A=kt?.(y)??{name:y};return ce!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>qa({group:A.name,bounds:F.bounds})}]}),A},[kt,ce]),_o=d.useCallback(y=>{const[A,F]=y.cell,$=rt[A],j=$?.group!==void 0?Na($.group)?.overrideTheme:void 0,K=$?.themeOverride,z=Hr?.(F);o({...y,theme:pr(dt,j,K,z,y.content.themeOverride)})},[Hr,rt,Na,dt]),hi=d.useCallback((y,A,F)=>{if(X.current===void 0)return;const[$,j]=X.current.cell,K=Hn([$,j]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(F!==void 0)switch(z.kind){case Z.Number:{const W=Wp(()=>F==="-"?-0:Number.parseFloat(F),0);z={...z,data:Number.isNaN(W)?0:W};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:F};break}_o({target:y,content:z,initialValue:F,cell:[$,j],highlight:F===void 0,forceEditMode:F!==void 0,activation:A})}else K.kind===Z.Boolean&&A.inputType==="keyboard"&&K.readonly!==!0&&(Un([{location:X.current.cell,value:{...K,data:hf(K.data)}}]),mn.current?.damage([{cell:X.current.cell}]))},[Hn,X,Un,_o]),Bl=d.useCallback((y,A)=>{const F=mn.current?.getBounds(y,A);if(F===void 0||Nt.current===null)return;const $=Hn([y,A]);$.allowOverlay&&_o({target:F,content:$,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Hn,Nt,_o]),qt=d.useCallback((y,A,F="both",$=0,j=0,K=void 0)=>{if(Nt.current!==null){const z=mn.current,W=a.current,J=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,ae=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,Se=typeof y!="number"&&y.unit==="px"?y.amount:void 0,Et=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&W!==null){let Je={x:0,y:0,width:0,height:0},Ke=0,ft=0;if((J!==void 0||ae!==void 0)&&(Je=z.getBounds((J??0)+U,ae??0)??Je,Je.width===0||Je.height===0))return;const it=W.getBoundingClientRect(),Ct=it.width/W.offsetWidth;if(Se!==void 0&&(Je={...Je,x:Se-it.left-Nt.current.scrollLeft,width:1}),Et!==void 0&&(Je={...Je,y:Et+it.top-Nt.current.scrollTop,height:1}),Je!==void 0){const xt={x:Je.x-$,y:Je.y-j,width:Je.width+2*$,height:Je.height+2*j};let wi=0;for(let Qa=0;Qa<De;Qa++)wi+=dn[Qa].width;let ji=0;const qi=ct+(dr?1:0);qi>0&&(ji=ni(vn,qi,rr));let ar=wi*Ct+it.left+U*yr*Ct,yi=it.right,jr=it.top+pn*Ct,Ci=it.bottom-ji*Ct;const $o=Je.width+$*2;switch(K?.hAlign){case"start":yi=ar+$o;break;case"end":ar=yi-$o;break;case"center":ar=Math.floor((ar+yi)/2)-$o/2,yi=ar+$o;break}const No=Je.height+j*2;switch(K?.vAlign){case"start":Ci=jr+No;break;case"end":jr=Ci-No;break;case"center":jr=Math.floor((jr+Ci)/2)-No/2,Ci=jr+No;break}ar>xt.x?Ke=xt.x-ar:yi<xt.x+xt.width&&(Ke=xt.x+xt.width-yi),jr>xt.y?ft=xt.y-jr:Ci<xt.y+xt.height&&(ft=xt.y+xt.height-Ci),F==="vertical"||typeof y=="number"&&y<De?Ke=0:(F==="horizontal"||typeof A=="number"&&A>=vn-qi)&&(ft=0),(Ke!==0||ft!==0)&&(Ct!==1&&(Ke/=Ct,ft/=Ct),Nt.current.scrollTo({left:Ke+Nt.current.scrollLeft,top:ft+Nt.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[U,ct,yr,Nt,pn,De,dn,vn,dr,rr]),Ba=d.useRef(Bl),Wa=d.useRef(C);Ba.current=Bl,Wa.current=C;const Ua=d.useRef(He);Ua.current=He;const Wl=d.useRef(rt.length);Wl.current=rt.length;const Sr=d.useCallback(async(y,A=!0,F)=>{if(rt[y]?.trailingRowOptions?.disabled===!0)return;const j=ve?.();let K,z=!0;j!==void 0&&(K=await j,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let W=0;const J=()=>{if(Ua.current<=He){W<500&&window.setTimeout(J,W),W=50+W*2;return}const ae=typeof K=="number"?K:z?He:0;Vo.current(y-U,ae,"both",0,0,F?{behavior:F}:void 0),Rt({cell:[y,ae],range:{x:y,y:ae,width:1,height:1}},!1,!1,"edit");const Se=Wa.current([y-U,ae]);Se.allowOverlay&&Ri(Se)&&Se.readonly!==!0&&A&&window.setTimeout(()=>{Ba.current(y,ae)},0)};J()},[rt,ve,U,He,Rt]),Lo=d.useCallback(async(y,A=!0)=>{const F=et?.();let $,j=!0;F!==void 0&&($=await F,$==="left"&&(j=!1),typeof $=="number"&&(j=!1));let K=0;const z=()=>{if(Wl.current<=rt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const W=typeof $=="number"?$:j?rt.length:0;qt(W-U,y),Rt({cell:[W,y],range:{x:W,y,width:1,height:1}},!1,!1,"edit");const J=Wa.current([W-U,y]);J.allowOverlay&&Ri(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{Ba.current(W,y)},0)};z()},[rt,et,U,qt,Rt]),gi=d.useCallback(y=>{const A=dn[y]?.trailingRowOptions?.targetColumn??Oe?.targetColumn;if(typeof A=="number")return A+(An?1:0);if(typeof A=="object"){const F=b.indexOf(A);if(F>=0)return F+(An?1:0)}},[dn,b,An,Oe?.targetColumn]),xr=d.useRef(),pi=d.useRef(),Vi=d.useCallback((y,A)=>{const[F,$]=A;return pr(dt,rt[F]?.themeOverride,Hr?.($),y.themeOverride)},[Hr,rt,dt]),{mapper:Br}=cb(wt,v),Yn=wt?.navigationBehavior,$i=d.useCallback(y=>{const A=ma.value?y.metaKey:y.ctrlKey,F=A&&se==="multi",[$,j]=y.location,K=X.columns,z=X.rows,[W,J]=X.current?.cell??[];if(y.kind==="cell"){if(pi.current=void 0,Wr.current=[$,j],$===0&&An){if(Vt===!0&&j===He||Cn==="number"||se==="none")return;const ae=Hn(y.location);if(ae.kind!==qn.Marker)return;if(nn!==void 0){const Je=rn(ae);Vn(Je?.kind===qn.Marker);const Ke=Je?.onClick?.({...y,cell:ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Vi(ae,y.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ae.checked)return}o(void 0),Sn();const Se=z.hasIndex(j),Et=xr.current;if(se==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Et!==void 0&&z.hasIndex(Et)){const Je=[Math.min(Et,j),Math.max(Et,j)+1];F||_e==="multi"?ut(void 0,Je,!0):ut(Qe.fromSingleSelection(Je),void 0,F)}else se==="multi"&&(F||y.isTouch||_e==="multi")?Se?ut(z.remove(j),void 0,!0):(ut(void 0,j,!0),xr.current=j):Se&&z.length===1?ut(Qe.empty(),void 0,A):(ut(Qe.fromSingleSelection(j),void 0,A),xr.current=j)}else if($>=U&&Vt&&j===He){const ae=gi($);Sr(ae??$)}else if(W!==$||J!==j){const ae=Hn(y.location),Se=rn(ae);if(Se?.onSelect!==void 0){let Ke=!1;if(Se.onSelect({...y,cell:ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Ke=!0,theme:Vi(ae,y.location)}),Ke)return}if(Yn==="block"&&Br(j).isGroupHeader)return;const Et=dr&&j===He,Je=dr&&X!==void 0&&X.current?.cell[1]===He;if((y.shiftKey||y.isLongTouch===!0)&&W!==void 0&&J!==void 0&&X.current!==void 0&&!Je){if(Et)return;const Ke=Math.min($,W),ft=Math.max($,W),it=Math.min(j,J),Ct=Math.max(j,J);Rt({...X.current,range:{x:Ke,y:it,width:ft-Ke+1,height:Ct-it+1}},!0,A,"click"),xr.current=void 0,Sn()}else Rt({cell:[$,j],range:{x:$,y:j,width:1,height:1}},!0,A,"click"),xr.current=void 0,o(void 0),Sn()}}else if(y.kind==="header")if(Wr.current=[$,j],o(void 0),An&&$===0)xr.current=void 0,pi.current=void 0,!si&&se==="multi"&&(z.length!==He?ut(Qe.fromSingleSelection([0,He]),void 0,A):ut(Qe.empty(),void 0,A),Sn());else{const ae=pi.current;if(re==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&ae!==void 0&&K.hasIndex(ae)){const Se=[Math.min(ae,$),Math.max(ae,$)+1];A||y.isTouch||ht==="multi"?Ye(void 0,Se,A):Ye(Qe.fromSingleSelection(Se),void 0,A)}else re==="multi"&&(A||y.isTouch||ht==="multi")?(K.hasIndex($)?Ye(K.remove($),void 0,A):Ye(void 0,$,A),pi.current=$):re!=="none"&&(K.hasIndex($)?Ye(K.remove($),void 0,A):Ye(Qe.fromSingleSelection($),void 0,A),pi.current=$);xr.current=void 0,Sn()}else y.kind===Jn?Wr.current=[$,j]:y.kind===va&&!y.isMaybeScrollbar&&(pe(Ko,!1),o(void 0),Sn(),ln?.(),xr.current=void 0,pi.current=void 0)},[se,re,X,An,U,Vt,He,Cn,Hn,nn,Sn,_e,ht,rn,Vi,ut,gi,Sr,Yn,Br,dr,Rt,si,Ye,pe,ln]),Ni=d.useRef(!1),Wr=d.useRef(),Ul=d.useRef(hr),or=d.useRef(),kh=d.useCallback(y=>{if(mi.current=!1,Ul.current=on.current,y.button!==0&&y.button!==1){or.current=void 0;return}const A=performance.now();or.current={button:y.button,time:A,location:y.location},y?.kind==="header"&&(Ni.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:X,fillHandle:F}),Wr.current=void 0,!y.isTouch&&y.button===0&&!F?$i(y):!y.isTouch&&y.button===1&&(Wr.current=y.location))},[X,$i]),[ja,qa]=d.useState(),jl=d.useCallback(y=>{if(y.kind!==Jn||re!=="multi")return;const A=ma.value?y.metaKey:y.ctrlKey,[F]=y.location,$=X.columns;if(F<U)return;const j=rt[F];let K=F,z=F;for(let W=F-1;W>=U&&vo(j.group,rt[W].group);W--)K--;for(let W=F+1;W<rt.length&&vo(j.group,rt[W].group);W++)z++;if(Sn(),A||y.isTouch||ht==="multi")if($.hasAll([K,z+1])){let W=$;for(let J=K;J<=z;J++)W=W.remove(J);Ye(W,void 0,A)}else Ye(void 0,[K,z+1],A);else Ye(Qe.fromSingleSelection([K,z+1]),void 0,A)},[re,Sn,X.columns,rt,U,Ye,ht]),mi=d.useRef(!1),Fo=d.useCallback(async y=>{if(Q!==void 0&&je!==void 0){const A=on.current.y,F=on.current.height;let $=Q({x:y,y:A,width:1,height:Math.min(F,He-A)},V.current.signal);typeof $!="object"&&($=await $());const j=dn[y-U],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=dt.baseFontFull;const W=Qd(z,dt,j,0,$,wr,li,!1,rn);je?.(j,W.width,y,W.width)}}},[dn,Q,li,dt,wr,je,U,He,rn]),[Mh,Ga]=d.useState(),vi=d.useCallback(async(y,A)=>{const F=y.current?.range;if(F===void 0||Q===void 0||A.current===void 0)return;const $=A.current.range;if(R!==void 0){let W=!1;if(R({fillDestination:{...$,x:$.x-U},patternSource:{...F,x:F.x-U},preventDefault:()=>W=!0}),W)return}let j=Q(F,V.current.signal);typeof j!="object"&&(j=await j());const K=j,z=[];for(let W=0;W<$.width;W++)for(let J=0;J<$.height;J++){const ae=[$.x+W,$.y+J];if(Nd(ae,F))continue;const Se=K[J%F.height][W%F.width];Ii(Se)||!Ri(Se)||z.push({location:ae,value:{...Se}})}Un(z),mn.current?.damage(z.map(W=>({cell:W.location})))},[Q,Un,R,U]),ql=d.useCallback(()=>{if(X.current===void 0||X.current.range.width<=1)return;const y={...X,current:{...X.current,range:{...X.current.range,width:1}}};vi(y,X)},[vi,X]),Gl=d.useCallback(()=>{if(X.current===void 0||X.current.range.height<=1)return;const y={...X,current:{...X.current,range:{...X.current.range,height:1}}};vi(y,X)},[vi,X]),Rh=d.useCallback((y,A)=>{const F=l;if(u(void 0),$a(void 0),Ga(void 0),Ni.current=!1,A)return;if(F?.fillHandle===!0&&X.current!==void 0&&F.previousSelection?.current!==void 0){if(Nr===void 0)return;const Se={...X,current:{...X.current,range:of(F.previousSelection.current.range,Nr)}};vi(F.previousSelection,Se),pe(Se,!0);return}const[$,j]=y.location,[K,z]=Wr.current??[],W=()=>{mi.current=!0},J=Se=>{const Et=Se.isTouch||K===$&&z===j;if(Et&&I?.([$-U,j],{...Se,preventDefault:W}),Se.button===1)return!mi.current;if(!mi.current){const Je=Hn(y.location),Ke=rn(Je);if(Ke!==void 0&&Ke.onClick!==void 0&&Et){const it=Ke.onClick({...Se,cell:Je,posX:Se.localEventX,posY:Se.localEventY,bounds:Se.bounds,theme:Vi(Je,y.location),preventDefault:W});it!==void 0&&!Ii(it)&&Mi(it)&&(Un([{location:Se.location,value:it}]),mn.current?.damage([{cell:Se.location}]))}if(mi.current||X.current===void 0)return!1;let ft=!1;switch(Je.activationBehaviorOverride??Ie){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[it,Ct]=X.current.cell,[xt,wi]=F.previousSelection.current.cell;ft=$===it&&$===xt&&j===Ct&&j===wi&&(Se.isDoubleClick===!0||Ie==="second-click");break}case"single-click":{ft=!0;break}}if(ft){const Ct={inputType:"pointer",pointerActivation:Se.isDoubleClick===!0?"double-click":Je.activationBehaviorOverride??Ie,pointerType:Se.isTouch?"touch":"mouse"};return E?.([$-U,j],Ct),hi(Se.bounds,Ct),!0}}return!1},ae=y.location[0]-U;if(y.isTouch){const Se=on.current,Et=Ul.current;if(Se.x!==Et.x||Se.y!==Et.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&fo(X.current?.cell,y.location)){q?.([ae,y.location[1]],{...y,preventDefault:W});return}else if(y.kind==="header"&&X.columns.hasIndex($)){ue?.(ae,{...y,preventDefault:W});return}else if(y.kind===Jn){if(ae<0)return;te?.(ae,{...y,preventDefault:W});return}}y.kind==="cell"?J(y)||$i(y):y.kind===Jn?N?.(ae,{...y,preventDefault:W}):(y.kind===Ir&&M?.(ae,{...y,preventDefault:W}),$i(y));return}if(y.kind==="header"){if(ae<0)return;y.isEdge?y.isDoubleClick===!0&&Fo($):y.button===0&&$===K&&j===z&&M?.(ae,{...y,preventDefault:W})}if(y.kind===Jn){if(ae<0)return;y.button===0&&$===K&&j===z&&(N?.(ae,{...y,preventDefault:W}),mi.current||jl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&J(y),Wr.current=void 0},[l,X,U,Nr,vi,pe,I,Hn,rn,Ie,Vi,Un,E,hi,q,ue,te,$i,N,M,Fo,jl]),Eh=d.useCallback(y=>{const A={...y,location:[y.location[0]-U,y.location[1]]};tt?.(A),l!==void 0&&y.buttons===0&&(u(void 0),$a(void 0),Ga(void 0),Ni.current=!1),Ga(F=>Ni.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===F?.[0]&&y.scrollEdge[1]===F[1]?F:l===void 0||(or.current?.location[0]??0)<U?void 0:y.scrollEdge)},[l,tt,U]),Ih=d.useCallback((y,A)=>{nt?.(y-U,A)},[nt,U]),Th=d.useCallback((y,A)=>{Xe?.(y-U,A)},[Xe,U]),bi=X?.current?.cell,Dh=d.useCallback((y,A,F,$,j,K)=>{$r.current=!1;let z=bi;z!==void 0&&(z=[z[0]-U,z[1]]);const W=De===0?void 0:{x:0,y:y.y,width:De,height:y.height},J=[];W!==void 0&&J.push(W),ct>0&&(J.push({x:y.x-U,y:He-ct,width:y.width,height:ct}),De>0&&J.push({x:0,y:He-ct,width:De,height:ct}));const ae={x:y.x-U,y:y.y,width:y.width,height:Vt&&y.y+y.height>=He?y.height-1:y.height,tx:j,ty:K,extras:{selected:z,freezeRegion:W,freezeRegions:J}};on.current=ae,Cr(ae),di([A,F,$]),Dn?.(ae,ae.tx,ae.ty,ae.extras)},[bi,U,Vt,He,De,ct,Cr,Dn]),Oh=Er(T,d.useCallback((y,A)=>T?.(y-U,A-U)!==!1,[T,U])),Ph=Er(ke,d.useCallback((y,A)=>{ke?.(y-U,A-U),re!=="none"&&Ye(Qe.fromSingleSelection(A),void 0,!0)},[re,ke,U,Ye])),Ya=d.useRef(!1),_h=d.useCallback(y=>{if(y.location[0]===0&&U>0){y.preventDefault();return}Fe?.({...y,location:[y.location[0]-U,y.location[1]]}),y.defaultPrevented()||(Ya.current=!0),u(void 0)},[Fe,U]),Lh=d.useCallback(()=>{Ya.current=!1},[]),Yl=wt?.selectionBehavior,Ao=d.useCallback(y=>{if(Yl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:$}=Br(y);if(A)return[y,y];const j=F[F.length-1],K=y-j,z=y+$-j-1;return[K,z]},[Br,Yl]),Xa=d.useRef(),Ka=d.useCallback(y=>{if(!df(y,Xa.current)&&(Xa.current=y,!(or?.current?.button!==void 0&&or.current.button>=1))){if(y.buttons!==0&&l!==void 0&&or.current?.location[0]===0&&U===1&&se==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(or.current.location[1])&&X.rows.hasIndex(or.current.location[1])){const A=Math.min(or.current.location[1],y.location[1]),F=Math.max(or.current.location[1],y.location[1])+1;ut(Qe.fromSingleSelection([A,F]),void 0,!1)}else if(y.buttons!==0&&l!==void 0&&X.current!==void 0&&!Ya.current&&!Ni.current&&(Ue==="rect"||Ue==="multi-rect")){const[A,F]=X.current.cell;let[$,j]=y.location;if(j<0&&(j=on.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const K=l.previousSelection.current.range;j=Math.min(j,Vt?He-1:He);const z=K0(K,$,j,pt);$a(z)}else{if(Vt&&F===He)return;if(Vt&&j===He)if(y.kind===va)j--;else return;$=Math.max($,U);const W=Ao(F);j=W===void 0?j:jn(j,W[0],W[1]);const J=$-A,ae=j-F,Se={x:J>=0?A:$,y:ae>=0?F:j,width:Math.abs(J)+1,height:Math.abs(ae)+1};Rt({...X.current,range:Se},!0,!1,"drag")}}Pt?.({...y,location:[y.location[0]-U,y.location[1]]})}},[l,U,se,X,Ue,Pt,ut,Vt,He,pt,Ao,Rt]),Fh=d.useCallback(()=>{const y=Xa.current;if(y===void 0)return;const[A,F]=y.scrollEdge;let[$,j]=y.location;const K=on.current;A===-1?$=K.extras?.freezeRegion?.x??K.x:A===1&&($=K.x+K.width),F===-1?j=Math.max(0,K.y):F===1&&(j=Math.min(He-1,K.y+K.height)),$=jn($,0,rt.length-1),j=jn(j,0,He-1),Ka({...y,location:[$,j]})},[rt.length,Ka,He]);ob(Mh,Nt,Fh);const Xn=d.useCallback(y=>{if(X.current===void 0)return;const[A,F]=y,[$,j]=X.current.cell,K=X.current.range;let z=K.x,W=K.x+K.width,J=K.y,ae=K.y+K.height;const[Se,Et]=Ao(j)??[0,He-1],Je=Et+1;if(F!==0)switch(F){case 2:{ae=Je,J=j,qt(0,ae,"vertical");break}case-2:{J=Se,ae=j+1,qt(0,J,"vertical");break}case 1:{J<j?(J++,qt(0,J,"vertical")):(ae=Math.min(Je,ae+1),qt(0,ae,"vertical"));break}case-1:{ae>j+1?(ae--,qt(0,ae,"vertical")):(J=Math.max(Se,J-1),qt(0,J,"vertical"));break}default:po()}if(A!==0)if(A===2)W=rt.length,z=$,qt(W-1-U,0,"horizontal");else if(A===-2)z=U,W=$+1,qt(z-U,0,"horizontal");else{let Ke=[];if(Q!==void 0){const ft=Q({x:z,y:J,width:W-z-U,height:ae-J},V.current.signal);typeof ft=="object"&&(Ke=pb(ft))}if(A===1){let ft=!1;if(z<$){if(Ke.length>0){const it=Dr(z+1,$+1).find(Ct=>!Ke.includes(Ct-U));it!==void 0&&(z=it,ft=!0)}else z++,ft=!0;ft&&qt(z,0,"horizontal")}ft||(W=Math.min(rt.length,W+1),qt(W-1-U,0,"horizontal"))}else if(A===-1){let ft=!1;if(W>$+1){if(Ke.length>0){const it=Dr(W-1,$,-1).find(Ct=>!Ke.includes(Ct-U));it!==void 0&&(W=it,ft=!0)}else W--,ft=!0;ft&&qt(W-U,0,"horizontal")}ft||(z=Math.max(U,z-1),qt(z-U,0,"horizontal"))}else po()}Rt({cell:X.current.cell,range:{x:z,y:J,width:W-z,height:ae-J}},!0,!1,"keyboard-select")},[Q,Ao,X,rt.length,U,He,qt,Rt]),Za=d.useRef(Fr);Za.current=Fr;const kr=d.useCallback((y,A,F,$)=>{const j=vn-(F?0:1);y=jn(y,U,dn.length-1+U),A=jn(A,0,j);const K=bi?.[0],z=bi?.[1];if(y===K&&A===z)return!1;if($&&X.current!==void 0){const W=[...X.current.rangeStack];(X.current.range.width>1||X.current.range.height>1)&&W.push(X.current.range),pe({...X,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:W}},!0)}else Rt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Za.current&&qt(y-U,A),!0},[vn,U,dn.length,bi,X,qt,pe,Rt]),Ah=d.useCallback((y,A)=>{i?.cell!==void 0&&y!==void 0&&Mi(y)&&(Un([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{mn.current?.damage([{cell:i.cell}])})),Sn(!0),o(void 0);const[F,$]=A;if(X.current!==void 0&&(F!==0||$!==0)){const j=X.current.cell[1]===vn-1&&y!==void 0,K=X.current.cell[0]===rt.length-1&&y!==void 0;let z=!0;if(j&&$===1&&ve!==void 0){z=!1;const W=X.current.cell[0]+F,J=gi(W);Sr(J??W,!1)}if(K&&F===1&&et!==void 0){z=!1;const W=X.current.cell[1]+$;Lo(W,!1)}z&&kr(jn(X.current.cell[0]+F,0,rt.length-1),jn(X.current.cell[1]+$,0,vn-1),j,!1)}P?.(y,A)},[i?.cell,Sn,X,P,Un,vn,kr,rt.length,Sr,Lo,ve,et,gi]),Hh=d.useMemo(()=>`gdg-overlay-${gb++}`,[]),Ur=d.useCallback(y=>{Sn();const A=[];for(let F=y.x;F<y.x+y.width;F++)for(let $=y.y;$<y.y+y.height;$++){const j=C([F-U,$]);if(!j.allowOverlay&&j.kind!==Z.Boolean)continue;let K;if(j.kind===Z.Custom){const z=rn(j),W=z?.provideEditor?.({...j,location:[F-U,$]});z?.onDelete!==void 0?K=z.onDelete(j):Up(W)&&(K=W?.deletedValue?.(j))}else(Mi(j)&&j.allowOverlay||j.kind===Z.Boolean)&&(K=rn(j)?.onDelete?.(j));K!==void 0&&!Ii(K)&&Mi(K)&&A.push({location:[F,$],value:K})}Un(A),mn.current?.damage(A.map(F=>({cell:F.location})))},[Sn,C,rn,Un,U]),Bi=i!==void 0,Xl=d.useCallback(y=>{const A=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:$}=y,j=X.columns,K=X.rows,z=ir;if(!Bi&&ot(z.clear,y,F))pe(Ko,!1),ln?.();else if(!Bi&&ot(z.selectAll,y,F))pe({columns:Qe.empty(),rows:Qe.empty(),current:{cell:X.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:He},rangeStack:[]}},!1);else if(ot(z.search,y,F))s?.current?.focus({preventScroll:!0}),zr(!0);else if(ot(z.delete,y,F)){const it=jt?.(X)??!0;if(it!==!1){const Ct=it===!0?X:it;if(Ct.current!==void 0){Ur(Ct.current.range);for(const xt of Ct.current.rangeStack)Ur(xt)}for(const xt of Ct.rows)Ur({x:U,y:xt,width:b.length,height:1});for(const xt of Ct.columns)Ur({x:xt,y:0,width:1,height:He})}}if(F.didMatch)return A(),!0;if(X.current===void 0)return!1;let[W,J]=X.current.cell;const[,ae]=X.current.cell;let Se=!1,Et=!1;if(ot(z.scrollToSelectedCell,y,F))Vo.current(W-U,J);else if(re!=="none"&&ot(z.selectColumn,y,F))j.hasIndex(W)?Ye(j.remove(W),void 0,!0):re==="single"?Ye(Qe.fromSingleSelection(W),void 0,!0):Ye(void 0,W,!0);else if(se!=="none"&&ot(z.selectRow,y,F))K.hasIndex(J)?ut(K.remove(J),void 0,!0):se==="single"?ut(Qe.fromSingleSelection(J),void 0,!0):ut(void 0,J,!0);else if(!Bi&&$!==void 0&&ot(z.activateCell,y,F))if(J===He&&Vt)window.setTimeout(()=>{const it=gi(W);Sr(it??W)},0);else{const it={inputType:"keyboard",key:y.key};E?.([W-U,J],it),hi($,it)}else X.current.range.height>1&&ot(z.downFill,y,F)?Gl():X.current.range.width>1&&ot(z.rightFill,y,F)?ql():ot(z.goToNextPage,y,F)?J+=Math.max(1,on.current.height-4):ot(z.goToPreviousPage,y,F)?J-=Math.max(1,on.current.height-4):ot(z.goToFirstCell,y,F)?(o(void 0),J=0,W=0):ot(z.goToLastCell,y,F)?(o(void 0),J=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER):ot(z.selectToFirstCell,y,F)?(o(void 0),Xn([-2,-2])):ot(z.selectToLastCell,y,F)?(o(void 0),Xn([2,2])):Bi?(ot(z.closeOverlay,y,F)&&o(void 0),ot(z.acceptOverlayDown,y,F)&&(o(void 0),J++),ot(z.acceptOverlayUp,y,F)&&(o(void 0),J--),ot(z.acceptOverlayLeft,y,F)&&(o(void 0),W--),ot(z.acceptOverlayRight,y,F)&&(o(void 0),W++)):(ot(z.goDownCell,y,F)?J+=1:ot(z.goUpCell,y,F)?J-=1:ot(z.goRightCell,y,F)?W+=1:ot(z.goLeftCell,y,F)?W-=1:ot(z.goDownCellRetainSelection,y,F)?(J+=1,Se=!0):ot(z.goUpCellRetainSelection,y,F)?(J-=1,Se=!0):ot(z.goRightCellRetainSelection,y,F)?(W+=1,Se=!0):ot(z.goLeftCellRetainSelection,y,F)?(W-=1,Se=!0):ot(z.goToLastRow,y,F)?J=He-1:ot(z.goToFirstRow,y,F)?J=Number.MIN_SAFE_INTEGER:ot(z.goToLastColumn,y,F)?W=Number.MAX_SAFE_INTEGER:ot(z.goToFirstColumn,y,F)?W=Number.MIN_SAFE_INTEGER:(Ue==="rect"||Ue==="multi-rect")&&(ot(z.selectGrowDown,y,F)?Xn([0,1]):ot(z.selectGrowUp,y,F)?Xn([0,-1]):ot(z.selectGrowRight,y,F)?Xn([1,0]):ot(z.selectGrowLeft,y,F)?Xn([-1,0]):ot(z.selectToLastRow,y,F)?Xn([0,2]):ot(z.selectToFirstRow,y,F)?Xn([0,-2]):ot(z.selectToLastColumn,y,F)?Xn([2,0]):ot(z.selectToFirstColumn,y,F)&&Xn([-2,0])),Et=F.didMatch);if(Yn!==void 0&&Yn!=="normal"&&J!==ae){const it=Yn==="skip-up"||Yn==="skip"||Yn==="block",Ct=Yn==="skip-down"||Yn==="skip"||Yn==="block",xt=J<ae;if(xt&&it){for(;J>=0&&Br(J).isGroupHeader;)J--;J<0&&(J=ae)}else if(!xt&&Ct){for(;J<He&&Br(J).isGroupHeader;)J++;J>=He&&(J=ae)}}const Ke=kr(W,J,!1,Se),ft=F.didMatch;return ft&&(Ke||!Et||In)&&A(),ft},[Yn,Bi,X,ir,re,se,Ue,U,Br,He,kr,pe,ln,b.length,jt,In,Ur,Ye,ut,Vt,gi,Sr,E,hi,Gl,ql,Xn]),Wi=d.useCallback(y=>{let A=!1;if(G!==void 0&&G({...y,...y.location&&{location:[y.location[0]-U,y.location[1]]},cancel:()=>{A=!0}}),A||Xl(y)||X.current===void 0)return;const[F,$]=X.current.cell,j=on.current;if(xe&&!y.metaKey&&!y.ctrlKey&&X.current!==void 0&&y.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(y.key)&&y.bounds!==void 0&&Ri(C([F-U,Math.max(0,Math.min($,He-1))]))){if((!Vt||$!==He)&&(j.y>$||$>j.y+j.height||j.x>F||F>j.x+j.width))return;const K={inputType:"keyboard",key:y.key};E?.([F-U,$],K),hi(y.bounds,K,y.key),y.stopPropagation(),y.preventDefault()}},[xe,G,Xl,X,C,U,He,Vt,E,hi]),zh=d.useCallback((y,A)=>{const F=y.location[0]-U;if(y.kind==="header"&&ue?.(F,{...y,preventDefault:A}),y.kind===Jn){if(F<0)return;te?.(F,{...y,preventDefault:A})}if(y.kind==="cell"){const[$,j]=y.location;q?.([F,j],{...y,preventDefault:A}),qm(X,y.location)||kr($,j,!1,!1)}},[X,q,te,ue,U,kr]),Ja=d.useCallback(async y=>{if(!ir.paste)return;function A(z,W,J,ae){const Se=typeof J=="object"?J?.join(`
|
|
173
173
|
`)??"":J?.toString()??"";if(!Ii(z)&&Ri(z)&&z.readonly!==!0){const Et=x?.(Se,z);if(Et!==void 0&&Mi(Et))return{location:W,value:Et};const Je=rn(z);if(Je===void 0)return;if(Je.kind===Z.Custom){Vn(z.kind===Z.Custom);const Ke=Je.onPaste?.(Se,z.data);return Ke===void 0?void 0:{location:W,value:{...z,data:Ke}}}else{const Ke=Je.onPaste?.(Se,z,{formatted:ae,formattedString:typeof ae=="string"?ae:ae?.join(`
|
|
174
174
|
`),rawValue:J});return Ke===void 0?void 0:(Vn(Ke.kind===z.kind),{location:W,value:Ke})}}}const F=X.columns,$=X.rows,j=Nt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let K;if(X.current!==void 0?K=[X.current.range.x,X.current.range.y]:F.length===1?K=[F.first()??0,0]:$.length===1&&(K=[U,$.first()??0]),j&&K!==void 0){let z,W;const J="text/plain",ae="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const ft of Ke){if(ft.types.includes(ae)){const Ct=await(await ft.getType(ae)).text(),xt=rc(Ct);if(xt!==void 0){z=xt;break}}ft.types.includes(J)&&(W=await(await ft.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)W=await navigator.clipboard.readText();else if(y!==void 0&&y?.clipboardData!==null){if(y.clipboardData.types.includes(ae)){const Ke=y.clipboardData.getData(ae);z=rc(Ke)}z===void 0&&y.clipboardData.types.includes(J)&&(W=y.clipboardData.getData(J))}else return;const[Se,Et]=K,Je=[];do{if(Re===void 0){const Ke=Hn(K),ft=W??z?.map(Ct=>Ct.map(xt=>xt.rawValue).join(" ")).join(" ")??"",it=A(Ke,K,ft,void 0);it!==void 0&&Je.push(it);break}if(z===void 0){if(W===void 0)return;z=Jv(W)}if(Re===!1||typeof Re=="function"&&Re?.([K[0]-U,K[1]],z.map(Ke=>Ke.map(ft=>ft.rawValue?.toString()??"")))!==!0)return;for(const[Ke,ft]of z.entries()){if(Ke+Et>=He)break;for(const[it,Ct]of ft.entries()){const xt=[it+Se,Ke+Et],[wi,ji]=xt;if(wi>=rt.length||ji>=vn)continue;const qi=Hn(xt),ar=A(qi,xt,Ct.rawValue,Ct.formatted);ar!==void 0&&Je.push(ar)}}}while(!1);Un(Je),mn.current?.damage(Je.map(Ke=>({cell:Ke.location})))}},[x,rn,Hn,X,ir.paste,Nt,rt.length,Un,vn,Re,U,He]);xn("paste",Ja,f,!1,!0);const Ui=d.useCallback(async(y,A)=>{if(!ir.copy)return;const F=A===!0||Nt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,$=X.columns,j=X.rows,K=(z,W)=>{if(!qe)oc(z,W,y);else{const J=W.map(ae=>({kind:Z.Text,data:b[ae].title,displayData:b[ae].title,allowOverlay:!1}));oc([J,...z],W,y)}};if(F&&Q!==void 0){if(X.current!==void 0){let z=Q(X.current.range,V.current.signal);typeof z!="object"&&(z=await z()),K(z,Dr(X.current.range.x-U,X.current.range.x+X.current.range.width-U))}else if(j!==void 0&&j.length>0){const W=[...j].map(J=>{const ae=Q({x:U,y:J,width:b.length,height:1},V.current.signal);return typeof ae=="object"?ae[0]:ae().then(Se=>Se[0])});if(W.some(J=>J instanceof Promise)){const J=await Promise.all(W);K(J,Dr(b.length))}else K(W,Dr(b.length))}else if($.length>0){const z=[],W=[];for(const J of $){let ae=Q({x:J,y:0,width:1,height:He},V.current.signal);typeof ae!="object"&&(ae=await ae()),z.push(ae),W.push(J-U)}if(z.length===1)K(z[0],W);else{const J=z.reduce((ae,Se)=>ae.map((Et,Je)=>[...Et,...Se[Je]]));K(J,W)}}}},[b,Q,X,ir.copy,U,Nt,He,qe]);xn("copy",Ui,f,!1,!1);const Vh=d.useCallback(async y=>{if(!(!ir.cut||!(Nt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Ui(y),X.current!==void 0)){let F={current:{cell:X.current.cell,range:X.current.range,rangeStack:[]},rows:Qe.empty(),columns:Qe.empty()};const $=jt?.(F);if($===!1||(F=$===!0?F:$,F.current===void 0))return;Ur(F.current.range)}},[Ur,X,ir.cut,Ui,Nt,jt]);xn("cut",Vh,f,!1,!1);const $h=d.useCallback((y,A)=>{if(de!==void 0){U!==0&&(y=y.map(j=>[j[0]-U,j[1]])),de(y,A);return}if(y.length===0||A===-1)return;const[F,$]=y[A];c.current!==void 0&&c.current[0]===F&&c.current[1]===$||(c.current=[F,$],kr(F,$,!1,!1))},[de,U,kr]),[Ho,zo]=Tt?.current?.cell??[],Vo=d.useRef(qt);Vo.current=qt,d.useLayoutEffect(()=>{Za.current&&!$r.current&&Ho!==void 0&&zo!==void 0&&(Ho!==ge.current?.current?.cell[0]||zo!==ge.current?.current?.cell[1])&&Vo.current(Ho,zo),$r.current=!1},[Ho,zo]);const Kl=X.current!==void 0&&(X.current.cell[0]>=rt.length||X.current.cell[1]>=vn);d.useLayoutEffect(()=>{Kl&&pe(Ko,!1)},[Kl,pe]);const Nh=d.useMemo(()=>Vt===!0&&Oe?.tint===!0?Qe.fromSingleSelection(vn-1):Qe.empty(),[vn,Vt,Oe?.tint]),Bh=d.useCallback(y=>typeof cn=="boolean"?cn:cn?.(y-U)??!0,[U,cn]),Wh=d.useMemo(()=>{if(ja===void 0||a.current===null)return null;const{bounds:y,group:A}=ja,F=a.current.getBoundingClientRect();return d.createElement(Nv,{bounds:y,group:A,canvasBounds:F,onClose:()=>qa(void 0),onFinish:$=>{qa(void 0),ce?.(A,$)}})},[ce,ja]),Uh=Math.min(rt.length,De+(An?1:0));d.useImperativeHandle(t,()=>({appendRow:(y,A)=>Sr(y+U,A),appendColumn:(y,A)=>Lo(y,A),updateCells:y=>(U!==0&&(y=y.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),mn.current?.damage(y)),getBounds:(y,A)=>{if(!(a?.current===null||Nt?.current===null)){if(y===void 0&&A===void 0){const F=a.current.getBoundingClientRect(),$=F.width/Nt.current.clientWidth;return{x:F.x-Nt.current.scrollLeft*$,y:F.y-Nt.current.scrollTop*$,width:Nt.current.scrollWidth*$,height:Nt.current.scrollHeight*$}}return mn.current?.getBounds((y??0)+U,A)}},focus:()=>mn.current?.focus(),emit:async y=>{switch(y){case"delete":Wi({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":Wi({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":Wi({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 Ui(void 0,!0);break;case"paste":await Ja();break}},scrollTo:qt,remeasureColumns:y=>{for(const A of y)Fo(A+U)},getMouseArgsForPosition:(y,A,F)=>{if(mn?.current===null)return;const $=mn.current.getMouseArgsForPosition(y,A,F);if($!==void 0)return{...$,location:[$.location[0]-U,$.location[1]]}}}),[Sr,Lo,Fo,Nt,Ui,Wi,Ja,U,qt]);const[Zl,Jl]=bi??[],jh=d.useCallback(y=>{const[A,F]=y;if(F===-1){re!=="none"&&(Ye(Qe.fromSingleSelection(A),void 0,!1),Sn());return}Zl===A&&Jl===F||(Rt({cell:y,range:{x:A,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),qt(A,F))},[re,Sn,qt,Zl,Jl,Rt,Ye]),[qh,Gh]=d.useState(!1),Ql=d.useRef(Id(y=>{Gh(y)},5)),Yh=d.useCallback(()=>{Ql.current(!0),X.current===void 0&&X.columns.length===0&&X.rows.length===0&&l===void 0&&Rt({cell:[U,To],range:{x:U,y:To,width:1,height:1}},!0,!1,"keyboard-select")},[To,X,l,U,Rt]),Xh=d.useCallback(()=>{Ql.current(!1)},[]),[Kh,Zh]=d.useMemo(()=>{let y;const A=mt?.scrollbarWidthOverride??As(),F=He+(Vt?1:0);if(typeof rr=="number")y=pn+F*rr;else{let j=0;const K=Math.min(F,10);for(let z=0;z<K;z++)j+=rr(z);j=Math.floor(j/K),y=pn+F*j}y+=A;const $=rt.reduce((j,K)=>K.width+j,0)+A;return[`${Math.min(1e5,$)}px`,`${Math.min(1e5,y)}px`]},[rt,mt?.scrollbarWidthOverride,rr,He,Vt,pn]),Jh=d.useMemo(()=>a0(dt),[dt]);return d.createElement(Zd.Provider,{value:dt},d.createElement(nb,{style:Jh,className:Y,inWidth:m??Kh,inHeight:w??Zh},d.createElement(Hv,{fillHandle:Lt,drawFocusRing:ri,experimental:mt,fixedShadowX:Mn,fixedShadowY:ur,getRowThemeOverride:Hr,headerIcons:Nn,imageWindowLoader:B,initialSize:We,isDraggable:Ge,onDragLeave:_t,onRowMoved:nn,overscrollX:Aa,overscrollY:Ha,preventDiagonalScrolling:yn,rightElement:Ut,rightElementProps:En,smoothScrollX:Ce,smoothScrollY:Ft,className:Y,enableGroups:Wn,onCanvasFocused:Yh,onCanvasBlur:Xh,canvasRef:a,onContextMenu:zh,theme:dt,cellXOffset:Sh,cellYOffset:To,accessibilityHeight:hr.height,onDragEnd:Lh,columns:rt,nonGrowWidth:At,drawHeader:vt,onColumnProposeMove:Oh,drawCell:gn,disabledRows:Nh,freezeColumns:Uh,lockColumns:U,firstColAccessible:U===0,getCellContent:Hn,minColumnWidth:wr,maxColumnWidth:li,searchInputRef:s,showSearch:Va,onSearchClose:ci,highlightRegions:xh,getCellsForSelection:Q,getGroupDetails:Na,headerHeight:zi,isFocused:qh,groupHeaderHeight:Wn?Io:0,freezeTrailingRows:ct+(Vt&&Oe?.sticky===!0?1:0),hasAppendRow:Vt,onColumnResize:je,onColumnResizeEnd:Ee,onColumnResizeStart:Ze,onCellFocused:jh,onColumnMoved:Ph,onDragStart:_h,onHeaderMenuClick:Ih,onHeaderIndicatorClick:Th,onItemHovered:Ka,isFilling:l?.fillHandle===!0,onMouseMove:Eh,onKeyDown:Wi,onKeyUp:ne,onMouseDown:kh,onMouseUp:Rh,onDragOverCell:_n,onDrop:en,onSearchResultsChanged:$h,onVisibleRegionChanged:Dh,clientSize:$t,rowHeight:rr,searchResults:ie,searchValue:_,onSearchValueChange:H,rows:vn,scrollRef:Nt,selection:X,translateX:hr.tx,translateY:hr.ty,verticalBorder:Bh,gridRef:mn,getCellRenderer:rn,resizeIndicator:Mo}),Wh,i!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(hb,{...i,validateCell:Te,bloom:D,id:Hh,getCellRenderer:rn,className:mt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:kn,imageEditorOverride:g,portalElementRef:Ro,onFinishEditing:Ah,markdownDivCreateNode:p,isOutsideClick:Fn,customEventTarget:mt?.eventTarget}))))},vb=d.forwardRef(mb);function lc(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,f=Math.floor(i.y+a/2),g=Od(c,a,o.cellVerticalPadding),h=Dd(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),p=Td(h,f,g),m=Pd(l+n,u+r,p);return tl(t)&&m}const bb={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>wb(e,e.cell.data,tl(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{lc(e)&&e.preventDefault()},onClick:e=>{if(lc(e))return{...e.cell,data:hf(e.cell.data)}},onPaste:(e,t)=>{let n=da;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=el),n===t.data?void 0:{...t,data:n}}};function wb(e,t,n,r,i){if(!n&&t===da)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:f,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:w}=l;let b=!1;if(i>0){let v=n?1-i+i*s:.4;if(t===da&&(v*=s),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}fl(o,a,t,h,p,m,w,u,c,f,r,g),b&&(o.globalAlpha=1)}const yb=fn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Cb=e=>{const{bubbles:t}=e;return d.createElement(yb,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Sb={getAccessibilityString:e=>_d(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>xb(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Cb,{bubbles:t.data})},onPaste:()=>{}};function xb(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const f=[];for(const g of t){if(c>s+l)break;const h=_r(g,i,r.baseFontFull).width;f.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of f)er(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of f.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+nr(i,r))}const kb=fn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Mb=e=>{const{drilldowns:t}=e;return d.createElement(kb,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))))},Rb={getAccessibilityString:e=>_d(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Ib(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Mb,{drilldowns:t.data})},onPaste:()=>{}},ws={};function Eb(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,f=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(ws[g]!==void 0)return{el:ws[g],height:l,width:f,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),p=h.getContext("2d");return p===null?null:(h.width=f,h.height=l,p.scale(i,i),ws[g]=h,p.beginPath(),er(p,o,o,c,s,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(),er(p,o+.5,o+.5,c,s,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:l,width:f,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function Ib(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,f=ll(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(f*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,w=r.bubbleMargin;let b=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,C=Eb(r.bgCell,r.drilldownBorder,g,v),I=[];for(const E of t){if(b>l+u)break;const P=_r(E.text,i,c).width;let x=0;E.img!==void 0&&o.loadOrGetImage(E.img,s,a)!==void 0&&(x=p-8+4);const S=P+x+m*2;I.push({x:b,width:S}),b+=S+w}if(C!==null){const{el:E,height:R,middleWidth:P,sideWidth:x,width:S,dpr:L,padding:D}=C,M=x/L,T=D/L;for(const O of I){const k=Math.floor(O.x),N=Math.floor(O.width),q=N-(M-T)*2;i.imageSmoothingEnabled=!1,i.drawImage(E,0,0,x,R,k-T,h,M,g),q>0&&i.drawImage(E,x,0,P,R,k+(M-T),h,q,g),i.drawImage(E,S-x,0,x,R,k+N-(M-T),h,M,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[E,R]of I.entries()){const P=t[E];let x=R.x+m;if(P.img!==void 0){const S=o.loadOrGetImage(P.img,s,a);if(S!==void 0){const L=p-8;let D=0,M=0,T=S.width,O=S.height;T>O?(D+=(T-O)/2,T=O):O>T&&(M+=(O-T)/2,O=T),i.beginPath(),er(i,x,h+g/2-L/2,L,L,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(S,D,M,T,O,x,h+g/2-L/2,L,L),i.restore(),x+=L+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,x,h+g/2+nr(i,r))}}const Tb={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Db(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??mm;return d.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},ys=4;function Db(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:f,height:g,width:h}=i,p=g-a.cellVerticalPadding*2,m=[];let w=0;for(let v=0;v<t.length;v++){const C=t[v];if(C.length===0)continue;const I=u.loadOrGetImage(C,o,s);if(I!==void 0){m[v]=I;const E=I.width*(p/I.height);w+=E+ys}}if(w===0)return;w-=ys;let b=c+a.cellHorizontalPadding;r==="right"?b=Math.floor(c+h-a.cellHorizontalPadding-w):r==="center"&&(b=Math.floor(c+h/2-w/2));for(const v of m){if(v===void 0)continue;const C=v.width*(p/v.height);n>0&&(l.beginPath(),er(l,b,f+a.cellVerticalPadding,C,p,n),l.save(),l.clip()),l.drawImage(v,b,f+a.cellVerticalPadding,C,p),n>0&&l.restore(),b+=C+ys}}function Ob(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Pb={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(Ob(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);er(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Jr(s.textDark,.1),i.fill()},onPaste:()=>{}},_b=()=>e=>e.targetWidth,uc=fn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[_b(),"px"]}}),Lb=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,f]=d.useState(l===""||r),g=d.useCallback(()=>{f(p=>!p)},[]),h=l?"gdg-ml-6":"";return c?d.createElement(uc,{targetWidth:o.width-20},d.createElement(ti,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},d.createElement(um,null))):d.createElement(uc,{targetWidth:o.width},d.createElement(Fm,{contents:l,createNode:i}),!u&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},d.createElement(rl,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Fb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:ko,measure:(e,t,n)=>{const r=t.data.split(`
|
|
175
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>sr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return d.createElement(Lb,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ab={getAccessibilityString:e=>e.row.toString(),kind:qn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Hb,measure:()=>44,draw:e=>Vb(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Hb(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=zb,n.textAlign="center",o}function zb(e){const{ctx:t}=e;t.textAlign="start"}function Vb(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:f,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&p>0){s.globalAlpha=p;const m=7*(n?l:1);if(fl(s,u,n,i?c+m:c,f,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const w of[3,6])for(const b of[-5,-1,3])s.rect(c+w,f+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=w,s.fillText(m,b,f+h/2+nr(s,w)),l!==0&&(s.globalAlpha=1)}}const $b={getAccessibilityString:()=>"",kind:qn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Nb(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Nb(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:f}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,f-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=f-8,w=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,w,b,m,s,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,w=g?0:(1-o)*p*.5,b=s.cellHorizontalPadding+4;m>0&&(r.moveTo(l+b+w,u+f/2),r.lineTo(l+b+w+m,u+f/2),r.moveTo(l+b+w+m*.5,u+f/2-m*.5),r.lineTo(l+b+w+m*.5,u+f/2+m*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+f/2+nr(r,s)),r.beginPath()}function mf(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Bb(e,i,r,t,n?.fullSize??!1);e.beginPath(),er(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Jr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Bb(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=_r(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Wb=d.lazy(async()=>await Js(()=>import("./number-overlay-editor-
|
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>sr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return d.createElement(Lb,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ab={getAccessibilityString:e=>e.row.toString(),kind:qn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Hb,measure:()=>44,draw:e=>Vb(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Hb(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=zb,n.textAlign="center",o}function zb(e){const{ctx:t}=e;t.textAlign="start"}function Vb(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:f,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&p>0){s.globalAlpha=p;const m=7*(n?l:1);if(fl(s,u,n,i?c+m:c,f,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const w of[3,6])for(const b of[-5,-1,3])s.rect(c+w,f+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=w,s.fillText(m,b,f+h/2+nr(s,w)),l!==0&&(s.globalAlpha=1)}}const $b={getAccessibilityString:()=>"",kind:qn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Nb(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Nb(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:f}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,f-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=f-8,w=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,w,b,m,s,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,w=g?0:(1-o)*p*.5,b=s.cellHorizontalPadding+4;m>0&&(r.moveTo(l+b+w,u+f/2),r.lineTo(l+b+w+m,u+f/2),r.moveTo(l+b+w+m*.5,u+f/2-m*.5),r.lineTo(l+b+w+m*.5,u+f/2+m*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+f/2+nr(r,s)),r.beginPath()}function mf(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Bb(e,i,r,t,n?.fullSize??!1);e.beginPath(),er(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Jr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Bb(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=_r(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Wb=d.lazy(async()=>await Js(()=>import("./number-overlay-editor-DRf5xgI3.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]))),Ub={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:ko,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&mf(r,i,u,l,o,t,s),sr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(Wb,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},jb={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:qb,onPaste:()=>{}};function qb(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(Tu(30))*a,f=Math.sin(Tu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-f),t.lineTo(l-c,u+f),t.moveTo(l-c,u-f),t.lineTo(l+c,u+f),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Gb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>ko(e,t,e.theme.textLight),draw:e=>sr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return Bt.createElement(ti,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Yb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:ko,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:f,hoverEffectTheme:g}=t;c===!0&&n>0&&mf(i,s,g,l,o,n,a),sr(e,l,u,f,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
|
176
176
|
`,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return d.createElement(ti,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Xb=fn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Kb=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=d.useState(!i&&(t===""||r)),u=d.useCallback(()=>{l(!0)},[]);return a?d.createElement(ti,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Xb,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&d.createElement("div",{className:"gdg-edit-icon",onClick:u},d.createElement(rl,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function vf(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function cc(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=jd(s,o.baseFontFull);if(a===void 0)return!1;const l=vf(a,n,o,t.contentAlign);return Zr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Zb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:ko,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=_r(l,a,n.baseFontFull),f=vf(c,s,n,t.contentAlign),{x:g,y:h,width:p,height:m}=f;if(i>=g-4&&i<=g-4+p+8&&o>=h-4&&o<=h-4+m+8){const w=nr(a,n.baseFontFull);r("pointer");const b=5,v=h-w;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+m+b)+.5),a.lineTo(s.x+g+p,Math.floor(s.y+v+m+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,sr({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),sr({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),sr({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),sr({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,sr(e,l,t.contentAlign)},onSelect:e=>{cc(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;cc(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return d.createElement(Kb,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Jb=[Ab,$b,bb,Sb,Rb,Tb,Pb,Fb,Ub,jb,Gb,Yb,Zb];var Cs,dc;function Qb(){if(dc)return Cs;dc=1;var e=Ed(),t=nd(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return Cs=r,Cs}var e1=Qb();const t1=vr(e1),Ss=[];class n1 extends Yd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=t1(()=>{this.imageLoaded(new go(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=Ss.pop()??new Image;let a=!1;const l={img:void 0,cells:[Qn(n,r)],url:t,cancel:()=>{a||(a=!0,Ss.length<12?Ss.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const f of c.cells)this.loadedLocations.push(dl(f));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Qn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const r1=(e,t)=>{const n=d.useMemo(()=>({...G0,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??Jb,[e.renderers]),i=d.useMemo(()=>e.imageWindowLoader??new n1,[e.imageWindowLoader]);return d.createElement(vb,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},i1=d.forwardRef(r1);function fc(e,t){const n=d.useRef(null),r=d.useRef(),i=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>i,[i]),{debouncedCallback:d.useCallback((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var o1=cg();const a1=vr(o1);var aa={exports:{}};var s1=aa.exports,hc;function l1(){return hc||(hc=1,(function(e,t){(function(n,r){try{e.exports=r(dg)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(s1,function(n){var r=!1,i=!1,o=!1,s=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),l=[{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 u(H,_){return _.length>H.length?!1:H.indexOf(_)!==-1}function c(H){for(var _="";H;)_+="0",H-=1;return _}function f(H){for(var _=H.split("").reverse(),G=0,ne=!0;ne&&G<_.length;)G?_[G]==="9"?_[G]="0":(_[G]=(parseInt(_[G],10)+1).toString(),ne=!1):(parseInt(_[G],10)<5&&(ne=!1),_[G]="0"),G+=1;return ne&&_.push("1"),_.reverse().join("")}function g(H,_){var G=P(k(_).sort(),function(oe){return oe+":"+_[oe]}).join(","),ne=H+"+"+G;return g.cache[ne]||(g.cache[ne]=Intl.NumberFormat(H,_)),g.cache[ne]}g.cache={};function h(H,_,G){var ne=_.useToLocaleString,oe=_.useGrouping,xe=oe&&_.grouping.slice(),ve=_.maximumSignificantDigits,et=_.minimumIntegerDigits||1,ke=_.fractionDigits||0,bt=_.groupingSeparator,St=_.decimalSeparator;if(ne&&G){var Ue={minimumIntegerDigits:et,useGrouping:oe};if(ke&&(Ue.maximumFractionDigits=ke,Ue.minimumFractionDigits=ke),ve&&H>0&&(Ue.maximumSignificantDigits=ve),o){if(!s){var re=O({},_);re.useGrouping=!1,re.decimalSeparator=".",H=parseFloat(h(H,re),10)}return g(G,Ue).format(H)}else{if(!i){var re=O({},_);re.useGrouping=!1,re.decimalSeparator=".",H=parseFloat(h(H,re),10)}return H.toLocaleString(G,Ue)}}var se;ve?se=H.toPrecision(ve+1):se=H.toFixed(ke+1);var we,fe,ye,$e=se.split("e");ye=$e[1]||"",$e=$e[0].split("."),fe=$e[1]||"",we=$e[0]||"";var Fe=we.length,tt=fe.length,Re=Fe+tt,qe=we+fe;(ve&&Re===ve+1||!ve&&tt===ke+1)&&(qe=f(qe),qe.length===Re+1&&(Fe=Fe+1),tt&&(qe=qe.slice(0,-1)),we=qe.slice(0,Fe),fe=qe.slice(Fe)),ve&&(fe=fe.replace(/0*$/,""));var De=parseInt(ye,10);De>0?fe.length<=De?(fe=fe+c(De-fe.length),we=we+fe,fe=""):(we=we+fe.slice(0,De),fe=fe.slice(De)):De<0&&(fe=c(Math.abs(De)-we.length)+we+fe,we="0"),ve||(fe=fe.slice(0,ke),fe.length<ke&&(fe=fe+c(ke-fe.length)),we.length<et&&(we=c(et-we.length)+we));var Ie="";if(oe){$e=we;for(var _e;$e.length;)xe.length&&(_e=xe.shift()),Ie&&(Ie=bt+Ie),Ie=$e.slice(-_e)+Ie,$e=$e.slice(0,-_e)}else Ie=we;return fe&&(Ie=Ie+St+fe),Ie}function p(H,_){return H.label.length>_.label.length?-1:H.label.length<_.label.length?1:0}function m(H,_){var G=[];return R(k(_),function(ne){if(ne.slice(0,15)==="_durationLabels"){var oe=ne.slice(15).toLowerCase();R(k(_[ne]),function(xe){xe.slice(0,1)===H&&G.push({type:oe,key:xe,label:_[ne][xe]})})}}),G}function w(H,_,G){return _===1&&G===null?H:H+H}var b={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(H){return Object.prototype.toString.call(H)==="[object Array]"}function C(H){return Object.prototype.toString.call(H)==="[object Object]"}function I(H,_){for(var G=H.length;G-=1;)if(_(H[G]))return H[G]}function E(H,_){var G=0,ne=H&&H.length||0,oe;for(typeof _!="function"&&(oe=_,_=function(xe){return xe===oe});G<ne;){if(_(H[G]))return H[G];G+=1}}function R(H,_){var G=0,ne=H.length;if(!(!H||!ne))for(;G<ne;){if(_(H[G],G)===!1)return;G+=1}}function P(H,_){var G=0,ne=H.length,oe=[];if(!H||!ne)return oe;for(;G<ne;)oe[G]=_(H[G],G),G+=1;return oe}function x(H,_){return P(H,function(G){return G[_]})}function S(H){var _=[];return R(H,function(G){G&&_.push(G)}),_}function L(H){var _=[];return R(H,function(G){E(_,G)||_.push(G)}),_}function D(H,_){var G=[];return R(H,function(ne){R(_,function(oe){ne===oe&&G.push(ne)})}),L(G)}function M(H,_){var G=[];return R(H,function(ne,oe){if(!_(ne))return G=H.slice(oe),!1}),G}function T(H,_){var G=H.slice().reverse();return M(G,_).reverse()}function O(H,_){for(var G in _)_.hasOwnProperty(G)&&(H[G]=_[G]);return H}function k(H){var _=[];for(var G in H)H.hasOwnProperty(G)&&_.push(G);return _}function N(H,_){var G=0,ne=H.length;if(!H||!ne)return!1;for(;G<ne;){if(_(H[G],G)===!0)return!0;G+=1}return!1}function q(H){var _=[];return R(H,function(G){_=_.concat(G)}),_}function Y(){var H=0;try{H.toLocaleString("i")}catch(_){return _.name==="RangeError"}return!1}function ue(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(H){var _=!0;return _=_&&H(1,"en",{minimumIntegerDigits:1})==="1",_=_&&H(1,"en",{minimumIntegerDigits:2})==="01",_=_&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!_||(_=_&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",_=_&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",_=_&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",_=_&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!_)||(_=_&&H(99.99,"en",{maximumSignificantDigits:1})==="100",_=_&&H(99.99,"en",{maximumSignificantDigits:2})==="100",_=_&&H(99.99,"en",{maximumSignificantDigits:3})==="100",_=_&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",_=_&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!_)||(_=_&&H(1e3,"en",{useGrouping:!0})==="1,000",_=_&&H(1e3,"en",{useGrouping:!1})==="1000",!_))}function te(){var H=[].slice.call(arguments),_={},G;if(R(H,function(ve,et){if(!et){if(!v(ve))throw"Expected array as the first argument to durationsFormat.";G=ve}if(typeof ve=="string"||typeof ve=="function"){_.template=ve;return}if(typeof ve=="number"){_.precision=ve;return}C(ve)&&O(_,ve)}),!G||!G.length)return[];_.returnMomentTypes=!0;var ne=P(G,function(ve){return ve.format(_)}),oe=D(a,L(x(q(ne),"type"))),xe=_.largest;return xe&&(oe=oe.slice(0,xe)),_.returnMomentTypes=!1,_.outputTypes=oe,P(G,function(ve){return ve.format(_)})}function ce(){var H=[].slice.call(arguments),_=O({},this.format.defaults),G=this.asMilliseconds(),ne=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,ne=0);var oe=G<0,xe=n.duration(Math.abs(G),"milliseconds"),ve=n.duration(Math.abs(ne),"months");R(H,function(B){if(typeof B=="string"||typeof B=="function"){_.template=B;return}if(typeof B=="number"){_.precision=B;return}C(B)&&O(_,B)});var et={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},ke={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};_.types=a;var bt=function(B){return E(a,function(We){return ke[We].test(B)})},St=new RegExp(P(a,function(B){return ke[B].source}).join("|"),"g");_.duration=this;var Ue=typeof _.template=="function"?_.template.apply(_):_.template,re=_.outputTypes,se=_.returnMomentTypes,we=_.largest,fe=[];re||(v(_.stopTrim)&&(_.stopTrim=_.stopTrim.join("")),_.stopTrim&&R(_.stopTrim.match(St),function(B){var We=bt(B);We==="escape"||We==="general"||fe.push(We)}));var ye=n.localeData();ye||(ye={}),R(k(b),function(B){if(typeof b[B]=="function"){ye[B]||(ye[B]=b[B]);return}ye["_"+B]||(ye["_"+B]=b[B])}),R(k(ye._durationTimeTemplates),function(B){Ue=Ue.replace("_"+B+"_",ye._durationTimeTemplates[B])});var $e=_.userLocale||n.locale(),Fe=_.useLeftUnits,tt=_.usePlural,Re=_.precision,qe=_.forceLength,De=_.useGrouping,Ie=_.trunc,_e=_.useSignificantDigits&&Re>0,ht=_e?_.precision:0,nt=ht,Xe=_.minValue,kt=!1,wt=_.maxValue,Ot=!1,Pt=_.useToLocaleString,ln=_.groupingSeparator,Jt=_.decimalSeparator,Dn=_.grouping;Pt=Pt&&(r||o);var Tt=_.trim;v(Tt)&&(Tt=Tt.join(" ")),Tt===null&&(we||wt||_e)&&(Tt="all"),(Tt===null||Tt===!0||Tt==="left"||Tt==="right")&&(Tt="large"),Tt===!1&&(Tt="");var gt=function(B){return B.test(Tt)},On=/large/,yt=/small/,Qt=/both/,kn=/mid/,Oe=/^all|[^sm]all/,ct=/final/,pt=we>0||N([On,Qt,Oe],gt),Pn=N([yt,Qt,Oe],gt),un=N([kn,Oe],gt),cn=N([ct,Oe],gt),_n=P(Ue.match(St),function(B,We){var Ge=bt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ge!=="escape"&&Ge!=="general"&&fe.push(Ge)),{index:We,length:B.length,text:"",token:Ge==="escape"?B.replace(ke.escape,"$1"):B,type:Ge==="escape"||Ge==="general"?null:Ge}}),en={index:0,length:0,token:"",text:"",type:null},tn=[];Fe&&_n.reverse(),R(_n,function(B){if(B.type){(en.type||en.text)&&tn.push(en),en=B;return}Fe?en.text=B.token+en.text:en.text+=B.token}),(en.type||en.text)&&tn.push(en),Fe&&tn.reverse();var Be=D(a,L(S(x(tn,"type"))));if(!Be.length)return x(tn,"text").join("");Be=P(Be,function(B,We){var Ge=We+1===Be.length,_t=!We,nn;B==="years"||B==="months"?nn=ve.as(B):nn=xe.as(B);var hn=Math.floor(nn),Rn=nn-hn,yn=E(tn,function(Ut){return B===Ut.type});return _t&&wt&&nn>wt&&(Ot=!0),Ge&&Xe&&Math.abs(_.duration.as(B))<Xe&&(kt=!0),_t&&qe===null&&yn.length>1&&(qe=!0),xe.subtract(hn,B),ve.subtract(hn,B),{rawValue:nn,wholeValue:hn,decimalValue:Ge?Rn:0,isSmallest:Ge,isLargest:_t,type:B,tokenLength:yn.length}});var Mt=Ie?Math.floor:Math.round,Ln=function(B,We){var Ge=Math.pow(10,We);return Mt(B*Ge)/Ge},Lt=!1,mt=!1,Mn=function(B,We){var Ge={useGrouping:De,groupingSeparator:ln,decimalSeparator:Jt,grouping:Dn,useToLocaleString:Pt};return _e&&(ht<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ge.maximumSignificantDigits=ht,B.significantDigits=ht)),Ot&&!mt&&(B.isLargest?(B.wholeValue=wt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),kt&&!mt&&(B.isSmallest?(B.wholeValue=Xe,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Re<0?B.value=Ln(B.wholeValue,Re):Re===0?B.value=Mt(B.wholeValue+B.decimalValue):_e?(Ie?B.value=Ln(B.rawValue,ht-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ht-=B.wholeValue.toString().length)):(Ge.fractionDigits=Re,Ie?B.value=B.wholeValue+Ln(B.decimalValue,Re):B.value=B.wholeValue+B.decimalValue):_e&&B.wholeValue?(B.value=Math.round(Ln(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ht-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(qe||Lt)&&(Ge.minimumIntegerDigits=B.tokenLength,mt&&Ge.maximumSignificantDigits<B.tokenLength&&delete Ge.maximumSignificantDigits),!Lt&&(B.value>0||Tt===""||E(fe,B.type)||E(re,B.type))&&(Lt=!0),B.formattedValue=h(B.value,Ge,$e),Ge.useGrouping=!1,Ge.decimalSeparator=".",B.formattedValueEn=h(B.value,Ge,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=h(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Be=P(Be,Mn),Be=S(Be),Be.length>1){var ur=function(B){return E(Be,function(We){return We.type===B})},Nn=function(B){var We=ur(B.type);We&&R(B.targets,function(Ge){var _t=ur(Ge.type);_t&&parseInt(We.formattedValueEn,10)===Ge.value&&(We.rawValue=0,We.wholeValue=0,We.decimalValue=0,_t.rawValue+=1,_t.wholeValue+=1,_t.decimalValue=0,_t.formattedValueEn=_t.wholeValue.toString(),mt=!0)})};R(l,Nn)}return mt&&(Lt=!1,ht=nt,Be=P(Be,Mn),Be=S(Be)),re&&!(Ot&&!_.trim)?(Be=P(Be,function(B){return E(re,function(We){return B.type===We})?B:null}),Be=S(Be)):(pt&&(Be=M(Be,function(B){return!B.isSmallest&&!B.wholeValue&&!E(fe,B.type)})),we&&Be.length&&(Be=Be.slice(0,we)),Pn&&Be.length>1&&(Be=T(Be,function(B){return!B.wholeValue&&!E(fe,B.type)&&!B.isLargest})),un&&(Be=P(Be,function(B,We){return We>0&&We<Be.length-1&&!B.wholeValue?null:B}),Be=S(Be)),cn&&Be.length===1&&!Be[0].wholeValue&&!(!Ie&&Be[0].isSmallest&&Be[0].rawValue<Xe)&&(Be=[])),se?Be:(R(tn,function(B){var We=et[B.type],Ge=E(Be,function(Ut){return Ut.type===B.type});if(!(!We||!Ge)){var _t=Ge.formattedValueEn.split(".");_t[0]=parseInt(_t[0],10),_t[1]?_t[1]=parseFloat("0."+_t[1],10):_t[1]=null;var nn=ye.durationPluralKey(We,_t[0],_t[1]),hn=m(We,ye),Rn=!1,yn={};R(ye._durationLabelTypes,function(Ut){var En=E(hn,function(In){return In.type===Ut.type&&In.key===nn});En&&(yn[En.type]=En.label,u(B.text,Ut.string)&&(B.text=B.text.replace(Ut.string,En.label),Rn=!0))}),tt&&!Rn&&(hn.sort(p),R(hn,function(Ut){if(yn[Ut.type]===Ut.label)return u(B.text,Ut.label)?!1:void 0;if(u(B.text,Ut.label))return B.text=B.text.replace(Ut.label,yn[Ut.type]),!1}))}}),tn=P(tn,function(B){if(!B.type)return B.text;var We=E(Be,function(_t){return _t.type===B.type});if(!We)return"";var Ge="";return Fe&&(Ge+=B.text),(oe&&Ot||!oe&&kt)&&(Ge+="< ",Ot=!1,kt=!1),(oe&&kt||!oe&&Ot)&&(Ge+="> ",Ot=!1,kt=!1),oe&&(We.value>0||Tt===""||E(fe,We.type)||E(re,We.type))&&(Ge+="-",oe=!1),B.type==="milliseconds"&&We.formattedValueMS?Ge+=We.formattedValueMS:Ge+=We.formattedValue,Fe||(Ge+=B.text),Ge}),tn.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function le(){var H=this.duration,_=function(xe){return H._data[xe]},G=E(this.types,_),ne=I(this.types,_);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===ne)return"d __";case"weeks":return G===ne?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===ne)return"M __";case"years":return G===ne?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function he(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=te,H.duration.fn.format=ce,H.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:le,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",b)}var de=function(H,_,G){return H.toLocaleString(_,G)};r=Y()&&ee(de),i=r&&ue(de);var ie=function(H,_,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(_,G).format(H)};return o=ee(ie),s=o&&ue(ie),he(n),he})})(aa)),aa.exports}l1();const u1=["true","t","yes","y","on","1"],c1=["false","f","no","n","off","0"];function Dt(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Pi(e){return Object.hasOwn(e,"isError")&&e.isError}function d1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function pl(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function js(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function f1(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function qs(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 Fi(e,t){return Pe(e)?t||{}:Pe(t)?e||{}:od(e,t)}function ml(e){if(Pe(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:lt(n)):[lt(t)]}catch{return[lt(e)]}}function bf(e){return typeof e=="string"||e instanceof String?!0:(e instanceof fg&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function h1(e){return e?.startsWith("{")&&e.endsWith("}")}function lt(e){try{try{return a1(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function wf(e){if(Pe(e))return null;if(typeof e=="boolean")return e;const t=lt(e).toLowerCase().trim();if(t==="")return null;if(u1.includes(t))return!0;if(c1.includes(t))return!1}function wo(e){if(Pe(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=ao.unformat(e.trim());if(st(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function yf(e){return Pe(e)?"":lt(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ba(e){if(Pe(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return lt(e)}}function g1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function Yr(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 wa(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Pe(t)||t===""?st(n)?(n===0&&(e=Math.round(e)),ao(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):ao(e).format({thousandSeparated:!1,mantissa:g1(e),trimMantissa:!0}):t==="plain"?ao(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Yr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Yr(e,{style:"percent",minimumFractionDigits:st(n)?Math.max(n-2,0):0,maximumFractionDigits:st(n)?Math.max(n-2,0):2}):t==="dollar"?Yr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Yr(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Yr(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Yr(e,{notation:t}):t==="accounting"?ao(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Yr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):Ep.sprintf(t,e)}function gc(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(s){if(s instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw s}}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 Zo(e){if(Pe(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=Xr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Xr.utc(e);if(n.isValid())return n.toDate();const r=Xr.utc(e,[Xr.HTML5_FMT.TIME_MS,Xr.HTML5_FMT.TIME_SECONDS,Xr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Cf(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 p1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const m1=new RegExp(/(\r\n|\n|\r)/gm);function yo(e){return e.indexOf(`
|
|
177
177
|
`)!==-1?e.replace(m1," "):e}function v1(e,t){if(Pe(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const b1=tr("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"}}),""),vl=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?ts.parse(e):ts.parse(ts.stringify(e))}catch{n=void 0}return Pe(n)?me.jsx(ti,{highlight:!0,autoFocus:!1,disabled:!0,value:ba(e)??"",onChange:()=>{}}):me.jsx(b1,{"data-testid":"stJsonColumnViewer",children:me.jsx(hg,{src:n,collapsed:2,theme:gg(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(vl);const w1=e=>{const t=e.theme,n=e.value.data;return me.jsx(vl,{jsonValue:n.value||n.displayValue,theme:t})},y1=e=>{const t=e.theme,n=e.value;return me.jsx(vl,{jsonValue:n.data,theme:t})},C1={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return sl(e,r??ba(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??ba(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:w1})},Sf="line_chart",S1="area_chart",xf="bar_chart",x1=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 bl(e,t,n,r){const i=Fi({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),o=x1(r);let s;i.color==="auto"||i.color==="auto-inverse"?s=r.colors.greenColor:s=i.color?o.get(i.color)??i.color:void 0;const a={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:s,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===Sf?":material/show_chart:":e===xf?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(l){if(Pe(l))return js();const u=ml(l),c=[];let f=[];if(u.length===0)return js();let g=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER;for(let b=0;b<u.length;b++){const v=wo(u[b]);if(Number.isNaN(v)||Pe(v))return Dt(lt(u),`The value cannot be interpreted as a numeric array. ${lt(v)} is not a number.`);v>g&&(g=v),v<h&&(h=v),c.push(v)}let p,m;if(u.length===1){let b;g<=0?b=g===0?1:0:b=g,p=i.y_max??b,m=i.y_min??(g>=0?0:g)}else p=i.y_max??g,m=i.y_min??h;if(Pe(m)||Pe(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Dt("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);c.length>0&&(g>p||h<m)?f=c.map(b=>g-h===0?g>(p||1)?p:m:(p-m)*((b-h)/(g-h))+m):f=c;let w=s;return(i.color==="auto"&&f[0]>f[f.length-1]||i.color==="auto-inverse"&&f[0]<f[f.length-1])&&(w=r.colors.redColor),{...a,copyData:c.join(","),data:{...a.data,values:f,displayValues:c.map(b=>wa(b)),yAxis:[m,p],color:w},isMissingValue:Pe(l)}},getCellValue(l){return l.kind===Z.Loading||l.data?.values===void 0?null:l.data?.values}}}function kf(e,t){return bl(Sf,e,"line",t)}kf.isEditableType=!1;function Mf(e,t){return bl(xf,e,"bar",t)}Mf.isEditableType=!1;function Rf(e,t){return bl(S1,e,"area",t)}Rf.isEditableType=!1;function wl(e,t){const n={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(an(t.radii.md),an(t.radii.maxCheckbox)))},getCell(r){let i=null;return i=wf(r),i===void 0?Dt(lt(r),"The value cannot be interpreted as boolean."):{...n,data:i,isMissingValue:Pe(i)}},getCellValue(r){return r.data===void 0?null:r.data}}}wl.isEditableType=!0;function pc(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function yl(e,t,n,r,i,o,s){const a=Fi({format:n,step:r,timezone:s},t.columnTypeOptions);let l;if(st(a.timezone))try{l=pc(eu(),a.timezone)?.utcOffset()||void 0}catch{}let u;st(a.min_value)&&(u=Zo(a.min_value)||void 0);let c;st(a.max_value)&&(c=Zo(a.max_value)||void 0);const f={kind:Z.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:a.step?.toString()||"1",format:i,min:u,max:c}},g=h=>{const p=Zo(h);return p===null?!t.isRequired:!(p===void 0||st(u)&&o(p)<o(u)||st(c)&&o(p)>o(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(h,p){if(p===!0){const C=g(h);if(C===!1)return Dt(lt(h),"Invalid input.");C instanceof Date&&(h=C)}const m=Zo(h);let w="",b="",v=l;if(m===void 0)return Dt(lt(h),"The value cannot be interpreted as a datetime object.");if(m!==null){let C=eu.utc(m);if(!C.isValid())return Dt(lt(m),`Invalid moment date. This should never happen. Please report this bug.
|
|
178
178
|
Error: ${C.toString()}`);if(a.timezone){try{C=pc(C,a.timezone)}catch(I){return Dt(C.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
|
|
@@ -184,5 +184,5 @@ Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,content
|
|
|
184
184
|
40% { opacity: 1; }
|
|
185
185
|
`]))),Py=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Le({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},Ms=function(t){var n=t.delay,r=t.offset;return Ae("span",{css:Dl({animation:"".concat(Oy," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},_y=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=lr(t,xy);return Ae("div",ze({},Xt(Le(Le({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ae(Ms,{delay:0,offset:r}),Ae(Ms,{delay:160,offset:!0}),Ae(Ms,{delay:320,offset:!r}))},Ly=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Le({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},Fy=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Ae("div",ze({ref:o},Xt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},Ay=Fy,Hy=["data"],zy=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Vy=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,f=t.selectProps;return Ae("div",ze({},Xt(t,"group",{group:!0}),l),Ae(s,ze({},a,{selectProps:f,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Ae("div",null,n))},$y=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Le({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},Ny=function(t){var n=qf(t);n.data;var r=lr(n,Hy);return Ae("div",ze({},Xt(t,"groupHeading",{"group-heading":!0}),r))},By=Vy,Wy=["innerRef","isDisabled","isHidden","inputClassName"],Uy=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Le(Le({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},jy),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},th={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},jy={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Le({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},th)},qy=function(t){return Le({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},th)},Gy=function(t){var n=t.cx,r=t.value,i=qf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=lr(i,Wy);return Ae("div",ze({},Xt(t,"input",{"input-container":!0}),{"data-value":r||""}),Ae("input",ze({className:n({input:!0},l),ref:o,style:qy(a),disabled:s},u)))},Yy=Gy,Xy=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Le({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Ky=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Le({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Zy=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Le({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},nh=function(t){var n=t.children,r=t.innerProps;return Ae("div",r,n)},Jy=nh,Qy=nh;function eC(e){var t=e.children,n=e.innerProps;return Ae("div",ze({role:"button"},n),t||Ae(Ll,{size:14}))}var tC=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,f=r.Remove;return Ae(u,{data:i,innerProps:Le(Le({},Xt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Ae(c,{data:i,innerProps:Le({},Xt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Ae(f,{data:i,innerProps:Le(Le({},Xt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},nC=tC,rC=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Le({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},iC=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Ae("div",ze({},Xt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},oC=iC,aC=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Le({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},sC=function(t){var n=t.children,r=t.innerProps;return Ae("div",ze({},Xt(t,"placeholder",{placeholder:!0}),r),n)},lC=sC,uC=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Le({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},cC=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Ae("div",ze({},Xt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},dC=cC,Fl={ClearIndicator:Iy,Control:Ay,DropdownIndicator:Ry,DownChevron:Qf,CrossIcon:Ll,Group:By,GroupHeading:Ny,IndicatorsContainer:Cy,IndicatorSeparator:Dy,Input:Yy,LoadingIndicator:_y,Menu:sy,MenuList:uy,MenuPortal:py,LoadingMessage:hy,NoOptionsMessage:fy,MultiValue:nC,MultiValueContainer:Jy,MultiValueLabel:Qy,MultiValueRemove:eC,Option:oC,Placeholder:lC,SelectContainer:vy,SingleValue:dC,ValueContainer:wy},fC=function(t){return Le(Le({},Fl),t.components)},Lc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function hC(e,t){return!!(e===t||Lc(e)&&Lc(t))}function gC(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!hC(e[n],t[n]))return!1;return!0}function pC(e,t){t===void 0&&(t=gC);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var mC={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"},vC=function(t){return Ae("span",ze({css:mC},t))},Fc=vC,bC={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,f=function(m,w){return m&&m.length?"".concat(m.indexOf(w)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(f(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).concat(h,", ").concat(f(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},wC=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,f=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,p=l.isMulti,m=l.isOptionDisabled,w=l.isSearchable,b=l.menuIsOpen,v=l.options,C=l.screenReaderStatus,I=l.tabSelectsValue,E=l.isLoading,R=l["aria-label"],P=l["aria-live"],x=d.useMemo(function(){return Le(Le({},bC),f||{})},[f]),S=d.useMemo(function(){var k="";if(n&&x.onChange){var N=n.option,q=n.options,Y=n.removedValue,ue=n.removedValues,ee=n.value,te=function(_){return Array.isArray(_)?null:_},ce=Y||N||te(ee),le=ce?g(ce):"",he=q||ue||void 0,de=he?he.map(g):[],ie=Le({isDisabled:ce&&m(ce,a),label:le,labels:de},n);k=x.onChange(ie)}return k},[n,x,m,a,g]),L=d.useMemo(function(){var k="",N=r||i,q=!!(r&&a&&a.includes(r));if(N&&x.onFocus){var Y={focused:N,label:g(N),isDisabled:m(N,a),isSelected:q,options:o,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};k=x.onFocus(Y)}return k},[r,i,g,m,x,o,a,c]),D=d.useMemo(function(){var k="";if(b&&v.length&&!E&&x.onFilter){var N=C({count:o.length});k=x.onFilter({inputValue:h,resultsMessage:N})}return k},[o,h,b,x,v,C,E]),M=n?.action==="initial-input-focus",T=d.useMemo(function(){var k="";if(x.guidance){var N=i?"value":b?"menu":"input";k=x.guidance({"aria-label":R,context:N,isDisabled:r&&m(r,a),isMulti:p,isSearchable:w,tabSelectsValue:I,isInitialFocus:M})}return k},[R,r,i,p,m,w,b,x,a,I,M]),O=Ae(d.Fragment,null,Ae("span",{id:"aria-selection"},S),Ae("span",{id:"aria-focused"},L),Ae("span",{id:"aria-results"},D),Ae("span",{id:"aria-guidance"},T));return Ae(d.Fragment,null,Ae(Fc,{id:u},M&&O),Ae(Fc,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!M&&O))},yC=wC,Ks=[{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źẑżžẓẕƶȥɀⱬꝣ"}],CC=new RegExp("["+Ks.map(function(e){return e.letters}).join("")+"]","g"),rh={};for(var Rs=0;Rs<Ks.length;Rs++)for(var Es=Ks[Rs],Is=0;Is<Es.letters.length;Is++)rh[Es.letters[Is]]=Es.base;var ih=function(t){return t.replace(CC,function(n){return rh[n]})},SC=pC(ih),Ac=function(t){return t.replace(/^\s+|\s+$/g,"")},xC=function(t){return"".concat(t.label," ").concat(t.value)},kC=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Le({ignoreCase:!0,ignoreAccents:!0,stringify:xC,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?Ac(r):r,f=l?Ac(a(n)):a(n);return o&&(c=c.toLowerCase(),f=f.toLowerCase()),s&&(c=SC(c),f=ih(f)),u==="start"?f.substr(0,c.length)===c:f.indexOf(c)>-1}},MC=["innerRef"];function RC(e){var t=e.innerRef,n=lr(e,MC),r=Qw(n,"onExited","in","enter","exit","appear");return Ae("input",ze({ref:t},r,{css:Dl({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 EC=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function IC(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=d.useRef(!1),a=d.useRef(!1),l=d.useRef(0),u=d.useRef(null),c=d.useCallback(function(w,b){if(u.current!==null){var v=u.current,C=v.scrollTop,I=v.scrollHeight,E=v.clientHeight,R=u.current,P=b>0,x=I-E-C,S=!1;x>b&&s.current&&(r&&r(w),s.current=!1),P&&a.current&&(o&&o(w),a.current=!1),P&&b>x?(n&&!s.current&&n(w),R.scrollTop=I,S=!0,s.current=!0):!P&&-b>C&&(i&&!a.current&&i(w),R.scrollTop=0,S=!0,a.current=!0),S&&EC(w)}},[n,r,i,o]),f=d.useCallback(function(w){c(w,w.deltaY)},[c]),g=d.useCallback(function(w){l.current=w.changedTouches[0].clientY},[]),h=d.useCallback(function(w){var b=l.current-w.changedTouches[0].clientY;c(w,b)},[c]),p=d.useCallback(function(w){if(w){var b=Kw?{passive:!1}:!1;w.addEventListener("wheel",f,b),w.addEventListener("touchstart",g,b),w.addEventListener("touchmove",h,b)}},[h,g,f]),m=d.useCallback(function(w){w&&(w.removeEventListener("wheel",f,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",h,!1))},[h,g,f]);return d.useEffect(function(){if(t){var w=u.current;return p(w),function(){m(w)}}},[t,p,m]),function(w){u.current=w}}var Hc=["boxSizing","height","overflow","paddingRight","position"],zc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Vc(e){e.cancelable&&e.preventDefault()}function $c(e){e.stopPropagation()}function Nc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Bc(){return"ontouchstart"in window||navigator.maxTouchPoints}var Wc=!!(typeof window<"u"&&window.document&&window.document.createElement),oo=0,xi={capture:!1,passive:!1};function TC(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=d.useRef({}),o=d.useRef(null),s=d.useCallback(function(l){if(Wc){var u=document.body,c=u&&u.style;if(r&&Hc.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&oo<1){var f=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+f||0;Object.keys(zc).forEach(function(p){var m=zc[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&Bc()&&(u.addEventListener("touchmove",Vc,xi),l&&(l.addEventListener("touchstart",Nc,xi),l.addEventListener("touchmove",$c,xi))),oo+=1}},[r]),a=d.useCallback(function(l){if(Wc){var u=document.body,c=u&&u.style;oo=Math.max(oo-1,0),r&&oo<1&&Hc.forEach(function(f){var g=i.current[f];c&&(c[f]=g)}),u&&Bc()&&(u.removeEventListener("touchmove",Vc,xi),l&&(l.removeEventListener("touchstart",Nc,xi),l.removeEventListener("touchmove",$c,xi)))}},[r]);return d.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var DC=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},OC={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function PC(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=IC({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=TC({isEnabled:n}),f=function(h){u(h),c(h)};return Ae(d.Fragment,null,n&&Ae("div",{onClick:DC,css:OC}),t(f))}var _C={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},LC=function(t){var n=t.name,r=t.onFocus;return Ae("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:_C,value:"",onChange:function(){}})},FC=LC;function Al(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 AC(){return Al(/^iPhone/i)}function oh(){return Al(/^Mac/i)}function HC(){return Al(/^iPad/i)||oh()&&navigator.maxTouchPoints>1}function zC(){return AC()||HC()}function VC(){return oh()||zC()}var $C=function(t){return t.label},ah=function(t){return t.label},sh=function(t){return t.value},NC=function(t){return!!t.isDisabled},BC={clearIndicator:Ey,container:my,control:Ly,dropdownIndicator:My,group:zy,groupHeading:$y,indicatorsContainer:yy,indicatorSeparator:Ty,input:Uy,loadingIndicator:Py,loadingMessage:dy,menu:iy,menuList:ly,menuPortal:gy,multiValue:Xy,multiValueLabel:Ky,multiValueRemove:Zy,noOptionsMessage:cy,option:rC,placeholder:aC,singleValue:uC,valueContainer:by},WC={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%)"},UC=4,lh=4,jC=38,qC=lh*2,GC={baseUnit:lh,controlHeight:jC,menuGutter:qC},Ts={borderRadius:UC,colors:WC,spacing:GC},YC={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Pc(),captureMenuScroll:!Pc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:kC(),formatGroupLabel:$C,getOptionLabel:ah,getOptionValue:sh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:NC,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Yw(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Uc(e,t,n,r){var i=dh(e,t,n),o=fh(e,t,n),s=ch(e,t),a=Ra(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function la(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return Uc(e,s,t,a)}).filter(function(s){return qc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=Uc(e,n,t,r);return qc(e,o)?o:void 0}).filter(Zw)}function uh(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Oi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function jc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Oi(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function XC(e,t){return uh(la(e,t))}function qc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!gh(e)||!o)&&hh(e,{label:s,value:a,data:i},r)}function KC(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function ZC(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Ds=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},ch=function(t,n){return t.getOptionLabel(n)},Ra=function(t,n){return t.getOptionValue(n)};function dh(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function fh(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ra(e,t);return n.some(function(i){return Ra(e,i)===r})}function hh(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var gh=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},JC=1,Hl=(function(e){_p(n,e);var t=Ap(n);function n(r){var i;if(Fp(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,f=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),f(l,u)},i.setValue=function(l,u,c){var f=i.props,g=f.closeMenuOnSelect,h=f.isMulti,p=f.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,f=u.isMulti,g=u.name,h=i.state.selectValue,p=f&&i.isOptionSelected(l,h),m=i.isOptionDisabled(l,h);if(p){var w=i.getOptionValue(l);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==w}),"deselect-option",l)}else if(!m)f?i.setValue([].concat(Oi(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,f=i.getOptionValue(l),g=c.filter(function(p){return i.getOptionValue(p)!==f}),h=lo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(lo(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],f=u.slice(0,u.length-1),g=lo(l,f,f[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return Ds(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return jc(la(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return Ww.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return ch(i.props,l)},i.getOptionValue=function(l){return Ra(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,f=BC[l](u,c);f.boxSizing="border-box";var g=i.props.styles[l];return g?g(f,u):f},i.getClassNames=function(l,u){var c,f;return(c=(f=i.props.classNames)[l])===null||c===void 0?void 0:c.call(f,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return fC(i.props)},i.buildCategorizedOptions=function(){return la(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return uh(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Le({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,f=u.menuIsOpen;i.focusInput(),f?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Pa(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var f=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=f>h||g>h}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return gh(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,f=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,p=u.isClearable,m=u.isDisabled,w=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,C=u.openMenuOnFocus,I=i.state,E=I.focusedOption,R=I.focusedValue,P=I.selectValue;if(!m&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!f)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!w||!v||!E||C&&i.isOptionSelected(E,P))return;i.selectOption(E);break;case"Enter":if(l.keyCode===229)break;if(w){if(!E||i.isComposing)return;i.selectOption(E);break}return;case"Escape":w?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&g&&i.clearValue();break;case" ":if(h)return;if(!w){i.openMenu("first");break}if(!E)return;i.selectOption(E);break;case"ArrowUp":w?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":w?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!w)return;i.focusOption("pageup");break;case"PageDown":if(!w)return;i.focusOption("pagedown");break;case"Home":if(!w)return;i.focusOption("first");break;case"End":if(!w)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++JC),i.state.selectValue=ka(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=Ds(o,s[a])}return i}return Lp(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&&Oc(this.menuListRef,this.focusedOptionRef),VC()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Oc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var f=u.indexOf(a[0]);f>-1&&(c=f)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ts):Le(Le({},Ts),this.props.theme):Ts})},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,f=this.props,g=f.isMulti,h=f.isRtl,p=f.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps:f,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return dh(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return fh(this.props,i,o)}},{key:"filterOption",value:function(i,o){return hh(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,f=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,w=m.inputIsHidden,b=m.ariaSelection,v=this.commonProps,C=a||this.getElementId("input"),I=Le(Le(Le({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?d.createElement(p,ze({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:o,isHidden:w,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},I)):d.createElement(RC,ze({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:xa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},I))})},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,f=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,w=h.isMulti,b=h.inputValue,v=h.placeholder,C=this.state,I=C.selectValue,E=C.focusedValue,R=C.isFocused;if(!this.hasValue()||!p)return b?null:d.createElement(f,ze({},g,{key:"placeholder",isDisabled:m,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),v);if(w)return I.map(function(x,S){var L=x===E,D="".concat(i.getOptionLabel(x),"-").concat(i.getOptionValue(x));return d.createElement(s,ze({},g,{components:{Container:a,Label:l,Remove:u},isFocused:L,isDisabled:m,key:D,index:S,removeProps:{onClick:function(){return i.removeValue(x)},onTouchEnd:function(){return i.removeValue(x)},onMouseDown:function(T){T.preventDefault()}},data:x}),i.formatOptionLabel(x,"value"))});if(b)return null;var P=I[0];return d.createElement(c,ze({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,ze({},s,{innerProps:f,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var f={"aria-hidden":"true"};return d.createElement(o,ze({},s,{innerProps:f,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return d.createElement(s,ze({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,ze({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,f=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,p=this.commonProps,m=this.state.focusedOption,w=this.props,b=w.captureMenuScroll,v=w.inputValue,C=w.isLoading,I=w.loadingMessage,E=w.minMenuHeight,R=w.maxMenuHeight,P=w.menuIsOpen,x=w.menuPlacement,S=w.menuPosition,L=w.menuPortalTarget,D=w.menuShouldBlockScroll,M=w.menuShouldScrollIntoView,T=w.noOptionsMessage,O=w.onMenuScrollToTop,k=w.onMenuScrollToBottom;if(!P)return null;var N=function(le,he){var de=le.type,ie=le.data,H=le.isDisabled,_=le.isSelected,G=le.label,ne=le.value,oe=m===ie,xe=H?void 0:function(){return i.onOptionHover(ie)},ve=H?void 0:function(){return i.selectOption(ie)},et="".concat(i.getElementId("option"),"-").concat(he),ke={id:et,onClick:ve,onMouseMove:xe,onMouseOver:xe,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:_};return d.createElement(h,ze({},p,{innerProps:ke,data:ie,isDisabled:H,isSelected:_,key:et,label:G,type:de,value:ne,isFocused:oe,innerRef:oe?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(le.data,"menu"))},q;if(this.hasOptions())q=this.getCategorizedOptions().map(function(ce){if(ce.type==="group"){var le=ce.data,he=ce.options,de=ce.index,ie="".concat(i.getElementId("group"),"-").concat(de),H="".concat(ie,"-heading");return d.createElement(s,ze({},p,{key:ie,data:le,options:he,Heading:a,headingProps:{id:H,data:ce.data},label:i.formatGroupLabel(ce.data)}),ce.options.map(function(_){return N(_,"".concat(de,"-").concat(_.index))}))}else if(ce.type==="option")return N(ce,"".concat(ce.index))});else if(C){var Y=I({inputValue:v});if(Y===null)return null;q=d.createElement(f,p,Y)}else{var ue=T({inputValue:v});if(ue===null)return null;q=d.createElement(g,p,ue)}var ee={minMenuHeight:E,maxMenuHeight:R,menuPlacement:x,menuPosition:S,menuShouldScrollIntoView:M},te=d.createElement(oy,ze({},p,ee),function(ce){var le=ce.ref,he=ce.placerProps,de=he.placement,ie=he.maxHeight;return d.createElement(l,ze({},p,ee,{innerRef:le,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:C,placement:de}),d.createElement(PC,{captureEnabled:b,onTopArrive:O,onBottomArrive:k,lockEnabled:D},function(H){return d.createElement(u,ze({},p,{innerRef:function(G){i.getMenuListRef(G),H(G)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:C,maxHeight:ie,focusedOption:m}),q)}))});return L||S==="fixed"?d.createElement(c,ze({},p,{appendTo:L,controlElement:this.controlRef,menuPlacement:x,menuPosition:S}),te):te}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,f=this.state.selectValue;if(c&&!this.hasValue()&&!a)return d.createElement(FC,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=f.map(function(m){return i.getOptionValue(m)}).join(s);return d.createElement("input",{name:u,type:"hidden",value:g})}else{var h=f.length>0?f.map(function(m,w){return d.createElement("input",{key:"i-".concat(w),name:u,type:"hidden",value:i.getOptionValue(m)})}):d.createElement("input",{name:u,type:"hidden",value:""});return d.createElement("div",null,h)}else{var p=f[0]?this.getOptionValue(f[0]):"";return d.createElement("input",{name:u,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,f=this.getFocusableOptions();return d.createElement(yC,ze({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:f,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,f=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return d.createElement(a,ze({},m,{className:c,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),d.createElement(o,ze({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),d.createElement(l,ze({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(s,ze({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,f=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,w=i.inputValue,b=i.isMulti,v=ka(p),C={};if(s&&(p!==s.value||h!==s.options||m!==s.menuIsOpen||w!==s.inputValue)){var I=m?XC(i,v):[],E=m?jc(la(i,v),"".concat(g,"-option")):[],R=a?KC(o,v):null,P=ZC(o,I),x=Ds(E,P);C={selectValue:v,focusedOption:P,focusedOptionId:x,focusableOptionsWithIds:E,focusedValue:R,clearFocusValueOnUpdate:!1}}var S=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},L=u,D=c&&f;return c&&!D&&(L={value:lo(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!f),u?.action==="initial-input-focus"&&(L=null),Le(Le(Le({},C),S),{},{prevProps:i,ariaSelection:L,prevWasFocused:D})}}]),n})(d.Component);Hl.defaultProps=YC;var QC=d.forwardRef(function(e,t){var n=Hf(e);return d.createElement(Hl,ze({ref:t},n))}),ph=QC;const eS=e=>{const{Menu:t}=Fl,{children:n,...r}=e;return d.createElement(t,{...r},n)},tS=fn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),nS=fn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),rS=fn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),iS=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:s}=t.data,[a,l]=d.useState(s),[u,c]=d.useState(r??""),f=Jd(),g=d.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?d.createElement(rS,null,d.createElement(ti,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):d.createElement(tS,null,d.createElement(ph,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:p})=>({...h,fontSize:f.editorFontSize,fontFamily:f.fontFamily,cursor:p?"pointer":void 0,paddingLeft:f.cellHorizontalPadding,paddingRight:f.cellHorizontalPadding,":active":{...h[":active"],color:f.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:f.bgCell,neutral5:f.bgCell,neutral10:f.bgCell,neutral20:f.bgCellMedium,neutral30:f.bgCellMedium,neutral40:f.bgCellMedium,neutral50:f.textLight,neutral60:f.textMedium,neutral70:f.textMedium,neutral80:f.textDark,neutral90:f.textDark,neutral100:f.textDark,primary:f.accentColor,primary75:f.accentColor,primary50:f.accentColor,primary25:f.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>d.createElement(nS,null,d.createElement(eS,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},oS={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+nr(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:iS,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 aS(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const sS={marginRight:8},lS={display:"flex",alignItems:"center",flexGrow:1},uS={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,f=i.y+i.height/2,g=s-o,h=(a-o)/g,p=`${aS(r.baseFontStyle,.9)} ${r.fontFamily}`,w=ll(n,p)/2;n.save();let b=0;l!==void 0&&(n.font=p,b=_r(u??l,n,p).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=w){const C=n.createLinearGradient(c,f,c+v,f);C.addColorStop(0,r.accentColor),C.addColorStop(h,r.accentColor),C.addColorStop(h,r.bgBubble),C.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=C,Mc(n,c,f-w/2,v,w,w/2),n.fill(),n.beginPath(),Mc(n,c+.5,f-w/2+.5,v-1,w-1,(w-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,f+nr(n,p))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return d.createElement("label",{style:lS},d.createElement("input",{style:sS,type:"range",value:r,min:i,max:o,step:s,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},cS=fn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Os=(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}`)}},dS=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?Os(n,t.min,o):t.min,a=t.max instanceof Date?Os(n,t.max,o):t.max,l=Os(n,t.date,o);return e.value.readonly?Bt.createElement(ti,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Bt.createElement(cS,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},fS={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return sl(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:dS}),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 hS=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Gc=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return o===i||s===i},Ps={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return Gc(t,o,i)})||r.some(function(o){return Gc(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function gS(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,s=o===void 0?Ps.formatCreateLabel:o,a=e.isValidNewOption,l=a===void 0?Ps.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?Ps.getNewOptionData:u,f=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=lr(e,hS),w=m.getOptionValue,b=w===void 0?sh:w,v=m.getOptionLabel,C=v===void 0?ah:v,I=m.inputValue,E=m.isLoading,R=m.isMulti,P=m.value,x=m.name,S=d.useMemo(function(){return l(I,ka(P),h,{getOptionValue:b,getOptionLabel:C})?c(I,s(I)):void 0},[s,c,C,b,I,l,h,P]),L=d.useMemo(function(){return(n||!E)&&S?i==="first"?[S].concat(Oi(h)):[].concat(Oi(h),[S]):h},[n,i,E,S,h]),D=d.useCallback(function(M,T){if(T.action!=="select-option")return p(M,T);var O=Array.isArray(M)?M:[M];if(O[O.length-1]===S){if(f)f(I);else{var k=c(I,I),N={action:"create-option",name:x,option:k};p(lo(R,[].concat(Oi(ka(P)),[k]),k),N)}return}p(M,T)},[c,I,R,x,S,f,p,P]);return Le(Le({},m),{},{options:L,onChange:D})}var pS=d.forwardRef(function(e,t){var n=Hf(e),r=gS(n);return d.createElement(Hl,ze({ref:t},r))}),mS=pS;const zl="__value",vS=new RegExp(`^${zl}\\d+__`),bS=fn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),wS=fn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),ua=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}),mh=(e,t,n)=>e==null?[]:e.map((r,i)=>{const o=n?`${zl}${i}__`:"",s=t.find(a=>a.value===r);return s?{...s,value:`${o}${s.value}`}:{value:`${o}${r}`,label:r}}),yS=e=>{const{Menu:t}=Fl,{children:n,...r}=e;return d.createElement(t,{...r},n)},CS=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i,portalElementRef:o}=e,{options:s,values:a,allowCreation:l,allowDuplicates:u}=t.data,c=Jd(),[f,g]=d.useState(a),[h,p]=d.useState(!0),[m,w]=d.useState(n??""),b=d.useMemo(()=>ua(s??[]),[s]),v=l&&u&&b.length===0,C=d.useCallback(x=>{h&&x.stopPropagation()},[h]),I={control:(x,S)=>({...x,border:0,boxShadow:"none",backgroundColor:c.bgCell,pointerEvents:S.isDisabled?"auto":x.pointerEvents,cursor:S.isDisabled?"default":x.cursor}),valueContainer:x=>({...x,flexWrap:x.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:x=>({...x,backgroundColor:c.bgCell}),option:(x,S)=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark,...S.isFocused?{backgroundColor:c.accentLight,cursor:"pointer"}:{},":active":{...x[":active"],color:c.accentFg,backgroundColor:c.accentColor}}),input:(x,{isDisabled:S})=>S?{display:"none"}:{...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark},placeholder:x=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),noOptionsMessage:x=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),clearIndicator:x=>({...x,color:c.textLight,":hover":{color:c.textDark,cursor:"pointer"}}),multiValue:(x,{data:S})=>({...x,backgroundColor:S.color??c.bgBubble,borderRadius:`${c.roundingRadius??c.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(x,{data:S,isDisabled:L})=>({...x,paddingRight:L?c.bubblePadding:0,paddingLeft:c.bubblePadding,paddingTop:0,paddingBottom:0,color:S.color?zs(S.color)>.5?"black":"white":c.textBubble,fontSize:c.editorFontSize,fontFamily:c.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:c.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(x,{data:S,isDisabled:L,isFocused:D})=>L?{display:"none"}:{...x,color:S.color?zs(S.color)>.5?"black":"white":c.textBubble,backgroundColor:void 0,borderRadius:D?`${c.roundingRadius??c.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},E=d.useCallback(x=>{const S=x.map(L=>u&&L.startsWith(zl)?L.replace(new RegExp(vS),""):L);g(S),r({...t,data:{...t.data,values:S}})},[t,r,u]),R=x=>{switch(x.key){case"Enter":case"Tab":if(!m){i(t,[0,1]);return}u&&l&&(w(""),E([...f??[],m]),p(!1),x.preventDefault())}},P=l?mS:ph;return d.createElement(bS,{onKeyDown:C,"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:b,placeholder:t.readonly?"":l?"Add...":void 0,noOptionsMessage:x=>l&&u&&x.inputValue?`Create "${x.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:h,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:mh(f,b,u),onKeyDown:t.readonly?void 0:R,menuPlacement:"auto",menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:I,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:x=>v?null:d.createElement(wS,null,d.createElement(yS,{className:"click-outside-ignore",...x}))},onChange:async x=>{x!==null&&E(x.map(S=>S.value))}}))},SS={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:s,options:a}=t.data;if(s==null)return!0;const l=ua(a??[]),u={x:i.x+r.cellHorizontalPadding,y:i.y+r.cellVerticalPadding,width:i.width-2*r.cellHorizontalPadding,height:i.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:f}=u,g=1,h=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const p of s){const m=l.find(E=>E.value===p),w=m?.color??(o?r.bgBubbleSelected:r.bgBubble),b=m?.label??p,C=_r(b,n).width+r.bubblePadding*2,I=r.bubbleHeight/2;if(f!==u.x&&f+C>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,f=u.x),n.fillStyle=w,n.beginPath(),er(n,f,h,C,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?zs(w)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(b,f+r.bubblePadding,h+I+nr(n,r)),f+=C+r.bubbleMargin,f>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:i}=t.data;if(!r)return n.cellHorizontalPadding*2;const o=mh(r,ua(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),s=o.reduce((a,l)=>e.measureText(l).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:s+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:CS,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,i)=>n.indexOf(r)===i)),!t.allowCreation){const r=ua(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},xS="None";function Yc(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 kS=e=>{const{cell:t,theme:n,ctx:r}=e;sl({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},xS,t.contentAlign),r.fillStyle=n.textDark};function MS(e){const t=d.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(Pi(o))Yc(a,l,s);else if(pl(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():kS(r),c.isRequired&&c.isEditable&&Yc(a,l,s);return}i()},[e]),n=d.useMemo(()=>[nw,oS,uS,fS,SS,...I1],[]);return{drawCell:t,customRenderers:n}}function RS(){const e=Qr();return d.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:ki(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:ki(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:ki(e.colors.darkenedBgMix100,.9),bgHeaderHovered:ki(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(an("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${an(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${an(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:ki(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(an(e.spacing.sm)),cellVerticalPadding:Math.round(an("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:hp(e.colors.secondaryBg,.1),bubbleHeight:Math.round(an("1.25rem")),bubblePadding:Math.round(an(e.spacing.sm)),bubbleMargin:Math.round(an(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(an(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(an("25rem")),minColumnWidth:Math.round(an("3.125rem")),maxColumnWidth:Math.round(an("62.5rem")),maxColumnAutoWidth:Math.round(an("31.25rem")),defaultRowHeight:Math.round(an("2.1875rem")),defaultHeaderHeight:Math.round(an("2.1875rem")),bgRowHovered:gp(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const ES=Qs.getLogger("useDataEditor");function IS(e,t,n,r,i,o,s,a,l){const u=d.useCallback(([m,w],b)=>{const v=e[m];if(!v.isEditable)return;const C=v.indexNumber,I=n.current.getOriginalRowIndex(i(w)),E=r([m,w]),R=v.getCellValue(E),P=v.getCellValue(b);if(!Pi(E)&&P===R)return;const x=v.getCell(P,!0);Pi(x)?ES.warn(`Not applying the cell edit since it causes this error:
|
|
186
186
|
${x.data}`):(n.current.setCell(C,I,{...x,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=d.useCallback(()=>{if(t)return;const m=new Map;e.forEach(w=>{m.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(m),s()},[e,n,t,s]),f=d.useCallback(()=>{t||(c(),a())},[c,a,t]),g=d.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const w=m.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(w),s(),l(),a(),!1}if(m.current?.range){const w=[],b=m.current.range;for(let v=b.y;v<b.y+b.height;v++)for(let C=b.x;C<b.x+b.width;C++){const I=e[C];I.isEditable&&!I.isRequired&&(w.push({cell:[C,v]}),u([C,v],I.getCell(null)))}return w.length>0&&(a(),o(w)),!1}return!0},[e,n,t,o,i,a,u,l,s]),h=d.useCallback((m,w)=>{const[b,v]=m,C=[];for(let I=0;I<w.length;I++){const E=w[I];if(I+v>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<E.length;R++){const P=E[R],x=I+v,S=R+b;if(S>=e.length)break;const L=e[S];if(L.isEditable){const D=L.getCell(P,!0);if(st(D)&&!Pi(D)){const M=L.indexNumber,T=n.current.getOriginalRowIndex(i(x)),O=L.getCellValue(r([S,x]));L.getCellValue(D)!==O&&(n.current.setCell(M,T,{...D,lastUpdated:performance.now()}),C.push({cell:[S,x]}))}}}C.length>0&&(a(),o(C))}return!1},[e,n,t,i,r,c,a,o]),p=d.useCallback((m,w)=>{const b=m[0];if(b>=e.length)return!0;const v=e[b];if(v.validateInput){const C=v.validateInput(v.getCellValue(w));return C===!0||C===!1?C:v.getCell(C)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:f,onDelete:g,validateCell:p}}const vh=",",uo='"',TS='"',bh=`
|
|
187
|
-
`,DS="\uFEFF",OS=new RegExp(`[${[vh,uo,bh].join("")}]`),Xc=Qs.getLogger("useDataExporter");function Kc(e){return e.map(t=>PS(t)).join(vh)+bh}function PS(e){if(Pe(e))return"";const t=lt(e);return OS.test(t)?`${uo}${t.replace(new RegExp(uo,"g"),TS+uo)}${uo}`:t}async function Zc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(DS));const o=n.map(s=>s.name);await e.write(i.encode(Kc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(Kc(a)))}await e.close()}function _S(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Js(()=>import("./es6-
|
|
187
|
+
`,DS="\uFEFF",OS=new RegExp(`[${[vh,uo,bh].join("")}]`),Xc=Qs.getLogger("useDataExporter");function Kc(e){return e.map(t=>PS(t)).join(vh)+bh}function PS(e){if(Pe(e))return"";const t=lt(e);return OS.test(t)?`${uo}${t.replace(new RegExp(uo,"g"),TS+uo)}${uo}`:t}async function Zc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(DS));const o=n.map(s=>s.name);await e.write(i.encode(Kc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(Kc(a)))}await e.close()}function _S(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Js(()=>import("./es6-BCBcAdQS.js").then(c=>c.a),__vite__mapDeps([14,1,2]))).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Zc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{Xc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Zc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),f=URL.createObjectURL(c),g=Op({enforceDownloadInNewTab:r,url:f,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(f)}catch(l){Xc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function LS(e,t,n,r){return{getCellContent:d.useCallback(([o,s])=>{if(o>t.length-1)return Dt("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Dt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(st(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Dt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const f=e.getCell(u,l),g=pp(e,u,l);return z1(a,f,g,e.styler?.cssStyles)}catch(a){return Dt("Error during cell creation",`This error should never happen. Please report this bug.
|
|
188
188
|
Error: ${a}`)}},[t,n,e,r])}}function FS(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function AS(e,t,n,r,i){const[o,s]=d.useState({columns:Qe.empty(),rows:Qe.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(sn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(sn.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(sn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(sn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(sn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(sn.SelectionMode.MULTI_COLUMN),f=!t&&!n&&(e.selectionMode.includes(sn.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(sn.SelectionMode.MULTI_CELL)),g=f&&e.selectionMode.includes(sn.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,w=d.useCallback(v=>{const C=!ns(v.rows.toArray(),o.rows.toArray()),I=!ns(v.columns.toArray(),o.columns.toArray()),E=!ns(v.current,o.current),R=a&&C||u&&I||f&&E;let P=v;if(I&&P.columns.length>=0){let x=P.columns;r.forEach((S,L)=>{S.isIndex&&(x=x.remove(L))}),x.length<P.columns.length&&(P={...P,columns:x})}s(P),R&&i(P,f)},[o,a,u,f,i,r]),b=d.useCallback((v=!1,C=!1)=>{const I={columns:C?o.columns:Qe.empty(),rows:v?o.rows:Qe.empty(),current:void 0};s(I),(!v&&a||!C&&u||f)&&i(I,f)},[o,a,u,f,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:f,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:b,processSelectionChange:w}}function HS(e,t,n,r,i,o,s,a,l){const u=e.rowHeight??t.defaultRowHeight,c=t.defaultHeaderHeight+u+2*t.tableBorderWidth,f=r?2:1,g=e.editingMode===sn.EditingMode.DYNAMIC?1:0,h=n+g;let p=Math.max(h*u+f*t.defaultHeaderHeight+2*t.tableBorderWidth,c),m=Math.min(p,t.defaultTableHeight);const w=$1(e,l);w&&(m=Math.max(w,c),p=Math.max(w,p)),o&&(m=Math.min(m,o),p=Math.min(p,o),w||(m=p));const b=t.minColumnWidth+2*t.tableBorderWidth,v=Math.max(i,b);let C,I=v;const E=Lf(e,a),R=Ff(e,a),P=V1(a);E?C=v:R?(C=Math.min(Math.max(R,b),v),I=Math.min(Math.max(R,I),v)):P&&(C=void 0);const[x,S]=d.useState({width:C||"100%",height:m});return d.useLayoutEffect(()=>{E&&x.width==="100%"&&S(L=>({...L,width:v}))},[v]),d.useLayoutEffect(()=>{S(L=>({...L,width:C||"100%"}))},[C]),d.useLayoutEffect(()=>{S(L=>({...L,height:m}))},[m,n]),d.useLayoutEffect(()=>{if(s){const L=E||st(R)&&R>0;S({width:L?I:"100%",height:p})}else S({width:C||"100%",height:m})},[s]),{minHeight:c,maxHeight:p,minWidth:b,maxWidth:I,rowHeight:u,resizableSize:x,setResizableSize:S}}const zS=600,VS="⚠️ Please fill out this cell.";function $S(e,t,n=[]){const[r,i]=d.useState(),o=d.useRef(null),s=d.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let f;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&&st(g))f=g.help;else if(l.kind==="cell"){const h=t([u,c]);Pi(h)?f=h.errorDetails:g.isRequired&&g.isEditable&&pl(h)?f=VS:d1(h)&&(f=h.tooltip)}f&&(o.current=setTimeout(()=>{f&&i({content:f,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},zS))}},[e,t,i,o,n]),a=d.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}const wh=tr("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),Tr=tr("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}}}),""),yh=tr("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),NS=tr("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS}),""),BS=tr("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"}),""),WS=tr("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"}),""),US=tr("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),jS=tr("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}}),""),Jc=[{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:"}],qS={number:Jc,progress:Jc,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 GS({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=Qr(),{colors:l,fontSizes:u,radii:c,fontWeights:f}=a,g=qS[e]||[];return g.length===0?me.jsx(me.Fragment,{}):me.jsx(Ea,{triggerType:pd.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:me.jsx(wh,{role:"menu",children:g.map(h=>me.jsxs(Tr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:Ia.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:Ta(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:f.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const YS=d.memo(GS);function XS({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const f=Qr(),[g,h]=d.useState(!1),{colors:p,fontSizes:m,radii:w,fontWeights:b}=f,{isCopied:v,copyToClipboard:C}=mp();d.useEffect(()=>{function R(P){P.preventDefault()}return document.addEventListener("wheel",R,{passive:!1}),document.addEventListener("touchmove",R,{passive:!1}),()=>{document.removeEventListener("wheel",R),document.removeEventListener("touchmove",R)}},[]);const I=d.useCallback(()=>{o()},[o]),E=d.useCallback(()=>{C(l.title)},[l.title,C]);return me.jsx(Ea,{autoFocus:!0,"aria-label":"Dataframe column menu",content:me.jsxs(wh,{children:[me.jsxs(NS,{children:[me.jsx(BS,{title:l.kind,children:me.jsx(Zn,{iconValue:l.typeIcon||":material/notes:",size:"base",color:"inherit"})}),me.jsxs(WS,{title:l.title,children:[me.jsx(US,{children:l.title}),me.jsx(jS,{onClick:E,title:"Copy column name","aria-label":"Copy column name",children:me.jsx(Zn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),s&&me.jsxs(me.Fragment,{children:[me.jsxs(Tr,{onClick:()=>{s("asc"),I()},role:"menuitem",children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),me.jsxs(Tr,{onClick:()=>{s("desc"),I()},role:"menuitem",children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),me.jsx(yh,{})]}),u&&me.jsx(YS,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:I,children:me.jsxs(Tr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[me.jsxs("div",{children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&me.jsxs(Tr,{onClick:()=>{c(),I()},children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&me.jsxs(Tr,{onClick:()=>{i(),I()},children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&me.jsxs(Tr,{onClick:()=>{r(),I()},children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&me.jsxs(Tr,{onClick:()=>{a(),I()},children:[me.jsx(Zn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Ia.bottomRight,accessibilityType:md.menu,showArrow:!1,popoverMargin:an("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:`${f.sizes.borderWidth} solid ${f.colors.borderColor}`,backgroundColor:Ta(f)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:b.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 KS=d.memo(XS),ZS="(index)";function _s(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const Qc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Qr();return me.jsx(Ip,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:Dp.default,labelPlacement:Tp.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:s,$isIndeterminate:a})=>{const l=s||a?i.colors.primary:i.colors.fadedText40;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(s||a)?`0 0 0 0.2rem ${ki(i.colors.primary,.5)}`:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},JS=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=Qr(),u=h=>!(h.isHidden===!0||_s(h,t)),c=e.every(u),f=e.some(u)&&!c,g=h=>{e.forEach(p=>{const m=_s(p,t);h?(i(p.id),m&&n(w=>[...w,p.id])):r(p.id)})};return me.jsx(Ea,{triggerType:pd.click,placement:Ia.bottomRight,autoFocus:!0,focusLock:!0,content:()=>me.jsxs("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto"},children:[me.jsx(Qc,{label:"Select all",isIndeterminate:f,initialValue:c,onChange:h=>{g(h)}}),me.jsx(yh,{}),me.jsx("div",{children:e.map(h=>{const p=_s(h,t);return me.jsx(Qc,{label:!h.title&&h.isIndex?ZS:h.title,initialValue:!(h.isHidden===!0||p),onChange:m=>{m?(i(h.id),p&&n(w=>[...w,h.id])):r(h.id)}},h.id)})})]}),isOpen:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Ta(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:me.jsx("div",{children:o})})},QS=d.memo(JS),ed=tr("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 ex({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=d.useState(!0),s=Qr(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,f=d.useCallback(()=>{o(!1),r()},[r,o]);return me.jsx(Ea,{content:me.jsx(vp,{"data-testid":"stDataFrameTooltipContent",children:me.jsx(bp,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:Ia.top,accessibilityType:md.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:f,onEsc:f,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Ta(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:me.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const tx=d.memo(ex),td=150,nx=15e4,rx="0.5rem";function ix({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:s,widthConfig:a,heightConfig:l}){const{expanded:u,expand:c,collapse:f,width:g,height:h}=iu(kp),{isInHorizontalLayout:p}=iu(wp),m=d.useRef(null),w=d.useRef(null),b=d.useRef(null),v=yp(),C=RS(),{getRowThemeOverride:I,onItemHovered:E}=FS(C),{libConfig:{enforceDownloadInNewTab:R=!1}}=d.useContext(Cp),[P,x]=d.useState(!0),[S,L]=d.useState(!1),[D,M]=d.useState(!1),[T,O]=d.useState(!1),[k,N]=d.useState(),[q,Y]=d.useState(!1),ue=d.useCallback(()=>Y(Ce=>!Ce),[]),ee=d.useCallback(()=>Y(!1),[]),te=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Pe(e.editingMode)&&(e.editingMode=sn.EditingMode.READ_ONLY);const{READ_ONLY:ce,DYNAMIC:le}=sn.EditingMode,he=t.dimensions,de=Math.max(0,he.numDataRows),ie=de===0&&!(e.editingMode===le&&he.numDataColumns>0),H=de>nx,_=!H&&!ie&&e.editingMode!==le,G=!ie&&e.editingMode===le&&!n,ne=d.useRef(new Qo(de)),[oe,xe]=d.useState(ne.current.getNumRows());d.useEffect(()=>{ne.current=new Qo(de),xe(ne.current.getNumRows())},[de]);const ve=d.useCallback(()=>{ne.current=new Qo(de),xe(ne.current.getNumRows())},[de]),[et,ke]=d.useState(e.columnOrder);d.useEffect(()=>{ke(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:bt,allColumns:St,setColumnConfigMapping:Ue}=W1(e,t,n,et,a);d.useEffect(()=>{if(e.editingMode===ce||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});Ce&&(ne.current.fromJson(Ce,bt),xe(ne.current.getNumRows()))},[]);const{getCellContent:re}=LS(t,bt,oe,ne),{columns:se,sortColumn:we,getOriginalIndex:fe,getCellContent:ye}=Q1(de,bt,re),$e=d.useCallback((Ce,Ft)=>{if(!r)return;const Kt={selection:{rows:[],columns:[],cells:[]}};if(Kt.selection.rows=Ce.rows.toArray().map(Gt=>fe(Gt)),Kt.selection.columns=Ce.columns.toArray().map(Gt=>Kr(se[Gt])),Ft&&Ce.current){const{cell:Gt,range:Yt}=Ce.current;if(Yt)for(let Fn=Yt.y;Fn<Yt.y+Yt.height;Fn++)for(let Tn=Yt.x;Tn<Yt.x+Yt.width;Tn++)se[Tn].isIndex||Kt.selection.cells.push([fe(Fn),Kr(se[Tn])]);else if(Gt){const[Fn,Tn]=Gt;se[Fn].isIndex||Kt.selection.cells.push([fe(Tn),Kr(se[Fn])])}}const Bn=JSON.stringify(Kt),Zt=r.getStringValue({id:e.id,formId:e.formId});(Zt===void 0||Zt!==Bn)&&r.setStringValue({id:e.id,formId:e.formId},Bn,{fromUi:!0},o)},[se,e.id,e.formId,r,o,fe]),{debouncedCallback:Fe}=fc($e,td),{gridSelection:tt,isRowSelectionActivated:Re,isMultiRowSelectionActivated:qe,isColumnSelectionActivated:De,isMultiColumnSelectionActivated:Ie,isCellSelectionActivated:_e,isMultiCellSelectionActivated:ht,isRowSelected:nt,isColumnSelected:Xe,isCellSelected:kt,clearSelection:wt,processSelectionChange:Ot}=AS(e,ie,n,se,Fe);d.useEffect(()=>{_e||wt(!0,!0)},[u]);const Pt=d.useCallback(Ce=>{w.current?.updateCells(Ce)},[]);d.useEffect(()=>{if(!Re&&!De&&!_e||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});if(Ce){const Ft=se.map(Yt=>Kr(Yt)),Kt=JSON.parse(Ce);let Bn=Qe.empty(),Zt=Qe.empty(),Gt;if(Kt.selection?.rows?.forEach(Yt=>{Bn=Bn.add(Yt)}),Kt.selection?.columns?.forEach(Yt=>{Zt=Zt.add(Ft.indexOf(Yt))}),_e&&!ht){const[Yt,Fn]=Kt.selection?.cells?.[0]??[];Yt!==void 0&&Fn!==void 0&&(Gt=[Ft.indexOf(Fn),Yt])}if(Bn.length>0||Zt.length>0||Gt!==void 0){const Yt={rows:Bn,columns:Zt,current:Gt?{cell:Gt,range:{x:Gt[0],y:Gt[1],width:1,height:1},rangeStack:[]}:void 0};Ot(Yt)}}},[]);const ln=d.useCallback(()=>{oe!==ne.current.getNumRows()&&xe(ne.current.getNumRows())},[oe]),Jt=d.useCallback(()=>{if(!r)return;const Ce=ne.current.toJson(se);let Ft=r.getStringValue({id:e.id,formId:e.formId});Ft===void 0&&(Ft=new Qo(0).toJson([])),Ce!==Ft&&r.setStringValue({id:e.id,formId:e.formId},Ce,{fromUi:!0},o)},[se,e.id,e.formId,r,o]),{debouncedCallback:Dn}=fc(Jt,td),{exportToCsv:Tt}=_S(ye,se,oe,R),{onCellEdited:gt,onPaste:On,onRowAppended:yt,onDelete:Qt,validateCell:kn}=IS(se,e.editingMode!==le,ne,ye,fe,Pt,ln,Dn,wt),Oe=d.useMemo(()=>ie?[0]:G?[oe]:[],[ie,G,oe]),{tooltip:ct,clearTooltip:pt,onItemHovered:Pn}=$S(se,ye,Oe),{drawCell:un,customRenderers:cn}=MS(se),{provideEditor:_n}=tw(),en=d.useCallback(Ce=>({...Ce,hasMenu:!ie}),[ie]),tn=d.useMemo(()=>se.map(Ce=>en(qs(Ce))),[se,en]),{columns:Be,onColumnResize:Mt}=G1(tn),Ln=t.dimensions.numHeaderRows>1,{minHeight:Lt,maxHeight:mt,minWidth:Mn,maxWidth:ur,rowHeight:Nn,resizableSize:B,setResizableSize:We}=HS(e,C,oe,Ln,g||0,h,u,a,l),Ge=d.useCallback(([Ce,Ft])=>({...f1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:C.glideTheme.textLight},span:[0,Math.max(se.length-1,0)]}),[se,C.glideTheme.textLight]),_t=d.useCallback(()=>{ve(),wt()},[ve,wt]);Rp({element:e,widgetMgr:r,onFormCleared:_t});const{pinColumn:nn,unpinColumn:hn,freezeColumns:Rn}=j1(se,ie,g||0,C.minColumnWidth,wt,Ue),{changeColumnFormat:yn}=U1(Ue),{hideColumn:Ut,showColumn:En}=ew(wt,Ue),{onColumnMoved:In}=q1(se,Rn,nn,hn,ke);return d.useEffect(()=>{let Ce;const Ft=requestAnimationFrame(()=>{Ce=setTimeout(()=>{if(b.current&&w.current){const Kt=b.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Kt&&(M(Kt.height>b.current.clientHeight),O(Kt.width>b.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(Ft),Ce&&clearTimeout(Ce)}},[B,oe,Be]),d.useEffect(()=>{St.length==se.length&&Y(!1)},[St.length,se.length]),me.jsxs(ed,{className:"stDataFrame","data-testid":"stDataFrame",ref:b,isInHorizontalLayout:p,onPointerDown:Ce=>{if(b.current){const Ft=b.current.getBoundingClientRect(),Kt=(v||Math.round(an(rx)))+1;T&&Ft.height-Kt<Ce.clientY-Ft.top&&Ce.stopPropagation(),D&&Ft.width-Kt<Ce.clientX-Ft.left&&Ce.stopPropagation()}},onBlur:Ce=>{!P&&!te&&!Ce.currentTarget.contains(Ce.relatedTarget)&&!_e&&wt(!0,!0)},children:[me.jsxs(Mp,{isFullScreen:u,disableFullscreenMode:i,locked:nt&&!Re||kt||te&&P||q,onExpand:c,onCollapse:f,target:ed,children:[s?.map(Ce=>Ce),(Re&&nt||De&&Xe||_e&&kt)&&me.jsx(Si,{label:"Clear selection",icon:Pp,onClick:()=>{wt(),pt()}}),G&&nt&&me.jsx(Si,{label:"Delete row(s)",icon:Hp,onClick:()=>{Qt&&(Qt(tt),pt())}}),G&&!nt&&me.jsx(Si,{label:"Add row",icon:vd,onClick:()=>{yt&&(x(!0),yt(),pt(),w.current?.scrollTo(0,oe,"vertical"))}}),!ie&&St.length>se.length&&me.jsx(QS,{columns:St,columnOrder:et,setColumnOrder:ke,hideColumn:Ut,showColumn:En,isOpen:q,onClose:ee,children:me.jsx(Si,{label:"Show/hide columns",icon:wd,onClick:ue})}),!H&&!ie&&me.jsx(Si,{label:"Download as CSV",icon:zp,onClick:Tt}),!ie&&me.jsx(Si,{label:"Search",icon:bd,onClick:()=>{S?L(!1):(x(!0),L(!0)),pt()}})]}),me.jsx(Sp,{"data-testid":"stDataFrameResizable",ref:m,defaultSize:B,style:{border:`${C.tableBorderWidth}px solid ${C.glideTheme.borderColor}`,borderRadius:`${C.tableBorderRadius}`},minHeight:Lt,maxHeight:mt,minWidth:Mn,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,Nn],snapGap:Nn/3,onResizeStop:(Ce,Ft,Kt,Bn)=>{if(m.current){const Zt=2*C.tableBorderWidth;We({width:m.current.size.width,height:mt-m.current.size.height===Zt?m.current.size.height+Zt:m.current.size.height})}},children:me.jsx(i1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:w,columns:Be,rows:ie?1:oe,minColumnWidth:C.minColumnWidth,maxColumnWidth:C.maxColumnWidth,maxColumnAutoWidth:C.maxColumnAutoWidth,rowHeight:Nn,headerHeight:C.defaultHeaderHeight,getCellContent:ie?Ge:ye,onColumnResize:te?void 0:Mt,resizeIndicator:"header",freezeColumns:Rn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:te?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:De?void 0:In,onItemHovered:Ce=>{E?.(Ce),Pn?.(Ce)},keybindings:{downFill:!0,..._e||H?{selectAll:!1}:{}},onKeyDown:Ce=>{(Ce.ctrlKey||Ce.metaKey)&&Ce.key==="f"&&(L(Ft=>!Ft),Ce.stopPropagation(),Ce.preventDefault())},showSearch:S,searchResults:S?void 0:[],onSearchClose:()=>{L(!1),pt()},onHeaderClicked:(Ce,Ft)=>{!_||De||(S&&L(!1),Re&&nt?wt():wt(!0,!0),we(Ce,"auto"))},gridSelection:tt,onGridSelectionChange:Ce=>{(P||te)&&(Ot(Ce),ct!==void 0&&pt(),N(void 0),Y(!1))},theme:C.glideTheme,getRowThemeOverride:I,onMouseMove:Ce=>{Ce.kind==="out-of-bounds"&&P?x(!1):Ce.kind!=="out-of-bounds"&&!P&&x(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:T?-v:void 0,paddingRight:D?-v:void 0},provideEditor:_n,drawCell:un,customRenderers:cn,imageEditorOverride:E1,headerIcons:C.headerIcons,validateCell:kn,onHeaderMenuClick:(Ce,Ft)=>{q||N({columnIdx:Ce,headerBounds:Ft})},onPaste:!1,...Re&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader,textMedium:C.glideTheme.textLight}},rowSelectionMode:qe?"multi":"auto",rowSelect:n?"none":qe?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...De&&{columnSelect:n?"none":Ie?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Ie?"multi":"auto",rangeSelectionBlending:"additive"},..._e&&{rangeSelect:ht?"rect":"cell",rangeSelectionBlending:"additive"},...!ie&&e.editingMode!==ce&&!n&&{fillHandle:!te,onCellEdited:gt,onPaste:On,onDelete:Qt},...!ie&&e.editingMode===le&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:yt,onHeaderClicked:void 0}})}),ct?.content&&me.jsx(tx,{top:ct.top,left:ct.left,content:ct.content,clearTooltip:pt}),k&&gd.createPortal(me.jsx(KS,{top:k.headerBounds.y+k.headerBounds.height,left:k.headerBounds.x+k.headerBounds.width,column:bt[k.columnIdx],onCloseMenu:()=>N(void 0),onSortColumn:_?Ce=>{S&&L(!1),wt(!(Re&&nt),!0),we(k.columnIdx,Ce,!0)}:void 0,isColumnPinned:bt[k.columnIdx].isPinned,onUnpinColumn:()=>{hn(bt[k.columnIdx].id)},onPinColumn:()=>{nn(bt[k.columnIdx].id)},onHideColumn:()=>{Ut(bt[k.columnIdx].id)},onChangeFormat:Ce=>{yn(bt[k.columnIdx].id,Ce),setTimeout(()=>{w.current?.remeasureColumns(Qe.fromSingleSelection(k.columnIdx))},100)},onAutosize:()=>{w.current?.remeasureColumns(Qe.fromSingleSelection(k.columnIdx))}}),document.querySelector("#portal"))]})}const ox=xp(ix),Ch=d.memo(ox),ax=({data:e,height:t,customToolbarActions:n})=>me.jsx(Ch,{element:new sn({useContainerWidth:!0,editingMode:sn.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 ou.WidthConfig({useStretch:!0}),heightConfig:t?new ou.HeightConfig({pixelHeight:t}):void 0}),bx=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:ax,default:Ch},Symbol.toStringTag,{value:"Module"}));export{zv as C,ax as R,Zd as T,Ii as a,Up as b,bx as c,Mi as i,a0 as m,fn as s};
|