@stlite/desktop 0.91.1 → 0.91.2
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/bin/dump_artifacts.js +1 -1
- package/build/assets/{ErrorOutline.esm-BLjkDUgO-BiXylF9Q.js → ErrorOutline.esm-CBPRrcCq-C9-TIHiy.js} +1 -1
- package/build/assets/{FileDownload.esm-BP6Yw6Mo-BauI2spi.js → FileDownload.esm-zztsCQgv-C5piFaVt.js} +1 -1
- package/build/assets/{FileHelper-BCkX4r3T-DFMmrw88.js → FileHelper-D9iak492-B1kwMP-N.js} +1 -1
- package/build/assets/{FormClearHelper-Dgu5Halt-BxICjxpW.js → FormClearHelper-B-0AN2KG-drNJ-Zdq.js} +1 -1
- package/build/assets/{Hooks-BLb3umpI-9FUxV5o-.js → Hooks-BLb3umpI-CC08A2wx.js} +1 -1
- package/build/assets/{InputInstructions-yTnPUqJo-CoOBrVL7.js → InputInstructions-w5hPdqFC-DnPj3I4S.js} +1 -1
- package/build/assets/{Particles-Dlshfcc8-CNq_pZlo.js → Particles-DQoPZNo9-BWmBxXhd.js} +1 -1
- package/build/assets/{ProgressBar-bzD0ionS-CaMxdV67.js → ProgressBar-DlHaaa-z-DdC3oXz0.js} +1 -1
- package/build/assets/{Toolbar-Ba82LOXi-C-TMlOex.js → Toolbar-Cau3SOTY-cJ6wtM04.js} +1 -1
- package/build/assets/{base-input-DjjpNP8Y-DtsTHlXD.js → base-input-D-Fvddky-3QuAUeGB.js} +1 -1
- package/build/assets/{checkbox-i_07yegq-B7N8fYE1.js → checkbox-CjcIG3na-LB8a9-d7.js} +1 -1
- package/build/assets/{createSuper-Bj1hzAgo-DTBN9Cdm.js → createSuper-B81LEHTk-DVB4ulOX.js} +1 -1
- package/build/assets/data-grid-overlay-editor-C7-8Z8CC-CmhK1L1G.js +1 -0
- package/build/assets/{downloader-DcCTL3Wz-szZSaHY-.js → downloader-DcCTL3Wz-DfHnsO-D.js} +1 -1
- package/build/assets/{es6--XPcqeHG-B7r8Rb2B.js → es6--XPcqeHG-CU-P5RWV.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-D_iySM1B-C8GQUol2.js → iframeResizer.contentWindow-vAQsQkcx-DjDgPkx5.js} +1 -1
- package/build/assets/{index-GJmmE3rK-9unNgOON.js → index--hiX6Uwv-DtKO9Hld.js} +1 -1
- package/build/assets/{index-DDqIvyop-CtB9mW2T.js → index-6t9Tq-Ab-Cc_ees8I.js} +1 -1
- package/build/assets/{index-EaQvJARH-BtsSVy_Q.js → index-B5h0Xgw3-CNFqm9ip.js} +1 -1
- package/build/assets/{index-B_WoYQrI-DzwQulx6.js → index-BDD6ManL-XC9-hEWd.js} +1 -1
- package/build/assets/{index-DhLLbarZ-JEJ3GjGo.js → index-BDtR3I-m-C6v_enzF.js} +1 -1
- package/build/assets/{index-0Kn1AVK2-CFHLqZQv.js → index-BNeCf0z6-eizg-dFz.js} +1 -1
- package/build/assets/{index-DUaAy90Q-XjKFsjy5.js → index-BXbsmcnm-D0BJVs7R.js} +1 -1
- package/build/assets/index-Bt2pmgaJ-ymksNLCl.js +198 -0
- package/build/assets/{index-CvM3pTat-B8q07d1y.js → index-Bx1YyC6x-bUWv5Yyf.js} +1 -1
- package/build/assets/{index-D3uELfdo.js → index-BxpEVUJq.js} +5 -5
- package/build/assets/{index-Bo7cn_f6-DkJNz7_c.js → index-C5FPtYYS-BTTgdUI2.js} +1 -1
- package/build/assets/{index-Ct4am237-CcMxDLpd.js → index-CL9VPrGG-DvzaBWYj.js} +1 -1
- package/build/assets/{index-BhasphER-CtCV9cV8.js → index-COXlYbHo-B2m8urCs.js} +1 -1
- package/build/assets/{index-CSKWQlNk-CT5sDNrq.js → index-CR_1rzEZ-DaqWZNME.js} +1 -1
- package/build/assets/{index-C_q9gQa7-DDnyjQrF.js → index-CUH8SI0g-CgCG3Tq7.js} +1 -1
- package/build/assets/{index-CugHuPaw-BlbAJDrs.js → index-CeUKVR_x-6fYziq6X.js} +1 -1
- package/build/assets/{index-BPtHoAnG-Bw2wANqW.js → index-D4OS_mB9-BwMU_oxN.js} +1 -1
- package/build/assets/{index-CTwTw5ms-DakzaYYn.js → index-D5GvvN8r-CL05rAIV.js} +1 -1
- package/build/assets/{index-B-TfdrsK-M9kXXCZC.js → index-D6OV4wQy-CQIpYALu.js} +1 -1
- package/build/assets/{index-B3KILbqX-BzOz8wK5.js → index-D8AcUh2z-BvmWAicd.js} +1 -1
- package/build/assets/{index-kYeUTGL3-OTlUcjkG.js → index-D9Ww6wIM-CODTYNKi.js} +1 -1
- package/build/assets/{index-BxHa0gYF-QN3i1uRA.js → index-D9xjkRNt-CFe8X0f3.js} +1 -1
- package/build/assets/{index-DMjPNVEr-D5adQnea.js → index-DBM8Q3zu-1UaS0Le1.js} +1 -1
- package/build/assets/{index-X1p_3J78-Vt5ccOoW.js → index-DEKI5kx7-B8lK1On8.js} +1 -1
- package/build/assets/{index-DOzur6Jw-BNtjcqTY.js → index-DVo6TdD5-Cigl7ucs.js} +1 -1
- package/build/assets/{index-B-p8cwea-D1OIlg5n.js → index-DYssp6us-ss1M0SKX.js} +1 -1
- package/build/assets/{index-D5JbiLwX-CJBgVo_3.js → index-Da8BucgM-CDMzLZMq.js} +1 -1
- package/build/assets/{index-vYM99bZC-_qzTrUih.js → index-DbIPIRRU-UJS7GIgX.js} +1 -1
- package/build/assets/{index-Fts1z9_x-20UUj5MC.js → index-DqAvSOqr-BCGTFud5.js} +1 -1
- package/build/assets/{index-NlD3wxQH-BRnDRGJG.js → index-Ds3R2kL1-CFh_Kz3Y.js} +1 -1
- package/build/assets/{index-p-pTZlQx-8zFcur2d.js → index-FbSORAjW-Lthz52ML.js} +1 -1
- package/build/assets/{index-CATwv37T-B7vouX3Y.js → index-JJq6JoHy-CX1Omp_x.js} +1 -1
- package/build/assets/{index-D0GcWpyX--juTltdu.js → index-OAJkEMe--vGYqEFkN.js} +1 -1
- package/build/assets/{index-DmB3SAP2-X6jwpSIv.js → index-PfjJDWy5-DkldmeJ8.js} +1 -1
- package/build/assets/{index-CAzavyuT-BhYS_U-d.js → index-kgY8PEpO-BUILDAe7.js} +1 -1
- package/build/assets/{index-DU9g9Sd6-Daa3488f.js → index-oFRA4JRK-kx0e_3zA.js} +1 -1
- package/build/assets/{index-BB-Jchwk-Bom7C4Yg.js → index-vdN_5NIh-CyyygayY.js} +1 -1
- package/build/assets/{inherits-Rx5YJbse-DVYurFFp.js → inherits-DIXnBNlu-DQhXiByk.js} +1 -1
- package/build/assets/{input-BDVeiWWL-DMiIFeVV.js → input-D3V-zfyu-Ca751_uU.js} +1 -1
- package/build/assets/{memory-B3L1Fctl-Bm8c-YGK.js → memory-B3L1Fctl-DNb7NEQl.js} +1 -1
- package/build/assets/{number-overlay-editor-BGJ9OD_Z-DIBxtO2v.js → number-overlay-editor-ChRMsdOl-C6ThLwiC.js} +1 -1
- package/build/assets/{sandbox-ChAzL-i--D3ngLCsZ.js → sandbox-ChAzL-i--FikCfyDW.js} +1 -1
- package/build/assets/{slicedToArray-DCtO1hP1-DNgLFFIn.js → slicedToArray-BPQXLGHq-C21Y2TxO.js} +1 -1
- package/build/assets/{timepicker-BTEFSiul-BiCu9n-C.js → timepicker-B0aGGgzd-sxFvpbfo.js} +1 -1
- package/build/assets/{uniqueId-DFKpdKNq-BgvPpMK3.js → uniqueId-MHj2wT7u-DPxsodx6.js} +1 -1
- package/build/assets/{useBasicWidgetState-DqA4I-I_-DtgK63iS.js → useBasicWidgetState-zjZCXhqV-BNiFnFun.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-Di5cdshf-IDsnD2RC.js → useTextInputAutoExpand-ox95UJrD-CZJQOtsK.js} +1 -1
- package/build/assets/{useUpdateUiValue-09I2_X1f-DW6jbCsf.js → useUpdateUiValue-Yj1mvLxf-DIZzUp3u.js} +1 -1
- package/build/assets/{withFullScreenWrapper-WW0e_nhm-CAjrnrPK.js → withFullScreenWrapper-Ca0mIjWH-ClODS1xe.js} +1 -1
- package/build/assets/worker-B65uO5d3-CuVvmm9s.js +106 -0
- package/build/electron/worker.js +9 -9
- package/build/index.html +1 -1
- package/package.json +12 -11
- package/wheels/stlite_lib-0.1.0-py3-none-any.whl +0 -0
- package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
- package/build/assets/data-grid-overlay-editor-BiH9JogL-SwK5dD6O.js +0 -1
- package/build/assets/index-GLEJ4uEg-Df22L041.js +0 -188
- package/build/assets/worker-BOuMG9lT-DqkGm1hg.js +0 -106
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-C7-8Z8CC-CmhK1L1G.js","assets/index-BxpEVUJq.js","assets/index-Bjs8n_uU.css","assets/withFullScreenWrapper-Ca0mIjWH-ClODS1xe.js","assets/Toolbar-Cau3SOTY-cJ6wtM04.js","assets/FormClearHelper-B-0AN2KG-drNJ-Zdq.js","assets/sprintf-D5E86llw-6tzWM3a-.js","assets/checkbox-CjcIG3na-LB8a9-d7.js","assets/createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js","assets/slicedToArray-BPQXLGHq-C21Y2TxO.js","assets/inherits-DIXnBNlu-DQhXiByk.js","assets/createSuper-B81LEHTk-DVB4ulOX.js","assets/FileDownload.esm-zztsCQgv-C5piFaVt.js","assets/number-overlay-editor-ChRMsdOl-C6ThLwiC.js","assets/es6--XPcqeHG-CU-P5RWV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as me,r as d,c9 as cc,ca as on,aC as St,cb as sp,c8 as ns,bX as cp,cc as sd,l as rs,E as os,_ as Ae,cd as up,ce as cd,cf as ud,X as vr,d as Tr,cg as dp,Q as nl,v as Te,c as Qn,ch as hp,ci as fp,x as ot,cj as dd,C as pp,ck as gp,cl as mp,cm as vp,cn as bp,co as yp,cp as wp,cq as Fl,cr as hd,aB as rn,cs as xp,ct as kp,cu as Cp,cv as Sp,cw as Mp,cx as Rp,cy as Ip,U as li,m as Yr,bg as Oa,bf as Da,cz as fd,M as Pa,F as qn,cA as Ep,bu as pd,cB as Tp,H as Op,e as uc,cC as Dp,cD as Pp,L as Hp,b as gd,cE as zp,cF as Lp,cG as Ap,cH as Fp,cI as Vp,at as md,cJ as si,cK as dc,aH as _p,cL as $p,cM as Bp,cN as vd,ao as xo,cO as Np,cP as Wp,cQ as jp,y as rl,cR as Gp,bZ as ol,cS as Up,cT as bd,cU as Kp,be as Ur,cV as Xp,cW as qp,cX as Zp,cY as Yp,D as Jp,cZ as yd,c_ as Qp,c$ as eg,aD as tg,d0 as ng,d1 as rg,d2 as og,A as ig,B as ag,d3 as lg,d4 as sg,z as cg,d5 as ug,d6 as dg,d7 as hg,d8 as cr,$ as Eo,bH as fg,d9 as pg,da as gg,db as mg,dc as vg,dd as bg,de as yg,df as wg,dg as aa,dh as Uo,di as At,dj as Ct,dk as ha,dl as vn,dm as xg,dn as kg,dp as Cg,dq as Sg,dr as Mg,ds as Rg,dt as Ig,du as Wr,dv as hc,dw as fc,dx as wd,dy as xd,dz as Eg,dA as Vl,dB as Tg,dC as Og,dD as kd,dE as Dg}from"./index-BxpEVUJq.js";import{v as Pg,d as Hg}from"./withFullScreenWrapper-Ca0mIjWH-ClODS1xe.js";import{y as zg,X as yo}from"./Toolbar-Cau3SOTY-cJ6wtM04.js";import{m as Lg}from"./FormClearHelper-B-0AN2KG-drNJ-Zdq.js";import{_ as Ag}from"./sprintf-D5E86llw-6tzWM3a-.js";import{v as Fg,y as Vg,T as _g}from"./checkbox-CjcIG3na-LB8a9-d7.js";import{a as $g}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{p as Bg,_ as gr}from"./slicedToArray-BPQXLGHq-C21Y2TxO.js";import{b as Ng,p as Wg,l as jg}from"./inherits-DIXnBNlu-DQhXiByk.js";import{i as Gg}from"./createSuper-B81LEHTk-DVB4ulOX.js";import{o as Ug,i as Kg}from"./FileDownload.esm-zztsCQgv-C5piFaVt.js";var Cd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Cd.displayName="Add";var Sd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Sd.displayName="Search";var Md=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Md.displayName="Visibility";var il,pc;function Xg(){if(pc)return il;pc=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return il=n,il}var al,gc;function qg(){if(gc)return al;gc=1;var e=Xg(),t=up();function n(r,o){return r!=null&&t(r,o,e)}return al=n,al}var Zg=qg();const Yg=vr(Zg);function Rd(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return Rd(t)}function mi(e,t){return Rd(t??"Hell froze over")}function Jg(e,t){try{return e()}catch{return t}}const mc=Object.prototype.hasOwnProperty;function Oo(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Oo(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(mc.call(e,n)&&++r&&!mc.call(t,n)||!(n in t)||!Oo(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const fa=null,is=void 0;var Y;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Y||(Y={}));var vc;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(vc||(vc={}));var pa;(function(e){e.Triangle="triangle",e.Dots="dots"})(pa||(pa={}));function Ki(e){return"width"in e&&typeof e.width=="number"}async function bc(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Y.Loading||e.kind===Y.Bubble||e.kind===Y.RowID||e.kind===Y.Protected||e.kind===Y.Drilldown)}function Mo(e){return e.kind===jn.Marker||e.kind===jn.NewRow}function Co(e){if(!ko(e)||e.kind===Y.Image)return!1;switch(e.kind){case Y.Text:case Y.Number:case Y.Markdown:case Y.Uri:case Y.Custom:case Y.Boolean:return e.readonly!==!0;default:mi(e,"A cell was passed with an invalid kind")}}function Qg(e){return Yg(e,"editor")}function as(e){return!(e.readonly??!1)}var jn;(function(e){e.NewRow="new-row",e.Marker="marker"})(jn||(jn={}));const ga={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function ll(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let yc;class Ye{items;constructor(t){this.items=t}static create=t=>new Ye(ll(t));static empty=()=>yc??(yc=new Ye([]));static fromSingleSelection=t=>Ye.empty().add(t);static fromArray=t=>{if(t.length===0)return Ye.empty();const n=t.map(o=>[o,o+1]),r=ll(n);return new Ye(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Ye(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=ll([...this.items,n]);return new Ye(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new Ye(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var em=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},wc=em,tm=e=>e.toUpperCase()===e,nm=e=>t=>e.indexOf(t)===-1,Id=(e,t)=>{const n={};return Object.keys(e).filter(nm(t)).forEach(r=>{n[r]=e[r]}),n};function rm(e,t,n){const r=Id(t,n);if(!e){const o=typeof ol=="function"?{default:ol}:ol;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var om=(e,t)=>{};function im(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!tm(l[0])):n.propsAsIs,u=rm(c,i,["as","class"]);u.ref=a,u.className=n.atomic?wc(n.class,u.className||s):wc(u.className||s,n.class);const{vars:h}=n;if(h){const g={};for(const m in h){const w=h[m],y=w[0],v=w[1]||"",x=typeof y=="function"?y(i):y;om(x,n.name),g[`--${m}`]=`${x}${v}`}const f=u.style||{},p=Object.keys(f);p.length>0&&p.forEach(m=>{g[m]=f[m]}),u.style=g}return e.__wyw_meta&&e!==l?(u.as=l,d.createElement(e,u)):d.createElement(l,u)},o=d.forwardRef?d.forwardRef(r):(i=>{const a=Id(i,["innerRef"]);return r(a,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var un=im;const am=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var xc={},Ko={},sl={},cl={},kc;function lm(){return kc||(kc=1,(function(e){(function(t,n){n(e,St,tg())})(cl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var o=a(n),i=a(r);function a(v){return v&&v.__esModule?v:{default:v}}var l=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var I=arguments[x];for(var O in I)Object.prototype.hasOwnProperty.call(I,O)&&(v[O]=I[O])}return v};function s(v,x){var I={};for(var O in v)x.indexOf(O)>=0||Object.prototype.hasOwnProperty.call(v,O)&&(I[O]=v[O]);return I}function c(v,x){if(!(v instanceof x))throw new TypeError("Cannot call a class as a function")}var u=(function(){function v(x,I){for(var O=0;O<I.length;O++){var M=I[O];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,I,O){return I&&v(x.prototype,I),O&&v(x,O),x}})();function h(v,x){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:v}function g(v,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);v.prototype=Object.create(x&&x.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(v,x):v.__proto__=x)}var f=!1;function p(v){f=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?v:v.capture}function w(v){if("touches"in v){var x=v.touches[0],I=x.pageX,O=x.pageY;return{x:I,y:O}}var M=v.screenX,P=v.screenY;return{x:M,y:P}}var y=(function(v){g(x,v);function x(){var I;c(this,x);for(var O=arguments.length,M=Array(O),P=0;P<O;P++)M[P]=arguments[P];var S=h(this,(I=x.__proto__||Object.getPrototypeOf(x)).call.apply(I,[this].concat(M)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return u(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(I){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(I))}},{key:"_onMouseMove",value:function(I){this.mouseDown&&this._handleSwipeMove(I)}},{key:"_onMouseUp",value:function(I){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(I)}},{key:"_handleSwipeStart",value:function(I){var O=w(I),M=O.x,P=O.y;this.moveStart={x:M,y:P},this.props.onSwipeStart(I)}},{key:"_handleSwipeMove",value:function(I){if(this.moveStart){var O=w(I),M=O.x,P=O.y,S=M-this.moveStart.x,k=P-this.moveStart.y;this.moving=!0;var H=this.props.onSwipeMove({x:S,y:k},I);H&&I.cancelable&&I.preventDefault(),this.movePosition={deltaX:S,deltaY:k}}}},{key:"_handleSwipeEnd",value:function(I){this.props.onSwipeEnd(I);var O=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-O?this.props.onSwipeLeft(1,I):this.movePosition.deltaX>O&&this.props.onSwipeRight(1,I),this.movePosition.deltaY<-O?this.props.onSwipeUp(1,I):this.movePosition.deltaY>O&&this.props.onSwipeDown(1,I)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(I){this.swiper=I,this.props.innerRef(I)}},{key:"render",value:function(){var I=this.props;I.tagName;var O=I.className,M=I.style,P=I.children;I.allowMouseEvents,I.onSwipeUp,I.onSwipeDown,I.onSwipeLeft,I.onSwipeRight,I.onSwipeStart,I.onSwipeMove,I.onSwipeEnd,I.innerRef,I.tolerance;var S=s(I,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:O,style:M},S),P)}}]),x})(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})})(cl)),cl}var Cc;function Ed(){return Cc||(Cc=1,(function(e){(function(t,n){n(e,lm())})(sl,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(sl)),sl}var Xo={},Sc;function Td(){if(Sc)return Xo;Sc=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=void 0;var e=t(Gp());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,e.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,a){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xo.default=r,Xo}var qo={},Zo={},Mc;function sm(){if(Mc)return Zo;Mc=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Zo.outerWidth=e,Zo}var Yo={},Rc;function ls(){if(Rc)return Yo;Rc=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.default=void 0;var e=function(t,n,r){var o=t===0?t:t+n,i=r==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+i.join(",")+")";return a+l};return Yo.default=e,Yo}var Jo={},Ic;function Od(){if(Ic)return Jo;Ic=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(){return window};return Jo.default=e,Jo}var Ec;function Dd(){if(Ec)return qo;Ec=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e=s(St),t=a(Td()),n=sm(),r=a(ls()),o=a(Ed()),i=a(Od());function a(S){return S&&S.__esModule?S:{default:S}}function l(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return l=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||c(S)!=="object"&&typeof S!="function")return{default:S};var k=l();if(k&&k.has(S))return k.get(S);var H={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in S)if(Object.prototype.hasOwnProperty.call(S,R)){var T=E?Object.getOwnPropertyDescriptor(S,R):null;T&&(T.get||T.set)?Object.defineProperty(H,R,T):H[R]=S[R]}return H.default=S,k&&k.set(S,H),H}function c(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(k){return typeof k}:c=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},c(S)}function u(){return u=Object.assign||function(S){for(var k=1;k<arguments.length;k++){var H=arguments[k];for(var E in H)Object.prototype.hasOwnProperty.call(H,E)&&(S[E]=H[E])}return S},u.apply(this,arguments)}function h(S,k){if(!(S instanceof k))throw new TypeError("Cannot call a class as a function")}function g(S,k){for(var H=0;H<k.length;H++){var E=k[H];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function f(S,k,H){return k&&g(S.prototype,k),S}function p(S,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(k&&k.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),k&&m(S,k)}function m(S,k){return m=Object.setPrototypeOf||function(H,E){return H.__proto__=E,H},m(S,k)}function w(S){var k=x();return function(){var H=I(S),E;if(k){var R=I(this).constructor;E=Reflect.construct(H,arguments,R)}else E=H.apply(this,arguments);return y(this,E)}}function y(S,k){return k&&(c(k)==="object"||typeof k=="function")?k:v(S)}function v(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(S){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(k){return k.__proto__||Object.getPrototypeOf(k)},I(S)}function O(S,k,H){return k in S?Object.defineProperty(S,k,{value:H,enumerable:!0,configurable:!0,writable:!0}):S[k]=H,S}var M=function(S){return S.hasOwnProperty("key")},P=(function(S){p(H,S);var k=w(H);function H(E){var R;return h(this,H),R=k.call(this,E),O(v(R),"itemsWrapperRef",void 0),O(v(R),"itemsListRef",void 0),O(v(R),"thumbsRef",void 0),O(v(R),"setItemsWrapperRef",function(T){R.itemsWrapperRef=T}),O(v(R),"setItemsListRef",function(T){R.itemsListRef=T}),O(v(R),"setThumbsRef",function(T,D){R.thumbsRef||(R.thumbsRef=[]),R.thumbsRef[D]=T}),O(v(R),"updateSizes",function(){if(!(!R.props.children||!R.itemsWrapperRef||!R.thumbsRef)){var T=e.Children.count(R.props.children),D=R.itemsWrapperRef.clientWidth,C=R.props.thumbWidth?R.props.thumbWidth:(0,n.outerWidth)(R.thumbsRef[0]),J=Math.floor(D/C),W=J<T,Z=W?T-J:0;R.setState(function(ce,te){return{itemSize:C,visibleItems:J,firstItem:W?R.getFirstItem(te.selectedItem):0,lastPosition:Z,showArrows:W}})}}),O(v(R),"handleClickItem",function(T,D,C){if(!M(C)||C.key==="Enter"){var J=R.props.onSelectItem;typeof J=="function"&&J(T,D)}}),O(v(R),"onSwipeStart",function(){R.setState({swiping:!0})}),O(v(R),"onSwipeEnd",function(){R.setState({swiping:!1})}),O(v(R),"onSwipeMove",function(T){var D=T.x;if(!R.state.itemSize||!R.itemsWrapperRef||!R.state.visibleItems)return!1;var C=0,J=e.Children.count(R.props.children),W=-(R.state.firstItem*100)/R.state.visibleItems,Z=Math.max(J-R.state.visibleItems,0),ce=-Z*100/R.state.visibleItems;W===C&&D>0&&(D=0),W===ce&&D<0&&(D=0);var te=R.itemsWrapperRef.clientWidth,q=W+100/(te/D);return R.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ge){R.itemsListRef.style[ge]=(0,r.default)(q,"%",R.props.axis)}),!0}),O(v(R),"slideRight",function(T){R.moveTo(R.state.firstItem-(typeof T=="number"?T:1))}),O(v(R),"slideLeft",function(T){R.moveTo(R.state.firstItem+(typeof T=="number"?T:1))}),O(v(R),"moveTo",function(T){T=T<0?0:T,T=T>=R.state.lastPosition?R.state.lastPosition:T,R.setState({firstItem:T})}),R.state={selectedItem:E.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},R}return f(H,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(E){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==E.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(E){var R=E;return E>=this.state.lastPosition&&(R=this.state.lastPosition),E<this.state.firstItem+this.state.visibleItems&&(R=this.state.firstItem),E<this.state.firstItem&&(R=E),R}},{key:"renderItems",value:function(){var E=this;return this.props.children.map(function(R,T){var D=t.default.ITEM(!1,T===E.state.selectedItem),C={key:T,ref:function(J){return E.setThumbsRef(J,T)},className:D,onClick:E.handleClickItem.bind(E,T,E.props.children[T]),onKeyDown:E.handleClickItem.bind(E,T,E.props.children[T]),"aria-label":"".concat(E.props.labels.item," ").concat(T+1),style:{width:E.props.thumbWidth}};return e.default.createElement("li",u({},C,{role:"button",tabIndex:0}),R)})}},{key:"render",value:function(){var E=this;if(!this.props.children)return null;var R=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,C={},J=-this.state.firstItem*(this.state.itemSize||0),W=(0,r.default)(J,"px",this.props.axis),Z=this.props.transitionTime+"ms";return C={WebkitTransform:W,MozTransform:W,MsTransform:W,OTransform:W,transform:W,msTransform:W,WebkitTransitionDuration:Z,MozTransitionDuration:Z,MsTransitionDuration:Z,OTransitionDuration:Z,transitionDuration:Z,msTransitionDuration:Z},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!T),onClick:function(){return E.slideRight()},"aria-label":this.props.labels.leftArrow}),R?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:C,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ce){return E.setItemsListRef(ce)},style:C},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return E.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),H})(e.Component);return qo.default=P,O(P,"displayName","Thumbs"),O(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),qo}var Qo={},Tc;function cm(){if(Tc)return Qo;Tc=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var e=function(){return document};return Qo.default=e,Qo}var Ln={},Oc;function Pd(){if(Oc)return Ln;Oc=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=St,t=n(ls());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};Ln.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=i;var a=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,g=u-1;return s&&(s!==g||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===g&&(h+=100-c.centerSlidePercentage),h}return-s*100};Ln.getPosition=a;var l=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return Ln.setPosition=l,Ln}var Xn={},Dc;function um(){if(Dc)return Xn;Dc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fadeAnimationHandler=Xn.slideStopSwipingHandler=Xn.slideSwipeAnimationHandler=Xn.slideAnimationHandler=void 0;var e=St,t=r(ls()),n=Pd();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,p)}return f}function i(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?o(Object(f),!0).forEach(function(p){a(h,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(f,p))})}return h}function a(h,g,f){return g in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}var l=function(h,g){var f={},p=g.selectedItem,m=p,w=e.Children.count(h.children)-1,y=h.infiniteLoop&&(p<0||p>w);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):m>w&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var v=(0,n.getPosition)(p,h),x=(0,t.default)(v,"%",h.axis),I=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:x,msTransform:x,OTransform:x,transform:x},g.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:I,MozTransitionDuration:I,OTransitionDuration:I,transitionDuration:I,msTransitionDuration:I})),f};Xn.slideAnimationHandler=l;var s=function(h,g,f,p){var m={},w=g.axis==="horizontal",y=e.Children.count(g.children),v=0,x=(0,n.getPosition)(f.selectedItem,g),I=g.infiniteLoop?(0,n.getPosition)(y-1,g)-100:(0,n.getPosition)(y-1,g),O=w?h.x:h.y,M=O;x===v&&O>0&&(M=0),x===I&&O<0&&(M=0);var P=x+100/(f.itemSize/M),S=Math.abs(O)>g.swipeScrollTolerance;return g.infiniteLoop&&S&&(f.selectedItem===0&&P>-100?P-=y*100:f.selectedItem===y-1&&P<-y*100&&(P+=y*100)),(!g.preventMovementUntilSwipeScrollTolerance||S||f.swipeMovementStarted)&&(f.swipeMovementStarted||p({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(P,g.axis)),S&&!f.cancelClick&&p({cancelClick:!0}),m};Xn.slideSwipeAnimationHandler=s;var c=function(h,g){var f=(0,n.getPosition)(g.selectedItem,h),p=(0,n.setPosition)(f,h.axis);return{itemListStyle:p}};Xn.slideStopSwipingHandler=c;var u=function(h,g){var f=h.transitionTime+"ms",p="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Xn.fadeAnimationHandler=u,Xn}var Pc;function dm(){if(Pc)return Ko;Pc=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var e=u(St),t=s(Ed()),n=s(Td()),r=s(Dd()),o=s(cm()),i=s(Od()),a=Pd(),l=um();function s(E){return E&&E.__esModule?E:{default:E}}function c(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return c=function(){return E},E}function u(E){if(E&&E.__esModule)return E;if(E===null||h(E)!=="object"&&typeof E!="function")return{default:E};var R=c();if(R&&R.has(E))return R.get(E);var T={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var J=D?Object.getOwnPropertyDescriptor(E,C):null;J&&(J.get||J.set)?Object.defineProperty(T,C,J):T[C]=E[C]}return T.default=E,R&&R.set(E,T),T}function h(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(R){return typeof R}:h=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},h(E)}function g(){return g=Object.assign||function(E){for(var R=1;R<arguments.length;R++){var T=arguments[R];for(var D in T)Object.prototype.hasOwnProperty.call(T,D)&&(E[D]=T[D])}return E},g.apply(this,arguments)}function f(E,R){var T=Object.keys(E);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(E);R&&(D=D.filter(function(C){return Object.getOwnPropertyDescriptor(E,C).enumerable})),T.push.apply(T,D)}return T}function p(E){for(var R=1;R<arguments.length;R++){var T=arguments[R]!=null?arguments[R]:{};R%2?f(Object(T),!0).forEach(function(D){k(E,D,T[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(T)):f(Object(T)).forEach(function(D){Object.defineProperty(E,D,Object.getOwnPropertyDescriptor(T,D))})}return E}function m(E,R){if(!(E instanceof R))throw new TypeError("Cannot call a class as a function")}function w(E,R){for(var T=0;T<R.length;T++){var D=R[T];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function y(E,R,T){return R&&w(E.prototype,R),E}function v(E,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(R&&R.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),R&&x(E,R)}function x(E,R){return x=Object.setPrototypeOf||function(T,D){return T.__proto__=D,T},x(E,R)}function I(E){var R=P();return function(){var T=S(E),D;if(R){var C=S(this).constructor;D=Reflect.construct(T,arguments,C)}else D=T.apply(this,arguments);return O(this,D)}}function O(E,R){return R&&(h(R)==="object"||typeof R=="function")?R:M(E)}function M(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(E){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},S(E)}function k(E,R,T){return R in E?Object.defineProperty(E,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):E[R]=T,E}var H=(function(E){v(T,E);var R=I(T);function T(D){var C;m(this,T),C=R.call(this,D),k(M(C),"thumbsRef",void 0),k(M(C),"carouselWrapperRef",void 0),k(M(C),"listRef",void 0),k(M(C),"itemsRef",void 0),k(M(C),"timer",void 0),k(M(C),"animationHandler",void 0),k(M(C),"setThumbsRef",function(W){C.thumbsRef=W}),k(M(C),"setCarouselWrapperRef",function(W){C.carouselWrapperRef=W}),k(M(C),"setListRef",function(W){C.listRef=W}),k(M(C),"setItemsRef",function(W,Z){C.itemsRef||(C.itemsRef=[]),C.itemsRef[Z]=W}),k(M(C),"autoPlay",function(){e.Children.count(C.props.children)<=1||(C.clearAutoPlay(),C.props.autoPlay&&(C.timer=setTimeout(function(){C.increment()},C.props.interval)))}),k(M(C),"clearAutoPlay",function(){C.timer&&clearTimeout(C.timer)}),k(M(C),"resetAutoPlay",function(){C.clearAutoPlay(),C.autoPlay()}),k(M(C),"stopOnHover",function(){C.setState({isMouseEntered:!0},C.clearAutoPlay)}),k(M(C),"startOnLeave",function(){C.setState({isMouseEntered:!1},C.autoPlay)}),k(M(C),"isFocusWithinTheCarousel",function(){return C.carouselWrapperRef?!!((0,o.default)().activeElement===C.carouselWrapperRef||C.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),k(M(C),"navigateWithKeyboard",function(W){if(C.isFocusWithinTheCarousel()){var Z=C.props.axis,ce=Z==="horizontal",te={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},q=ce?te.ArrowRight:te.ArrowDown,ge=ce?te.ArrowLeft:te.ArrowUp;q===W.keyCode?C.increment():ge===W.keyCode&&C.decrement()}}),k(M(C),"updateSizes",function(){if(!(!C.state.initialized||!C.itemsRef||C.itemsRef.length===0)){var W=C.props.axis==="horizontal",Z=C.itemsRef[0];if(Z){var ce=W?Z.clientWidth:Z.clientHeight;C.setState({itemSize:ce}),C.thumbsRef&&C.thumbsRef.updateSizes()}}}),k(M(C),"setMountState",function(){C.setState({hasMount:!0}),C.updateSizes()}),k(M(C),"handleClickItem",function(W,Z){if(e.Children.count(C.props.children)!==0){if(C.state.cancelClick){C.setState({cancelClick:!1});return}C.props.onClickItem(W,Z),W!==C.state.selectedItem&&C.setState({selectedItem:W})}}),k(M(C),"handleOnChange",function(W,Z){e.Children.count(C.props.children)<=1||C.props.onChange(W,Z)}),k(M(C),"handleClickThumb",function(W,Z){C.props.onClickThumb(W,Z),C.moveTo(W)}),k(M(C),"onSwipeStart",function(W){C.setState({swiping:!0}),C.props.onSwipeStart(W)}),k(M(C),"onSwipeEnd",function(W){C.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),C.props.onSwipeEnd(W),C.clearAutoPlay(),C.state.autoPlay&&C.autoPlay()}),k(M(C),"onSwipeMove",function(W,Z){C.props.onSwipeMove(Z);var ce=C.props.swipeAnimationHandler(W,C.props,C.state,C.setState.bind(M(C)));return C.setState(p({},ce)),!!Object.keys(ce).length}),k(M(C),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem-(typeof W=="number"?W:1))}),k(M(C),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C.moveTo(C.state.selectedItem+(typeof W=="number"?W:1))}),k(M(C),"moveTo",function(W){if(typeof W=="number"){var Z=e.Children.count(C.props.children)-1;W<0&&(W=C.props.infiniteLoop?Z:0),W>Z&&(W=C.props.infiniteLoop?0:Z),C.selectItem({selectedItem:W}),C.state.autoPlay&&C.state.isMouseEntered===!1&&C.resetAutoPlay()}}),k(M(C),"onClickNext",function(){C.increment(1)}),k(M(C),"onClickPrev",function(){C.decrement(1)}),k(M(C),"onSwipeForward",function(){C.increment(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),k(M(C),"onSwipeBackwards",function(){C.decrement(1),C.props.emulateTouch&&C.setState({cancelClick:!0})}),k(M(C),"changeItem",function(W){return function(Z){(!(0,a.isKeyboardEvent)(Z)||Z.key==="Enter")&&C.moveTo(W)}}),k(M(C),"selectItem",function(W){C.setState(p({previousItem:C.state.selectedItem},W),function(){C.setState(C.animationHandler(C.props,C.state))}),C.handleOnChange(W.selectedItem,e.Children.toArray(C.props.children)[W.selectedItem])}),k(M(C),"getInitialImage",function(){var W=C.props.selectedItem,Z=C.itemsRef&&C.itemsRef[W],ce=Z&&Z.getElementsByTagName("img")||[];return ce[0]}),k(M(C),"getVariableItemHeight",function(W){var Z=C.itemsRef&&C.itemsRef[W];if(C.state.hasMount&&Z&&Z.children.length){var ce=Z.children[0].getElementsByTagName("img")||[];if(ce.length>0){var te=ce[0];if(!te.complete){var q=function fe(){C.forceUpdate(),te.removeEventListener("load",fe)};te.addEventListener("load",q)}}var ge=ce[0]||Z.children[0],ae=ge.clientHeight;return ae>0?ae:null}return null});var J={initialized:!1,previousItem:D.selectedItem,selectedItem:D.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:D.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return C.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,C.state=p(p({},J),C.animationHandler(D,J)),C}return y(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,C){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),C.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(D.selectedItem!==this.props.selectedItem||D.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),D.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var D=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var C=D.getInitialImage();C&&!C.complete?C.addEventListener("load",D.setMountState):D.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.addEventListener("mouseenter",this.stopOnHover),D.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.removeEventListener("mouseenter",this.stopOnHover),D.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var D=this.getInitialImage();D&&D.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var D;(D=this.carouselWrapperRef)===null||D===void 0||D.focus()}},{key:"renderItems",value:function(D){var C=this;return this.props.children?e.Children.map(this.props.children,function(J,W){var Z=W===C.state.selectedItem,ce=W===C.state.previousItem,te=Z&&C.state.selectedStyle||ce&&C.state.prevStyle||C.state.slideStyle||{};C.props.centerMode&&C.props.axis==="horizontal"&&(te=p(p({},te),{},{minWidth:C.props.centerSlidePercentage+"%"})),C.state.swiping&&C.state.swipeMovementStarted&&(te=p(p({},te),{},{pointerEvents:"none"}));var q={ref:function(ge){return C.setItemsRef(ge,W)},key:"itemKey"+W+(D?"clone":""),className:n.default.ITEM(!0,W===C.state.selectedItem,W===C.state.previousItem),onClick:C.handleClickItem.bind(C,W,J),style:te};return e.default.createElement("li",q,C.props.renderItem(J,{isSelected:W===C.state.selectedItem,isPrevious:W===C.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,C=this.props,J=C.showIndicators,W=C.labels,Z=C.renderIndicator,ce=C.children;return J?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ce,function(te,q){return Z&&Z(D.changeItem(q),q===D.state.selectedItem,q,W.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var C=this.props.swipeable&&e.Children.count(this.props.children)>1,J=this.props.axis==="horizontal",W=this.props.showArrows&&e.Children.count(this.props.children)>1,Z=W&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ce=W&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),q=te.shift(),ge=te.pop(),ae={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};if(J){if(ae.onSwipeLeft=this.onSwipeForward,ae.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var he=this.getVariableItemHeight(this.state.selectedItem);fe.height=he||"auto"}}else ae.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ae.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ae.style=p(p({},ae.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,Z,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},C?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ae,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(oe){return D.setListRef(oe)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q)),this.props.renderArrowNext(this.onClickNext,ce,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T})(e.default.Component);return Ko.default=H,k(H,"displayName","Carousel"),k(H,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(E,R,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!R),onClick:E})},renderArrowNext:function(E,R,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!R),onClick:E})},renderIndicator:function(E,R,T,D){return e.default.createElement("li",{className:n.default.DOT(R),onClick:E,onKeyDown:E,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(T+1)})},renderItem:function(E){return E},renderThumbs:function(E){var R=e.Children.map(E,function(T){var D=T;if(T.type!=="img"&&(D=e.Children.toArray(T.props.children).find(function(C){return C.type==="img"})),!!D)return D});return R.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):R},statusFormatter:a.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Ko}var hm={};function fm(){return hm}var Hc;function pm(){return Hc||(Hc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(dm()),n=fm(),r=o(Dd());function o(i){return i&&i.__esModule?i:{default:i}}})(xc)),xc}var gm=pm(),ul,zc;function mm(){if(zc)return ul;zc=1;var e=Lp(),t=function(){return e.Date.now()};return ul=t,ul}var dl,Lc;function Hd(){if(Lc)return dl;Lc=1;var e=cd(),t=mm(),n=ud(),r="Expected a function",o=Math.max,i=Math.min;function a(l,s,c){var u,h,g,f,p,m,w=0,y=!1,v=!1,x=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,v="maxWait"in c,g=v?o(n(c.maxWait)||0,s):g,x="trailing"in c?!!c.trailing:x);function I(T){var D=u,C=h;return u=h=void 0,w=T,f=l.apply(C,D),f}function O(T){return w=T,p=setTimeout(S,s),y?I(T):f}function M(T){var D=T-m,C=T-w,J=s-D;return v?i(J,g-C):J}function P(T){var D=T-m,C=T-w;return m===void 0||D>=s||D<0||v&&C>=g}function S(){var T=t();if(P(T))return k(T);p=setTimeout(S,M(T))}function k(T){return p=void 0,x&&u?I(T):(u=h=void 0,f)}function H(){p!==void 0&&clearTimeout(p),w=0,u=m=h=p=void 0}function E(){return p===void 0?f:k(t())}function R(){var T=t(),D=P(T);if(u=arguments,h=this,m=T,D){if(p===void 0)return O(m);if(v)return clearTimeout(p),p=setTimeout(S,s),I(m)}return p===void 0&&(p=setTimeout(S,s)),f}return R.cancel=H,R.flush=E,R}return dl=a,dl}var vm=Hd();const zd=vr(vm);function xn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{i.current?.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Rr(e,t){return e===void 0?void 0:t}const bm=Math.PI;function Ac(e){return e*bm/180}const Ld=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Ad=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Fd=(e,t,n)=>Math.min(e,t-n*2),Vd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,ss=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},ym=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function wm(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const a=d.useRef(zd(l=>{i.current&&o(l)},n));return d.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const xm="֑-߿יִ-﷽ﹰ-ﻼ",km="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Cm=new RegExp("^[^"+km+"]*["+xm+"]");function cs(e){return Cm.test(e)?"rtl":"not-rtl"}let Xi;function _l(){if(typeof document>"u")return 0;if(Xi!==void 0)return Xi;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Xi=n-r,Xi}const jr=Symbol();function Sm(e){const t=d.useRef([jr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(l=>{const s=t.current[0];s!==jr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==jr&&o({}),r(c=>typeof l=="function"?l(s===jr?c:s):l),t.current[0]=jr)},[]),a=d.useCallback(()=>{t.current[0]=jr,o({})},[]);return[t.current[0]===jr?n:t.current[0],i,a]}function _d(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Mm(e){const t=d.useRef(e);return Oo(e,t.current)||(t.current=e),t.current}const Rm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return d.createElement(am,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(gm.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=o?.(l)??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(ss,null)))};function us(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=us();function $d(e){Jr=e}const Bd=/[&<>"']/,Im=new RegExp(Bd.source,"g"),Nd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Em=new RegExp(Nd.source,"g"),Tm={"&":"&","<":"<",">":">",'"':""","'":"'"},Fc=e=>Tm[e];function An(e,t){if(t){if(Bd.test(e))return e.replace(Im,Fc)}else if(Nd.test(e))return e.replace(Em,Fc);return e}const Om=/(^|[^\[])\^/g;function Pt(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Om,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function Vc(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const di={exec:()=>null};function _c(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function ei(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function Dm(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function $c(e,t,n,r){const o=t.href,i=t.title?An(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:An(a)}}function Pm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
3
|
+
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
|
|
4
|
+
`)}class ma{options;rules;lexer;constructor(t){this.options=t||Jr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ei(r,`
|
|
5
|
+
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=Pm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=ei(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:ei(n[0],`
|
|
6
|
+
`)}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let r=ei(n[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),o="",i="";const a=[];for(;r.length>0;){let l=!1;const s=[];let c;for(c=0;c<r.length;c++)if(/^ {0,3}>/.test(r[c]))s.push(r[c]),l=!0;else if(!l)s.push(r[c]);else break;r=r.slice(c);const u=s.join(`
|
|
9
|
+
`),h=u.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
10
|
+
$1`).replace(/^ {0,3}>[ \t]?/gm,"");o=o?`${o}
|
|
11
|
+
${u}`:u,i=i?`${i}
|
|
12
|
+
${h}`:h;const g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,a,!0),this.lexer.state.top=g,r.length===0)break;const f=a[a.length-1];if(f?.type==="code")break;if(f?.type==="blockquote"){const p=f,m=p.raw+`
|
|
13
|
+
`+r.join(`
|
|
14
|
+
`),w=this.blockquote(m);a[a.length-1]=w,o=o.substring(0,o.length-p.raw.length)+w.raw,i=i.substring(0,i.length-p.text.length)+w.text;break}else if(f?.type==="list"){const p=f,m=p.raw+`
|
|
15
|
+
`+r.join(`
|
|
16
|
+
`),w=this.list(m);a[a.length-1]=w,o=o.substring(0,o.length-f.raw.length)+w.raw,i=i.substring(0,i.length-p.raw.length)+w.raw,r=m.substring(a[a.length-1].raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:a,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const a=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let l=!1;for(;t;){let s=!1,c="",u="";if(!(n=a.exec(t))||this.rules.block.hr.test(t))break;c=n[0],t=t.substring(c.length);let h=n[2].split(`
|
|
18
|
+
`,1)[0].replace(/^\t+/,y=>" ".repeat(3*y.length)),g=t.split(`
|
|
19
|
+
`,1)[0],f=!h.trim(),p=0;if(this.options.pedantic?(p=2,u=h.trimStart()):f?p=n[1].length+1:(p=n[2].search(/[^ ]/),p=p>4?1:p,u=h.slice(p),p+=n[1].length),f&&/^ *$/.test(g)&&(c+=g+`
|
|
20
|
+
`,t=t.substring(g.length+1),s=!0),!s){const y=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),v=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),x=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),I=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;t;){const O=t.split(`
|
|
21
|
+
`,1)[0];if(g=O,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),x.test(g)||I.test(g)||y.test(g)||v.test(t))break;if(g.search(/[^ ]/)>=p||!g.trim())u+=`
|
|
22
|
+
`+g.slice(p);else{if(f||h.search(/[^ ]/)>=4||x.test(h)||I.test(h)||v.test(h))break;u+=`
|
|
23
|
+
`+g}!f&&!g.trim()&&(f=!0),c+=O+`
|
|
24
|
+
`,t=t.substring(O.length+1),h=g.slice(p)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(c)&&(l=!0));let m=null,w;this.options.gfm&&(m=/^\[[ xX]\] /.exec(u),m&&(w=m[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:c,task:!!m,checked:w,loose:!1,text:u,tokens:[]}),i.raw+=c}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let s=0;s<i.items.length;s++)if(this.lexer.state.top=!1,i.items[s].tokens=this.lexer.blockTokens(i.items[s].text,[]),!i.loose){const c=i.items[s].tokens.filter(h=>h.type==="space"),u=c.length>0&&c.some(h=>/\n.*\n/.test(h.raw));i.loose=u}if(i.loose)for(let s=0;s<i.items.length;s++)i.items[s].loose=!0;return i}}html(t){const n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(!n||!/[:|]/.test(n[2]))return;const r=_c(n[1]),o=n[2].replace(/^\||\| *$/g,"").split("|"),i=n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
|
25
|
+
`):[],a={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const l of o)/^ *-+: *$/.test(l)?a.align.push("right"):/^ *:-+: *$/.test(l)?a.align.push("center"):/^ *:-+ *$/.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<r.length;l++)a.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:a.align[l]});for(const l of i)a.rows.push(_c(l,a.header.length).map((s,c)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[c]})));return a}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
|
|
26
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:An(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const a=ei(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{const a=Dm(n[2],"()");if(a>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);a&&(o=a[1],i=a[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),$c(n,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const o=(r[2]||r[1]).replace(/\s+/g," "),i=n[o.toLowerCase()];if(!i){const a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return $c(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))&&(!(o[1]||o[2])||!r||this.rules.inline.punctuation.exec(r))){const i=[...o[0]].length-1;let a,l,s=i,c=0;const u=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,n=n.slice(-1*t.length+i);(o=u.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){s+=l;continue}else if((o[5]||o[6])&&i%3&&!((i+l)%3)){c+=l;continue}if(s-=l,s>0)continue;l=Math.min(l,l+s+c);const h=[...o[0]][0].length,g=t.slice(0,i+o.index+h+l);if(Math.min(i,l)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const f=g.slice(2,-2);return{type:"strong",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=An(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,o;return n[2]==="@"?(r=An(n[1]),o="mailto:"+r):(r=An(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=An(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(i!==n[0]);r=An(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=An(n[0]),{type:"text",raw:n[0],text:r}}}}const Hm=/^(?: *(?:\n|$))+/,zm=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Lm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Si=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Am=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Wd=/(?:[*+-]|\d{1,9}[.)])/,jd=Pt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Wd).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ds=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fm=/^[^\n]+/,hs=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Vm=Pt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",hs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_m=Pt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wd).getRegex(),Ha="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$m=Pt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",fs).replace("tag",Ha).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gd=Pt(ds).replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ha).getRegex(),Bm=Pt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Gd).getRegex(),ps={blockquote:Bm,code:zm,def:Vm,fences:Lm,heading:Am,hr:Si,html:$m,lheading:jd,list:_m,newline:Hm,paragraph:Gd,table:di,text:Fm},Bc=Pt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ha).getRegex(),Nm={...ps,table:Bc,paragraph:Pt(ds).replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ha).getRegex()},Wm={...ps,html:Pt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:di,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pt(ds).replace("hr",Si).replace("heading",` *#{1,6} *[^
|
|
27
|
+
]`).replace("lheading",jd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ud=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jm=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Kd=/^( {2,}|\\)\n(?!\s*$)/,Gm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Mi="\\p{P}\\p{S}",Um=Pt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Mi).getRegex(),Km=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Xm=Pt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Mi).getRegex(),qm=Pt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Mi).getRegex(),Zm=Pt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Mi).getRegex(),Ym=Pt(/\\([punct])/,"gu").replace(/punct/g,Mi).getRegex(),Jm=Pt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qm=Pt(fs).replace("(?:-->|$)","-->").getRegex(),e0=Pt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),va=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,t0=Pt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",va).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xd=Pt(/^!?\[(label)\]\[(ref)\]/).replace("label",va).replace("ref",hs).getRegex(),qd=Pt(/^!?\[(ref)\](?:\[\])?/).replace("ref",hs).getRegex(),n0=Pt("reflink|nolink(?!\\()","g").replace("reflink",Xd).replace("nolink",qd).getRegex(),gs={_backpedal:di,anyPunctuation:Ym,autolink:Jm,blockSkip:Km,br:Kd,code:jm,del:di,emStrongLDelim:Xm,emStrongRDelimAst:qm,emStrongRDelimUnd:Zm,escape:Ud,link:t0,nolink:qd,punctuation:Um,reflink:Xd,reflinkSearch:n0,tag:e0,text:Gm,url:di},r0={...gs,link:Pt(/^!?\[(label)\]\((.*?)\)/).replace("label",va).getRegex(),reflink:Pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",va).getRegex()},$l={...gs,escape:Pt(Ud).replace("])","~|])").getRegex(),url:Pt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},o0={...$l,br:Pt(Kd).replace("{2,}","*").getRegex(),text:Pt($l.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qi={normal:ps,gfm:Nm,pedantic:Wm},ti={normal:gs,gfm:$l,breaks:o0,pedantic:r0};class lr{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jr,this.options.tokenizer=this.options.tokenizer||new ma,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:qi.normal,inline:ti.normal};this.options.pedantic?(n.block=qi.pedantic,n.inline=ti.pedantic):this.options.gfm&&(n.block=qi.gfm,this.options.breaks?n.inline=ti.breaks:n.inline=ti.gfm),this.tokenizer.rules=n}static get rules(){return{block:qi,inline:ti}}static lex(t,n){return new lr(n).lex(t)}static lexInline(t,n){return new lr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
|
28
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(l,s,c)=>s+" ".repeat(c.length));let o,i,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(o=l.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))){if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length),o.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
|
29
|
+
`:n.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
|
30
|
+
`+o.raw,i.text+=`
|
|
31
|
+
`+o.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
|
32
|
+
`+o.raw,i.text+=`
|
|
33
|
+
`+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(a=t,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const s=t.slice(1);let c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},s),typeof c=="number"&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(a=t.substring(0,l+1))}if(this.state.top&&(o=this.tokenizer.paragraph(a))){i=n[n.length-1],r&&i?.type==="paragraph"?(i.raw+=`
|
|
34
|
+
`+o.raw,i.text+=`
|
|
35
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(o),r=a.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
|
|
36
|
+
`+o.raw,i.text+=`
|
|
37
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(o);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,i,a=t,l,s,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(s||(c=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,a,c)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const h=t.slice(1);let g;this.options.extensions.startInline.forEach(f=>{g=f.call({lexer:this},h),typeof g=="number"&&g>=0&&(u=Math.min(u,g))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),s=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class ba{options;parser;constructor(t){this.options=t||Jr}space(t){return""}code({text:t,lang:n,escaped:r}){const o=(n||"").match(/^\S*/)?.[0],i=t.replace(/\n$/,"")+`
|
|
38
|
+
`;return o?'<pre><code class="language-'+An(o)+'">'+(r?i:An(i,!0))+`</code></pre>
|
|
39
|
+
`:"<pre><code>"+(r?i:An(i,!0))+`</code></pre>
|
|
40
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
41
|
+
${this.parser.parse(t)}</blockquote>
|
|
42
|
+
`}html({text:t}){return t}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
43
|
+
`}hr(t){return`<hr>
|
|
44
|
+
`}list(t){const n=t.ordered,r=t.start;let o="";for(let l=0;l<t.items.length;l++){const s=t.items[l];o+=this.listitem(s)}const i=n?"ol":"ul",a=n&&r!==1?' start="'+r+'"':"";return"<"+i+a+`>
|
|
45
|
+
`+o+"</"+i+`>
|
|
46
|
+
`}listitem(t){let n="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?t.tokens.length>0&&t.tokens[0].type==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):n+=r+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
|
|
47
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
48
|
+
`}table(t){let n="",r="";for(let i=0;i<t.header.length;i++)r+=this.tablecell(t.header[i]);n+=this.tablerow({text:r});let o="";for(let i=0;i<t.rows.length;i++){const a=t.rows[i];r="";for(let l=0;l<a.length;l++)r+=this.tablecell(a[l]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
49
|
+
<thead>
|
|
50
|
+
`+n+`</thead>
|
|
51
|
+
`+o+`</table>
|
|
52
|
+
`}tablerow({text:t}){return`<tr>
|
|
53
|
+
${t}</tr>
|
|
54
|
+
`}tablecell(t){const n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
55
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${t}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){const o=this.parser.parseInline(r),i=Vc(t);if(i===null)return o;t=i;let a='<a href="'+t+'"';return n&&(a+=' title="'+n+'"'),a+=">"+o+"</a>",a}image({href:t,title:n,text:r}){const o=Vc(t);if(o===null)return r;t=o;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):t.text}}class ms{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}}class sr{options;renderer;textRenderer;constructor(t){this.options=t||Jr,this.options.renderer=this.options.renderer||new ba,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ms}static parse(t,n){return new sr(n).parse(t)}static parseInline(t,n){return new sr(n).parseInline(t)}parse(t,n=!0){let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=i,s=this.options.extensions.renderers[l.type].call({parser:this},l);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){r+=s||"";continue}}const a=i;switch(a.type){case"space":{r+=this.renderer.space(a);continue}case"hr":{r+=this.renderer.hr(a);continue}case"heading":{r+=this.renderer.heading(a);continue}case"code":{r+=this.renderer.code(a);continue}case"table":{r+=this.renderer.table(a);continue}case"blockquote":{r+=this.renderer.blockquote(a);continue}case"list":{r+=this.renderer.list(a);continue}case"html":{r+=this.renderer.html(a);continue}case"paragraph":{r+=this.renderer.paragraph(a);continue}case"text":{let l=a,s=this.renderer.text(l);for(;o+1<t.length&&t[o+1].type==="text";)l=t[++o],s+=`
|
|
56
|
+
`+this.renderer.text(l);n?r+=this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s}]}):r+=s;continue}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,n){n=n||this.renderer;let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}const a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}}class la{options;constructor(t){this.options=t||Jr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}}class i0{defaults=us();options=this.setOptions;parse=this.parseMarkdown(lr.lex,sr.parse);parseInline=this.parseMarkdown(lr.lexInline,sr.parseInline);Parser=sr;Renderer=ba;TextRenderer=ms;Lexer=lr;Tokenizer=ma;Hooks=la;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(const o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{const i=o;for(const a of i.header)r=r.concat(this.walkTokens(a.tokens,n));for(const a of i.rows)for(const l of a)r=r.concat(this.walkTokens(l.tokens,n));break}case"list":{const i=o;r=r.concat(this.walkTokens(i.items,n));break}default:{const i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{const l=i[a].flat(1/0);r=r.concat(this.walkTokens(l,n))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const a=n.renderers[i.name];a?n.renderers[i.name]=function(...l){let s=i.renderer.apply(this,l);return s===!1&&(s=a.apply(this,l)),s}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=n[i.level];a?a.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){const i=this.defaults.renderer||new ba(this.defaults);for(const a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const l=a,s=r.renderer[l],c=i[l];i[l]=(...u)=>{let h=s.apply(i,u);return h===!1&&(h=c.apply(i,u)),h||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new ma(this.defaults);for(const a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const l=a,s=r.tokenizer[l],c=i[l];i[l]=(...u)=>{let h=s.apply(i,u);return h===!1&&(h=c.apply(i,u)),h}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new la;for(const a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(a==="options")continue;const l=a,s=r.hooks[l],c=i[l];la.passThroughHooks.has(a)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(g=>c.call(i,g));const h=s.call(i,u);return c.call(i,h)}:i[l]=(...u)=>{let h=s.apply(i,u);return h===!1&&(h=c.apply(i,u)),h}}o.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,a=r.walkTokens;o.walkTokens=function(l){let s=[];return s.push(a.call(this,l)),i&&(s=s.concat(i.call(this,l))),s}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return lr.lex(t,n??this.defaults)}parser(t,n){return sr.parse(t,n??this.defaults)}parseMarkdown(t,n){return(r,o)=>{const i={...o},a={...this.defaults,...i},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(r):r).then(s=>t(s,a)).then(s=>a.hooks?a.hooks.processAllTokens(s):s).then(s=>a.walkTokens?Promise.all(this.walkTokens(s,a.walkTokens)).then(()=>s):s).then(s=>n(s,a)).then(s=>a.hooks?a.hooks.postprocess(s):s).catch(l);try{a.hooks&&(r=a.hooks.preprocess(r));let s=t(r,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let c=n(s,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(s){return l(s)}}}onError(t,n){return r=>{if(r.message+=`
|
|
57
|
+
Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+An(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}}}const qr=new i0;function Et(e,t){return qr.parse(e,t)}Et.options=Et.setOptions=function(e){return qr.setOptions(e),Et.defaults=qr.defaults,$d(Et.defaults),Et};Et.getDefaults=us;Et.defaults=Jr;Et.use=function(...e){return qr.use(...e),Et.defaults=qr.defaults,$d(Et.defaults),Et};Et.walkTokens=function(e,t){return qr.walkTokens(e,t)};Et.parseInline=qr.parseInline;Et.Parser=sr;Et.parser=sr.parse;Et.Renderer=ba;Et.TextRenderer=ms;Et.Lexer=lr;Et.lexer=lr.lex;Et.Tokenizer=ma;Et.Hooks=la;Et.parse=Et;Et.options;Et.setOptions;Et.use;Et.walkTokens;Et.parseInline;sr.parse;lr.lex;const a0=un("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class l0 extends St.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:o}=n,i=Et(r),a=document.createRange();a.selectNodeContents(t),a.deleteContents();let l=o?.(i);if(l===void 0){const c=document.createElement("template");c.innerHTML=i,l=c.content}t.append(l);const s=t.getElementsByTagName("a");for(const c of s)c.target="_blank",c.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),St.createElement(a0,{ref:this.containerRefHook})}}const s0=un("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),c0=un("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),u0=un("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Nc=0;const Qr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:a,...l}=e,{onChange:s,className:c}=l,u=d.useRef(null),h=n??"";Fn(s!==void 0,"GrowingEntry must be a controlled input area");const[g]=d.useState(()=>"input-box-"+(Nc=(Nc+1)%1e7));d.useEffect(()=>{const p=u.current;if(p===null||p.disabled)return;const m=h.toString().length;p.focus(),p.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{if(a!==void 0){const p=typeof a=="number"?[a,null]:a;u.current?.setSelectionRange(p[0],p[1])}},[a]);const f=d.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&i===!0||r?.(p)},[i,r]);return d.createElement(u0,{className:"gdg-growing-entry"},d.createElement(c0,{className:c},h+`
|
|
58
|
+
`),d.createElement(s0,{...l,className:(c??"")+" gdg-input",id:g,ref:u,onKeyDown:f,value:h,placeholder:t,dir:"auto"}))},hl={};let Sr=null;function d0(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function vi(e){const t=e.toLowerCase().trim();if(hl[t]!==void 0)return hl[t];Sr=Sr||d0(),Sr.style.color="#000",Sr.style.color=t;const n=getComputedStyle(Sr).color;Sr.style.color="#fff",Sr.style.color=t;const r=getComputedStyle(Sr).color;if(r!==n)return[0,0,0,1];let o=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return o.length<4&&o.push(1),o=o.map(i=>Number.isNaN(i)?0:i),hl[t]=o,o}function Zr(e,t){const[n,r,o]=vi(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Wc=new Map;function jc(e,t){const n=`${e}-${t}`,r=Wc.get(n);if(r!==void 0)return r;const o=Vn(e,t);return Wc.set(n,o),o}function Vn(e,t){if(t===void 0)return e;const[n,r,o,i]=vi(e);if(i===1)return e;const[a,l,s,c]=vi(t),u=i+c*(1-i),h=(i*n+c*a*(1-i))/u,g=(i*r+c*l*(1-i))/u,f=(i*o+c*s*(1-i))/u;return`rgba(${h}, ${g}, ${f}, ${u})`}function Bl(e){if(e==="transparent")return 0;function t(i){const a=i/255;return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}const[n,r,o]=vi(e);return .2126*t(n)+.7152*t(r)+.0722*t(o)}var So=new Map,Ro=new Map,Nl=new Map;function h0(){So.clear(),Nl.clear(),Ro.clear()}function f0(e,t,n,r,o){var i,a,l;let s=0,c={};for(let h of e)s+=(i=n.get(h))!=null?i:o,c[h]=((a=c[h])!=null?a:0)+1;let u=t-s;for(let h of Object.keys(c)){let g=c[h],f=(l=n.get(h))!=null?l:o,p=f*g/s,m=u*p*r/g,w=f+m;n.set(h,w)}}function p0(e,t){var n;let r=new Map,o=0;for(let c of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let u=e.measureText(c).width;r.set(c,u),o+=u}let i=o/r.size,a=3,l=(t/i+a)/(a+1),s=r.keys();for(let c of s)r.set(c,((n=r.get(c))!=null?n:i)*l);return r}function hi(e,t,n,r){var o,i;let a=Ro.get(n);if(r&&a!==void 0&&a.count>2e4){let c=Nl.get(n);if(c===void 0&&(c=p0(e,a.size),Nl.set(n,c)),a.count>5e5){let h=0;for(let g of t)h+=(o=c.get(g))!=null?o:a.size;return h*1.01}let u=e.measureText(t);return f0(t,u.width,c,Math.max(.05,1-a.count/2e5),a.size),Ro.set(n,{count:a.count+t.length,size:a.size}),u.width}let l=e.measureText(t),s=l.width/t.length;if(((i=a?.count)!=null?i:0)>2e4)return l.width;if(a===void 0)Ro.set(n,{count:t.length,size:s});else{let c=s-a.size,u=t.length/(a.count+t.length),h=a.size+c*u;Ro.set(n,{count:a.count+t.length,size:h})}return l.width}function g0(e,t,n,r,o,i,a,l){if(t.length<=1)return t.length;if(o<n)return-1;let s=Math.floor(n/o*i),c=hi(e,t.slice(0,Math.max(0,s)),r,a);if(c!==n)if(c<n){for(;c<n;)s++,c=hi(e,t.slice(0,Math.max(0,s)),r,a);s--}else for(;c>n;){let u=t.lastIndexOf(" ",s-1);u>0?s=u:s--,c=hi(e,t.slice(0,Math.max(0,s)),r,a)}if(t[s]!==" "){let u=0;u=t.lastIndexOf(" ",s),u>0&&(s=u)}return s}function m0(e,t,n,r,o,i){let a=`${t}_${n}_${r}px`,l=So.get(a);if(l!==void 0)return l;if(r<=0)return[];let s=[],c=t.split(`
|
|
59
|
+
`),u=Ro.get(n),h=u===void 0?t.length:r/u.size*1.5,g=o&&u!==void 0&&u.count>2e4;for(let f of c){let p=hi(e,f.slice(0,Math.max(0,h)),n,g),m=Math.min(f.length,h);if(p<=r)s.push(f);else{for(;p>r;){let w=g0(e,f,r,n,p,m,g),y=f.slice(0,Math.max(0,w));f=f.slice(y.length),s.push(y),p=hi(e,f.slice(0,Math.max(0,h)),n,g),m=Math.min(f.length,h)}p>0&&s.push(f)}}return s=s.map((f,p)=>p===0?f.trimEnd():f.trim()),So.set(a,s),So.size>500&&So.delete(So.keys().next().value),s}function v0(e,t){return St.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function b0(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(fi(e.current.cell,t))return!0;const o=[e.current.range,...e.current.rangeStack];for(const i of o)if(n>=i.x&&n<i.x+i.width&&r>=i.y&&r<i.y+i.height)return!0}return!1}function bi(e,t){return(e??"")===(t??"")}function y0(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function Zd(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function fi(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function Yd(e){return[e.x+e.width-1,e.y+e.height-1]}function Gc(e,t,n){const r=n.x,o=n.x+n.width-1,i=n.y,a=n.y+n.height-1,[l,s]=e;if(s<i||s>a)return!1;if(t.span===void 0)return l>=r&&l<=o;const[c,u]=t.span;return c>=r&&c<=o||u>=r&&c<=o||c<r&&u>o}function w0(e,t,n,r){let o=0;if(n.current===void 0)return o;const i=n.current.range;(r||i.height*i.width>1)&&Gc(e,t,i)&&o++;for(const a of n.current.rangeStack)Gc(e,t,a)&&o++;return o}function Jd(e,t){let n=e;if(t!==void 0){let r=[...e];const o=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,o)):(r.splice(t.dest+1,0,o),r.splice(t.src,1)),r=r.map((i,a)=>({...i,sticky:e[a].sticky})),n=r}return n}function Do(e,t){let n=0;const r=Jd(e,t);for(let o=0;o<r.length;o++){const i=r[o];if(i.sticky)n+=i.width;else break}return n}function eo(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let o=e-t;o<e;o++)r+=n(o);return r}}function Wl(e,t,n,r,o){const i=Jd(e,r),a=[];for(const c of i)if(c.sticky)a.push(c);else break;if(a.length>0)for(const c of a)n-=c.width;let l=t,s=o??0;for(;s<=n&&l<i.length;)s+=i[l].width,l++;for(let c=t;c<l;c++){const u=i[c];u.sticky||a.push(u)}return a}function x0(e,t,n){let r=0;for(const o of t){const i=o.sticky?r:r+(n??0);if(e<=i+o.width)return o.sourceIndex;r+=o.width}return-1}function k0(e,t,n,r,o,i,a,l,s,c){const u=r+o;if(n&&e<=o)return-2;if(e<=u)return-1;let h=t;for(let p=0;p<c;p++){const m=i-1-p,w=typeof a=="number"?a:a(m);if(h-=w,e>=h)return m}const g=i-c,f=e-(s??0);if(typeof a=="number"){const p=Math.floor((f-u)/a)+l;return p>=g?void 0:p}else{let p=u;for(let m=l;m<g;m++){const w=a(m);if(f<=p+w)return m;p+=w}return}}let sa=0,pi={};const C0=typeof window>"u";async function S0(){C0||document?.fonts?.ready===void 0||(await document.fonts.ready,sa=0,pi={},h0())}S0();function Qd(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Dr(e,t,n,r="middle"){const o=Qd(e,t,r,n);let i=pi[o];return i===void 0&&(i=t.measureText(e),pi[o]=i,sa++),sa>1e4&&(pi={},sa=0),i}function eh(e,t){const n=Qd(e,void 0,"middle",t);return pi[n]}function er(e,t){return typeof t!="string"&&(t=t.baseFontFull),M0(e,t)}function Uc(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const Kc=[];function M0(e,t){for(const o of Kc)if(o.key===t)return o.val;const n=Uc(e,"alphabetic"),r=-(Uc(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Kc.push({key:t,val:r}),r}function R0(e,t,n,r,o,i){const{ctx:a,rect:l,theme:s}=e;let c=Number.MAX_SAFE_INTEGER;const u=500;if(t!==void 0&&(c=n-t,c<u)){const h=1-c/u;a.globalAlpha=h,a.fillStyle=s.bgSearchResult,a.fillRect(l.x+1,l.y+1,l.width-(o?2:1),l.height-(i?2:1)),a.globalAlpha=1,r!==void 0&&(r.fillStyle=s.bgSearchResult)}return c<u}function Ri(e,t,n){const{ctx:r,theme:o}=e,i=t??{},a=n??o.textDark;return a!==i.fillStyle&&(r.fillStyle=a,i.fillStyle=a),i}function vs(e,t,n,r,o){const{rect:i,ctx:a,theme:l}=e;a.fillStyle=l.textDark,ar({ctx:a,rect:i,theme:l},t,n,r,o)}function th(e,t,n,r,o,i,a,l,s){s==="right"?e.fillText(t,n+o-(l.cellHorizontalPadding+.5),r+i/2+a):s==="center"?e.fillText(t,n+o/2,r+i/2+a):e.fillText(t,n+l.cellHorizontalPadding+.5,r+i/2+a)}function bs(e,t){const n=Dr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function I0(e,t){e.includes(`
|
|
60
|
+
`)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function E0(e,t,n,r,o,i,a,l,s,c){const u=l.baseFontFull,h=m0(e,t,u,o-l.cellHorizontalPadding*2,c??!1),g=bs(e,u),f=l.lineHeight*g,p=g+f*(h.length-1),m=p+l.cellVerticalPadding>i;m&&(e.save(),e.rect(n,r,o,i),e.clip());const w=r+i/2-p/2;let y=Math.max(r+l.cellVerticalPadding,w);for(const v of h)if(th(e,v,n,y,o,g,a,l,s),y+=f,y>r+i)break;m&&e.restore()}function ar(e,t,n,r,o){const{ctx:i,rect:a,theme:l}=e,{x:s,y:c,width:u,height:h}=a;r=r??!1,r||(t=I0(t,u));const g=er(i,l),f=cs(t)==="rtl";if(n===void 0&&f&&(n="right"),f&&(i.direction="rtl"),t.length>0){let p=!1;n==="right"?(i.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,p=!0),r?E0(i,t,s,c,u,h,g,l,n,o):th(i,t,s,c,u,h,g,l,n),p&&(i.textAlign="start"),f&&(i.direction="inherit")}}function Jn(e,t,n,r,o,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,o/2,r/2)),tr:Math.max(0,Math.min(i.tr,o/2,r/2)),bl:Math.max(0,Math.min(i.bl,o/2,r/2)),br:Math.max(0,Math.min(i.br,o/2,r/2))},e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function T0(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function O0(e,t,n){const r=function(l,s){const c=s.x-l.x,u=s.y-l.y,h=Math.sqrt(c*c+u*u),g=c/h,f=u/h;return{x:c,y:s.y-l.y,len:h,nx:g,ny:f,ang:Math.atan2(f,g)}};let o;const i=t.length;let a=t[i-1];for(let l=0;l<i;l++){let s=t[l%i];const c=t[(l+1)%i],u=r(s,a),h=r(s,c),g=u.nx*h.ny-u.ny*h.nx,f=u.nx*h.nx-u.ny*-h.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,w=!1;f<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,w=!0):p>0&&(m=-1,w=!0),o=s.radius!==void 0?s.radius:n;const y=p/2;let v=Math.abs(Math.cos(y)*o/Math.sin(y)),x;v>Math.min(u.len/2,h.len/2)?(v=Math.min(u.len/2,h.len/2),x=Math.abs(v*Math.sin(y)/Math.cos(y))):x=o;let I=s.x+h.nx*v,O=s.y+h.ny*v;I+=-h.ny*x*m,O+=h.nx*x*m,e.arc(I,O,x,u.ang+Math.PI/2*m,h.ang-Math.PI/2*m,w),a=s,s=c}e.closePath()}function jl(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p){const m={x:0,y:i+c,width:0,height:0};if(e>=f.length||t>=u||t<-2||e<0)return m;const w=i-o;if(e>=h){const y=a>e?-1:1,v=Do(f);m.x+=v+s;for(let x=a;x!==e;x+=y)m.x+=f[y===1?x:x-1].width*y}else for(let y=0;y<e;y++)m.x+=f[y].width;if(m.width=f[e].width+1,t===-1)m.y=o,m.height=w;else if(t===-2){m.y=0,m.height=o;let y=e;const v=f[e].group,x=f[e].sticky;for(;y>0&&bi(f[y-1].group,v)&&f[y-1].sticky===x;){const O=f[y-1];m.x-=O.width,m.width+=O.width,y--}let I=e;for(;I+1<f.length&&bi(f[I+1].group,v)&&f[I+1].sticky===x;){const O=f[I+1];m.width+=O.width,I++}if(!x){const O=Do(f),M=m.x-O;M<0&&(m.x-=M,m.width+=M),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=u-g){let y=u-t;for(m.y=r;y>0;){const v=t+y-1;m.height=typeof p=="number"?p:p(v),m.y-=m.height,y--}m.height+=1}else{const y=l>t?-1:1;if(typeof p=="number"){const v=t-l;m.y+=v*p}else for(let v=l;v!==t;v+=y)m.y+=p(v)*y;m.height=(typeof p=="number"?p:p(t))+1}return m}const ys=1<<21;function Yn(e,t){return(t+2)*ys+e}function nh(e){return e%ys}function ws(e){return Math.floor(e/ys)-2}function xs(e){const t=nh(e),n=ws(e);return[t,n]}class rh{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=nh(t),r=ws(t),o=this.visibleWindow,i=n>=o.x&&n<=o.x+o.width||n<this.freezeCols,a=r>=o.y&&r<=o.y+o.height||this.freezeRows.includes(r);return i&&a};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Oo(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class D0 extends rh{cache=new Map;setValue=(t,n)=>{this.cache.set(Yn(t[0],t[1]),n)};getValue=t=>this.cache.get(Yn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class gi{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Yn(n[0],n[1])))}add(t){this.cells.add(Yn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Yn(t[0],t[1]))}remove(t){this.cells.delete(Yn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(ws(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Yn(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield xs(t)}}function P0(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const oh={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function ih(){return oh}const ah=St.createContext(oh);function lh(){return St.useContext(ah)}function mr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const o in r)r.hasOwnProperty(o)&&(o==="bgCell"?n[o]=Vn(r[o],n[o]):n[o]=r[o]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Gl=150;function H0(e,t,n,r){return r(t)?.measure?.(e,t,n)??Gl}function sh(e,t,n,r,o,i,a,l,s){let c=0;const u=o===void 0?[]:o.map(f=>{const p=H0(e,f[r],t,s);return c=Math.max(c,p),p});if(u.length>5&&l){c=0;let f=0;for(const m of u)f+=m;const p=f/u.length;for(let m=0;m<u.length;m++)u[m]>=p*2?u[m]=0:c=Math.max(c,u[m])}const h=e.font;e.font=t.headerFontFull,c=Math.max(c,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=h;const g=Math.max(Math.ceil(i),Math.min(Math.floor(a),Math.ceil(c)));return{...n,width:g}}function z0(e,t,n,r,o,i,a,l,s){const c=d.useRef(t),u=d.useRef(n),h=d.useRef(a);c.current=t,u.current=n,h.current=a;const[g,f]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const p=d.useRef({}),m=d.useRef(),[w,y]=d.useState();return d.useLayoutEffect(()=>{const v=u.current;if(v===void 0||e.every(Ki))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),I=0;x<c.current&&x>1&&(x--,I=1);const O={x:0,y:0,width:e.length,height:Math.min(c.current,x)},M={x:0,y:c.current-1,width:e.length,height:1};(async()=>{const P=v(O,s.signal),S=I>0?v(M,s.signal):void 0;let k;typeof P=="object"?k=P:k=await bc(P),S!==void 0&&(typeof S=="object"?k=[...k,...S]:k=[...k,...await bc(S)]),m.current=e,y(k)})()},[s.signal,e]),d.useMemo(()=>{let v=e.every(Ki)?e:f===null?e.map(M=>Ki(M)?M:{...M,width:Gl}):(f.font=h.current.baseFontFull,e.map((M,P)=>{if(Ki(M))return M;if(p.current[M.id]!==void 0)return{...M,width:p.current[M.id]};if(w===void 0||m.current!==e||M.id===void 0)return{...M,width:Gl};const S=sh(f,a,M,P,w,o,i,!0,l);return p.current[M.id]=S.width,S})),x=0,I=0;const O=[];for(const[M,P]of v.entries())x+=P.width,P.grow!==void 0&&P.grow>0&&(I+=P.grow,O.push(M));if(x<r&&O.length>0){const M=[...v],P=r-x;let S=P;for(let k=0;k<O.length;k++){const H=O[k],E=(v[H].grow??0)/I,R=k===O.length-1?S:Math.min(S,Math.floor(P*E));M[H]={...v[H],growOffset:R,width:v[H].width+R},S-=R}v=M}return{sizedColumns:v,nonGrowWidth:x}},[r,e,f,w,a,o,i,l])}var fl,Xc;function L0(){if(Xc)return fl;Xc=1;function e(t,n,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),n!==void 0&&(t=t>=n?t:n)),t}return fl=e,fl}var pl,qc;function A0(){if(qc)return pl;qc=1;var e=L0(),t=ud();function n(r,o,i){return i===void 0&&(i=o,o=void 0),i!==void 0&&(i=t(i),i=i===i?i:0),o!==void 0&&(o=t(o),o=o===o?o:0),e(t(r),o,i)}return pl=n,pl}var F0=A0();const Wn=vr(F0);var gl,Zc;function V0(){if(Zc)return gl;Zc=1;function e(){}return gl=e,gl}var ml,Yc;function _0(){if(Yc)return ml;Yc=1;var e=Up(),t=V0(),n=bd(),r=1/0,o=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return ml=o,ml}var vl,Jc;function $0(){if(Jc)return vl;Jc=1;var e=Ap(),t=Fp(),n=pg(),r=Vp(),o=_0(),i=bd(),a=200;function l(s,c,u){var h=-1,g=t,f=s.length,p=!0,m=[],w=m;if(u)p=!1,g=n;else if(f>=a){var y=c?null:o(s);if(y)return i(y);p=!1,g=r,w=new e}else w=c?[]:m;e:for(;++h<f;){var v=s[h],x=c?c(v):v;if(v=u||v!==0?v:0,p&&x===x){for(var I=w.length;I--;)if(w[I]===x)continue e;c&&w.push(x),m.push(v)}else g(w,x,u)||(w!==m&&w.push(x),m.push(v))}return m}return vl=l,vl}var bl,Qc;function B0(){if(Qc)return bl;Qc=1;var e=$0();function t(n){return n&&n.length?e(n):[]}return bl=t,bl}var N0=B0();const W0=vr(N0);var j0=sp();const eu=vr(j0),Vt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',G0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
61
|
+
${Vt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},U0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
62
|
+
${Vt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},K0=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
63
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
|
64
|
+
<path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
|
|
65
|
+
</svg>`},X0=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
66
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
|
67
|
+
<path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
|
|
68
|
+
</svg>`},q0=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
69
|
+
<path
|
|
70
|
+
d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
|
|
71
|
+
fill="${n}"
|
|
72
|
+
/>
|
|
73
|
+
<path
|
|
74
|
+
fill-rule="evenodd"
|
|
75
|
+
clip-rule="evenodd"
|
|
76
|
+
d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
|
|
77
|
+
fill="${t}"
|
|
78
|
+
/>
|
|
79
|
+
</svg>`},ch=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
80
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
|
81
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
|
|
82
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
|
|
83
|
+
</svg>
|
|
84
|
+
`},Z0=e=>{const t=e.bgColor;return`${Vt}
|
|
85
|
+
<path stroke="${t}" stroke-width="2" d="M12 3v14"/>
|
|
86
|
+
<path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
|
|
87
|
+
<path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
|
|
88
|
+
</svg>
|
|
89
|
+
`},Y0=ch,J0=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
90
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
|
91
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
|
|
92
|
+
</svg>`},Q0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
93
|
+
${Vt}
|
|
94
|
+
<path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
|
|
95
|
+
<path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
|
|
96
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
|
97
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
|
98
|
+
<path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
|
|
99
|
+
<path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
|
|
100
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
|
101
|
+
</svg>`},ev=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
102
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
|
103
|
+
<path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
|
|
104
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
|
|
105
|
+
</svg>`},tv=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
106
|
+
${Vt}
|
|
107
|
+
<path fill="${t}" d="M3 3h14v14H3z"/>
|
|
108
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/>
|
|
109
|
+
</svg>`},nv=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
110
|
+
${Vt}
|
|
111
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
|
112
|
+
<path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
|
|
113
|
+
</svg>`},rv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
114
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
|
115
|
+
<path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
|
|
116
|
+
</svg>`},ov=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
117
|
+
${Vt}
|
|
118
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
|
119
|
+
<path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
|
|
120
|
+
<path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
|
|
121
|
+
</svg>`},iv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
122
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
123
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
|
|
124
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
|
|
125
|
+
</svg>`},av=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
126
|
+
${Vt}
|
|
127
|
+
<rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
|
|
128
|
+
<rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
|
|
129
|
+
<path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
|
|
130
|
+
</svg>`},lv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
131
|
+
<path fill="${t}" d="M4 3h12v14H4z"/>
|
|
132
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/>
|
|
133
|
+
</svg>`},sv=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
134
|
+
${Vt}
|
|
135
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
136
|
+
<path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
|
|
137
|
+
</svg>`},cv=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
138
|
+
${Vt}
|
|
139
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
140
|
+
<path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
|
|
141
|
+
</svg>`},uv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
142
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
143
|
+
<path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
|
|
144
|
+
</svg>`},dv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
145
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
146
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
|
|
147
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
|
|
148
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
|
|
149
|
+
<path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
|
|
150
|
+
</svg>`},hv=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
151
|
+
${Vt}
|
|
152
|
+
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
|
153
|
+
<path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
|
|
154
|
+
</svg>`},fv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
155
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
156
|
+
<path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
|
|
157
|
+
</svg>`},pv=e=>{const t=e.fgColor,n=e.bgColor;return`
|
|
158
|
+
${Vt}
|
|
159
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
160
|
+
<path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
|
|
161
|
+
</svg>`},gv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
162
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
|
163
|
+
<path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
|
|
164
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
|
|
165
|
+
</svg>`},mv=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
|
|
166
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
|
167
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
|
|
168
|
+
</svg>`},vv=e=>{const t=e.fgColor;return`
|
|
169
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
170
|
+
<path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
|
171
|
+
</svg>`},bv=e=>{const t=e.fgColor;return`
|
|
172
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
173
|
+
<path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
|
174
|
+
</svg>
|
|
175
|
+
`},yv={headerRowID:G0,headerNumber:K0,headerCode:U0,headerString:X0,headerBoolean:q0,headerAudioUri:Y0,headerVideoUri:J0,headerEmoji:Q0,headerImage:ev,headerUri:ch,headerPhone:tv,headerMarkdown:nv,headerDate:rv,headerTime:ov,headerEmail:iv,headerReference:av,headerIfThenElse:lv,headerSingleValue:sv,headerLookup:cv,headerTextTemplate:uv,headerMath:dv,headerRollup:hv,headerJoinStrings:fv,headerSplitString:pv,headerGeoDistance:gv,headerArray:mv,rowOwnerOverlay:vv,protectedColumnOverlay:bv,renameIcon:Z0};function wv(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class xv{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,o,i,a,l,s=1){const[c,u]=wv(n,l),h=a*Math.ceil(window.devicePixelRatio),g=`${c}_${u}_${h}_${t}`;let f=this.spriteMap.get(g);if(f===void 0){const p=this.headerIcons[t];if(p===void 0)return;f=document.createElement("canvas");const m=f.getContext("2d");if(m===null)return;const w=new Image;w.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:u,bgColor:c}))}`,this.spriteMap.set(g,f);const y=w.decode();if(y===void 0)return;this.inFlight++,y.then(()=>{m.drawImage(w,0,0,h,h)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(f,0,0,h,h,o,i,a,a),s<1&&(r.globalAlpha=1)}}function uh(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function za(e,t,n,r,o,i,a,l,s){l=l??t;let c=t,u=e;const h=r-i;let g=!1;for(;c<n&&u<h;){const f=o(u);if(c+f>l&&s(c,u,f,!1,a&&u===r-1)===!0){g=!0;break}c+=f,u++}if(!g){c=n;for(let f=0;f<i;f++){u=r-1-f;const p=o(u);c-=p,s(c,u,p,!0,a&&u===r-1)}}}function Pr(e,t,n,r,o,i){let a=0,l=0;const s=o+r;for(const c of e){const u=c.sticky?l:a+n;if(i(c,u,s,c.sticky?0:l,t)===!0)break;a+=c.width,l+=c.sticky?c.width:0}}function dh(e,t,n,r,o){let i=0,a=0;for(let l=0;l<e.length;l++){const s=e[l];let c=l+1,u=s.width;for(s.sticky&&(a+=u);c<e.length&&bi(e[c].group,s.group)&&e[c].sticky===e[l].sticky;){const m=e[c];u+=m.width,c++,l++,m.sticky&&(a+=m.width)}const h=s.sticky?0:n,g=i+h,f=s.sticky?0:Math.max(0,a-g),p=Math.min(u-f,t-(g+f));o([s.sourceIndex,e[c-1].sourceIndex],s.group??"",g+f,0,p,r),i+=u}}function hh(e,t,n,r,o,i,a){const[l,s]=e;let c,u;const h=a.find(g=>!g.sticky)?.sourceIndex??0;if(s>h){const g=Math.max(l,h);let f=t,p=r;for(let m=i.sourceIndex-1;m>=g;m--)f-=a[m].width,p+=a[m].width;for(let m=i.sourceIndex+1;m<=s;m++)p+=a[m].width;u={x:f,y:n,width:p,height:o}}if(h>l){const g=Math.min(s,h-1);let f=t,p=r;for(let m=i.sourceIndex-1;m>=l;m--)f-=a[m].width,p+=a[m].width;for(let m=i.sourceIndex+1;m<=g;m++)p+=a[m].width;c={x:f,y:n,width:p,height:o}}return[c,u]}function kv(e,t,n,r){if(r==="any")return fh(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),Zd([t,n],e))return;const o=t-e.x,i=e.x+e.width-t,a=n-e.y+1,l=e.y+e.height-n,s=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="horizontal"?Number.MAX_SAFE_INTEGER:a,r==="horizontal"?Number.MAX_SAFE_INTEGER:l);return s===l?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:s===a?{x:e.x,y:n,width:e.width,height:e.y-n}:s===i?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function yi(e,t,n,r,o,i,a,l){return e<=o+a&&o<=e+n&&t<=i+l&&i<=t+r}function Xr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function fh(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width)-n,i=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:o,height:i}}function Cv(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Sv(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const o=-4,i=-4,a=t+4,l=n+4,s=o-e.x,c=e.x+e.width-a,u=i-e.y,h=e.y+e.height-l,g=s>0?e.x+Math.floor(s/r)*r:e.x,f=c>0?e.x+e.width-Math.floor(c/r)*r:e.x+e.width,p=u>0?e.y+Math.floor(u/r)*r:e.y,m=h>0?e.y+e.height-Math.floor(h/r)*r:e.y+e.height;return{x:g,y:p,width:f-g,height:m-p}}function Mv(e,t,n,r,o){const[i,a,l,s]=t,[c,u,h,g]=o,{x:f,y:p,width:m,height:w}=e,y=[];if(m<=0||w<=0)return y;const v=f+m,x=p+w,I=f<i,O=p<a,M=f+m>l,P=p+w>s,S=f>=i&&f<l||v>i&&v<=l||f<i&&v>l,k=p>=a&&p<s||x>a&&x<=s||p<a&&x>s;if(S&&k){const H=Math.max(f,i),E=Math.max(p,a),R=Math.min(v,l),T=Math.min(x,s);y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:c,y:u,width:h-c+1,height:g-u+1}})}if(I&&O){const H=f,E=p,R=Math.min(v,i),T=Math.min(x,a);y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:0,y:0,width:c+1,height:u+1}})}if(O&&S){const H=Math.max(f,i),E=p,R=Math.min(v,l),T=Math.min(x,a);y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:c,y:0,width:h-c+1,height:u+1}})}if(O&&M){const H=Math.max(f,l),E=p,R=v,T=Math.min(x,a);y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:h,y:0,width:n-h+1,height:u+1}})}if(I&&k){const H=f,E=Math.max(p,a),R=Math.min(v,i),T=Math.min(x,s);y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:0,y:u,width:c+1,height:g-u+1}})}if(M&&k){const H=Math.max(f,l),E=Math.max(p,a),R=v,T=Math.min(x,s);y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:h,y:u,width:n-h+1,height:g-u+1}})}if(I&&P){const H=f,E=Math.max(p,s),R=Math.min(v,i),T=x;y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:0,y:g,width:c+1,height:r-g+1}})}if(P&&S){const H=Math.max(f,i),E=Math.max(p,s),R=Math.min(v,l),T=x;y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:c,y:g,width:h-c+1,height:r-g+1}})}if(M&&P){const H=Math.max(f,l),E=Math.max(p,s),R=v,T=x;y.push({rect:{x:H,y:E,width:R-H,height:T-E},clip:{x:h,y:g,width:n-h+1,height:r-g+1}})}return y}const Rv={kind:Y.Loading,allowOverlay:!1};function tu(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v,x,I,O,M,P,S,k,H,E,R,T,D,C,J,W,Z){let ce=x?.size??Number.MAX_SAFE_INTEGER;const te=performance.now();let q=T.baseFontFull;e.font=q;const ge={ctx:e},ae=[0,0],fe=w>0?eo(s,w,c):0;let he,oe;const V=uh(v);return Pr(t,l,i,a,o,(z,G,re,le,Ie)=>{const ye=Math.max(0,le-G),at=G+ye,Ce=o+1,ft=z.width-ye,vt=r-o-1;if(v.length>0){let Fe=!1;for(let Ve=0;Ve<v.length;Ve++){const Je=v[Ve];if(yi(at,Ce,ft,vt,Je.x,Je.y,Je.width,Je.height)){Fe=!0;break}}if(!Fe)return}const Be=()=>{e.save(),e.beginPath(),e.rect(at,Ce,ft,vt),e.clip()},ne=I.columns.hasIndex(z.sourceIndex),ie=h(z.group??"").overrideTheme,be=z.themeOverride===void 0&&ie===void 0?T:mr(T,ie,z.themeOverride),ue=be.baseFontFull;ue!==q&&(q=ue,e.font=ue),Be();let ve;return za(Ie,re,r,s,c,w,y,V,(Fe,Ve,Je,Se,Ze)=>{if(Ve<0||(ae[0]=z.sourceIndex,ae[1]=Ve,x!==void 0&&!x.has(ae)))return;if(v.length>0){let De=!1;for(let et=0;et<v.length;et++){const bt=v[et];if(yi(G,Fe,z.width,Je,bt.x,bt.y,bt.width,bt.height)){De=!0;break}}if(!De)return}const Ee=I.rows.hasIndex(Ve),Me=f.hasIndex(Ve),Oe=Ve<s?u(ae):Rv;let ut=G,Qe=z.width,Ue=!1,wt=!1;if(Oe.span!==void 0){const[De,et]=Oe.span,bt=`${Ve},${De},${et},${z.sticky}`;if(oe===void 0&&(oe=new Set),oe.has(bt)){ce--;return}else{const Tn=hh(Oe.span,G,Fe,z.width,Je,z,n),ln=z.sticky?Tn[0]:Tn[1];if(!z.sticky&&Tn[0]!==void 0&&(wt=!0),ln!==void 0){ut=ln.x,Qe=ln.width,oe.add(bt),e.restore(),ve=void 0,e.save(),e.beginPath();const sn=Math.max(0,le-ln.x);e.rect(ln.x+sn,Fe,ln.width-sn,Je),he===void 0&&(he=[]),he.push({x:ln.x+sn,y:Fe,width:ln.width-sn,height:Je}),e.clip(),Ue=!0}}}const gt=g?.(Ve),Tt=Ze&&z.trailingRowOptions?.themeOverride!==void 0?z.trailingRowOptions?.themeOverride:void 0,Ot=Oe.themeOverride===void 0&>===void 0&&Tt===void 0?be:mr(be,gt,Tt,Oe.themeOverride);e.beginPath();const an=y0(ae,Oe,I);let qt=w0(ae,Oe,I,m);const In=Oe.span!==void 0&&I.columns.some(De=>Oe.span!==void 0&&De>=Oe.span[0]&&De<=Oe.span[1]);an&&!p&&m?qt=0:an&&m&&(qt=Math.max(qt,1)),In&&qt++,an||(Ee&&qt++,ne&&!Ze&&qt++);const Mt=Oe.kind===Y.Protected?Ot.bgCellMedium:Ot.bgCell;let dt;if((Se||Mt!==T.bgCell)&&(dt=Vn(Mt,dt)),qt>0||Me){Me&&(dt=Vn(Ot.bgHeader,dt));for(let De=0;De<qt;De++)dt=Vn(Ot.accentLight,dt)}else if(O!==void 0){for(const De of O)if(De[0]===z.sourceIndex&&De[1]===Ve){dt=Vn(Ot.bgSearchResult,dt);break}}if(M!==void 0)for(let De=0;De<M.length;De++){const et=M[De],bt=et.range;et.style!=="solid-outline"&&bt.x<=z.sourceIndex&&z.sourceIndex<bt.x+bt.width&&bt.y<=Ve&&Ve<bt.y+bt.height&&(dt=Vn(et.color,dt))}let En=!1;if(x!==void 0){const De=Fe+1,et=(Se?De+Je-1:Math.min(De+Je-1,r-fe))-De;(et!==Je-1||ut+1<=le)&&(En=!0,e.save(),e.beginPath(),e.rect(ut+1,De,Qe-1,et),e.clip()),dt=dt===void 0?Ot.bgCell:Vn(dt,Ot.bgCell)}const mt=z.sourceIndex===n.length-1,Zt=Ve===s-1;dt!==void 0&&(e.fillStyle=dt,ve!==void 0&&(ve.fillStyle=dt),x!==void 0?e.fillRect(ut+1,Fe+1,Qe-(mt?2:1),Je-(Zt?2:1)):e.fillRect(ut,Fe,Qe,Je)),Oe.style==="faded"&&(e.globalAlpha=.6);let kn;for(let De=0;De<k.length;De++){const et=k[De];if(et.item[0]===z.sourceIndex&&et.item[1]===Ve){kn=et;break}}if(Qe>Z&&!wt){const De=Ot.baseFontFull;De!==q&&(e.font=De,q=De),ve=ph(e,Oe,z.sourceIndex,Ve,mt,Zt,ut,Fe,Qe,Je,qt>0,Ot,dt??Ot.bgCell,P,S,kn?.hoverAmount??0,H,R,te,E,ve,D,C,J,W)}return En&&e.restore(),Oe.style==="faded"&&(e.globalAlpha=1),ce--,Ue&&(e.restore(),ve?.deprep?.(ge),ve=void 0,Be(),q=ue,e.font=ue),ce<=0}),e.restore(),ce<=0}),he}const ni=[0,0],ri={x:0,y:0,width:0,height:0},yl=[void 0,()=>{}];let Ul=!1;function Iv(){Ul=!0}function ph(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v,x,I,O,M,P,S){let k,H;w!==void 0&&w[0][0]===n&&w[0][1]===r&&(k=w[1][0],H=w[1][1]);let E;ni[0]=n,ni[1]=r,ri.x=a,ri.y=l,ri.width=s,ri.height=c,yl[0]=M.getValue(ni),yl[1]=C=>M.setValue(ni,C),Ul=!1;const R={ctx:e,theme:h,col:n,row:r,cell:t,rect:ri,highlighted:u,cellFillColor:g,hoverAmount:m,frameTime:v,hoverX:k,drawState:yl,hoverY:H,imageLoader:f,spriteManager:p,hyperWrapping:y,overrideCursor:k!==void 0?S:void 0,requestAnimationFrame:Iv},T=R0(R,t.lastUpdated,v,I,o,i),D=P(t);if(D!==void 0){I?.renderer!==D&&(I?.deprep?.(R),I=void 0);const C=D.drawPrep?.(R,I);x!==void 0&&!Mo(R.cell)?x(R,()=>D.draw(R,t)):D.draw(R,t),E=C===void 0?void 0:{deprep:C?.deprep,fillStyle:C?.fillStyle,font:C?.font,renderer:D}}return(T||Ul)&&O?.(ni),E}function ks(e,t,n,r,o,i,a,l,s=-20,c=-20,u=void 0,h="center",g="square"){const f=Math.floor(o+a/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=Fd(u??t.checkboxMaxSize,a,t.cellVerticalPadding),w=m/2;const y=Ad(h,r,i,t.cellHorizontalPadding,m),v=Ld(y,f,m),x=Vd(r+s,o+c,v);switch(n){case!0:{e.beginPath(),Jn(e,y-m/2,f-m/2,m,m,p),g==="circle"&&(w*=.8,m*=.8),e.fillStyle=l?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(y-w+m/4.23,f-w+m/1.97),e.lineTo(y-w+m/2.42,f-w+m/1.44),e.lineTo(y-w+m/1.29,f-w+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case fa:case!1:{e.beginPath(),Jn(e,y-m/2+.5,f-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case is:{e.beginPath(),Jn(e,y-m/2,f-m/2,m,m,p),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(w*=.8,m*=.8),e.beginPath(),e.moveTo(y-m/3,f),e.lineTo(y+m/3,f),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:mi()}}function Ev(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v){const x=a+l;if(x<=0)return;e.fillStyle=h.bgHeader,e.fillRect(0,0,o,x);const I=r?.[0]?.[0],O=r?.[0]?.[1],M=r?.[1]?.[0],P=r?.[1]?.[1],S=h.headerFontFull;e.font=S,Pr(t,0,i,0,x,(k,H,E,R)=>{if(w!==void 0&&!w.has([k.sourceIndex,-1]))return;const T=Math.max(0,R-H);e.save(),e.beginPath(),e.rect(H+T,l,k.width-T,a),e.clip();const D=m(k.group??"").overrideTheme,C=k.themeOverride===void 0&&D===void 0?h:mr(h,D,k.themeOverride);C.bgHeader!==h.bgHeader&&(e.fillStyle=C.bgHeader,e.fill()),C!==h&&(e.font=C.headerFontFull);const J=u.columns.hasIndex(k.sourceIndex),W=s!==void 0||c||k.headerRowMarkerDisabled===!0,Z=!W&&O===-1&&I===k.sourceIndex,ce=W?0:f.find(fe=>fe.item[0]===k.sourceIndex&&fe.item[1]===-1)?.hoverAmount??0,te=u?.current!==void 0&&u.current.cell[0]===k.sourceIndex,q=J?C.accentColor:te?C.bgHeaderHasFocus:C.bgHeader,ge=n?l:0,ae=k.sourceIndex===0?0:1;J?(e.fillStyle=q,e.fillRect(H+ae,ge,k.width-ae,a)):(te||ce>0)&&(e.beginPath(),e.rect(H+ae,ge,k.width-ae,a),te&&(e.fillStyle=C.bgHeaderHasFocus,e.fill()),ce>0&&(e.globalAlpha=ce,e.fillStyle=C.bgHeaderHovered,e.fill(),e.globalAlpha=1)),vh(e,H,ge,k.width,a,k,J,C,Z,Z?M:void 0,Z?P:void 0,te,ce,g,y,v),e.restore()}),n&&Tv(e,t,o,i,l,r,h,g,f,p,m,w)}function Tv(e,t,n,r,o,i,a,l,s,c,u,h){const[g,f]=i?.[0]??[];let p=0;dh(t,n,r,o,(m,w,y,v,x,I)=>{if(h!==void 0&&!h.hasItemInRectangle({x:m[0],y:-2,width:m[1]-m[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(y,v,x,I),e.clip();const O=u(w),M=O?.overrideTheme===void 0?a:mr(a,O.overrideTheme),P=f===-2&&g!==void 0&&g>=m[0]&&g<=m[1],S=P?M.bgGroupHeaderHovered??M.bgHeaderHovered:M.bgGroupHeader??M.bgHeader;if(S!==a.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=M.textGroupHeader??M.textHeader,O!==void 0){let k=y;if(O.icon!==void 0&&(l.drawSprite(O.icon,"normal",e,k+8,(o-20)/2,20,M),k+=26),e.fillText(O.name,k+8,o/2+er(e,a.headerFontFull)),O.actions!==void 0&&P){const H=gh({x:y,y:v,width:x,height:I},O.actions);e.beginPath();const E=H[0].x-10,R=y+x-E;e.rect(E,0,R,o);const T=e.createLinearGradient(E,0,E+R,0),D=Zr(S,0);T.addColorStop(0,D),T.addColorStop(10/R,S),T.addColorStop(1,S),e.fillStyle=T,e.fill(),e.globalAlpha=.6;const[C,J]=i?.[1]??[-1,-1];for(let W=0;W<O.actions.length;W++){const Z=O.actions[W],ce=H[W],te=Xr(ce,C+y,J);te&&(e.globalAlpha=1),l.drawSprite(Z.icon,"normal",e,ce.x+ce.width/2-10,ce.y+ce.height/2-10,20,M),te&&(e.globalAlpha=.6)}e.globalAlpha=1}}y!==0&&c(m[0])&&(e.beginPath(),e.moveTo(y+.5,0),e.lineTo(y+.5,o),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=y+x}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,o),e.moveTo(0,o+.5),e.lineTo(n,o+.5),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()}const Zi=30;function Ov(e,t,n,r,o){return{x:e+n-Zi,y:Math.max(t,t+r/2-Zi/2),width:Zi,height:Math.min(Zi,r)}}function gh(e,t){const n=[];let r=e.x+e.width-26*t.length;const o=e.y+e.height/2-13,i=26,a=26;for(let l=0;l<t.length;l++)n.push({x:r,y:o,width:a,height:i}),r+=26;return n}function oi(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function mh(e,t,n,r,o,i,a,l){const s=a.cellHorizontalPadding,c=a.headerIconSize,u=Ov(n,r,o,i);let h=n+s;const g=t.icon===void 0?void 0:{x:h,y:r+(i-c)/2,width:c,height:c},f=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(h+=Math.ceil(c*1.3));const p={x:h,y:r,width:o-h,height:i};let m;if(t.indicatorIcon!==void 0){const y=e===void 0?eh(t.title,a.headerFontFull)?.width??0:Dr(t.title,e,a.headerFontFull).width;p.width=y,h+=y+s,m={x:h,y:r+(i-c)/2,width:c,height:c}}const w=n+o/2;return{menuBounds:oi(u,w,l),iconBounds:oi(g,w,l),iconOverlayBounds:oi(f,w,l),textBounds:oi(p,w,l),indicatorIconBounds:oi(m,w,l)}}function nu(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const v=i.rowMarkerChecked;v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=h);const x=i.headerRowMarkerTheme!==void 0?mr(l,i.headerRowMarkerTheme):l;ks(e,x,v,t,n,r,o,!1,void 0,void 0,l.checkboxMaxSize,"center",i.rowMarker),v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const w=a?l.textHeaderSelected:l.textHeader,y=i.hasMenu===!0&&(s||f&&a)&&m.menuBounds!==void 0;if(i.icon!==void 0&&m.iconBounds!==void 0){let v=a?"selected":"normal";i.style==="highlight"&&(v=a?"selected":"special"),g.drawSprite(i.icon,v,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,l),i.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(i.overlayIcon,a?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,l)}if(y&&r>35){const v=p?35:r-35,x=p?35*.7:r-35*.7,I=v/r,O=x/r,M=e.createLinearGradient(t,0,t+r,0),P=Zr(w,0);M.addColorStop(p?1:0,w),M.addColorStop(I,w),M.addColorStop(O,P),M.addColorStop(p?0:1,P),e.fillStyle=M}else e.fillStyle=w;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+o/2+er(e,l.headerFontFull)),p&&(e.textAlign="left"),i.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!y||!yi(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let v=a?"selected":"normal";i.style==="highlight"&&(v=a?"selected":"special"),g.drawSprite(i.indicatorIcon,v,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,l)}if(y&&m.menuBounds!==void 0){const v=m.menuBounds,x=c!==void 0&&u!==void 0&&Xr(v,c+t,u+n);if(x||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===pa.Triangle){e.beginPath();const I=v.x+v.width/2-5.5,O=v.y+v.height/2-3;O0(e,[{x:I,y:O},{x:I+11,y:O},{x:I+5.5,y:O+6}],1),e.fillStyle=w,e.fill()}else if(i.menuIcon===pa.Dots){e.beginPath();const I=v.x+v.width/2,O=v.y+v.height/2;T0(e,I,O),e.fillStyle=w,e.fill()}else{const I=v.x+(v.width-l.headerIconSize)/2,O=v.y+(v.height-l.headerIconSize)/2;g.drawSprite(i.menuIcon,"normal",e,I,O,l.headerIconSize,l)}x||(e.globalAlpha=1)}}function vh(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m){const w=cs(i.title)==="rtl",y=mh(e,i,t,n,r,o,l,w);p!==void 0?p({ctx:e,theme:l,rect:{x:t,y:n,width:r,height:o},column:i,columnIndex:i.sourceIndex,isSelected:a,hoverAmount:g,isHovered:s,hasSelectedCell:h,spriteManager:f,menuBounds:y?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:c,hoverY:u},()=>nu(e,t,n,r,o,i,a,l,s,c,u,g,f,m,w,y)):nu(e,t,n,r,o,i,a,l,s,c,u,g,f,m,w,y)}function Dv(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v){if(y!==void 0||t[t.length-1]!==n[t.length-1])return;const x=uh(w);Pr(t,s,a,l,i,(I,O,M,P,S)=>{if(I!==t[t.length-1])return;O+=I.width;const k=Math.max(O,P);k>r||(e.save(),e.beginPath(),e.rect(k,i+1,1e4,o-i-1),e.clip(),za(S,M,o,c,u,p,m,x,(H,E,R,T)=>{if(!T&&w.length>0&&!w.some(Z=>yi(O,H,1e4,R,Z.x,Z.y,Z.width,Z.height)))return;const D=g.hasIndex(E),C=f.hasIndex(E);e.beginPath();const J=h?.(E),W=J===void 0?v:mr(v,J);W.bgCell!==v.bgCell&&(e.fillStyle=W.bgCell,e.fillRect(O,H,1e4,R)),C&&(e.fillStyle=W.bgHeader,e.fillRect(O,H,1e4,R)),D&&(e.fillStyle=W.accentLight,e.fillRect(O,H,1e4,R))}),e.restore())})}function Pv(e,t,n,r,o,i,a,l,s){let c=!1;for(const p of t)if(!p.sticky){c=a(p.sourceIndex);break}const u=s.horizontalBorderColor??s.borderColor,h=s.borderColor,g=c?Do(t):0;let f;if(g!==0&&(f=jc(h,s.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=f,e.stroke()),o>0){const p=h===u&&f!==void 0?f:jc(u,s.bgCell),m=eo(i,o,l);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const bh=(e,t,n)=>{let r=0,o=t,i=0,a=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(const l of e)r=Math.min(r,l.x-1),o=Math.max(o,l.x+l.width+1),i=Math.min(i,l.y-1),a=Math.max(a,l.y+l.height+1)}return{minX:r,maxX:o,minY:i,maxY:a}};function Hv(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p){const m=p.bgCell,{minX:w,maxX:y,minY:v,maxY:x}=bh(l,i,a),I=[],O=a-eo(f,g,c);let M=s,P=n,S=0;for(;M+o<O;){const R=M+o,T=c(P);if(R>=v&&R<=x-1){const D=u?.(P)?.bgCell;D!==void 0&&D!==m&&P>=f-g&&I.push({x:w,y:R,w:y-w,h:T,color:D})}M+=T,P<f-g&&(S=M),P++}let k=0;const H=Math.min(O,x)-S;if(H>0)for(let R=0;R<t.length;R++){const T=t[R];if(T.width===0)continue;const D=T.sticky?k:k+r,C=T.themeOverride?.bgCell;C!==void 0&&C!==m&&D>=w&&D<=y&&h(R+1)&&I.push({x:D,y:S,w:T.width,h:H,color:C}),k+=T.width}if(I.length===0)return;let E;e.beginPath();for(let R=I.length-1;R>=0;R--){const T=I[R];E===void 0?E=T.color:T.color!==E&&(e.fillStyle=E,e.fill(),e.beginPath(),E=T.color),e.rect(T.x,T.y,T.w,T.h)}E!==void 0&&(e.fillStyle=E,e.fill()),e.beginPath()}function ru(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,a);for(const R of s)e.rect(R.x+1,R.y+1,R.width-1,R.height-1);e.clip("evenodd")}const v=w.horizontalBorderColor??w.borderColor,x=w.borderColor,{minX:I,maxX:O,minY:M,maxY:P}=bh(l,i,a),S=[];e.beginPath();let k=.5;for(let R=0;R<t.length;R++){const T=t[R];if(T.width===0)continue;k+=T.width;const D=T.sticky?k:k+r;D>=I&&D<=O&&f(R+1)&&S.push({x1:D,y1:Math.max(c,M),x2:D,y2:Math.min(a,P),color:x})}let H=a+.5;for(let R=m-p;R<m;R++){const T=h(R);H-=T,S.push({x1:I,y1:H,x2:O,y2:H,color:v})}if(y!==!0){let R=u+.5,T=n;const D=H;for(;R+o<D;){const C=R+o;if(C>=M&&C<=P-1){const J=g?.(T);S.push({x1:I,y1:C,x2:O,y2:C,color:J?.horizontalBorderColor??J?.borderColor??v})}R+=h(T),T++}}const E=Kp(S,R=>R.color);for(const R of Object.keys(E)){e.strokeStyle=R;for(const T of E[R])e.moveTo(T.x1,T.y1),e.lineTo(T.x2,T.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function zv(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v){const x=[];e.imageSmoothingEnabled=!1;const I=Math.min(o.cellYOffset,a),O=Math.max(o.cellYOffset,a);let M=0;if(typeof y=="number")M+=(O-I)*y;else for(let D=I;D<O;D++)M+=y(D);a>o.cellYOffset&&(M=-M),M+=s-o.translateY;const P=Math.min(o.cellXOffset,i),S=Math.max(o.cellXOffset,i);let k=0;for(let D=P;D<S;D++)k+=m[D].width;i>o.cellXOffset&&(k=-k),k+=l-o.translateX;const H=Do(w);if(k!==0&&M!==0)return{regions:[]};const E=c>0?eo(g,c,y):0,R=u-H-Math.abs(k),T=h-f-E-Math.abs(M)-1;if(R>150&&T>150){const D={sx:0,sy:0,sw:u*p,sh:h*p,dx:0,dy:0,dw:u*p,dh:h*p};if(M>0?(D.sy=(f+1)*p,D.sh=T*p,D.dy=(M+f+1)*p,D.dh=T*p,x.push({x:0,y:f,width:u,height:M+1})):M<0&&(D.sy=(-M+f+1)*p,D.sh=T*p,D.dy=(f+1)*p,D.dh=T*p,x.push({x:0,y:h+M-E,width:u,height:-M+E})),k>0?(D.sx=H*p,D.sw=R*p,D.dx=(k+H)*p,D.dw=R*p,x.push({x:H-1,y:0,width:k+2,height:h})):k<0&&(D.sx=(H-k)*p,D.sw=R*p,D.dx=H*p,D.dw=R*p,x.push({x:u+k,y:0,width:-k,height:h})),e.setTransform(1,0,0,1,0,0),v){if(H>0&&k!==0&&M===0&&(r===void 0||n?.[1]!==!1)){const C=H*p,J=h*p;e.drawImage(t,0,0,C,J,0,0,C,J)}if(E>0&&k===0&&M!==0&&(r===void 0||n?.[0]!==!1)){const C=(h-E)*p,J=u*p,W=E*p;e.drawImage(t,0,C,J,W,0,C,J,W)}}e.drawImage(t,D.sx,D.sy,D.sw,D.sh,D.dx,D.dy,D.dw,D.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:x}}function Lv(e,t,n,r,o,i,a,l,s,c){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||o!==e.translateY||Pr(s,n,r,o,l,(h,g,f,p)=>{if(h.sourceIndex===c){const m=Math.max(g,p)+1;return u.push({x:m,y:0,width:i-m,height:a}),!0}}),u}function Av(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const o=e.mappedColumns[r],i=t.mappedColumns[r];if(Oo(o,i))continue;if(n!==void 0||o.width===i.width)return!1;const{width:a,...l}=o,{width:s,...c}=i;if(!Oo(l,c))return!1;n=r}return n===void 0?!0:n}return!0}function ou(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m){const w=p?.filter(P=>P.style!=="no-outline");if(w===void 0||w.length===0)return;const y=Do(l),v=eo(f,g,h),x=[s,0,l.length,f-g],I=[y,0,t,n-v],O=w.map(P=>{const S=P.range,k=P.style??"dashed";return Mv(S,x,t,n,I).map(H=>{const E=H.rect,R=jl(E.x,E.y,t,n,u,c+u,r,o,i,a,f,s,g,l,h),T=E.width===1&&E.height===1?R:jl(E.x+E.width-1,E.y+E.height-1,t,n,u,c+u,r,o,i,a,f,s,g,l,h);return E.x+E.width>=l.length&&(T.width-=1),E.y+E.height>=f&&(T.height-=1),{color:P.color,style:k,clip:H.clip,rect:Sv({x:R.x,y:R.y,width:T.x+T.width-R.x,height:T.y+T.height-R.y},t,n,8)}})}),M=()=>{e.lineWidth=1;let P=!1;for(const S of O)for(const k of S)if(k?.rect!==void 0&&yi(0,0,t,n,k.rect.x,k.rect.y,k.rect.width,k.rect.height)){const H=P,E=!Cv(k.clip,k.rect);e.beginPath(),E&&(e.save(),e.rect(k.clip.x,k.clip.y,k.clip.width,k.clip.height),e.clip()),k.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(k.style==="solid"||k.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=k.style==="solid-outline"?Vn(Vn(k.color,m.borderColor),m.bgCell):Zr(k.color,1),e.closePath(),e.strokeRect(k.rect.x+.5,k.rect.y+.5,k.rect.width-1,k.rect.height-1),E&&(e.restore(),P=H)}P&&e.setLineDash([])};return M(),M}function iu(e,t,n,r,o){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=o,e.stroke(),e.globalAlpha=1}function wl(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w){if(u.current===void 0)return;const y=m!==!1&&m!==void 0;if(!y)return;const v=typeof m=="object"?{...ga,...m}:ga,x=u.current.range,I=u.current.cell,O=[x.x+x.width-1,x.y+x.height-1];if(I[1]>=w&&O[1]>=w||!a.some(C=>C.sourceIndex===I[0]||C.sourceIndex===O[0]))return;const[M,P]=u.current.cell,S=g(u.current.cell),k=S.span??[M,M],H=P>=w-f,E=f>0&&!H?eo(w,f,h)-1:0,R=O[1];let T;if(Pr(a,r,o,i,c,(C,J,W,Z,ce)=>{if(C.sticky&&M>C.sourceIndex)return;const te=C.sourceIndex<k[0],q=C.sourceIndex>k[1],ge=C.sourceIndex===O[0];if(!(!ge&&(te||q)))return za(ce,W,n,w,h,f,p,void 0,(ae,fe,he)=>{if(fe!==P&&fe!==R)return;let oe=J,V=C.width;if(S.span!==void 0){const z=hh(S.span,J,ae,C.width,he,C,l),G=C.sticky?z[0]:z[1];G!==void 0&&(oe=G.x,V=G.width)}return fe===R&&ge&&y&&(T=()=>{Z>oe&&!C.sticky&&(e.beginPath(),e.rect(Z,0,t-Z,n),e.clip());const z=v.size,G=z/2,re=oe+V+v.offsetX-G+.5,le=ae+he+v.offsetY-G+.5;e.beginPath(),v.shape==="circle"?e.arc(re+G,le+G,G,0,Math.PI*2):e.rect(re,le,z,z),e.fillStyle=C.themeOverride?.accentColor??s.accentColor,e.fill(),v.outline>0&&(e.lineWidth=v.outline,e.strokeStyle=s.bgCell,v.shape==="circle"?(e.beginPath(),e.arc(re+G,le+G,G+v.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(re-v.outline/2,le-v.outline/2,z+v.outline,z+v.outline))}),T!==void 0}),T!==void 0}),T===void 0)return;const D=()=>{e.save(),e.beginPath(),e.rect(0,c,t,n-c-E),e.clip(),T?.(),e.restore()};return D(),D}function Fv(e,t,n,r,o,i,a,l,s){s===void 0||s.size===0||(e.beginPath(),dh(t,n,i,r,(c,u,h,g,f,p)=>{s.hasItemInRectangle({x:c[0],y:-2,width:c[1]-c[0]+1,height:1})&&e.rect(h,g,f,p)}),Pr(t,l,i,a,o,(c,u,h,g)=>{const f=Math.max(0,g-u),p=u+f+1,m=c.width-f-1;s.has([c.sourceIndex,-1])&&e.rect(p,r,m,o-r)}),e.clip())}function Vv(e,t,n,r,o,i,a,l,s,c){let u=0;return Pr(e,i,r,o,n,(h,g,f,p,m)=>(za(m,f,t,a,l,s,c,void 0,(w,y,v,x)=>{x||(u=Math.max(y,u))}),!0)),u}function au(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:o,height:i,cellXOffset:a,cellYOffset:l,translateX:s,translateY:c,mappedColumns:u,enableGroups:h,freezeColumns:g,dragAndDropState:f,theme:p,drawFocus:m,headerHeight:w,groupHeaderHeight:y,disabledRows:v,rowHeight:x,verticalBorder:I,overrideCursor:O,isResizing:M,selection:P,fillHandle:S,freezeTrailingRows:k,rows:H,getCellContent:E,getGroupDetails:R,getRowThemeOverride:T,isFocused:D,drawHeaderCallback:C,prelightCells:J,drawCellCallback:W,highlightRegions:Z,resizeCol:ce,imageLoader:te,lastBlitData:q,hoverValues:ge,hyperWrapping:ae,hoverInfo:fe,spriteManager:he,maxScaleFactor:oe,hasAppendRow:V,touchMode:z,enqueue:G,renderStateProvider:re,getCellRenderer:le,renderStrategy:Ie,bufferACtx:ye,bufferBCtx:at,damage:Ce,minimumCellWidth:ft,resizeIndicator:vt}=e;if(o===0||i===0)return;const Be=Ie==="double-buffer",ne=Math.min(oe,Math.ceil(window.devicePixelRatio??1)),ie=Ie!=="direct"&&Av(e,t),be=n.canvas;(be.width!==o*ne||be.height!==i*ne)&&(be.width=o*ne,be.height=i*ne,be.style.width=o+"px",be.style.height=i+"px");const ue=r.canvas,ve=h?y+w:w,Fe=ve+1;(ue.width!==o*ne||ue.height!==Fe*ne)&&(ue.width=o*ne,ue.height=Fe*ne,ue.style.width=o+"px",ue.style.height=Fe+"px");const Ve=ye.canvas,Je=at.canvas;Be&&(Ve.width!==o*ne||Ve.height!==i*ne)&&(Ve.width=o*ne,Ve.height=i*ne,q.current!==void 0&&(q.current.aBufferScroll=void 0)),Be&&(Je.width!==o*ne||Je.height!==i*ne)&&(Je.width=o*ne,Je.height=i*ne,q.current!==void 0&&(q.current.bBufferScroll=void 0));const Se=q.current;if(ie===!0&&a===Se?.cellXOffset&&l===Se?.cellYOffset&&s===Se?.translateX&&c===Se?.translateY)return;let Ze=null;Be&&(Ze=n);const Ee=r;let Me;Be?Ce!==void 0?Me=Se?.lastBuffer==="b"?at:ye:Me=Se?.lastBuffer==="b"?ye:at:Me=n;const Oe=Me.canvas,ut=Be?Oe===Ve?Je:Ve:be,Qe=typeof x=="number"?()=>x:x;Ee.save(),Me.save(),Ee.beginPath(),Me.beginPath(),Ee.textBaseline="middle",Me.textBaseline="middle",ne!==1&&(Ee.scale(ne,ne),Me.scale(ne,ne));const Ue=Wl(u,a,o,f,s);let wt=[];const gt=m&&P.current?.cell[1]===l&&c===0;let Tt=!1;if(Z!==void 0){for(const mt of Z)if(mt.style!=="no-outline"&&mt.range.y===l&&c===0){Tt=!0;break}}const Ot=()=>{Ev(Ee,Ue,h,fe,o,s,w,y,f,M,P,p,he,ge,I,R,Ce,C,z),ru(Ee,Ue,l,s,c,o,i,void 0,void 0,y,ve,Qe,T,I,k,H,p,!0),Ee.beginPath(),Ee.moveTo(0,Fe-.5),Ee.lineTo(o,Fe-.5),Ee.strokeStyle=Vn(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),Ee.stroke(),Tt&&ou(Ee,o,i,a,l,s,c,u,g,w,y,x,k,H,Z,p),gt&&wl(Ee,o,i,l,s,c,Ue,u,p,ve,P,Qe,E,k,V,S,H)};if(Ce!==void 0){const mt=Ue[Ue.length-1].sourceIndex+1,Zt=Ce.hasItemInRegion([{x:a,y:-2,width:mt,height:2},{x:a,y:l,width:mt,height:300},{x:0,y:l,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:a,y:H-k,width:mt,height:k,when:k>0}]),kn=De=>{tu(De,Ue,u,i,ve,s,c,l,H,Qe,E,R,T,v,D,m,k,V,wt,Ce,P,J,Z,te,he,ge,fe,W,ae,p,G,re,le,O,ft);const et=P.current;S!==!1&&S!==void 0&&m&&et!==void 0&&Ce.has(Yd(et.range))&&wl(De,o,i,l,s,c,Ue,u,p,ve,P,Qe,E,k,V,S,H)};Zt&&(kn(Me),Ze!==null&&(Ze.save(),Ze.scale(ne,ne),Ze.textBaseline="middle",kn(Ze),Ze.restore()),Ce.hasHeader()&&(Fv(Ee,Ue,o,y,ve,s,c,l,Ce),Ot())),Me.restore(),Ee.restore();return}if((ie!==!0||a!==Se?.cellXOffset||s!==Se?.translateX||gt!==Se?.mustDrawFocusOnHeader||Tt!==Se?.mustDrawHighlightRingsOnHeader)&&Ot(),ie===!0){Fn(ut!==void 0&&Se!==void 0);const{regions:mt}=zv(Me,ut,ut===Ve?Se.aBufferScroll:Se.bBufferScroll,ut===Ve?Se.bBufferScroll:Se.aBufferScroll,Se,a,l,s,c,k,o,i,H,ve,ne,u,Ue,x,Be);wt=mt}else ie!==!1&&(Fn(Se!==void 0),wt=Lv(Se,a,l,s,c,o,i,ve,Ue,ie));Pv(Me,Ue,o,i,k,H,I,Qe,p);const an=ou(Me,o,i,a,l,s,c,u,g,w,y,x,k,H,Z,p),qt=m?wl(Me,o,i,l,s,c,Ue,u,p,ve,P,Qe,E,k,V,S,H):void 0;if(Me.fillStyle=p.bgCell,wt.length>0){Me.beginPath();for(const mt of wt)Me.rect(mt.x,mt.y,mt.width,mt.height);Me.clip(),Me.fill(),Me.beginPath()}else Me.fillRect(0,0,o,i);const In=tu(Me,Ue,u,i,ve,s,c,l,H,Qe,E,R,T,v,D,m,k,V,wt,Ce,P,J,Z,te,he,ge,fe,W,ae,p,G,re,le,O,ft);Dv(Me,Ue,u,o,i,ve,s,c,l,H,Qe,T,P.rows,v,k,V,wt,Ce,p),Hv(Me,Ue,l,s,c,o,i,wt,ve,Qe,T,I,k,H,p),ru(Me,Ue,l,s,c,o,i,wt,In,y,ve,Qe,T,I,k,H,p),an?.(),qt?.(),M&&vt!=="none"&&Pr(Ue,0,s,0,ve,(mt,Zt)=>mt.sourceIndex===ce?(iu(Ee,Zt+mt.width,0,ve+1,Vn(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),vt==="full"&&iu(Me,Zt+mt.width,ve,i,Vn(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),Ze!==null&&(Ze.fillStyle=p.bgCell,Ze.fillRect(0,0,o,i),Ze.drawImage(Me.canvas,0,0));const Mt=Vv(Ue,i,ve,s,c,l,H,Qe,k,V);te?.setWindow({x:a,y:l,width:Ue.length,height:Mt-l},g,Array.from({length:k},(mt,Zt)=>H-1-Zt));const dt=Se!==void 0&&(a!==Se.cellXOffset||s!==Se.translateX),En=Se!==void 0&&(l!==Se.cellYOffset||c!==Se.translateY);q.current={cellXOffset:a,cellYOffset:l,translateX:s,translateY:c,mustDrawFocusOnHeader:gt,mustDrawHighlightRingsOnHeader:Tt,lastBuffer:Be?Oe===Ve?"a":"b":void 0,aBufferScroll:Oe===Ve?[dt,En]:Se?.aBufferScroll,bBufferScroll:Oe===Je?[dt,En]:Se?.bBufferScroll},Me.restore(),Ee.restore()}const _v=80;function $v(e){const t=e-1;return t*t*t+1}class Bv{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(n=>fi(n.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>fi(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),n?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)};shouldStep=()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n};getAnimatingItems=()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:$v(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const n=(t-this.lastAnimationTime)/_v;for(const o of this.leavingItems)o.hoverAmount=Wn(o.hoverAmount-n,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Wn(this.currentHoveredItem.hoverAmount+n,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!fi(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class Nv{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Cs(e){return new Nv(e)}const Wv=Cs(()=>window.navigator.userAgent.includes("Firefox")),ya=Cs(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),wa=Cs(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function jv(e){const t=d.useRef([]),n=d.useRef(0),r=d.useRef(e);r.current=e;const o=d.useCallback(()=>{const i=()=>window.requestAnimationFrame(a),a=()=>{const l=t.current.map(xs);t.current=[],r.current(new gi(l)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:a)},[]);return d.useCallback(i=>{t.current.length===0&&o();const a=Yn(i[0],i[1]);t.current.includes(a)||t.current.push(a)},[o])}const Ir="header",Zn="group-header",xa="out-of-bounds";var Io;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Io||(Io={}));function yh(e,t){return e===t?!0:e?.kind==="out-of-bounds"?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}const Gv=(e,t)=>e.kind===Y.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",Uv=(e,t)=>{const{width:n,height:r,accessibilityHeight:o,columns:i,cellXOffset:a,cellYOffset:l,headerHeight:s,fillHandle:c=!1,groupHeaderHeight:u,rowHeight:h,rows:g,getCellContent:f,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:w,enableGroups:y,isFilling:v,onCanvasFocused:x,onCanvasBlur:I,isFocused:O,selection:M,freezeColumns:P,onContextMenu:S,freezeTrailingRows:k,fixedShadowX:H=!0,fixedShadowY:E=!0,drawFocusRing:R,onMouseDown:T,onMouseUp:D,onMouseMoveRaw:C,onMouseMove:J,onItemHovered:W,dragAndDropState:Z,firstColAccessible:ce,onKeyDown:te,onKeyUp:q,highlightRegions:ge,canvasRef:ae,onDragStart:fe,onDragEnd:he,eventTargetRef:oe,isResizing:V,resizeColumn:z,isDragging:G,isDraggable:re=!1,allowResize:le,disabledRows:Ie,hasAppendRow:ye,getGroupDetails:at,theme:Ce,prelightCells:ft,headerIcons:vt,verticalBorder:Be,drawCell:ne,drawHeader:ie,onCellFocused:be,onDragOverCell:ue,onDrop:ve,onDragLeave:Fe,imageWindowLoader:Ve,smoothScrollX:Je=!1,smoothScrollY:Se=!1,experimental:Ze,getCellRenderer:Ee,resizeIndicator:Me="full"}=e,Oe=e.translateX??0,ut=e.translateY??0,Qe=Math.max(P,Math.min(i.length-1,a)),Ue=d.useRef(null),wt=d.useRef(Ze?.eventTarget??window),gt=wt.current,Tt=Ve,Ot=d.useRef(),[an,qt]=d.useState(!1),In=d.useRef([]),Mt=d.useRef(),[dt,En]=d.useState(),[mt,Zt]=d.useState(),kn=d.useRef(null),[De,et]=d.useState(),[bt,Tn]=d.useState(!1),ln=d.useRef(bt);ln.current=bt;const sn=d.useMemo(()=>new xv(vt,()=>{dn.current=void 0,Mn.current()}),[vt]),On=y?u+s:s,Yt=d.useRef(-1),Jt=(Ze?.enableFirefoxRescaling??!1)&&Wv.value,_e=(Ze?.enableSafariRescaling??!1)&&ya.value;d.useLayoutEffect(()=>{window.devicePixelRatio===1||!Jt&&!_e||(Yt.current!==-1&&qt(!0),window.clearTimeout(Yt.current),Yt.current=window.setTimeout(()=>{qt(!1),Yt.current=-1},200))},[l,Qe,Oe,ut,Jt,_e]);const xt=v0(i,P),Dn=d.useMemo(()=>H?Do(xt,Z):0,[xt,Z,H]),Ht=d.useCallback((_,ee,xe)=>{const Re=_.getBoundingClientRect();if(ee>=xt.length||xe>=g)return;const de=Re.width/n,pe=jl(ee,xe,n,r,u,On,Qe,l,Oe,ut,g,P,k,xt,h);return de!==1&&(pe.x*=de,pe.y*=de,pe.width*=de,pe.height*=de),pe.x+=Re.x,pe.y+=Re.y,pe},[n,r,u,On,Qe,l,Oe,ut,g,P,k,xt,h]),ht=d.useCallback((_,ee,xe,Re)=>{const de=_.getBoundingClientRect(),pe=de.width/n,We=(ee-de.left)/pe,ke=(xe-de.top)/pe,Xe=5,pt=Wl(xt,Qe,n,void 0,Oe);let hn=0,Nt=0;const kt=typeof PointerEvent<"u"&&Re instanceof PointerEvent&&Re.pointerType==="mouse"||typeof MouseEvent<"u"&&Re instanceof MouseEvent,lt=typeof PointerEvent<"u"&&Re instanceof PointerEvent&&Re.pointerType==="touch"||typeof TouchEvent<"u"&&Re instanceof TouchEvent;kt&&(hn=Re.button,Nt=Re.buttons);const je=x0(We,pt,Oe),ct=k0(ke,r,y,s,u,g,h,l,ut,k),_t=Re?.shiftKey===!0,so=Re?.ctrlKey===!0,Fr=Re?.metaKey===!0,en=[We<0?-1:n<We?1:0,ke<On?-1:r<ke?1:0];let cn;if(je===-1||ke<0||We<0||ct===void 0||We>n||ke>r){const Lt=We>n?1:We<0?-1:0,Bn=ke>r?1:ke<0?-1:0;let pn=Lt*2,hr=Bn*2;Lt===0&&(pn=je===-1?Io.EndPadding:Io.Center),Bn===0&&(hr=ct===void 0?Io.EndPadding:Io.Center);let fr=!1;if(je===-1&&ct===-1){const tn=Ht(_,xt.length-1,-1);Fn(tn!==void 0),fr=ee<tn.x+tn.width+Xe}const st=We>n&&We<n+_l()||ke>r&&ke<r+_l();cn={kind:xa,location:[je!==-1?je:We<0?0:xt.length-1,ct??g-1],region:[pn,hr],shiftKey:_t,ctrlKey:so,metaKey:Fr,isEdge:fr,isTouch:lt,button:hn,buttons:Nt,scrollEdge:en,isMaybeScrollbar:st}}else if(ct<=-1){let Lt=Ht(_,je,ct);Fn(Lt!==void 0);let Bn=Lt!==void 0&&Lt.x+Lt.width-ee<=Xe;const pn=je-1;ee-Lt.x<=Xe&&pn>=0?(Bn=!0,Lt=Ht(_,pn,ct),Fn(Lt!==void 0),cn={kind:y&&ct===-2?Zn:Ir,location:[pn,ct],bounds:Lt,group:xt[pn].group??"",isEdge:Bn,shiftKey:_t,ctrlKey:so,metaKey:Fr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:hn,buttons:Nt,scrollEdge:en}):cn={kind:y&&ct===-2?Zn:Ir,group:xt[je].group??"",location:[je,ct],bounds:Lt,isEdge:Bn,shiftKey:_t,ctrlKey:so,metaKey:Fr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:hn,buttons:Nt,scrollEdge:en}}else{const Lt=Ht(_,je,ct);Fn(Lt!==void 0);const Bn=Lt!==void 0&&Lt.x+Lt.width-ee<Xe;let pn=!1;if(c!==!1&&c!==void 0&&M.current!==void 0){const hr=typeof c=="object"?{...ga,...c}:ga,fr=hr.size,st=fr/2,tn=Yd(M.current.range),rr=Ht(_,tn[0],tn[1]);if(rr!==void 0){const Pi=rr.x+rr.width+hr.offsetX-st+.5,pr=rr.y+rr.height+hr.offsetY-st+.5;pn=Math.abs(Pi-ee)<fr&&Math.abs(pr-xe)<fr}}cn={kind:"cell",location:[je,ct],bounds:Lt,isEdge:Bn,shiftKey:_t,ctrlKey:so,isFillHandle:pn,metaKey:Fr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:hn,buttons:Nt,scrollEdge:en}}return cn},[n,xt,Qe,Oe,r,y,s,u,g,h,l,ut,k,Ht,c,M,On]),[Cn]=dt??[],ur=d.useRef(()=>{}),_n=d.useRef(dt);_n.current=dt;const[B,$e]=d.useMemo(()=>{const _=document.createElement("canvas"),ee=document.createElement("canvas");return _.style.display="none",_.style.opacity="0",_.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[_.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>{if(!(B===null||$e===null))return document.documentElement.append(B.canvas),document.documentElement.append($e.canvas),()=>{B.canvas.remove(),$e.canvas.remove()}},[B,$e]);const Ne=d.useMemo(()=>new D0,[]),Dt=Jt&&an?1:_e&&an?2:5,Qt=Ze?.disableMinimumCellWidth===!0?1:10,dn=d.useRef(),Sn=d.useRef(null),bn=d.useRef(null),$t=d.useCallback(()=>{const _=Ue.current,ee=kn.current;if(_===null||ee===null||(Sn.current===null&&(Sn.current=_.getContext("2d",{alpha:!1}),_.width=0,_.height=0),bn.current===null&&(bn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),Sn.current===null||bn.current===null||B===null||$e===null))return;let xe=!1;const Re=We=>{xe=!0,et(We)},de=dn.current,pe={headerCanvasCtx:bn.current,canvasCtx:Sn.current,bufferACtx:B,bufferBCtx:$e,width:n,height:r,cellXOffset:Qe,cellYOffset:l,translateX:Math.round(Oe),translateY:Math.round(ut),mappedColumns:xt,enableGroups:y,freezeColumns:P,dragAndDropState:Z,theme:Ce,headerHeight:s,groupHeaderHeight:u,disabledRows:Ie??Ye.empty(),rowHeight:h,verticalBorder:Be,isResizing:V,resizeCol:z,isFocused:O,selection:M,fillHandle:c,drawCellCallback:ne,hasAppendRow:ye,overrideCursor:Re,maxScaleFactor:Dt,freezeTrailingRows:k,rows:g,drawFocus:R,getCellContent:f,getGroupDetails:at??(We=>({name:We})),getRowThemeOverride:p,drawHeaderCallback:ie,prelightCells:ft,highlightRegions:ge,imageLoader:Tt,lastBlitData:Mt,damage:Ot.current,hoverValues:In.current,hoverInfo:_n.current,spriteManager:sn,scrolling:an,hyperWrapping:Ze?.hyperWrapping??!1,touchMode:bt,enqueue:ur.current,renderStateProvider:Ne,renderStrategy:Ze?.renderStrategy??(ya.value?"double-buffer":"single-buffer"),getCellRenderer:Ee,minimumCellWidth:Qt,resizeIndicator:Me};pe.damage===void 0?(dn.current=pe,au(pe,de)):au(pe,void 0),!xe&&(pe.damage===void 0||pe.damage.has(_n?.current?.[0]))&&et(void 0)},[B,$e,n,r,Qe,l,Oe,ut,xt,y,P,Z,Ce,s,u,Ie,h,Be,V,ye,z,O,M,c,k,g,R,Dt,f,at,p,ne,ie,ft,ge,Tt,sn,an,Ze?.hyperWrapping,Ze?.renderStrategy,bt,Ne,Ee,Qt,Me]),Mn=d.useRef($t);d.useLayoutEffect(()=>{$t(),Mn.current=$t},[$t]),d.useLayoutEffect(()=>{(async()=>document?.fonts?.ready!==void 0&&(await document.fonts.ready,dn.current=void 0,Mn.current()))()},[]);const Rn=d.useCallback(_=>{Ot.current=_,Mn.current(),Ot.current=void 0},[]),we=jv(Rn);ur.current=we;const zt=d.useCallback(_=>{Rn(new gi(_.map(ee=>ee.cell)))},[Rn]);Tt.setCallback(Rn);const[Kt,$n]=d.useState(!1),[Xt,jt]=Cn??[],Gt=Xt!==void 0&&jt===-1&&Xt>=0&&Xt<xt.length&&xt[Xt].headerRowMarkerDisabled!==!0,Pn=Xt!==void 0&&jt===-2;let Hn=!1,Ii=!1,Hr=De;if(Hr===void 0&&Xt!==void 0&&jt!==void 0&&jt>-1&&jt<g){const _=f([Xt,jt],!0);Hn=_.kind===jn.NewRow||_.kind===jn.Marker&&_.markerKind!=="number",Ii=_.kind===Y.Boolean&&as(_),Hr=_.cursor}const Ho=G?"grabbing":(mt??!1)||V?"col-resize":Kt||v?"crosshair":Hr!==void 0?Hr:Gt||Hn||Ii||Pn?"pointer":"default",zo=d.useMemo(()=>({contain:"strict",display:"block",cursor:Ho}),[Ho]),Lo=d.useRef("default"),Gn=oe?.current;Gn!=null&&Lo.current!==zo.cursor&&(Gn.style.cursor=Lo.current=zo.cursor);const fn=d.useCallback((_,ee,xe,Re)=>{if(at===void 0)return;const de=at(_);if(de.actions!==void 0){const pe=gh(ee,de.actions);for(const[We,ke]of pe.entries())if(Xr(ke,xe+ee.x,Re+ke.y))return de.actions[We]}},[at]),br=d.useCallback((_,ee,xe,Re)=>{const de=xt[ee];if(!G&&!V&&!(mt??!1)){const pe=Ht(_,ee,-1);Fn(pe!==void 0);const We=mh(void 0,de,pe.x,pe.y,pe.width,pe.height,Ce,cs(de.title)==="rtl");if(de.hasMenu===!0&&We.menuBounds!==void 0&&Xr(We.menuBounds,xe,Re))return{area:"menu",bounds:We.menuBounds};if(de.indicatorIcon!==void 0&&We.indicatorIconBounds!==void 0&&Xr(We.indicatorIconBounds,xe,Re))return{area:"indicator",bounds:We.indicatorIconBounds}}},[xt,Ht,mt,G,V,Ce]),to=d.useRef(0),yr=d.useRef(),no=d.useRef(!1),Ei=d.useCallback(_=>{const ee=Ue.current,xe=oe?.current;if(ee===null||_.target!==ee&&_.target!==xe)return;no.current=!0;const Re=_.clientX,de=_.clientY;if(_.target===xe&&xe!==null){const We=xe.getBoundingClientRect();if(Re>We.right||de>We.bottom)return}const pe=ht(ee,Re,de,_);yr.current=pe.location,pe.isTouch&&(to.current=Date.now()),ln.current!==pe.isTouch&&Tn(pe.isTouch),!(pe.kind===Ir&&br(ee,pe.location[0],Re,de)!==void 0)&&(pe.kind===Zn&&fn(pe.group,pe.bounds,pe.localEventX,pe.localEventY)!==void 0||(T?.(pe),!pe.isTouch&&re!==!0&&re!==pe.kind&&pe.button<3&&pe.button!==1&&_.preventDefault()))},[oe,re,ht,fn,br,T]);xn("pointerdown",Ei,gt,!1);const zr=d.useRef(0),ro=d.useCallback(_=>{const ee=zr.current;zr.current=Date.now();const xe=Ue.current;if(no.current=!1,D===void 0||xe===null)return;const Re=oe?.current,de=_.target!==xe&&_.target!==Re,pe=_.clientX,We=_.clientY,ke=_.pointerType==="mouse"?_.button<3:!0;let Xe=ht(xe,pe,We,_);Xe.isTouch&&to.current!==0&&Date.now()-to.current>500&&(Xe={...Xe,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Xe.isTouch?1e3:500)&&(Xe={...Xe,isDoubleClick:!0}),ln.current!==Xe.isTouch&&Tn(Xe.isTouch),!de&&_.cancelable&&ke&&_.preventDefault();const[pt]=Xe.location,hn=br(xe,pt,pe,We);if(Xe.kind===Ir&&hn!==void 0){(Xe.button!==0||yr.current?.[0]!==pt||yr.current?.[1]!==-1)&&D(Xe,!0);return}else if(Xe.kind===Zn){const Nt=fn(Xe.group,Xe.bounds,Xe.localEventX,Xe.localEventY);if(Nt!==void 0){Xe.button===0&&Nt.onClick(Xe);return}}D(Xe,de)},[D,oe,ht,br,fn]);xn("pointerup",ro,gt,!1);const wr=d.useCallback(_=>{const ee=Ue.current;if(ee===null)return;const xe=oe?.current,Re=_.target!==ee&&_.target!==xe;let de,pe,We=!0;_ instanceof MouseEvent?(de=_.clientX,pe=_.clientY,We=_.button<3):(de=_.changedTouches[0].clientX,pe=_.changedTouches[0].clientY);const ke=ht(ee,de,pe,_);ln.current!==ke.isTouch&&Tn(ke.isTouch),!Re&&_.cancelable&&We&&_.preventDefault();const[Xe]=ke.location;if(ke.kind===Ir){const pt=br(ee,Xe,de,pe);pt!==void 0&&ke.button===0&&yr.current?.[0]===Xe&&yr.current?.[1]===-1&&(pt.area==="menu"?m?.(Xe,pt.bounds):pt.area==="indicator"&&w?.(Xe,pt.bounds))}},[oe,ht,br,m,w]);xn("click",wr,gt,!1);const oo=d.useCallback(_=>{const ee=Ue.current,xe=oe?.current;if(ee===null||_.target!==ee&&_.target!==xe||S===void 0)return;const Re=ht(ee,_.clientX,_.clientY,_);S(Re,()=>{_.cancelable&&_.preventDefault()})},[oe,ht,S]);xn("contextmenu",oo,oe?.current??null,!1);const Ti=d.useCallback(_=>{Ot.current=new gi(_.map(ee=>ee.item)),In.current=_,Mn.current(),Ot.current=void 0},[]),Ao=d.useMemo(()=>new Bv(Ti),[Ti]),Le=d.useRef(Ao);Le.current=Ao,d.useLayoutEffect(()=>{const _=Le.current;if(Cn===void 0||Cn[1]<0){_.setHovered(Cn);return}const ee=f(Cn,!0),xe=Ee(ee),Re=xe===void 0&&ee.kind===Y.Custom||xe?.needsHover!==void 0&&(typeof xe.needsHover=="boolean"?xe.needsHover:xe.needsHover(ee));_.setHovered(Re?Cn:void 0)},[f,Ee,Cn]);const Fo=d.useRef(),Fa=d.useCallback(_=>{const ee=Ue.current;if(ee===null)return;const xe=oe?.current,Re=_.target!==ee&&_.target!==xe,de=ht(ee,_.clientX,_.clientY,_);if(de.kind!=="out-of-bounds"&&Re&&!no.current&&!de.isTouch)return;const pe=(ke,Xe)=>{En(pt=>pt===ke||pt?.[0][0]===ke?.[0][0]&&pt?.[0][1]===ke?.[0][1]&&(pt?.[1][0]===ke?.[1][0]&&pt?.[1][1]===ke?.[1][1]||!Xe)?pt:ke)};if(!yh(de,Fo.current))et(void 0),W?.(de),pe(de.kind===xa?void 0:[de.location,[de.localEventX,de.localEventY]],!0),Fo.current=de;else if(de.kind==="cell"||de.kind===Ir||de.kind===Zn){let ke=!1,Xe=!0;if(de.kind==="cell"){const hn=f(de.location);Xe=Ee(hn)?.needsHoverPosition??hn.kind===Y.Custom,ke=Xe}else ke=!0;const pt=[de.location,[de.localEventX,de.localEventY]];pe(pt,Xe),_n.current=pt,ke&&Rn(new gi([de.location]))}const We=de.location[0]>=(ce?0:1);Zt(de.kind===Ir&&de.isEdge&&We&&le===!0),$n(de.kind==="cell"&&de.isFillHandle),C?.(_),J(de)},[oe,ht,ce,le,C,J,W,f,Ee,Rn]);xn("pointermove",Fa,gt,!0);const Lr=d.useCallback(_=>{const ee=Ue.current;if(ee===null)return;let xe,Re;M.current!==void 0&&(xe=Ht(ee,M.current.cell[0],M.current.cell[1]),Re=M.current.cell),te?.({bounds:xe,stopPropagation:()=>_.stopPropagation(),preventDefault:()=>_.preventDefault(),cancel:()=>{},ctrlKey:_.ctrlKey,metaKey:_.metaKey,shiftKey:_.shiftKey,altKey:_.altKey,key:_.key,keyCode:_.keyCode,rawEvent:_,location:Re})},[te,M,Ht]),Va=d.useCallback(_=>{const ee=Ue.current;if(ee===null)return;let xe,Re;M.current!==void 0&&(xe=Ht(ee,M.current.cell[0],M.current.cell[1]),Re=M.current.cell),q?.({bounds:xe,stopPropagation:()=>_.stopPropagation(),preventDefault:()=>_.preventDefault(),cancel:()=>{},ctrlKey:_.ctrlKey,metaKey:_.metaKey,shiftKey:_.shiftKey,altKey:_.altKey,key:_.key,keyCode:_.keyCode,rawEvent:_,location:Re})},[q,M,Ht]),tr=d.useCallback(_=>{if(Ue.current=_,ae!==void 0&&(ae.current=_),Ze?.eventTarget)wt.current=Ze.eventTarget;else if(_===null)wt.current=window;else{const ee=_.getRootNode();ee===document&&(wt.current=window),wt.current=ee}},[ae,Ze?.eventTarget]),Vo=d.useCallback(_=>{const ee=Ue.current;if(ee===null||re===!1||V){_.preventDefault();return}let xe,Re;const de=ht(ee,_.clientX,_.clientY);if(re!==!0&&de.kind!==re){_.preventDefault();return}const pe=(Nt,kt)=>{xe=Nt,Re=kt};let We,ke,Xe;const pt=(Nt,kt,lt)=>{We=Nt,ke=kt,Xe=lt};let hn=!1;if(fe?.({...de,setData:pe,setDragImage:pt,preventDefault:()=>hn=!0,defaultPrevented:()=>hn}),!hn&&xe!==void 0&&Re!==void 0&&_.dataTransfer!==null)if(_.dataTransfer.setData(xe,Re),_.dataTransfer.effectAllowed="copyLink",We!==void 0&&ke!==void 0&&Xe!==void 0)_.dataTransfer.setDragImage(We,ke,Xe);else{const[Nt,kt]=de.location;if(kt!==void 0){const lt=document.createElement("canvas"),je=Ht(ee,Nt,kt);Fn(je!==void 0);const ct=Math.ceil(window.devicePixelRatio??1);lt.width=je.width*ct,lt.height=je.height*ct;const _t=lt.getContext("2d");_t!==null&&(_t.scale(ct,ct),_t.textBaseline="middle",kt===-1?(_t.font=Ce.headerFontFull,_t.fillStyle=Ce.bgHeader,_t.fillRect(0,0,lt.width,lt.height),vh(_t,0,0,je.width,je.height,xt[Nt],!1,Ce,!1,void 0,void 0,!1,0,sn,ie,!1)):(_t.font=Ce.baseFontFull,_t.fillStyle=Ce.bgCell,_t.fillRect(0,0,lt.width,lt.height),ph(_t,f([Nt,kt]),0,kt,!1,!1,0,0,je.width,je.height,!1,Ce,Ce.bgCell,Tt,sn,1,void 0,!1,0,void 0,void 0,void 0,Ne,Ee,()=>{}))),lt.style.left="-100%",lt.style.position="absolute",lt.style.width=`${je.width}px`,lt.style.height=`${je.height}px`,document.body.append(lt),_.dataTransfer.setDragImage(lt,je.width/2,je.height/2),window.setTimeout(()=>{lt.remove()},0)}}else _.preventDefault()},[re,V,ht,fe,Ht,Ce,xt,sn,ie,f,Tt,Ne,Ee]);xn("dragstart",Vo,oe?.current??null,!1,!1);const io=d.useRef(),Oi=d.useCallback(_=>{const ee=Ue.current;if(ve!==void 0&&_.preventDefault(),ee===null||ue===void 0)return;const xe=ht(ee,_.clientX,_.clientY),[Re,de]=xe.location,pe=Re-(ce?0:1),[We,ke]=io.current??[];(We!==pe||ke!==de)&&(io.current=[pe,de],ue([pe,de],_.dataTransfer))},[ce,ht,ue,ve]);xn("dragover",Oi,oe?.current??null,!1,!1);const _a=d.useCallback(()=>{io.current=void 0,he?.()},[he]);xn("dragend",_a,oe?.current??null,!1,!1);const $a=d.useCallback(_=>{const ee=Ue.current;if(ee===null||ve===void 0)return;_.preventDefault();const xe=ht(ee,_.clientX,_.clientY),[Re,de]=xe.location,pe=Re-(ce?0:1);ve([pe,de],_.dataTransfer)},[ce,ht,ve]);xn("drop",$a,oe?.current??null,!1,!1);const nr=d.useCallback(()=>{Fe?.()},[Fe]);xn("dragleave",nr,oe?.current??null,!1,!1);const dr=d.useRef(M);dr.current=M;const yn=d.useRef(null),j=d.useCallback(_=>{Ue.current===null||!Ue.current.contains(document.activeElement)||(_===null&&dr.current.current!==void 0?ae?.current?.focus({preventScroll:!0}):_!==null&&_.focus({preventScroll:!0}),yn.current=_)},[ae]);d.useImperativeHandle(t,()=>({focus:()=>{const _=yn.current;_===null||!document.contains(_)?ae?.current?.focus({preventScroll:!0}):_.focus({preventScroll:!0})},getBounds:(_,ee)=>{if(!(ae===void 0||ae.current===null))return Ht(ae.current,_??0,ee??-1)},damage:zt,getMouseArgsForPosition:(_,ee,xe)=>{if(!(ae===void 0||ae.current===null))return ht(ae.current,_,ee,xe)}}),[ae,zt,Ht,ht]);const Ft=d.useRef(),Ar=wm(()=>{if(n<50||Ze?.disableAccessibilityTree===!0)return null;let _=Wl(xt,Qe,n,Z,Oe);const ee=ce?0:-1;!ce&&_[0]?.sourceIndex===0&&(_=_.slice(1));const[xe,Re]=M.current?.cell??[],de=M.current?.range,pe=_.map(ke=>ke.sourceIndex),We=Tr(l,Math.min(g,l+o));return xe!==void 0&&Re!==void 0&&!(pe.includes(xe)&&We.includes(Re))&&j(null),d.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":xt.length+ee},d.createElement("thead",{role:"rowgroup"},d.createElement("tr",{role:"row","aria-rowindex":1},_.map(ke=>d.createElement("th",{role:"columnheader","aria-selected":M.columns.hasIndex(ke.sourceIndex),"aria-colindex":ke.sourceIndex+1+ee,tabIndex:-1,onFocus:Xe=>{if(Xe.target!==yn.current)return be?.([ke.sourceIndex,-1])},key:ke.sourceIndex},ke.title)))),d.createElement("tbody",{role:"rowgroup"},We.map(ke=>d.createElement("tr",{role:"row","aria-selected":M.rows.hasIndex(ke),key:ke,"aria-rowindex":ke+2},_.map(Xe=>{const pt=Xe.sourceIndex,hn=Yn(pt,ke),Nt=xe===pt&&Re===ke,kt=de!==void 0&&pt>=de.x&&pt<de.x+de.width&&ke>=de.y&&ke<de.y+de.height,lt=`glide-cell-${pt}-${ke}`,je=[pt,ke],ct=f(je,!0);return d.createElement("td",{key:hn,role:"gridcell","aria-colindex":pt+1+ee,"aria-selected":kt,"aria-readonly":Mo(ct)||!Co(ct),id:lt,"data-testid":lt,onClick:()=>{const _t=ae?.current;if(_t!=null)return te?.({bounds:Ht(_t,pt,ke),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:je})},onFocusCapture:_t=>{if(!(_t.target===yn.current||Ft.current?.[0]===pt&&Ft.current?.[1]===ke))return Ft.current=je,be?.(je)},ref:Nt?j:void 0,tabIndex:-1},Gv(ct,Ee))})))))},[n,xt,Qe,Z,Oe,g,l,o,M,j,f,ae,te,Ht,be],200),ao=P===0||!H?0:Qe>P?1:Wn(-Oe/100,0,1),Di=-l*32+ut,lo=E?Wn(-Di/100,0,1):0,Ba=d.useMemo(()=>{if(!ao&&!lo)return null;const _={position:"absolute",top:0,left:Dn,width:n-Dn,height:r,opacity:ao,pointerEvents:"none",transition:Je?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:On,left:0,width:n,height:r,opacity:lo,pointerEvents:"none",transition:Se?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return d.createElement(d.Fragment,null,ao>0&&d.createElement("div",{id:"shadow-x",style:_}),lo>0&&d.createElement("div",{id:"shadow-y",style:ee}))},[ao,lo,Dn,n,Je,On,r,Se]),K=d.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return d.createElement(d.Fragment,null,d.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Lr,onKeyUp:Va,onFocus:x,onBlur:I,ref:tr,style:zo},Ar),d.createElement("canvas",{ref:kn,style:K}),Ba)},Kv=d.memo(d.forwardRef(Uv));function ii(e,t,n,r){return Wn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const Xv=e=>{const[t,n]=d.useState(),[r,o]=d.useState(),[i,a]=d.useState(),[l,s]=d.useState(),[c,u]=d.useState(!1),[h,g]=d.useState(),[f,p]=d.useState(),[m,w]=d.useState(),[y,v]=d.useState(!1),[x,I]=d.useState(),{onHeaderMenuClick:O,onHeaderIndicatorClick:M,getCellContent:P,onColumnMoved:S,onColumnResize:k,onColumnResizeStart:H,onColumnResizeEnd:E,gridRef:R,maxColumnWidth:T,minColumnWidth:D,onRowMoved:C,lockColumns:J,onColumnProposeMove:W,onMouseDown:Z,onMouseUp:ce,onItemHovered:te,onDragStart:q,canvasRef:ge}=e,ae=(k??E??H)!==void 0,{columns:fe,selection:he}=e,oe=he.columns,V=d.useCallback(ne=>{const[ie,be]=ne.location;i!==void 0&&l!==ie&&ie>=J?(u(!0),s(ie)):f!==void 0&&be!==void 0?(v(!0),w(Math.max(0,be))):r===void 0&&!c&&!y&&te?.(ne)},[i,f,l,te,J,r,c,y]),z=S!==void 0,G=d.useCallback(ne=>{if(ne.button===0){const[ie,be]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&ae){const ue=R?.current?.getBounds(fe.length-1,-1);ue!==void 0&&(n(ue.x),o(fe.length-1))}else if(ne.kind==="header"&&ie>=J){const ue=ge?.current;if(ne.isEdge&&ae&&ue){n(ne.bounds.x),o(ie);const ve=ue.getBoundingClientRect().width/ue.offsetWidth,Fe=ne.bounds.width/ve;H?.(fe[ie],Fe,ie,Fe+(fe[ie].growOffset??0))}else ne.kind==="header"&&z&&(g(ne.bounds.x),a(ie))}else ne.kind==="cell"&&J>0&&ie===0&&be!==void 0&&C!==void 0&&(I(ne.bounds.y),p(be))}Z?.(ne)},[Z,ae,J,C,R,fe,z,H,ge]),re=d.useCallback((ne,ie)=>{c||y||O?.(ne,ie)},[c,y,O]),le=d.useCallback((ne,ie)=>{c||y||M?.(ne,ie)},[c,y,M]),Ie=d.useRef(-1),ye=d.useCallback(()=>{Ie.current=-1,p(void 0),w(void 0),I(void 0),v(!1),a(void 0),s(void 0),g(void 0),u(!1),o(void 0),n(void 0)},[]),at=d.useCallback((ne,ie)=>{if(ne.button===0){if(r!==void 0){if(oe?.hasIndex(r)===!0)for(const ue of oe){if(ue===r)continue;const ve=fe[ue],Fe=ii(ve,Ie.current,D,T);k?.(ve,Fe,ue,Fe+(ve.growOffset??0))}const be=ii(fe[r],Ie.current,D,T);if(E?.(fe[r],be,r,be+(fe[r].growOffset??0)),oe.hasIndex(r))for(const ue of oe){if(ue===r)continue;const ve=fe[ue],Fe=ii(ve,Ie.current,D,T);E?.(ve,Fe,ue,Fe+(ve.growOffset??0))}}ye(),i!==void 0&&l!==void 0&&W?.(i,l)!==!1&&S?.(i,l),f!==void 0&&m!==void 0&&C?.(f,m)}ce?.(ne,ie)},[ce,r,i,l,f,m,oe,E,fe,D,T,k,S,C,ye,W]),Ce=d.useMemo(()=>{if(!(i===void 0||l===void 0)&&i!==l&&W?.(i,l)!==!1)return{src:i,dest:l}},[i,l,W]),ft=d.useCallback(ne=>{const ie=ge?.current;if(i!==void 0&&h!==void 0)Math.abs(ne.clientX-h)>20&&u(!0);else if(f!==void 0&&x!==void 0)Math.abs(ne.clientY-x)>20&&v(!0);else if(r!==void 0&&t!==void 0&&ie){const be=ie.getBoundingClientRect().width/ie.offsetWidth,ue=(ne.clientX-t)/be,ve=fe[r],Fe=ii(ve,ue,D,T);if(k?.(ve,Fe,r,Fe+(ve.growOffset??0)),Ie.current=ue,oe?.first()===r)for(const Ve of oe){if(Ve===r)continue;const Je=fe[Ve],Se=ii(Je,Ie.current,D,T);k?.(Je,Se,Ve,Se+(Je.growOffset??0))}}},[i,h,f,x,r,t,fe,D,T,k,oe,ge]),vt=d.useCallback((ne,ie)=>{if(f===void 0||m===void 0)return P(ne,ie);let[be,ue]=ne;return ue===m?ue=f:(ue>m&&(ue-=1),ue>=f&&(ue+=1)),P([be,ue],ie)},[f,m,P]),Be=d.useCallback(ne=>{q?.(ne),ne.defaultPrevented()||ye()},[ye,q]);return d.createElement(Kv,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:vt,isResizing:r!==void 0,onHeaderMenuClick:re,onHeaderIndicatorClick:le,isDragging:c,onItemHovered:V,onDragStart:Be,onMouseDown:G,allowResize:ae,onMouseUp:at,dragAndDropState:Ce,onMouseMoveRaw:ft,ref:R})};function qv(e){const t=d.useRef(null),[n,r]=d.useState({width:e?.[0],height:e?.[1]});return d.useLayoutEffect(()=>{const o=a=>{for(const l of a){const{width:s,height:c}=l&&l.contentRect||{};r(u=>u.width===s&&u.height===c?u:{width:s,height:c})}},i=new window.ResizeObserver(o);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const Zv=(e,t,n)=>{const r=d.useRef(null),o=d.useRef(null),i=d.useRef(null),a=d.useRef(0),l=d.useRef(t);l.current=t;const s=n.current;d.useEffect(()=>{const c=()=>{if(o.current===!1&&s!==null){const g=[s.scrollLeft,s.scrollTop];if(i.current?.[0]===g[0]&&i.current?.[1]===g[1])if(a.current>10){i.current=null,o.current=null;return}else a.current++;else a.current=0,l.current(g[0],g[1]),i.current=g;r.current=window.setTimeout(c,8.333333333333334)}},u=()=>{o.current=!0,i.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},h=g=>{g.touches.length===0&&(o.current=!1,a.current=0,r.current=window.setTimeout(c,8.333333333333334))};if(e&&s!==null){const g=s;return g.addEventListener("touchstart",u),g.addEventListener("touchend",h),()=>{g.removeEventListener("touchstart",u),g.removeEventListener("touchend",h),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},Yv=()=>e=>e.isSafari?"scroll":"auto",Jv=un("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[Yv()]}}),Qv=33554400,eb=5e6;function tb(e){const[t,n]=d.useState(!1),r=typeof window>"u"?null:window,o=d.useRef(0);return xn("touchstart",d.useCallback(()=>{window.clearTimeout(o.current),n(!0)},[]),r,!0,!1),xn("touchend",d.useCallback(i=>{i.touches.length===0&&(o.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const nb=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:o,update:i,draggable:a,className:l,preventDiagonalScrolling:s=!1,paddingBottom:c=0,paddingRight:u=0,rightElement:h,rightElementProps:g,kineticScrollPerfHack:f=!1,scrollRef:p,initialSize:m}=e,w=[],y=g?.sticky??!1,v=g?.fill??!1,x=d.useRef(0),I=d.useRef(0),O=d.useRef(null),M=typeof window>"u"?1:window.devicePixelRatio,P=d.useRef(M);d.useEffect(()=>{if(P.current!==M){x.current=0,I.current=0,P.current=M;const he=O.current;he!==null&&C.current(he.scrollLeft,he.scrollTop)}},[M]);const S=d.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),k=d.useRef(null),H=tb(200),[E,R]=d.useState(!0),T=d.useRef(0);d.useLayoutEffect(()=>{if(!E||H||S.current.lockDirection===void 0)return;const he=O.current;if(he===null)return;const[oe,V]=S.current.lockDirection;oe!==void 0?he.scrollLeft=oe:V!==void 0&&(he.scrollTop=V),S.current.lockDirection=void 0},[H,E]);const D=d.useCallback((he,oe)=>{const V=O.current;if(V===null)return;oe=oe??V.scrollTop,he=he??V.scrollLeft;const z=S.current.scrollTop,G=S.current.scrollLeft,re=he-G,le=oe-z;H&&re!==0&&le!==0&&(Math.abs(re)>3||Math.abs(le)>3)&&s&&S.current.lockDirection===void 0&&(S.current.lockDirection=Math.abs(re)<Math.abs(le)?[G,void 0]:[void 0,z]);const Ie=S.current.lockDirection;he=Ie?.[0]??he,oe=Ie?.[1]??oe,S.current.scrollLeft=he,S.current.scrollTop=oe;const ye=V.clientWidth,at=V.clientHeight,Ce=oe,ft=I.current-Ce,vt=V.scrollHeight-at;I.current=Ce;let Be;if(vt>0&&r>V.scrollHeight+5)if(Math.abs(ft)>2e3||Ce===0||Ce===vt){const ne=Math.max(0,Math.min(1,Ce/vt)),ie=r-at;Be=ne*ie,x.current=Be}else x.current-=ft,Be=x.current;else Be=Ce,x.current=Be;Be=Math.max(0,Math.min(Be,r-at)),x.current=Be,Ie!==void 0&&(window.clearTimeout(T.current),R(!1),T.current=window.setTimeout(()=>R(!0),200)),i({x:he,y:Be,width:ye-u,height:at-c,paddingRight:k.current?.clientWidth??0})},[c,u,r,i,s,H]);Zv(f&&ya.value,D,O);const C=d.useRef(D);C.current=D;const J=d.useRef(),W=d.useRef(!1);d.useLayoutEffect(()=>{W.current?D():W.current=!0},[D,c,u]);const Z=d.useCallback(he=>{O.current=he,p!==void 0&&(p.current=he)},[p]);let ce=0,te=0;const q=Math.min(r,Qv);for(w.push(d.createElement("div",{key:ce++,style:{width:o,height:0}}));te<q;){const he=Math.min(eb,q-te);w.push(d.createElement("div",{key:ce++,style:{width:0,height:he}})),te+=he}const{ref:ge,width:ae,height:fe}=qv(m);return typeof window<"u"&&(J.current?.height!==fe||J.current?.width!==ae)&&(window.setTimeout(()=>C.current(),0),J.current={width:ae,height:fe}),(ae??0)===0||(fe??0)===0?d.createElement("div",{ref:ge}):d.createElement("div",{ref:ge},d.createElement(Jv,{isSafari:ya.value},d.createElement("div",{className:"dvn-underlay"},t),d.createElement("div",{ref:Z,style:J.current,draggable:a,onDragStart:he=>{a||(he.stopPropagation(),he.preventDefault())},className:"dvn-scroller "+(l??""),onScroll:()=>D()},d.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},d.createElement("div",{className:"dvn-stack"},w),h!==void 0&&d.createElement(d.Fragment,null,!v&&d.createElement("div",{className:"dvn-spacer"}),d.createElement("div",{ref:k,style:{height:fe,maxHeight:n-Math.ceil(M%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:v?1:void 0,right:y?u??0:void 0,pointerEvents:"auto"}},h))))))},rb=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:o,groupHeaderHeight:i,enableGroups:a,freezeColumns:l,experimental:s,nonGrowWidth:c,clientSize:u,className:h,onVisibleRegionChanged:g,scrollRef:f,preventDiagonalScrolling:p,rightElement:m,rightElementProps:w,overscrollX:y,overscrollY:v,initialSize:x,smoothScrollX:I=!1,smoothScrollY:O=!1,isDraggable:M}=e,{paddingRight:P,paddingBottom:S}=s??{},[k,H]=u,E=d.useRef(),R=d.useRef(),T=d.useRef(),D=d.useRef(),C=c+Math.max(0,y??0);let J=a?o+i:o;if(typeof r=="number")J+=n*r;else for(let te=0;te<n;te++)J+=r(te);v!==void 0&&(J+=v);const W=d.useRef(),Z=d.useCallback(()=>{if(W.current===void 0)return;const te={...W.current};let q=0,ge=te.x<0?-te.x:0,ae=0,fe=0;te.x=te.x<0?0:te.x;let he=0;for(let le=0;le<l;le++)he+=t[le].width;for(const le of t){const Ie=q-he;if(te.x>=Ie+le.width)q+=le.width,fe++,ae++;else if(te.x>Ie)q+=le.width,I?ge+=Ie-te.x:fe++,ae++;else if(te.x+te.width>Ie)q+=le.width,ae++;else break}let oe=0,V=0,z=0;if(typeof r=="number")O?(V=Math.floor(te.y/r),oe=V*r-te.y):V=Math.ceil(te.y/r),z=Math.ceil(te.height/r)+V,oe<0&&z++;else{let le=0;for(let Ie=0;Ie<n;Ie++){const ye=r(Ie),at=le+(O?0:ye/2);if(te.y>=le+ye)le+=ye,V++,z++;else if(te.y>at)le+=ye,O?oe+=at-te.y:V++,z++;else if(te.y+te.height>ye/2+le)le+=ye,z++;else break}}V=Math.max(0,Math.min(V,n-1)),z=Math.max(V,Math.min(z,n));const G={x:fe,y:V,width:ae-fe,height:z-V},re=E.current;(re===void 0||re.y!==G.y||re.x!==G.x||re.height!==G.height||re.width!==G.width||R.current!==ge||T.current!==oe||te.width!==D.current?.[0]||te.height!==D.current?.[1])&&(g?.({x:fe,y:V,width:ae-fe,height:z-V},te.width,te.height,te.paddingRight??0,ge,oe),E.current=G,R.current=ge,T.current=oe,D.current=[te.width,te.height])},[t,r,n,g,l,I,O]),ce=d.useCallback(te=>{W.current=te,Z()},[Z]);return d.useEffect(()=>{Z()},[Z]),d.createElement(nb,{scrollRef:f,className:h,kineticScrollPerfHack:s?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:M===!0||typeof M=="string",scrollWidth:C+(P??0),scrollHeight:J+(S??0),clientHeight:H,rightElement:m,paddingBottom:S,paddingRight:P,rightElementProps:w,update:ce,initialSize:x},d.createElement(Xv,{eventTargetRef:f,width:k,height:H,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},ob=un("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),ib=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),ab=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),lb=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),sb=10,cb=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:o,searchInputRef:i,searchValue:a,searchResults:l,onSearchValueChange:s,getCellsForSelection:c,onSearchResultsChanged:u,showSearch:h=!1,onSearchClose:g}=e,[f]=d.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=d.useState(""),w=a??p,y=d.useCallback(q=>{m(q),s?.(q)},[s]),[v,x]=d.useState(),I=d.useRef(v);I.current=v,d.useEffect(()=>{l!==void 0&&(l.length>0?x(q=>({rowsSearched:r,results:l.length,selectedIndex:q?.selectedIndex??-1})):x(void 0))},[r,l]);const O=d.useRef();O.current===void 0&&(O.current=new AbortController);const M=d.useRef(),[P,S]=d.useState([]),k=l??P,H=d.useCallback(()=>{M.current!==void 0&&(window.cancelAnimationFrame(M.current),M.current=void 0),O.current!==void 0&&O.current.abort(),O.current=new AbortController},[]),E=d.useRef(n);E.current=n;const R=d.useCallback(q=>{const ge=new RegExp(q.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=E.current,fe=Math.min(10,r),he=0;x(void 0),S([]);const oe=[],V=async()=>{if(c===void 0)return;const z=performance.now(),G=r-he;let re=c({x:0,y:ae,width:o.length,height:Math.min(fe,G,r-ae)},O.current.signal);typeof re=="function"&&(re=await re());let le=!1;for(const[vt,Be]of re.entries())for(const[ne,ie]of Be.entries()){let be;switch(ie.kind){case Y.Text:case Y.Number:be=ie.displayData;break;case Y.Uri:case Y.Markdown:be=ie.data;break;case Y.Boolean:be=typeof ie.data=="boolean"?ie.data.toString():void 0;break;case Y.Image:case Y.Bubble:be=ie.data.join("🐳");break;case Y.Custom:be=ie.copyData;break}be!==void 0&&ge.test(be)&&(oe.push([ne,vt+ae]),le=!0)}const Ie=performance.now();le&&S([...oe]),he+=re.length,Fn(he<=r);const ye=I.current?.selectedIndex??-1;x({results:oe.length,rowsSearched:he,selectedIndex:ye}),u?.(oe,ye),ae+fe>=r?ae=0:ae+=fe;const at=Ie-z,Ce=Math.max(at,1),ft=sb/Ce;fe=Math.ceil(fe*ft),he<r&&oe.length<1e3&&(M.current=window.requestAnimationFrame(V))};H(),M.current=window.requestAnimationFrame(V)},[H,o.length,c,u,r]),T=d.useCallback(()=>{g?.(),x(void 0),S([]),u?.([],-1),H(),t?.current?.focus()},[H,t,g,u]),D=d.useCallback(q=>{y(q.target.value),l===void 0&&(q.target.value===""?(x(void 0),S([]),H()):R(q.target.value))},[R,H,y,l]);d.useEffect(()=>{i.current!==null&&(y(""),x(void 0),P.length>0&&(S([]),u?.([],-1)),h?i.current.focus({preventScroll:!0}):H())},[h,i]);const C=d.useCallback(q=>{if(q?.stopPropagation?.(),v===void 0||v.results===0)return;const ge=(v.selectedIndex+1)%v.results;x({...v,selectedIndex:ge}),u?.(k,ge)},[v,u,k]),J=d.useCallback(q=>{if(q?.stopPropagation?.(),v===void 0||v.results===0)return;let ge=(v.selectedIndex-1)%v.results;ge<0&&(ge+=v.results),x({...v,selectedIndex:ge}),u?.(k,ge)},[u,k,v]),W=d.useCallback(q=>{(q.ctrlKey||q.metaKey)&&q.nativeEvent.code==="KeyF"||q.key==="Escape"?(T(),q.stopPropagation(),q.preventDefault()):q.key==="Enter"&&(q.shiftKey?J():C())},[T,C,J]);d.useEffect(()=>()=>{H()},[H]);const[Z,ce]=d.useState(!1);d.useEffect(()=>{if(h)ce(!0);else{const q=setTimeout(()=>ce(!1),150);return()=>clearTimeout(q)}},[h]);const te=d.useMemo(()=>{if(!h&&!Z)return null;let q;v!==void 0&&(q=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(q=`${v.selectedIndex+1} of ${q}`));const ge=fe=>{fe.stopPropagation()},ae={width:`${r>0?Math.floor((v?.rowsSearched??0)/r*100):0}%`};return d.createElement(ob,{className:"gdg-search-bar"+(h?"":" out"),onMouseDown:ge,onMouseMove:ge,onMouseUp:ge,onClick:ge},d.createElement("div",{className:"gdg-search-bar-inner"},d.createElement("input",{id:f,"aria-hidden":!h,"data-testid":"search-input",ref:i,onChange:D,value:w,tabIndex:h?void 0:-1,onKeyDownCapture:W}),d.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:J,disabled:(v?.results??0)===0},ib),d.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:C,disabled:(v?.results??0)===0},ab),g!==void 0&&d.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!h,"data-testid":"search-close-button",tabIndex:h?void 0:-1,onClick:T},lb)),v!==void 0?d.createElement(d.Fragment,null,d.createElement("div",{className:"gdg-search-status"},d.createElement("div",{"data-testid":"search-result-area"},q)),d.createElement("div",{className:"gdg-search-progress",style:ae})):d.createElement("div",{className:"gdg-search-status"},d.createElement("label",{htmlFor:f},"Type to search")))},[h,Z,v,r,f,i,D,w,W,J,C,g,T]);return d.createElement(d.Fragment,null,d.createElement(rb,{prelightCells:k,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),te)};class ub extends d.PureComponent{wrapperRef=d.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...o}=this.props;return d.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}}const db=()=>e=>Math.max(16,e.targetHeight-10),hb=un("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[db(),"px"]}}),fb=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:o,onFinish:i}=e,[a,l]=St.useState(n);return St.createElement(ub,{style:{position:"absolute",left:t.x-o.left+1,top:t.y-o.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},St.createElement(hb,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,a.length),onChange:s=>l(s.target.value),onKeyDown:s=>{s.key==="Enter"?i(a):s.key==="Escape"&&r()},autoFocus:!0}))};function pb(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function nt(e,t,n){const r=wh(e,t);return r&&(n.didMatch=!0),r}function wh(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const c of s)if(wh(c,t))return!0;return!1}let n=!1,r=!1,o=!1,i=!1;const a=e.split("+"),l=a.pop();if(!pb(l,t))return!1;if(a[0]==="any")return!0;for(const s of a)switch(s){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":o=!0;break;case"meta":i=!0;break;case"primary":wa.value?i=!0:n=!0;break}return t.altKey===o&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===i}function gb(e,t,n,r,o,i,a){const l=St.useCallback((u,h,g,f)=>{(i==="cell"||i==="multi-cell")&&u!==void 0&&(u={...u,range:{x:u.cell[0],y:u.cell[1],width:1,height:1}}),!a&&u!==void 0&&u.range.width>1&&(u={...u,range:{...u.range,width:1,x:u.cell[0]}});const p=n==="mixed"&&(g||f==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,w=(o==="mixed"||o==="additive")&&p;let y={current:u===void 0?void 0:{...u,rangeStack:f==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:Ye.empty(),rows:w?e.rows:Ye.empty()};g&&(i==="multi-rect"||i==="multi-cell")&&y.current!==void 0&&e.current!==void 0&&(y={...y,current:{...y.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(y,h)},[r,e,n,i,a,o,t]),s=St.useCallback((u,h,g)=>{u=u??e.rows,h!==void 0&&(u=u.add(h));let f;if(o==="exclusive"&&u.length>0)f={current:void 0,columns:Ye.empty(),rows:u};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";f={current:p?e.current:void 0,columns:m?e.columns:Ye.empty(),rows:u}}t(f,!1)},[r,e,n,o,t]),c=St.useCallback((u,h,g)=>{u=u??e.columns,h!==void 0&&(u=u.add(h));let f;if(r==="exclusive"&&u.length>0)f={current:void 0,rows:Ye.empty(),columns:u};else{const p=g&&n==="mixed"||n==="additive",m=g&&o==="mixed"||o==="additive";f={current:p?e.current:void 0,rows:m?e.rows:Ye.empty(),columns:u}}t(f,!1)},[r,e,n,o,t]);return[l,s,c]}function mb(e,t,n,r,o){const i=d.useCallback(s=>{if(e===!0){const c=[];for(let u=s.y;u<s.y+s.height;u++){const h=[];for(let g=s.x;g<s.x+s.width;g++)g<0||u>=o?h.push({kind:Y.Loading,allowOverlay:!1}):h.push(t([g,u]));c.push(h)}return c}return e?.(s,r.signal)??[]},[r.signal,t,e,o]),a=e!==void 0?i:void 0,l=d.useCallback(s=>{if(a===void 0)return[];const c={...s,x:s.x-n};if(c.x<0){c.x=0,c.width--;const u=a(c,r.signal);return typeof u=="function"?async()=>(await u()).map(h=>[{kind:Y.Loading,allowOverlay:!1},...h]):u.map(h=>[{kind:Y.Loading,allowOverlay:!1},...h])}return a(c,r.signal)},[r.signal,a,n]);return[e!==void 0?l:void 0,a]}function vb(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Y.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===is?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Y.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Y.Image:case Y.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Y.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Y.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Y.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Y.Markdown:case Y.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Y.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Y.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Y.Protected:return{formatted:"************",rawValue:"",format:"string"};default:mi()}}function bb(e,t){return e.map((n,r)=>{const o=t[r];return n.map(i=>i.span!==void 0&&i.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:vb(i))})}function lu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function yb(e){const t=[];for(const n of e){const r=[];for(const o of n)o.format==="url"?r.push(o.rawValue?.toString()??""):o.format==="string-array"?r.push(o.formatted.map(i=>lu(i,!0)).join(",")):r.push(o.doNotEscape===!0?o.formatted:lu(o.formatted,!1));t.push(r.join(" "))}return t.join(`
|
|
176
|
+
`)}function xl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function su(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function wb(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function xb(e){const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const n of e){t.push("<tr>");for(const r of n){const o=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${o}><a href="${r.rawValue}">${xl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${o}><ol>${r.formatted.map((i,a)=>`<li gdg-raw-value=${su(r.rawValue[a])}>`+xl(i)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${su(r.rawValue?.toString()??"")} ${o}>${xl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function kb(e,t){const n=bb(e,t),r=yb(n),o=xb(n);return{textPlain:r,textHtml:o}}function cu(e){const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],o=[];let i;for(;r.length>0;){const a=r.pop();if(a===void 0)break;if(a instanceof HTMLTableElement||a.nodeName==="TBODY")r.push(...[...a.children].reverse());else if(a instanceof HTMLTableRowElement)i!==void 0&&o.push(i),i=[],r.push(...[...a.children].reverse());else if(a instanceof HTMLTableCellElement){const l=a.cloneNode(!0),s=l.children.length===1&&l.children[0].nodeName==="P"?l.children[0]:null,c=s?.children.length===1&&s.children[0].nodeName==="FONT",u=l.querySelectorAll("br");for(const f of u)f.replaceWith(`
|
|
177
|
+
`);const h=l.getAttribute("gdg-raw-value"),g=l.getAttribute("gdg-format")??"string";if(l.querySelector("a")!==null)i?.push({rawValue:l.querySelector("a")?.getAttribute("href")??"",formatted:l.textContent??"",format:g});else if(l.querySelector("ol")!==null){const f=l.querySelectorAll("li");i?.push({rawValue:[...f].map(p=>p.getAttribute("gdg-raw-value")??""),formatted:[...f].map(p=>p.textContent??""),format:"string-array"})}else if(h!==null)i?.push({rawValue:wb(h),formatted:l.textContent??"",format:g});else{let f=l.textContent??"";c&&(f=f.replace(/\n(?!\n)/g,"")),i?.push({rawValue:f??"",formatted:f??"",format:g})}}}return i!==void 0&&o.push(i),o}function Cb(e,t,n,r,o){const i=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!1;do{if(e?.current===void 0)break;const l=e.current?.range,s=[];if(l.width>2){const h=t({x:l.x,y:l.y,width:1,height:l.height},o.signal);if(typeof h=="function")return i;s.push(...h);const g=t({x:l.x+l.width-1,y:l.y,width:1,height:l.height},o.signal);if(typeof g=="function")return i;s.push(...g)}else{const h=t({x:l.x,y:l.y,width:l.width,height:l.height},o.signal);if(typeof h=="function")return i;s.push(...h)}let c=l.x-n,u=l.x+l.width-1-n;for(const h of s)for(const g of h)g.span!==void 0&&(c=Math.min(g.span[0],c),u=Math.max(g.span[1],u));c===l.x-n&&u===l.x+l.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:l.y,width:u-c+1,height:l.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function uu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Sb(e){let t;(function(l){l[l.None=0]="None",l[l.inString=1]="inString",l[l.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],o=0,i=t.None;e=e.replace(/\r\n/g,`
|
|
178
|
+
`);let a=0;for(const l of e){switch(i){case t.None:l===" "||l===`
|
|
179
|
+
`?(r.push(e.slice(o,a)),o=a+1,l===`
|
|
180
|
+
`&&(n.push(r),r=[])):l==='"'&&(i=t.inString);break;case t.inString:l==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?i=t.inString:((l===" "||l===`
|
|
181
|
+
`)&&(r.push(uu(e.slice(o,a))),o=a+1,l===`
|
|
182
|
+
`&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push(uu(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function du(e,t,n){const r=kb(e,t),o=l=>{window.navigator.clipboard?.writeText(l)},i=(l,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),a=(l,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",l),n?.clipboardData?.setData("text/html",s)}catch{i(l,s)||o(l)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function xh(e){return e!==!0}function hu(e){return typeof e=="string"?e:`${e}px`}const Mb=()=>e=>e.innerWidth,Rb=()=>e=>e.innerHeight,Ib=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Mb()],"wmyidgi-1":[Rb()]}}),Eb=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(Ib,{innerHeight:hu(n),innerWidth:hu(t),...o},r)},Tb=2,Ob=1300;function Db(e,t,n){const r=St.useRef(0),[o,i]=e??[0,0];St.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{if(!a){if(l===0)l=c;else{const u=c-l;r.current=Math.min(1,r.current+u/Ob);const h=r.current**1.618*u*Tb;t.current?.scrollBy(o*h,i*h),l=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Pb({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,h,g,f]=St.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const p=l/16,m=e,w=ih();return[typeof m=="number"?m*p:y=>Math.ceil(m(y)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*p},Math.ceil((o??0)*p),Math.ceil((i??0)*p)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:g,overscrollY:f}}const Mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function rt(e,t){return e===!0?t:e===!1?"":e}function fu(e){const t=wa.value;return{activateCell:rt(e.activateCell," |Enter|shift+Enter"),clear:rt(e.clear,"any+Escape"),closeOverlay:rt(e.closeOverlay,"any+Escape"),acceptOverlayDown:rt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:rt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:rt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:rt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:rt(e.delete,t?"Backspace|Delete":"Delete"),downFill:rt(e.downFill,"primary+_68"),scrollToSelectedCell:rt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:rt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:rt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:rt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:rt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:rt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:rt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:rt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:rt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:rt(e.goToFirstCell,"primary+Home"),goToFirstColumn:rt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:rt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:rt(e.goToLastCell,"primary+End"),goToLastColumn:rt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:rt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:rt(e.goToNextPage,"PageDown"),goToPreviousPage:rt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:rt(e.rightFill,"primary+_82"),search:rt(e.search,"primary+f"),selectAll:rt(e.selectAll,"primary+a"),selectColumn:rt(e.selectColumn,"ctrl+ "),selectGrowDown:rt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:rt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:rt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:rt(e.selectGrowUp,"shift+ArrowUp"),selectRow:rt(e.selectRow,"shift+ "),selectToFirstCell:rt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:rt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:rt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:rt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:rt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:rt(e.selectToLastRow,"primary+shift+ArrowDown")}}function Hb(e){const t=Mm(e);return St.useMemo(()=>{if(t===void 0)return fu(Mr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Mr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Mr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Mr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Mr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Mr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Mr.selectToLastCell};return fu({...Mr,...n})},[t])}function zb(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function Ss(e,t){const n=[];function r(l,s,c=!1){let u=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(u=l.subGroups[0].headerIndex-l.headerIndex),u--,n.push({rowIndex:-1,headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:u}),l.subGroups)for(let h=0;h<l.subGroups.length;h++){const g=h<l.subGroups.length-1?l.subGroups[h+1].headerIndex:s;r(l.subGroups[h],g,c||l.isCollapsed)}}const o=zb(e.groups);for(let l=0;l<o.length;l++){const s=l<o.length-1?o[l+1].headerIndex:null;r(o[l],s)}let i=0,a=0;for(const l of n)l.contentIndex=a,a+=l.rows,l.rowIndex=i,i+=l.isCollapsed?1:l.rows+1;return n.filter(l=>l.skip===!1).map(l=>{const{skip:s,...c}=l;return c})}function Kl(e,t){if(t===void 0||Ss.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Lb(e,t,n,r){const o=St.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]),i=St.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),a=St.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),l=St.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=St.useCallback(u=>{if(o===void 0)return u;let h=u;for(const g of o){if(h===0)return;if(h--,!g.isCollapsed){if(h<g.rows)return g.contentIndex+h;h-=g.rows}}return u},[o]),c=Rr(r??e?.themeOverride,St.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:g,groupIndex:f}=Kl(u,o);return h?e.themeOverride:r?.(u,f,g)},[o,r,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:a,rowNumberMapper:s,getRowThemeOverride:c}}function Ab(e,t){const n=St.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]);return{getRowGroupingForPath:Ch,updateRowGroupingByPath:kh,mapper:St.useCallback(r=>{if(typeof r=="number")return Kl(r,n);const o=Kl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function kh(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:kh(i.subGroups??[],o,n)}:i)}function Ch(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Ch(e[n].subGroups??[],r)}function Fb(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function Vb(e,t,n,r,o){const[i,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,c,u]=Sm(l),h=d.useRef(o);h.current=o;const g=Fb(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&f){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&u(),h.current()}},[t,f,u,g]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&u(),h.current()}},[e,p,u,g]),{visibleRegion:s,setVisibleRegion:c,scrollRef:g}}const _b=d.lazy(async()=>await ns(()=>import("./data-grid-overlay-editor-C7-8Z8CC-CmhK1L1G.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let $b=0;function Bb(e){return W0(eu(eu(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Yi(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Ji={kind:Y.Loading,allowOverlay:!1},Qi={columns:Ye.empty(),rows:Ye.empty(),current:void 0},Nb=(e,t)=>{const[n,r]=d.useState(Qi),[o,i]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:f,markdownDivCreateNode:p,width:m,height:w,columns:y,rows:v,getCellContent:x,onCellClicked:I,onCellActivated:O,onFillPattern:M,onFinishedEditing:P,coercePasteValue:S,drawHeader:k,drawCell:H,editorBloom:E,onHeaderClicked:R,onColumnProposeMove:T,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:C="default",onGroupHeaderClicked:J,onCellContextMenu:W,className:Z,onHeaderContextMenu:ce,getCellsForSelection:te,onGroupHeaderContextMenu:q,onGroupHeaderRenamed:ge,onCellEdited:ae,onCellsEdited:fe,onSearchResultsChanged:he,searchResults:oe,onSearchValueChange:V,searchValue:z,onKeyDown:G,onKeyUp:re,keybindings:le,editOnType:Ie=!0,onRowAppended:ye,onColumnAppended:at,onColumnMoved:Ce,validateCell:ft,highlightRegions:vt,rangeSelect:Be="rect",columnSelect:ne="multi",rowSelect:ie="multi",rangeSelectionBlending:be="exclusive",columnSelectionBlending:ue="exclusive",rowSelectionBlending:ve="exclusive",onDelete:Fe,onDragStart:Ve,onMouseMove:Je,onPaste:Se,copyHeaders:Ze=!1,freezeColumns:Ee=0,cellActivationBehavior:Me="second-click",rowSelectionMode:Oe="auto",columnSelectionMode:ut="auto",onHeaderMenuClick:Qe,onHeaderIndicatorClick:Ue,getGroupDetails:wt,rowGrouping:gt,onSearchClose:Tt,onItemHovered:Ot,onSelectionCleared:an,showSearch:qt,onVisibleRegionChanged:In,gridSelection:Mt,onGridSelectionChange:dt,minColumnWidth:En=50,maxColumnWidth:mt=500,maxColumnAutoWidth:Zt,provideEditor:kn,trailingRowOptions:De,freezeTrailingRows:et=0,allowedFillDirections:bt="orthogonal",scrollOffsetX:Tn,scrollOffsetY:ln,verticalBorder:sn,onDragOverCell:On,onDrop:Yt,onColumnResize:Jt,onColumnResizeEnd:_e,onColumnResizeStart:xt,customRenderers:Dn,fillHandle:Ht,experimental:ht,fixedShadowX:Cn,fixedShadowY:ur,headerIcons:_n,imageWindowLoader:B,initialSize:$e,isDraggable:Ne,onDragLeave:Dt,onRowMoved:Qt,overscrollX:dn,overscrollY:Sn,preventDiagonalScrolling:bn,rightElement:$t,rightElementProps:Mn,trapFocus:Rn=!1,smoothScrollX:we,smoothScrollY:zt,scaleToRem:Kt=!1,rowHeight:$n=34,headerHeight:Xt=36,groupHeaderHeight:jt=Xt,theme:Gt,isOutsideClick:Pn,renderers:Hn,resizeIndicator:Ii,scrollToActiveCell:Hr=!0,drawFocusRing:Ho=!0,portalElementRef:zo}=e,Lo=Ho==="no-editor"?o===void 0:Ho,Gn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,fn=Gn?.kind??e.rowMarkers??"none",br=Gn?.width??e.rowMarkerWidth,to=Gn?.startIndex??e.rowMarkerStartIndex??1,yr=Gn?.theme??e.rowMarkerTheme,no=Gn?.headerTheme,Ei=Gn?.headerAlwaysVisible,zr=ie!=="multi"||Gn?.headerDisabled===!0,ro=Gn?.checkboxStyle??"square",wr=Math.max(En,20),oo=Math.max(mt,wr),Ti=Math.max(Zt??oo,wr),Ao=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Le,rowNumberMapper:Fo,rowHeight:Fa,getRowThemeOverride:Lr}=Lb(gt,v,$n,f),Va=d.useMemo(()=>Number.parseFloat(Ao.fontSize),[Ao]),{rowHeight:tr,headerHeight:Vo,groupHeaderHeight:io,theme:Oi,overscrollX:_a,overscrollY:$a}=Pb({groupHeaderHeight:jt,headerHeight:Xt,overscrollX:dn,overscrollY:Sn,remSize:Va,rowHeight:Fa,scaleToRem:Kt,theme:Gt}),nr=Hb(le),dr=br??(v>1e4?48:v>1e3?44:v>100?36:32),yn=fn!=="none",j=yn?1:0,Ft=De!==void 0,Ar=De?.sticky===!0,[ao,Di]=d.useState(!1),lo=qt??ao,Ba=d.useCallback(()=>{Tt!==void 0?Tt():Di(!1)},[Tt]),K=d.useMemo(()=>Mt===void 0?void 0:Yi(Mt,j),[Mt,j])??n,_=d.useRef();_.current===void 0&&(_.current=new AbortController),d.useEffect(()=>()=>_?.current.abort(),[]);const[ee,xe]=mb(te,x,j,_.current,Le),Re=d.useCallback((b,L,A)=>{if(ft===void 0)return!0;const $=[b[0]-j,b[1]];return ft?.($,L,A)},[j,ft]),de=d.useRef(Mt),pe=d.useCallback((b,L)=>{L&&(b=Cb(b,ee,j,C,_.current)),dt!==void 0?(de.current=Yi(b,-j),dt(de.current)):r(b)},[dt,ee,j,C]),We=Rr(Jt,d.useCallback((b,L,A,$)=>{Jt?.(y[A-j],L,A-j,$)},[Jt,j,y])),ke=Rr(_e,d.useCallback((b,L,A,$)=>{_e?.(y[A-j],L,A-j,$)},[_e,j,y])),Xe=Rr(xt,d.useCallback((b,L,A,$)=>{xt?.(y[A-j],L,A-j,$)},[xt,j,y])),pt=Rr(k,d.useCallback((b,L)=>k?.({...b,columnIndex:b.columnIndex-j},L)??!1,[k,j])),hn=Rr(H,d.useCallback((b,L)=>H?.({...b,col:b.col-j},L)??!1,[H,j])),Nt=d.useCallback(b=>{if(Fe!==void 0){const L=Fe(Yi(b,-j));return typeof L=="boolean"?L:Yi(L,j)}return!0},[Fe,j]),[kt,lt,je]=gb(K,pe,be,ue,ve,Be,D),ct=d.useMemo(()=>mr(ih(),Oi),[Oi]),[_t,so]=d.useState([0,0,0]),Fr=d.useMemo(()=>{if(Hn===void 0)return{};const b={};for(const L of Hn)b[L.kind]=L;return b},[Hn]),en=d.useCallback(b=>b.kind!==Y.Custom?Fr[b.kind]:Dn?.find(L=>L.isMatch(b)),[Dn,Fr]);let{sizedColumns:cn,nonGrowWidth:Lt}=z0(y,Le,xe,_t[0]-(j===0?0:dr)-_t[2],wr,Ti,ct,en,_.current);fn!=="none"&&(Lt+=dr);const Bn=d.useMemo(()=>cn.some(b=>b.group!==void 0),[cn]),pn=Bn?Vo+io:Vo,hr=K.rows.length,fr=fn==="none"?void 0:hr===0?!1:hr===Le?!0:void 0,st=d.useMemo(()=>fn==="none"?cn:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:yr,rowMarker:ro,rowMarkerChecked:fr,headerRowMarkerTheme:no,headerRowMarkerAlwaysVisible:Ei,headerRowMarkerDisabled:zr},...cn],[fn,cn,dr,yr,ro,fr,no,Ei,zr]),tn=d.useRef({height:1,width:1,x:0,y:0}),rr=d.useRef(!1),{setVisibleRegion:Pi,visibleRegion:pr,scrollRef:Bt}=Vb(Tn,ln,tr,tn,()=>rr.current=!0);tn.current=pr;const Df=pr.x+j,Hi=pr.y,gn=d.useRef(null),wn=d.useCallback(b=>{b===!0?gn.current?.focus():window.requestAnimationFrame(()=>{gn.current?.focus()})},[]),mn=Ft?Le+1:Le,Nn=d.useCallback(b=>{const L=j===0?b:b.map($=>({...$,location:[$.location[0]-j,$.location[1]]})),A=fe?.(L);if(A!==!0)for(const $ of L)ae?.($.location,$.value);return A},[ae,fe,j]),[Vr,Na]=d.useState(),zi=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,qs=Lo?K.current?.cell:void 0,Li=qs?.[0],Ai=qs?.[1],Pf=d.useMemo(()=>{if((vt===void 0||vt.length===0)&&(zi??Li??Ai??Vr)===void 0)return;const b=[];if(vt!==void 0)for(const L of vt){const A=st.length-L.range.x-j;A>0&&b.push({color:L.color,range:{...L.range,x:L.range.x+j,width:Math.min(A,L.range.width)},style:L.style})}return Vr!==void 0&&b.push({color:Zr(ct.accentColor,0),range:Vr,style:"dashed"}),zi!==void 0&&b.push({color:Zr(ct.accentColor,.5),range:zi,style:"solid-outline"}),Li!==void 0&&Ai!==void 0&&b.push({color:ct.accentColor,range:{x:Li,y:Ai,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[Vr,zi,Li,Ai,vt,st.length,ct.accentColor,j]),Zs=d.useRef(st);Zs.current=st;const zn=d.useCallback(([b,L],A=!1)=>{const $=Ft&&L===mn-1;if(b===0&&yn){if($)return Ji;const N=Fo(L);return N===void 0?Ji:{kind:jn.Marker,allowOverlay:!1,checkboxStyle:ro,checked:K?.rows.hasIndex(L)===!0,markerKind:fn==="clickable-number"?"number":fn,row:to+N,drawHandle:Qt!==void 0,cursor:fn==="clickable-number"?"pointer":void 0}}else if($){const N=b===j?De?.hint??"":"",X=Zs.current[b];if(X?.trailingRowOptions?.disabled===!0)return Ji;{const F=X?.trailingRowOptions?.hint??N,U=X?.trailingRowOptions?.addIcon??De?.addIcon;return{kind:jn.NewRow,hint:F,allowOverlay:!1,icon:U}}}else{const N=b-j;if(A||ht?.strict===!0){const F=tn.current,U=F.x>N||N>F.x+F.width||F.y>L||L>F.y+F.height||L>=Ua.current,Q=N===F.extras?.selected?.[0]&&L===F.extras?.selected[1];let se=!1;if(F.extras?.freezeRegions!==void 0){for(const Pe of F.extras.freezeRegions)if(Xr(Pe,N,L)){se=!0;break}}if(U&&!Q&&!se)return Ji}let X=x([N,L]);return j!==0&&X.span!==void 0&&(X={...X,span:[X.span[0]+j,X.span[1]+j]}),X}},[Ft,mn,yn,Fo,ro,K?.rows,fn,to,Qt,j,De?.hint,De?.addIcon,ht?.strict,x]),Wa=d.useCallback(b=>{let L=wt?.(b)??{name:b};return ge!==void 0&&b!==""&&(L={icon:L.icon,name:L.name,overrideTheme:L.overrideTheme,actions:[...L.actions??[],{title:"Rename",icon:"renameIcon",onClick:A=>Xa({group:L.name,bounds:A.bounds})}]}),L},[wt,ge]),Fi=d.useCallback(b=>{const[L,A]=b.cell,$=st[L],N=$?.group!==void 0?Wa($.group)?.overrideTheme:void 0,X=$?.themeOverride,F=Lr?.(A);i({...b,theme:mr(ct,N,X,F,b.content.themeOverride)})},[Lr,st,Wa,ct]),co=d.useCallback((b,L,A)=>{if(K.current===void 0)return;const[$,N]=K.current.cell,X=zn([$,N]);if(X.kind!==Y.Boolean&&X.allowOverlay){let F=X;if(A!==void 0)switch(F.kind){case Y.Number:{const U=Jg(()=>A==="-"?-0:Number.parseFloat(A),0);F={...F,data:Number.isNaN(U)?0:U};break}case Y.Text:case Y.Markdown:case Y.Uri:F={...F,data:A};break}Fi({target:b,content:F,initialValue:A,cell:[$,N],highlight:A===void 0,forceEditMode:A!==void 0,activation:L})}else X.kind===Y.Boolean&&L.inputType==="keyboard"&&X.readonly!==!0&&(Nn([{location:K.current.cell,value:{...X,data:xh(X.data)}}]),gn.current?.damage([{cell:K.current.cell}]))},[zn,K,Nn,Fi]),Ys=d.useCallback((b,L)=>{const A=gn.current?.getBounds(b,L);if(A===void 0||Bt.current===null)return;const $=zn([b,L]);$.allowOverlay&&Fi({target:A,content:$,initialValue:void 0,highlight:!0,cell:[b,L],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[zn,Bt,Fi]),Wt=d.useCallback((b,L,A="both",$=0,N=0,X=void 0)=>{if(Bt.current!==null){const F=gn.current,U=l.current,Q=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,se=typeof L!="number"?L.unit==="cell"?L.amount:void 0:L,Pe=typeof b!="number"&&b.unit==="px"?b.amount:void 0,It=typeof L!="number"&&L.unit==="px"?L.amount:void 0;if(F!==null&&U!==null){let qe={x:0,y:0,width:0,height:0},Ge=0,Ke=0;if((Q!==void 0||se!==void 0)&&(qe=F.getBounds((Q??0)+j,se??0)??qe,qe.width===0||qe.height===0))return;const tt=U.getBoundingClientRect(),yt=tt.width/U.offsetWidth;if(Pe!==void 0&&(qe={...qe,x:Pe-tt.left-Bt.current.scrollLeft,width:1}),It!==void 0&&(qe={...qe,y:It+tt.top-Bt.current.scrollTop,height:1}),qe!==void 0){const nn={x:qe.x-$,y:qe.y-N,width:qe.width+2*$,height:qe.height+2*N};let mo=0;for(let tl=0;tl<Ee;tl++)mo+=cn[tl].width;let ji=0;const Go=et+(Ar?1:0);Go>0&&(ji=eo(mn,Go,tr));let ir=mo*yt+tt.left+j*dr*yt,vo=tt.right,Nr=tt.top+pn*yt,bo=tt.bottom-ji*yt;const Gi=qe.width+$*2;switch(X?.hAlign){case"start":vo=ir+Gi;break;case"end":ir=vo-Gi;break;case"center":ir=Math.floor((ir+vo)/2)-Gi/2,vo=ir+Gi;break}const Ui=qe.height+N*2;switch(X?.vAlign){case"start":bo=Nr+Ui;break;case"end":Nr=bo-Ui;break;case"center":Nr=Math.floor((Nr+bo)/2)-Ui/2,bo=Nr+Ui;break}ir>nn.x?Ge=nn.x-ir:vo<nn.x+nn.width&&(Ge=nn.x+nn.width-vo),Nr>nn.y?Ke=nn.y-Nr:bo<nn.y+nn.height&&(Ke=nn.y+nn.height-bo),A==="vertical"||typeof b=="number"&&b<Ee?Ge=0:(A==="horizontal"||typeof L=="number"&&L>=mn-Go)&&(Ke=0),(Ge!==0||Ke!==0)&&(yt!==1&&(Ge/=yt,Ke/=yt),Bt.current.scrollTo({left:Ge+Bt.current.scrollLeft,top:Ke+Bt.current.scrollTop,behavior:X?.behavior??"auto"}))}}}},[j,et,dr,Bt,pn,Ee,cn,mn,Ar,tr]),ja=d.useRef(Ys),Ga=d.useRef(x);ja.current=Ys,Ga.current=x;const Ua=d.useRef(Le);Ua.current=Le;const Js=d.useRef(st.length);Js.current=st.length;const xr=d.useCallback(async(b,L=!0,A)=>{if(st[b]?.trailingRowOptions?.disabled===!0)return;const $=ye?.();let N,X=!0;$!==void 0&&(N=await $,N==="top"&&(X=!1),typeof N=="number"&&(X=!1));let F=0;const U=()=>{if(Ua.current<=Le){F<500&&window.setTimeout(U,F),F=50+F*2;return}const Q=typeof N=="number"?N:X?Le:0;Wi.current(b-j,Q,"both",0,0,A?{behavior:A}:void 0),kt({cell:[b,Q],range:{x:b,y:Q,width:1,height:1}},!1,!1,"edit");const se=Ga.current([b-j,Q]);se.allowOverlay&&Co(se)&&se.readonly!==!0&&L&&window.setTimeout(()=>{ja.current(b,Q)},0)};U()},[st,ye,j,Le,kt]),Vi=d.useCallback(async(b,L=!0)=>{const A=at?.();let $,N=!0;A!==void 0&&($=await A,$==="left"&&(N=!1),typeof $=="number"&&(N=!1));let X=0;const F=()=>{if(Js.current<=st.length){X<500&&window.setTimeout(F,X),X=50+X*2;return}const U=typeof $=="number"?$:N?st.length:0;Wt(U-j,b),kt({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const Q=Ga.current([U-j,b]);Q.allowOverlay&&Co(Q)&&Q.readonly!==!0&&L&&window.setTimeout(()=>{ja.current(U,b)},0)};F()},[st,at,j,Wt,kt]),uo=d.useCallback(b=>{const L=cn[b]?.trailingRowOptions?.targetColumn??De?.targetColumn;if(typeof L=="number")return L+(yn?1:0);if(typeof L=="object"){const A=y.indexOf(L);if(A>=0)return A+(yn?1:0)}},[cn,y,yn,De?.targetColumn]),kr=d.useRef(),ho=d.useRef(),_o=d.useCallback((b,L)=>{const[A,$]=L;return mr(ct,st[A]?.themeOverride,Lr?.($),b.themeOverride)},[Lr,st,ct]),{mapper:_r}=Ab(gt,v),Un=gt?.navigationBehavior,$o=d.useCallback(b=>{const L=wa.value?b.metaKey:b.ctrlKey,A=L&&ie==="multi",[$,N]=b.location,X=K.columns,F=K.rows,[U,Q]=K.current?.cell??[];if(b.kind==="cell"){if(ho.current=void 0,$r.current=[$,N],$===0&&yn){if(Ft===!0&&N===Le||fn==="number"||ie==="none")return;const se=zn(b.location);if(se.kind!==jn.Marker)return;if(Qt!==void 0){const qe=en(se);Fn(qe?.kind===jn.Marker);const Ge=qe?.onClick?.({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:_o(se,b.location),preventDefault:()=>{}});if(Ge===void 0||Ge.checked===se.checked)return}i(void 0),wn();const Pe=F.hasIndex(N),It=kr.current;if(ie==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&It!==void 0&&F.hasIndex(It)){const qe=[Math.min(It,N),Math.max(It,N)+1];A||Oe==="multi"?lt(void 0,qe,!0):lt(Ye.fromSingleSelection(qe),void 0,A)}else ie==="multi"&&(A||b.isTouch||Oe==="multi")?Pe?lt(F.remove(N),void 0,!0):(lt(void 0,N,!0),kr.current=N):Pe&&F.length===1?lt(Ye.empty(),void 0,L):(lt(Ye.fromSingleSelection(N),void 0,L),kr.current=N)}else if($>=j&&Ft&&N===Le){const se=uo($);xr(se??$)}else if(U!==$||Q!==N){const se=zn(b.location),Pe=en(se);if(Pe?.onSelect!==void 0){let Ge=!1;if(Pe.onSelect({...b,cell:se,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>Ge=!0,theme:_o(se,b.location)}),Ge)return}if(Un==="block"&&_r(N).isGroupHeader)return;const It=Ar&&N===Le,qe=Ar&&K!==void 0&&K.current?.cell[1]===Le;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&Q!==void 0&&K.current!==void 0&&!qe){if(It)return;const Ge=Math.min($,U),Ke=Math.max($,U),tt=Math.min(N,Q),yt=Math.max(N,Q);kt({...K.current,range:{x:Ge,y:tt,width:Ke-Ge+1,height:yt-tt+1}},!0,L,"click"),kr.current=void 0,wn()}else kt({cell:[$,N],range:{x:$,y:N,width:1,height:1}},!0,L,"click"),kr.current=void 0,i(void 0),wn()}}else if(b.kind==="header")if($r.current=[$,N],i(void 0),yn&&$===0)kr.current=void 0,ho.current=void 0,!zr&&ie==="multi"&&(F.length!==Le?lt(Ye.fromSingleSelection([0,Le]),void 0,L):lt(Ye.empty(),void 0,L),wn());else{const se=ho.current;if(ne==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&se!==void 0&&X.hasIndex(se)){const Pe=[Math.min(se,$),Math.max(se,$)+1];L||b.isTouch||ut==="multi"?je(void 0,Pe,L):je(Ye.fromSingleSelection(Pe),void 0,L)}else ne==="multi"&&(L||b.isTouch||ut==="multi")?(X.hasIndex($)?je(X.remove($),void 0,L):je(void 0,$,L),ho.current=$):ne!=="none"&&(X.hasIndex($)?je(X.remove($),void 0,L):je(Ye.fromSingleSelection($),void 0,L),ho.current=$);kr.current=void 0,wn()}else b.kind===Zn?$r.current=[$,N]:b.kind===xa&&!b.isMaybeScrollbar&&(pe(Qi,!1),i(void 0),wn(),an?.(),kr.current=void 0,ho.current=void 0)},[ie,ne,K,yn,j,Ft,Le,fn,zn,Qt,wn,Oe,ut,en,_o,lt,uo,xr,Un,_r,Ar,kt,zr,je,pe,an]),Bo=d.useRef(!1),$r=d.useRef(),Qs=d.useRef(pr),or=d.useRef(),Hf=d.useCallback(b=>{if(fo.current=!1,Qs.current=tn.current,b.button!==0&&b.button!==1){or.current=void 0;return}const L=performance.now();or.current={button:b.button,time:L,location:b.location},b?.kind==="header"&&(Bo.current=!0);const A=b.kind==="cell"&&b.isFillHandle;!A&&b.kind!=="cell"&&b.isEdge||(c({previousSelection:K,fillHandle:A}),$r.current=void 0,!b.isTouch&&b.button===0&&!A?$o(b):!b.isTouch&&b.button===1&&($r.current=b.location))},[K,$o]),[Ka,Xa]=d.useState(),ec=d.useCallback(b=>{if(b.kind!==Zn||ne!=="multi")return;const L=wa.value?b.metaKey:b.ctrlKey,[A]=b.location,$=K.columns;if(A<j)return;const N=st[A];let X=A,F=A;for(let U=A-1;U>=j&&bi(N.group,st[U].group);U--)X--;for(let U=A+1;U<st.length&&bi(N.group,st[U].group);U++)F++;if(wn(),L||b.isTouch||ut==="multi")if($.hasAll([X,F+1])){let U=$;for(let Q=X;Q<=F;Q++)U=U.remove(Q);je(U,void 0,L)}else je(void 0,[X,F+1],L);else je(Ye.fromSingleSelection([X,F+1]),void 0,L)},[ne,wn,K.columns,st,j,je,ut]),fo=d.useRef(!1),_i=d.useCallback(async b=>{if(ee!==void 0&&We!==void 0){const L=tn.current.y,A=tn.current.height;let $=ee({x:b,y:L,width:1,height:Math.min(A,Le-L)},_.current.signal);typeof $!="object"&&($=await $());const N=cn[b-j],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=ct.baseFontFull;const F=sh(X,ct,N,0,$,wr,oo,!1,en);We?.(N,F.width,b,F.width)}}},[cn,ee,oo,ct,wr,We,j,Le,en]),[zf,qa]=d.useState(),po=d.useCallback(async(b,L)=>{const A=b.current?.range;if(A===void 0||ee===void 0||L.current===void 0)return;const $=L.current.range;if(M!==void 0){let U=!1;if(M({fillDestination:{...$,x:$.x-j},patternSource:{...A,x:A.x-j},preventDefault:()=>U=!0}),U)return}let N=ee(A,_.current.signal);typeof N!="object"&&(N=await N());const X=N,F=[];for(let U=0;U<$.width;U++)for(let Q=0;Q<$.height;Q++){const se=[$.x+U,$.y+Q];if(Zd(se,A))continue;const Pe=X[Q%A.height][U%A.width];Mo(Pe)||!Co(Pe)||F.push({location:se,value:{...Pe}})}Nn(F),gn.current?.damage(F.map(U=>({cell:U.location})))},[ee,Nn,M,j]),tc=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,width:1}}};po(b,K)},[po,K]),nc=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const b={...K,current:{...K.current,range:{...K.current.range,height:1}}};po(b,K)},[po,K]),Lf=d.useCallback((b,L)=>{const A=s;if(c(void 0),Na(void 0),qa(void 0),Bo.current=!1,L)return;if(A?.fillHandle===!0&&K.current!==void 0&&A.previousSelection?.current!==void 0){if(Vr===void 0)return;const Pe={...K,current:{...K.current,range:fh(A.previousSelection.current.range,Vr)}};po(A.previousSelection,Pe),pe(Pe,!0);return}const[$,N]=b.location,[X,F]=$r.current??[],U=()=>{fo.current=!0},Q=Pe=>{const It=Pe.isTouch||X===$&&F===N;if(It&&I?.([$-j,N],{...Pe,preventDefault:U}),Pe.button===1)return!fo.current;if(!fo.current){const qe=zn(b.location),Ge=en(qe);if(Ge!==void 0&&Ge.onClick!==void 0&&It){const tt=Ge.onClick({...Pe,cell:qe,posX:Pe.localEventX,posY:Pe.localEventY,bounds:Pe.bounds,theme:_o(qe,b.location),preventDefault:U});tt!==void 0&&!Mo(tt)&&ko(tt)&&(Nn([{location:Pe.location,value:tt}]),gn.current?.damage([{cell:Pe.location}]))}if(fo.current||K.current===void 0)return!1;let Ke=!1;switch(qe.activationBehaviorOverride??Me){case"double-click":case"second-click":{if(A?.previousSelection?.current?.cell===void 0)break;const[tt,yt]=K.current.cell,[nn,mo]=A.previousSelection.current.cell;Ke=$===tt&&$===nn&&N===yt&&N===mo&&(Pe.isDoubleClick===!0||Me==="second-click");break}case"single-click":{Ke=!0;break}}if(Ke){const tt={inputType:"pointer",pointerActivation:Pe.isDoubleClick===!0?"double-click":qe.activationBehaviorOverride??Me,pointerType:Pe.isTouch?"touch":"mouse"};return O?.([$-j,N],tt),co(Pe.bounds,tt),!0}}return!1},se=b.location[0]-j;if(b.isTouch){const Pe=tn.current,It=Qs.current;if(Pe.x!==It.x||Pe.y!==It.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&fi(K.current?.cell,b.location)){W?.([se,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&K.columns.hasIndex($)){ce?.(se,{...b,preventDefault:U});return}else if(b.kind===Zn){if(se<0)return;q?.(se,{...b,preventDefault:U});return}}b.kind==="cell"?Q(b)||$o(b):b.kind===Zn?J?.(se,{...b,preventDefault:U}):(b.kind===Ir&&R?.(se,{...b,preventDefault:U}),$o(b));return}if(b.kind==="header"){if(se<0)return;b.isEdge?b.isDoubleClick===!0&&_i($):b.button===0&&$===X&&N===F&&R?.(se,{...b,preventDefault:U})}if(b.kind===Zn){if(se<0)return;b.button===0&&$===X&&N===F&&(J?.(se,{...b,preventDefault:U}),fo.current||ec(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&Q(b),$r.current=void 0},[s,K,j,Vr,po,pe,I,zn,en,Me,_o,Nn,O,co,W,ce,q,$o,J,R,_i,ec]),Af=d.useCallback(b=>{const L={...b,location:[b.location[0]-j,b.location[1]]};Je?.(L),s!==void 0&&b.buttons===0&&(c(void 0),Na(void 0),qa(void 0),Bo.current=!1),qa(A=>Bo.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===A?.[0]&&b.scrollEdge[1]===A[1]?A:s===void 0||(or.current?.location[0]??0)<j?void 0:b.scrollEdge)},[s,Je,j]),Ff=d.useCallback((b,L)=>{Qe?.(b-j,L)},[Qe,j]),Vf=d.useCallback((b,L)=>{Ue?.(b-j,L)},[Ue,j]),go=K?.current?.cell,_f=d.useCallback((b,L,A,$,N,X)=>{rr.current=!1;let F=go;F!==void 0&&(F=[F[0]-j,F[1]]);const U=Ee===0?void 0:{x:0,y:b.y,width:Ee,height:b.height},Q=[];U!==void 0&&Q.push(U),et>0&&(Q.push({x:b.x-j,y:Le-et,width:b.width,height:et}),Ee>0&&Q.push({x:0,y:Le-et,width:Ee,height:et}));const se={x:b.x-j,y:b.y,width:b.width,height:Ft&&b.y+b.height>=Le?b.height-1:b.height,tx:N,ty:X,extras:{selected:F,freezeRegion:U,freezeRegions:Q}};tn.current=se,Pi(se),so([L,A,$]),In?.(se,se.tx,se.ty,se.extras)},[go,j,Ft,Le,Ee,et,Pi,In]),$f=Rr(T,d.useCallback((b,L)=>T?.(b-j,L-j)!==!1,[T,j])),Bf=Rr(Ce,d.useCallback((b,L)=>{Ce?.(b-j,L-j),ne!=="none"&&je(Ye.fromSingleSelection(L),void 0,!0)},[ne,Ce,j,je])),Za=d.useRef(!1),Nf=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}Ve?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(Za.current=!0),c(void 0)},[Ve,j]),Wf=d.useCallback(()=>{Za.current=!1},[]),rc=gt?.selectionBehavior,$i=d.useCallback(b=>{if(rc!=="block-spanning")return;const{isGroupHeader:L,path:A,groupRows:$}=_r(b);if(L)return[b,b];const N=A[A.length-1],X=b-N,F=b+$-N-1;return[X,F]},[_r,rc]),Ya=d.useRef(),Ja=d.useCallback(b=>{if(!yh(b,Ya.current)&&(Ya.current=b,!(or?.current?.button!==void 0&&or.current.button>=1))){if(b.buttons!==0&&s!==void 0&&or.current?.location[0]===0&&j===1&&ie==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(or.current.location[1])&&K.rows.hasIndex(or.current.location[1])){const L=Math.min(or.current.location[1],b.location[1]),A=Math.max(or.current.location[1],b.location[1])+1;lt(Ye.fromSingleSelection([L,A]),void 0,!1)}else if(b.buttons!==0&&s!==void 0&&K.current!==void 0&&!Za.current&&!Bo.current&&(Be==="rect"||Be==="multi-rect")){const[L,A]=K.current.cell;let[$,N]=b.location;if(N<0&&(N=tn.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const X=s.previousSelection.current.range;N=Math.min(N,Ft?Le-1:Le);const F=kv(X,$,N,bt);Na(F)}else{if(Ft&&A===Le)return;if(Ft&&N===Le)if(b.kind===xa)N--;else return;$=Math.max($,j);const X=$i(A);N=X===void 0?N:Wn(N,X[0],X[1]);const F=$-L,U=N-A,Q={x:F>=0?L:$,y:U>=0?A:N,width:Math.abs(F)+1,height:Math.abs(U)+1};kt({...K.current,range:Q},!0,!1,"drag")}}Ot?.({...b,location:[b.location[0]-j,b.location[1]]})}},[s,j,ie,K,Be,Ot,lt,Ft,Le,bt,$i,kt]),jf=d.useCallback(()=>{const b=Ya.current;if(b===void 0)return;const[L,A]=b.scrollEdge;let[$,N]=b.location;const X=tn.current;L===-1?$=X.extras?.freezeRegion?.x??X.x:L===1&&($=X.x+X.width),A===-1?N=Math.max(0,X.y):A===1&&(N=Math.min(Le-1,X.y+X.height)),$=Wn($,0,st.length-1),N=Wn(N,0,Le-1),Ja({...b,location:[$,N]})},[st.length,Ja,Le]);Db(zf,Bt,jf);const Kn=d.useCallback(b=>{if(K.current===void 0)return;const[L,A]=b,[$,N]=K.current.cell,X=K.current.range;let F=X.x,U=X.x+X.width,Q=X.y,se=X.y+X.height;const[Pe,It]=$i(N)??[0,Le-1],qe=It+1;if(A!==0)switch(A){case 2:{se=qe,Q=N,Wt(0,se,"vertical");break}case-2:{Q=Pe,se=N+1,Wt(0,Q,"vertical");break}case 1:{Q<N?(Q++,Wt(0,Q,"vertical")):(se=Math.min(qe,se+1),Wt(0,se,"vertical"));break}case-1:{se>N+1?(se--,Wt(0,se,"vertical")):(Q=Math.max(Pe,Q-1),Wt(0,Q,"vertical"));break}default:mi()}if(L!==0)if(L===2)U=st.length,F=$,Wt(U-1-j,0,"horizontal");else if(L===-2)F=j,U=$+1,Wt(F-j,0,"horizontal");else{let Ge=[];if(ee!==void 0){const Ke=ee({x:F,y:Q,width:U-F-j,height:se-Q},_.current.signal);typeof Ke=="object"&&(Ge=Bb(Ke))}if(L===1){let Ke=!1;if(F<$){if(Ge.length>0){const tt=Tr(F+1,$+1).find(yt=>!Ge.includes(yt-j));tt!==void 0&&(F=tt,Ke=!0)}else F++,Ke=!0;Ke&&Wt(F,0,"horizontal")}Ke||(U=Math.min(st.length,U+1),Wt(U-1-j,0,"horizontal"))}else if(L===-1){let Ke=!1;if(U>$+1){if(Ge.length>0){const tt=Tr(U-1,$,-1).find(yt=>!Ge.includes(yt-j));tt!==void 0&&(U=tt,Ke=!0)}else U--,Ke=!0;Ke&&Wt(U-j,0,"horizontal")}Ke||(F=Math.max(j,F-1),Wt(F-j,0,"horizontal"))}else mi()}kt({cell:K.current.cell,range:{x:F,y:Q,width:U-F,height:se-Q}},!0,!1,"keyboard-select")},[ee,$i,K,st.length,j,Le,Wt,kt]),Qa=d.useRef(Hr);Qa.current=Hr;const Cr=d.useCallback((b,L,A,$)=>{const N=mn-(A?0:1);b=Wn(b,j,cn.length-1+j),L=Wn(L,0,N);const X=go?.[0],F=go?.[1];if(b===X&&L===F)return!1;if($&&K.current!==void 0){const U=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&U.push(K.current.range),pe({...K,current:{cell:[b,L],range:{x:b,y:L,width:1,height:1},rangeStack:U}},!0)}else kt({cell:[b,L],range:{x:b,y:L,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===b&&u.current[1]===L&&(u.current=void 0),Qa.current&&Wt(b-j,L),!0},[mn,j,cn.length,go,K,Wt,pe,kt]),Gf=d.useCallback((b,L)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(Nn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{gn.current?.damage([{cell:o.cell}])})),wn(!0),i(void 0);const[A,$]=L;if(K.current!==void 0&&(A!==0||$!==0)){const N=K.current.cell[1]===mn-1&&b!==void 0,X=K.current.cell[0]===st.length-1&&b!==void 0;let F=!0;if(N&&$===1&&ye!==void 0){F=!1;const U=K.current.cell[0]+A,Q=uo(U);xr(Q??U,!1)}if(X&&A===1&&at!==void 0){F=!1;const U=K.current.cell[1]+$;Vi(U,!1)}F&&Cr(Wn(K.current.cell[0]+A,0,st.length-1),Wn(K.current.cell[1]+$,0,mn-1),N,!1)}P?.(b,L)},[o?.cell,wn,K,P,Nn,mn,Cr,st.length,xr,Vi,ye,at,uo]),Uf=d.useMemo(()=>`gdg-overlay-${$b++}`,[]),Br=d.useCallback(b=>{wn();const L=[];for(let A=b.x;A<b.x+b.width;A++)for(let $=b.y;$<b.y+b.height;$++){const N=x([A-j,$]);if(!N.allowOverlay&&N.kind!==Y.Boolean)continue;let X;if(N.kind===Y.Custom){const F=en(N),U=F?.provideEditor?.({...N,location:[A-j,$]});F?.onDelete!==void 0?X=F.onDelete(N):Qg(U)&&(X=U?.deletedValue?.(N))}else(ko(N)&&N.allowOverlay||N.kind===Y.Boolean)&&(X=en(N)?.onDelete?.(N));X!==void 0&&!Mo(X)&&ko(X)&&L.push({location:[A,$],value:X})}Nn(L),gn.current?.damage(L.map(A=>({cell:A.location})))},[wn,x,en,Nn,j]),No=o!==void 0,oc=d.useCallback(b=>{const L=()=>{b.stopPropagation(),b.preventDefault()},A={didMatch:!1},{bounds:$}=b,N=K.columns,X=K.rows,F=nr;if(!No&&nt(F.clear,b,A))pe(Qi,!1),an?.();else if(!No&&nt(F.selectAll,b,A))pe({columns:Ye.empty(),rows:Ye.empty(),current:{cell:K.current?.cell??[j,0],range:{x:j,y:0,width:y.length,height:Le},rangeStack:[]}},!1);else if(nt(F.search,b,A))a?.current?.focus({preventScroll:!0}),Di(!0);else if(nt(F.delete,b,A)){const Ke=Nt?.(K)??!0;if(Ke!==!1){const tt=Ke===!0?K:Ke;if(tt.current!==void 0){Br(tt.current.range);for(const yt of tt.current.rangeStack)Br(yt)}for(const yt of tt.rows)Br({x:j,y:yt,width:y.length,height:1});for(const yt of tt.columns)Br({x:yt,y:0,width:1,height:Le})}}if(A.didMatch)return L(),!0;if(K.current===void 0)return!1;let[U,Q]=K.current.cell;const[,se]=K.current.cell;let Pe=!1,It=!1;if(nt(F.scrollToSelectedCell,b,A))Wi.current(U-j,Q);else if(ne!=="none"&&nt(F.selectColumn,b,A))N.hasIndex(U)?je(N.remove(U),void 0,!0):ne==="single"?je(Ye.fromSingleSelection(U),void 0,!0):je(void 0,U,!0);else if(ie!=="none"&&nt(F.selectRow,b,A))X.hasIndex(Q)?lt(X.remove(Q),void 0,!0):ie==="single"?lt(Ye.fromSingleSelection(Q),void 0,!0):lt(void 0,Q,!0);else if(!No&&$!==void 0&&nt(F.activateCell,b,A))if(Q===Le&&Ft)window.setTimeout(()=>{const Ke=uo(U);xr(Ke??U)},0);else{const Ke={inputType:"keyboard",key:b.key};O?.([U-j,Q],Ke),co($,Ke)}else K.current.range.height>1&&nt(F.downFill,b,A)?nc():K.current.range.width>1&&nt(F.rightFill,b,A)?tc():nt(F.goToNextPage,b,A)?Q+=Math.max(1,tn.current.height-4):nt(F.goToPreviousPage,b,A)?Q-=Math.max(1,tn.current.height-4):nt(F.goToFirstCell,b,A)?(i(void 0),Q=0,U=0):nt(F.goToLastCell,b,A)?(i(void 0),Q=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):nt(F.selectToFirstCell,b,A)?(i(void 0),Kn([-2,-2])):nt(F.selectToLastCell,b,A)?(i(void 0),Kn([2,2])):No?(nt(F.closeOverlay,b,A)&&i(void 0),nt(F.acceptOverlayDown,b,A)&&(i(void 0),Q++),nt(F.acceptOverlayUp,b,A)&&(i(void 0),Q--),nt(F.acceptOverlayLeft,b,A)&&(i(void 0),U--),nt(F.acceptOverlayRight,b,A)&&(i(void 0),U++)):(nt(F.goDownCell,b,A)?Q+=1:nt(F.goUpCell,b,A)?Q-=1:nt(F.goRightCell,b,A)?U+=1:nt(F.goLeftCell,b,A)?U-=1:nt(F.goDownCellRetainSelection,b,A)?(Q+=1,Pe=!0):nt(F.goUpCellRetainSelection,b,A)?(Q-=1,Pe=!0):nt(F.goRightCellRetainSelection,b,A)?(U+=1,Pe=!0):nt(F.goLeftCellRetainSelection,b,A)?(U-=1,Pe=!0):nt(F.goToLastRow,b,A)?Q=Le-1:nt(F.goToFirstRow,b,A)?Q=Number.MIN_SAFE_INTEGER:nt(F.goToLastColumn,b,A)?U=Number.MAX_SAFE_INTEGER:nt(F.goToFirstColumn,b,A)?U=Number.MIN_SAFE_INTEGER:(Be==="rect"||Be==="multi-rect")&&(nt(F.selectGrowDown,b,A)?Kn([0,1]):nt(F.selectGrowUp,b,A)?Kn([0,-1]):nt(F.selectGrowRight,b,A)?Kn([1,0]):nt(F.selectGrowLeft,b,A)?Kn([-1,0]):nt(F.selectToLastRow,b,A)?Kn([0,2]):nt(F.selectToFirstRow,b,A)?Kn([0,-2]):nt(F.selectToLastColumn,b,A)?Kn([2,0]):nt(F.selectToFirstColumn,b,A)&&Kn([-2,0])),It=A.didMatch);if(Un!==void 0&&Un!=="normal"&&Q!==se){const Ke=Un==="skip-up"||Un==="skip"||Un==="block",tt=Un==="skip-down"||Un==="skip"||Un==="block",yt=Q<se;if(yt&&Ke){for(;Q>=0&&_r(Q).isGroupHeader;)Q--;Q<0&&(Q=se)}else if(!yt&&tt){for(;Q<Le&&_r(Q).isGroupHeader;)Q++;Q>=Le&&(Q=se)}}const qe=Cr(U,Q,!1,Pe),Ge=A.didMatch;return Ge&&(qe||!It||Rn)&&L(),Ge},[Un,No,K,nr,ne,ie,Be,j,_r,Le,Cr,pe,an,y.length,Nt,Rn,Br,je,lt,Ft,uo,xr,O,co,nc,tc,Kn]),Wo=d.useCallback(b=>{let L=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{L=!0}}),L||oc(b)||K.current===void 0)return;const[A,$]=K.current.cell,N=tn.current;if(Ie&&!b.metaKey&&!b.ctrlKey&&K.current!==void 0&&b.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(b.key)&&b.bounds!==void 0&&Co(x([A-j,Math.max(0,Math.min($,Le-1))]))){if((!Ft||$!==Le)&&(N.y>$||$>N.y+N.height||N.x>A||A>N.x+N.width))return;const X={inputType:"keyboard",key:b.key};O?.([A-j,$],X),co(b.bounds,X,b.key),b.stopPropagation(),b.preventDefault()}},[Ie,G,oc,K,x,j,Le,Ft,O,co]),Kf=d.useCallback((b,L)=>{const A=b.location[0]-j;if(b.kind==="header"&&ce?.(A,{...b,preventDefault:L}),b.kind===Zn){if(A<0)return;q?.(A,{...b,preventDefault:L})}if(b.kind==="cell"){const[$,N]=b.location;W?.([A,N],{...b,preventDefault:L}),b0(K,b.location)||Cr($,N,!1,!1)}},[K,W,q,ce,j,Cr]),el=d.useCallback(async b=>{if(!nr.paste)return;function L(F,U,Q,se){const Pe=typeof Q=="object"?Q?.join(`
|
|
183
|
+
`)??"":Q?.toString()??"";if(!Mo(F)&&Co(F)&&F.readonly!==!0){const It=S?.(Pe,F);if(It!==void 0&&ko(It))return{location:U,value:It};const qe=en(F);if(qe===void 0)return;if(qe.kind===Y.Custom){Fn(F.kind===Y.Custom);const Ge=qe.onPaste?.(Pe,F.data);return Ge===void 0?void 0:{location:U,value:{...F,data:Ge}}}else{const Ge=qe.onPaste?.(Pe,F,{formatted:se,formattedString:typeof se=="string"?se:se?.join(`
|
|
184
|
+
`),rawValue:Q});return Ge===void 0?void 0:(Fn(Ge.kind===F.kind),{location:U,value:Ge})}}}const A=K.columns,$=K.rows,N=Bt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0;let X;if(K.current!==void 0?X=[K.current.range.x,K.current.range.y]:A.length===1?X=[A.first()??0,0]:$.length===1&&(X=[j,$.first()??0]),N&&X!==void 0){let F,U;const Q="text/plain",se="text/html";if(navigator.clipboard.read!==void 0){const Ge=await navigator.clipboard.read();for(const Ke of Ge){if(Ke.types.includes(se)){const tt=await(await Ke.getType(se)).text(),yt=cu(tt);if(yt!==void 0){F=yt;break}}Ke.types.includes(Q)&&(U=await(await Ke.getType(Q)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(b!==void 0&&b?.clipboardData!==null){if(b.clipboardData.types.includes(se)){const Ge=b.clipboardData.getData(se);F=cu(Ge)}F===void 0&&b.clipboardData.types.includes(Q)&&(U=b.clipboardData.getData(Q))}else return;const[Pe,It]=X,qe=[];do{if(Se===void 0){const Ge=zn(X),Ke=U??F?.map(yt=>yt.map(nn=>nn.rawValue).join(" ")).join(" ")??"",tt=L(Ge,X,Ke,void 0);tt!==void 0&&qe.push(tt);break}if(F===void 0){if(U===void 0)return;F=Sb(U)}if(Se===!1||typeof Se=="function"&&Se?.([X[0]-j,X[1]],F.map(Ge=>Ge.map(Ke=>Ke.rawValue?.toString()??"")))!==!0)return;for(const[Ge,Ke]of F.entries()){if(Ge+It>=Le)break;for(const[tt,yt]of Ke.entries()){const nn=[tt+Pe,Ge+It],[mo,ji]=nn;if(mo>=st.length||ji>=mn)continue;const Go=zn(nn),ir=L(Go,nn,yt.rawValue,yt.formatted);ir!==void 0&&qe.push(ir)}}}while(!1);Nn(qe),gn.current?.damage(qe.map(Ge=>({cell:Ge.location})))}},[S,en,zn,K,nr.paste,Bt,st.length,Nn,mn,Se,j,Le]);xn("paste",el,h,!1,!0);const jo=d.useCallback(async(b,L)=>{if(!nr.copy)return;const A=L===!0||Bt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0,$=K.columns,N=K.rows,X=(F,U)=>{if(!Ze)du(F,U,b);else{const Q=U.map(se=>({kind:Y.Text,data:y[se].title,displayData:y[se].title,allowOverlay:!1}));du([Q,...F],U,b)}};if(A&&ee!==void 0){if(K.current!==void 0){let F=ee(K.current.range,_.current.signal);typeof F!="object"&&(F=await F()),X(F,Tr(K.current.range.x-j,K.current.range.x+K.current.range.width-j))}else if(N!==void 0&&N.length>0){const F=[...N].map(U=>{const Q=ee({x:j,y:U,width:y.length,height:1},_.current.signal);return typeof Q=="object"?Q[0]:Q().then(se=>se[0])});if(F.some(U=>U instanceof Promise)){const U=await Promise.all(F);X(U,Tr(y.length))}else X(F,Tr(y.length))}else if($.length>0){const F=[],U=[];for(const Q of $){let se=ee({x:Q,y:0,width:1,height:Le},_.current.signal);typeof se!="object"&&(se=await se()),F.push(se),U.push(Q-j)}if(F.length===1)X(F[0],U);else{const Q=F.reduce((se,Pe)=>se.map((It,qe)=>[...It,...Pe[qe]]));X(Q,U)}}}},[y,ee,K,nr.copy,j,Bt,Le,Ze]);xn("copy",jo,h,!1,!1);const Xf=d.useCallback(async b=>{if(!(!nr.cut||!(Bt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0))&&(await jo(b),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:Ye.empty(),columns:Ye.empty()};const A=Nt?.(L);if(A===!1||(L=A===!0?L:A,L.current===void 0))return;Br(L.current.range)}},[Br,K,nr.cut,jo,Bt,Nt]);xn("cut",Xf,h,!1,!1);const qf=d.useCallback((b,L)=>{if(he!==void 0){j!==0&&(b=b.map(N=>[N[0]-j,N[1]])),he(b,L);return}if(b.length===0||L===-1)return;const[A,$]=b[L];u.current!==void 0&&u.current[0]===A&&u.current[1]===$||(u.current=[A,$],Cr(A,$,!1,!1))},[he,j,Cr]),[Bi,Ni]=Mt?.current?.cell??[],Wi=d.useRef(Wt);Wi.current=Wt,d.useLayoutEffect(()=>{Qa.current&&!rr.current&&Bi!==void 0&&Ni!==void 0&&(Bi!==de.current?.current?.cell[0]||Ni!==de.current?.current?.cell[1])&&Wi.current(Bi,Ni),rr.current=!1},[Bi,Ni]);const ic=K.current!==void 0&&(K.current.cell[0]>=st.length||K.current.cell[1]>=mn);d.useLayoutEffect(()=>{ic&&pe(Qi,!1)},[ic,pe]);const Zf=d.useMemo(()=>Ft===!0&&De?.tint===!0?Ye.fromSingleSelection(mn-1):Ye.empty(),[mn,Ft,De?.tint]),Yf=d.useCallback(b=>typeof sn=="boolean"?sn:sn?.(b-j)??!0,[j,sn]),Jf=d.useMemo(()=>{if(Ka===void 0||l.current===null)return null;const{bounds:b,group:L}=Ka,A=l.current.getBoundingClientRect();return d.createElement(fb,{bounds:b,group:L,canvasBounds:A,onClose:()=>Xa(void 0),onFinish:$=>{Xa(void 0),ge?.(L,$)}})},[ge,Ka]),Qf=Math.min(st.length,Ee+(yn?1:0));d.useImperativeHandle(t,()=>({appendRow:(b,L)=>xr(b+j,L),appendColumn:(b,L)=>Vi(b,L),updateCells:b=>(j!==0&&(b=b.map(L=>({cell:[L.cell[0]+j,L.cell[1]]}))),gn.current?.damage(b)),getBounds:(b,L)=>{if(!(l?.current===null||Bt?.current===null)){if(b===void 0&&L===void 0){const A=l.current.getBoundingClientRect(),$=A.width/Bt.current.clientWidth;return{x:A.x-Bt.current.scrollLeft*$,y:A.y-Bt.current.scrollTop*$,width:Bt.current.scrollWidth*$,height:Bt.current.scrollHeight*$}}return gn.current?.getBounds((b??0)+j,L)}},focus:()=>gn.current?.focus(),emit:async b=>{switch(b){case"delete":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await jo(void 0,!0);break;case"paste":await el();break}},scrollTo:Wt,remeasureColumns:b=>{for(const L of b)_i(L+j)},getMouseArgsForPosition:(b,L,A)=>{if(gn?.current===null)return;const $=gn.current.getMouseArgsForPosition(b,L,A);if($!==void 0)return{...$,location:[$.location[0]-j,$.location[1]]}}}),[xr,Vi,_i,Bt,jo,Wo,el,j,Wt]);const[ac,lc]=go??[],ep=d.useCallback(b=>{const[L,A]=b;if(A===-1){ne!=="none"&&(je(Ye.fromSingleSelection(L),void 0,!1),wn());return}ac===L&&lc===A||(kt({cell:b,range:{x:L,y:A,width:1,height:1}},!0,!1,"keyboard-nav"),Wt(L,A))},[ne,wn,Wt,ac,lc,kt,je]),[tp,np]=d.useState(!1),sc=d.useRef(zd(b=>{np(b)},5)),rp=d.useCallback(()=>{sc.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&s===void 0&&kt({cell:[j,Hi],range:{x:j,y:Hi,width:1,height:1}},!0,!1,"keyboard-select")},[Hi,K,s,j,kt]),op=d.useCallback(()=>{sc.current(!1)},[]),[ip,ap]=d.useMemo(()=>{let b;const L=ht?.scrollbarWidthOverride??_l(),A=Le+(Ft?1:0);if(typeof tr=="number")b=pn+A*tr;else{let N=0;const X=Math.min(A,10);for(let F=0;F<X;F++)N+=tr(F);N=Math.floor(N/X),b=pn+A*N}b+=L;const $=st.reduce((N,X)=>X.width+N,0)+L;return[`${Math.min(1e5,$)}px`,`${Math.min(1e5,b)}px`]},[st,ht?.scrollbarWidthOverride,tr,Le,Ft,pn]),lp=d.useMemo(()=>P0(ct),[ct]);return d.createElement(ah.Provider,{value:ct},d.createElement(Eb,{style:lp,className:Z,inWidth:m??ip,inHeight:w??ap},d.createElement(cb,{fillHandle:Ht,drawFocusRing:Lo,experimental:ht,fixedShadowX:Cn,fixedShadowY:ur,getRowThemeOverride:Lr,headerIcons:_n,imageWindowLoader:B,initialSize:$e,isDraggable:Ne,onDragLeave:Dt,onRowMoved:Qt,overscrollX:_a,overscrollY:$a,preventDiagonalScrolling:bn,rightElement:$t,rightElementProps:Mn,smoothScrollX:we,smoothScrollY:zt,className:Z,enableGroups:Bn,onCanvasFocused:rp,onCanvasBlur:op,canvasRef:l,onContextMenu:Kf,theme:ct,cellXOffset:Df,cellYOffset:Hi,accessibilityHeight:pr.height,onDragEnd:Wf,columns:st,nonGrowWidth:Lt,drawHeader:pt,onColumnProposeMove:$f,drawCell:hn,disabledRows:Zf,freezeColumns:Qf,lockColumns:j,firstColAccessible:j===0,getCellContent:zn,minColumnWidth:wr,maxColumnWidth:oo,searchInputRef:a,showSearch:lo,onSearchClose:Ba,highlightRegions:Pf,getCellsForSelection:ee,getGroupDetails:Wa,headerHeight:Vo,isFocused:tp,groupHeaderHeight:Bn?io:0,freezeTrailingRows:et+(Ft&&De?.sticky===!0?1:0),hasAppendRow:Ft,onColumnResize:We,onColumnResizeEnd:ke,onColumnResizeStart:Xe,onCellFocused:ep,onColumnMoved:Bf,onDragStart:Nf,onHeaderMenuClick:Ff,onHeaderIndicatorClick:Vf,onItemHovered:Ja,isFilling:s?.fillHandle===!0,onMouseMove:Af,onKeyDown:Wo,onKeyUp:re,onMouseDown:Hf,onMouseUp:Lf,onDragOverCell:On,onDrop:Yt,onSearchResultsChanged:qf,onVisibleRegionChanged:_f,clientSize:_t,rowHeight:tr,searchResults:oe,searchValue:z,onSearchValueChange:V,rows:mn,scrollRef:Bt,selection:K,translateX:pr.tx,translateY:pr.ty,verticalBorder:Yf,gridRef:gn,getCellRenderer:en,resizeIndicator:Ii}),Jf,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(_b,{...o,validateCell:Re,bloom:E,id:Uf,getCellRenderer:en,className:ht?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:kn,imageEditorOverride:g,portalElementRef:zo,onFinishEditing:Gf,markdownDivCreateNode:p,isOutsideClick:Pn,customEventTarget:ht?.eventTarget}))))},Wb=d.forwardRef(Nb);function pu(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:a,height:l,x:s,y:c}=o,u=t.maxSize??i.checkboxMaxSize,h=Math.floor(o.y+l/2),g=Fd(u,l,i.cellVerticalPadding),f=Ad(t.contentAlign??"center",s,a,i.cellHorizontalPadding,g),p=Ld(f,h,g),m=Vd(s+n,c+r,p);return as(t)&&m}const jb={getAccessibilityString:e=>e.data?.toString()??"false",kind:Y.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Gb(e,e.cell.data,as(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{pu(e)&&e.preventDefault()},onClick:e=>{if(pu(e))return{...e.cell,data:xh(e.cell.data)}},onPaste:(e,t)=>{let n=fa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=is),n===t.data?void 0:{...t,data:n}}};function Gb(e,t,n,r,o){if(!n&&t===fa)return;const{ctx:i,hoverAmount:a,theme:l,rect:s,highlighted:c,hoverX:u,hoverY:h,cell:{contentAlign:g}}=e,{x:f,y:p,width:m,height:w}=s;let y=!1;if(o>0){let v=n?1-o+o*a:.4;if(t===fa&&(v*=a),v===0)return;v<1&&(y=!0,i.globalAlpha=v)}ks(i,l,t,f,p,m,w,c,u,h,r,g),y&&(i.globalAlpha=1)}const Ub=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Kb=e=>{const{bubbles:t}=e;return d.createElement(Ub,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Xb={getAccessibilityString:e=>_d(e.data),kind:Y.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>qb(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Kb,{bubbles:t.data})},onPaste:()=>{}};function qb(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:a,y:l,width:s,height:c}=n;let u=a+r.cellHorizontalPadding;const h=[];for(const g of t){if(u>a+s)break;const f=Dr(g,o,r.baseFontFull).width;h.push({x:u,width:f}),u+=f+r.bubblePadding*2+r.bubbleMargin}o.beginPath();for(const g of h)Jn(o,g.x,l+(c-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);o.fillStyle=i?r.bgBubbleSelected:r.bgBubble,o.fill();for(const[g,f]of h.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[g],f.x+r.bubblePadding,l+c/2+er(o,r))}const Zb=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Yb=e=>{const{drilldowns:t}=e;return d.createElement(Zb,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},Jb={getAccessibilityString:e=>_d(e.data.map(t=>t.text)),kind:Y.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+n.bubblePadding*2+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>e1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Yb,{drilldowns:t.data})},onPaste:()=>{}},kl={};function Qb(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,l=4,s=n*o,c=r+i,u=r*3,h=(u+i*2)*o,g=`${e},${t},${o},${n}`;if(kl[g]!==void 0)return{el:kl[g],height:s,width:h,middleWidth:l*o,sideWidth:c*o,padding:i*o,dpr:o};const f=document.createElement("canvas"),p=f.getContext("2d");return p===null?null:(f.width=h,f.height=s,p.scale(o,o),kl[g]=f,p.beginPath(),Jn(p,i,i,u,a,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),Jn(p,i+.5,i+.5,u,a,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:f,height:s,width:h,sideWidth:c*o,middleWidth:r*o,padding:i*o,dpr:o})}function e1(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:a,row:l}=e,{x:s,width:c}=n,u=r.baseFontFull,h=bs(o,u),g=Math.min(n.height,Math.max(16,Math.ceil(h*r.lineHeight)*2)),f=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,w=r.bubbleMargin;let y=s+r.cellHorizontalPadding;const v=r.roundingRadius??6,x=Qb(r.bgCell,r.drilldownBorder,g,v),I=[];for(const O of t){if(y>s+c)break;const M=Dr(O.text,o,u).width;let P=0;O.img!==void 0&&i.loadOrGetImage(O.img,a,l)!==void 0&&(P=p-8+4);const S=M+P+m*2;I.push({x:y,width:S}),y+=S+w}if(x!==null){const{el:O,height:M,middleWidth:P,sideWidth:S,width:k,dpr:H,padding:E}=x,R=S/H,T=E/H;for(const D of I){const C=Math.floor(D.x),J=Math.floor(D.width),W=J-(R-T)*2;o.imageSmoothingEnabled=!1,o.drawImage(O,0,0,S,M,C-T,f,R,g),W>0&&o.drawImage(O,S,0,P,M,C+(R-T),f,W,g),o.drawImage(O,k-S,0,S,M,C+J-(R-T),f,R,g),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[O,M]of I.entries()){const P=t[O];let S=M.x+m;if(P.img!==void 0){const k=i.loadOrGetImage(P.img,a,l);if(k!==void 0){const H=p-8;let E=0,R=0,T=k.width,D=k.height;T>D?(E+=(T-D)/2,T=D):D>T&&(R+=(D-T)/2,D=T),o.beginPath(),Jn(o,S,f+g/2-H/2,H,H,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(k,E,R,T,D,S,f+g/2-H/2,H,H),o.restore(),S+=H+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(P.text,S,f+g/2+er(o,r))}}const t1={getAccessibilityString:e=>e.data.join(", "),kind:Y.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>n1(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??Rm;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const n=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(n.length===t.data.length&&n.every((r,o)=>r===t.data[o])))return{...t,data:n}}},Cl=4;function n1(e,t,n,r){const{rect:o,col:i,row:a,theme:l,ctx:s,imageLoader:c}=e,{x:u,y:h,height:g,width:f}=o,p=g-l.cellVerticalPadding*2,m=[];let w=0;for(let v=0;v<t.length;v++){const x=t[v];if(x.length===0)continue;const I=c.loadOrGetImage(x,i,a);if(I!==void 0){m[v]=I;const O=I.width*(p/I.height);w+=O+Cl}}if(w===0)return;w-=Cl;let y=u+l.cellHorizontalPadding;r==="right"?y=Math.floor(u+f-l.cellHorizontalPadding-w):r==="center"&&(y=Math.floor(u+f/2-w/2));for(const v of m){if(v===void 0)continue;const x=v.width*(p/v.height);n>0&&(s.beginPath(),Jn(s,y,h+l.cellVerticalPadding,x,p,n),s.save(),s.clip()),s.drawImage(v,y,h+l.cellVerticalPadding,x,p),n>0&&s.restore(),y+=x+Cl}}function r1(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const o1={getAccessibilityString:()=>"",kind:Y.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(r1(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=i.width&&(l=i.width-s*2-1);const c=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);Jn(o,i.x+s,i.y+(i.height-c)/2,l,c,a.roundingRadius??3),o.fillStyle=Zr(a.textDark,.1),o.fill()},onPaste:()=>{}},i1=()=>e=>e.targetWidth,gu=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[i1(),"px"]}}),a1=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:a,validatedSelection:l}=e,s=t.data,c=t.readonly===!0,[u,h]=d.useState(s===""||r),g=d.useCallback(()=>{h(p=>!p)},[]),f=s?"gdg-ml-6":"";return u?d.createElement(gu,{targetWidth:i.width-20},d.createElement(Qr,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>a(t)},d.createElement(ym,null))):d.createElement(gu,{targetWidth:i.width},d.createElement(l0,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:g},d.createElement(ss,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},l1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Ri,measure:(e,t,n)=>{const r=t.data.split(`
|
|
185
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return d.createElement(a1,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},s1={getAccessibilityString:e=>e.row.toString(),kind:jn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:c1,measure:()=>44,draw:e=>d1(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function c1(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return i?.font!==o&&(n.font=o,i.font=o),i.deprep=u1,n.textAlign="center",i}function u1(e){const{ctx:t}=e;t.textAlign="start"}function d1(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:h,width:g,height:f}=l,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){a.globalAlpha=p;const m=7*(n?s:1);if(ks(a,c,n,o?u+m:u,h,o?g-m:g,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){a.globalAlpha=s,a.beginPath();for(const w of[3,6])for(const y of[-5,-1,3])a.rect(u+w,h+f/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=c.markerFontFull,y=u+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=w,a.fillText(m,y,h+f/2+er(a,w)),s!==0&&(a.globalAlpha=1)}}const h1={getAccessibilityString:()=>"",kind:jn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>f1(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function f1(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let f=0;if(n!==void 0){const p=h-8,m=s+8/2,w=c+8/2;l.drawSprite(n,"normal",r,m,w,p,a,g?1:i),f=p}else{f=24;const p=12,m=g?p:i*p,w=g?0:(1-i)*p*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+w,c+h/2),r.lineTo(s+y+w+m,c+h/2),r.moveTo(s+y+w+m*.5,c+h/2-m*.5),r.lineTo(s+y+w+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,c+h/2+er(r,a)),r.beginPath()}function Sh(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=p1(e,o,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Zr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a?.("text")}function p1(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const g1=d.lazy(async()=>await ns(()=>import("./number-overlay-editor-ChRMsdOl-C6ThLwiC.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]))),m1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Ri,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:c}=n;l===!0&&t>0&&Sh(r,o,c,s,i,t,a),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(g1,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},v1={getAccessibilityString:()=>"",measure:()=>108,kind:Y.Protected,needsHover:!1,needsHoverPosition:!1,draw:b1,onPaste:()=>{}};function b1(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:a}=r;t.beginPath();const l=2.5;let s=o+n.cellHorizontalPadding+l;const c=i+a/2,u=Math.cos(Ac(30))*l,h=Math.sin(Ac(30))*l;for(let g=0;g<12;g++)t.moveTo(s,c-l),t.lineTo(s,c+l),t.moveTo(s+u,c-h),t.lineTo(s-u,c+h),t.moveTo(s-u,c-h),t.lineTo(s+u,c+h),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const y1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Ri(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return St.createElement(Qr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},w1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Ri,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:c,hoverEffect:u,allowWrapping:h,hoverEffectTheme:g}=t;u===!0&&n>0&&Sh(o,a,g,s,i,n,l),ar(e,s,c,h,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
|
186
|
+
`,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(Qr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:a=>r({...o,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},x1=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),k1=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:a}=e,[l,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return l?d.createElement(Qr,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(x1,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(ss,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Mh(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?o=t.width-a-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-a/2),{x:o,y:i,width:a,height:l}}function mu(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=eh(a,i.baseFontFull);if(l===void 0)return!1;const s=Mh(l,n,i,t.contentAlign);return Xr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const C1={getAccessibilityString:e=>e.data?.toString()??"",kind:Y.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Ri,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:a,ctx:l}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const u=Dr(s,l,n.baseFontFull),h=Mh(u,a,n,t.contentAlign),{x:g,y:f,width:p,height:m}=h;if(o>=g-4&&o<=g-4+p+8&&i>=f-4&&i<=f-4+m+8){const w=er(l,n.baseFontFull);r("pointer");const y=5,v=f-w;l.beginPath(),l.moveTo(a.x+g,Math.floor(a.y+v+m+y)+.5),l.lineTo(a.x+g+p,Math.floor(a.y+v+m+y)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,ar({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=c?n.linkColor:n.textDark,ar(e,s,t.contentAlign)},onSelect:e=>{mu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;mu(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(k1,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},S1=[s1,h1,jb,Xb,Jb,t1,o1,l1,m1,v1,y1,w1,C1];var Sl,vu;function M1(){if(vu)return Sl;vu=1;var e=Hd(),t=cd(),n="Expected a function";function r(o,i,a){var l=!0,s=!0;if(typeof o!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(o,i,{leading:l,maxWait:i,trailing:s})}return Sl=r,Sl}var R1=M1();const I1=vr(R1),Ml=[];class E1 extends rh{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=I1(()=>{this.imageLoaded(new gi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let o=!1;for(let i=0;i<r.cells.length;i++){const a=r.cells[i];if(this.isInWindow(a)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,o){let i=!1;const a=Ml.pop()??new Image;let l=!1;const s={img:void 0,cells:[Yn(n,r)],url:t,cancel:()=>{l||(l=!0,Ml.length<12?Ml.unshift(a):i||(a.src=""))}},c=new Promise(u=>a.addEventListener("load",()=>u(null)));requestAnimationFrame(async()=>{try{a.src=t,await c,await a.decode();const u=this.cache[o];if(u!==void 0&&!l){u.img=a;for(const h of u.cells)this.loadedLocations.push(xs(h));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[o]=s}loadOrGetImage(t,n,r){const o=t,i=this.cache[o];if(i!==void 0){const a=Yn(n,r);return i.cells.includes(a)||i.cells.push(a),i.img}else this.loadImage(t,n,r,o)}}const T1=(e,t)=>{const n=d.useMemo(()=>({...yv,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??S1,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new E1,[e.imageWindowLoader]);return d.createElement(Wb,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})},O1=d.forwardRef(T1);function bu(e,t){const n=d.useRef(null),r=d.useRef(),o=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>o,[o]),{debouncedCallback:d.useCallback((...i)=>{r.current=i,o(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,o]),cancel:o}}var D1=cp();const P1=vr(D1);var Xl={exports:{}},H1=Xl.exports,yu;function z1(){return yu||(yu=1,(function(e,t){(function(n,r){try{e.exports=r(dp)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(H1,function(n){var r=!1,o=!1,i=!1,a=!1,l="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function c(V,z){return z.length>V.length?!1:V.indexOf(z)!==-1}function u(V){for(var z="";V;)z+="0",V-=1;return z}function h(V){for(var z=V.split("").reverse(),G=0,re=!0;re&&G<z.length;)G?z[G]==="9"?z[G]="0":(z[G]=(parseInt(z[G],10)+1).toString(),re=!1):(parseInt(z[G],10)<5&&(re=!1),z[G]="0"),G+=1;return re&&z.push("1"),z.reverse().join("")}function g(V,z){var G=P(C(z).sort(),function(le){return le+":"+z[le]}).join(","),re=V+"+"+G;return g.cache[re]||(g.cache[re]=Intl.NumberFormat(V,z)),g.cache[re]}g.cache={};function f(V,z,G){var re=z.useToLocaleString,le=z.useGrouping,Ie=le&&z.grouping.slice(),ye=z.maximumSignificantDigits,at=z.minimumIntegerDigits||1,Ce=z.fractionDigits||0,ft=z.groupingSeparator,vt=z.decimalSeparator;if(re&&G){var Be={minimumIntegerDigits:at,useGrouping:le};if(Ce&&(Be.maximumFractionDigits=Ce,Be.minimumFractionDigits=Ce),ye&&V>0&&(Be.maximumSignificantDigits=ye),i){if(!a){var ne=D({},z);ne.useGrouping=!1,ne.decimalSeparator=".",V=parseFloat(f(V,ne),10)}return g(G,Be).format(V)}else{if(!o){var ne=D({},z);ne.useGrouping=!1,ne.decimalSeparator=".",V=parseFloat(f(V,ne),10)}return V.toLocaleString(G,Be)}}var ie;ye?ie=V.toPrecision(ye+1):ie=V.toFixed(Ce+1);var be,ue,ve,Fe=ie.split("e");ve=Fe[1]||"",Fe=Fe[0].split("."),ue=Fe[1]||"",be=Fe[0]||"";var Ve=be.length,Je=ue.length,Se=Ve+Je,Ze=be+ue;(ye&&Se===ye+1||!ye&&Je===Ce+1)&&(Ze=h(Ze),Ze.length===Se+1&&(Ve=Ve+1),Je&&(Ze=Ze.slice(0,-1)),be=Ze.slice(0,Ve),ue=Ze.slice(Ve)),ye&&(ue=ue.replace(/0*$/,""));var Ee=parseInt(ve,10);Ee>0?ue.length<=Ee?(ue=ue+u(Ee-ue.length),be=be+ue,ue=""):(be=be+ue.slice(0,Ee),ue=ue.slice(Ee)):Ee<0&&(ue=u(Math.abs(Ee)-be.length)+be+ue,be="0"),ye||(ue=ue.slice(0,Ce),ue.length<Ce&&(ue=ue+u(Ce-ue.length)),be.length<at&&(be=u(at-be.length)+be));var Me="";if(le){Fe=be;for(var Oe;Fe.length;)Ie.length&&(Oe=Ie.shift()),Me&&(Me=ft+Me),Me=Fe.slice(-Oe)+Me,Fe=Fe.slice(0,-Oe)}else Me=be;return ue&&(Me=Me+vt+ue),Me}function p(V,z){return V.label.length>z.label.length?-1:V.label.length<z.label.length?1:0}function m(V,z){var G=[];return M(C(z),function(re){if(re.slice(0,15)==="_durationLabels"){var le=re.slice(15).toLowerCase();M(C(z[re]),function(Ie){Ie.slice(0,1)===V&&G.push({type:le,key:Ie,label:z[re][Ie]})})}}),G}function w(V,z,G){return z===1&&G===null?V:V+V}var y={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:w};function v(V){return Object.prototype.toString.call(V)==="[object Array]"}function x(V){return Object.prototype.toString.call(V)==="[object Object]"}function I(V,z){for(var G=V.length;G-=1;)if(z(V[G]))return V[G]}function O(V,z){var G=0,re=V&&V.length||0,le;for(typeof z!="function"&&(le=z,z=function(Ie){return Ie===le});G<re;){if(z(V[G]))return V[G];G+=1}}function M(V,z){var G=0,re=V.length;if(!(!V||!re))for(;G<re;){if(z(V[G],G)===!1)return;G+=1}}function P(V,z){var G=0,re=V.length,le=[];if(!V||!re)return le;for(;G<re;)le[G]=z(V[G],G),G+=1;return le}function S(V,z){return P(V,function(G){return G[z]})}function k(V){var z=[];return M(V,function(G){G&&z.push(G)}),z}function H(V){var z=[];return M(V,function(G){O(z,G)||z.push(G)}),z}function E(V,z){var G=[];return M(V,function(re){M(z,function(le){re===le&&G.push(re)})}),H(G)}function R(V,z){var G=[];return M(V,function(re,le){if(!z(re))return G=V.slice(le),!1}),G}function T(V,z){var G=V.slice().reverse();return R(G,z).reverse()}function D(V,z){for(var G in z)z.hasOwnProperty(G)&&(V[G]=z[G]);return V}function C(V){var z=[];for(var G in V)V.hasOwnProperty(G)&&z.push(G);return z}function J(V,z){var G=0,re=V.length;if(!V||!re)return!1;for(;G<re;){if(z(V[G],G)===!0)return!0;G+=1}return!1}function W(V){var z=[];return M(V,function(G){z=z.concat(G)}),z}function Z(){var V=0;try{V.toLocaleString("i")}catch(z){return z.name==="RangeError"}return!1}function ce(V){return V(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function te(V){var z=!0;return z=z&&V(1,"en",{minimumIntegerDigits:1})==="1",z=z&&V(1,"en",{minimumIntegerDigits:2})==="01",z=z&&V(1,"en",{minimumIntegerDigits:3})==="001",!(!z||(z=z&&V(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",z=z&&V(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",z=z&&V(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",z=z&&V(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!z)||(z=z&&V(99.99,"en",{maximumSignificantDigits:1})==="100",z=z&&V(99.99,"en",{maximumSignificantDigits:2})==="100",z=z&&V(99.99,"en",{maximumSignificantDigits:3})==="100",z=z&&V(99.99,"en",{maximumSignificantDigits:4})==="99.99",z=z&&V(99.99,"en",{maximumSignificantDigits:5})==="99.99",!z)||(z=z&&V(1e3,"en",{useGrouping:!0})==="1,000",z=z&&V(1e3,"en",{useGrouping:!1})==="1000",!z))}function q(){var V=[].slice.call(arguments),z={},G;if(M(V,function(ye,at){if(!at){if(!v(ye))throw"Expected array as the first argument to durationsFormat.";G=ye}if(typeof ye=="string"||typeof ye=="function"){z.template=ye;return}if(typeof ye=="number"){z.precision=ye;return}x(ye)&&D(z,ye)}),!G||!G.length)return[];z.returnMomentTypes=!0;var re=P(G,function(ye){return ye.format(z)}),le=E(l,H(S(W(re),"type"))),Ie=z.largest;return Ie&&(le=le.slice(0,Ie)),z.returnMomentTypes=!1,z.outputTypes=le,P(G,function(ye){return ye.format(z)})}function ge(){var V=[].slice.call(arguments),z=D({},this.format.defaults),G=this.asMilliseconds(),re=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,re=0);var le=G<0,Ie=n.duration(Math.abs(G),"milliseconds"),ye=n.duration(Math.abs(re),"months");M(V,function(B){if(typeof B=="string"||typeof B=="function"){z.template=B;return}if(typeof B=="number"){z.precision=B;return}x(B)&&D(z,B)});var at={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Ce={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};z.types=l;var ft=function(B){return O(l,function($e){return Ce[$e].test(B)})},vt=new RegExp(P(l,function(B){return Ce[B].source}).join("|"),"g");z.duration=this;var Be=typeof z.template=="function"?z.template.apply(z):z.template,ne=z.outputTypes,ie=z.returnMomentTypes,be=z.largest,ue=[];ne||(v(z.stopTrim)&&(z.stopTrim=z.stopTrim.join("")),z.stopTrim&&M(z.stopTrim.match(vt),function(B){var $e=ft(B);$e==="escape"||$e==="general"||ue.push($e)}));var ve=n.localeData();ve||(ve={}),M(C(y),function(B){if(typeof y[B]=="function"){ve[B]||(ve[B]=y[B]);return}ve["_"+B]||(ve["_"+B]=y[B])}),M(C(ve._durationTimeTemplates),function(B){Be=Be.replace("_"+B+"_",ve._durationTimeTemplates[B])});var Fe=z.userLocale||n.locale(),Ve=z.useLeftUnits,Je=z.usePlural,Se=z.precision,Ze=z.forceLength,Ee=z.useGrouping,Me=z.trunc,Oe=z.useSignificantDigits&&Se>0,ut=Oe?z.precision:0,Qe=ut,Ue=z.minValue,wt=!1,gt=z.maxValue,Tt=!1,Ot=z.useToLocaleString,an=z.groupingSeparator,qt=z.decimalSeparator,In=z.grouping;Ot=Ot&&(r||i);var Mt=z.trim;v(Mt)&&(Mt=Mt.join(" ")),Mt===null&&(be||gt||Oe)&&(Mt="all"),(Mt===null||Mt===!0||Mt==="left"||Mt==="right")&&(Mt="large"),Mt===!1&&(Mt="");var dt=function(B){return B.test(Mt)},En=/large/,mt=/small/,Zt=/both/,kn=/mid/,De=/^all|[^sm]all/,et=/final/,bt=be>0||J([En,Zt,De],dt),Tn=J([mt,Zt,De],dt),ln=J([kn,De],dt),sn=J([et,De],dt),On=P(Be.match(vt),function(B,$e){var Ne=ft(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ne!=="escape"&&Ne!=="general"&&ue.push(Ne)),{index:$e,length:B.length,text:"",token:Ne==="escape"?B.replace(Ce.escape,"$1"):B,type:Ne==="escape"||Ne==="general"?null:Ne}}),Yt={index:0,length:0,token:"",text:"",type:null},Jt=[];Ve&&On.reverse(),M(On,function(B){if(B.type){(Yt.type||Yt.text)&&Jt.push(Yt),Yt=B;return}Ve?Yt.text=B.token+Yt.text:Yt.text+=B.token}),(Yt.type||Yt.text)&&Jt.push(Yt),Ve&&Jt.reverse();var _e=E(l,H(k(S(Jt,"type"))));if(!_e.length)return S(Jt,"text").join("");_e=P(_e,function(B,$e){var Ne=$e+1===_e.length,Dt=!$e,Qt;B==="years"||B==="months"?Qt=ye.as(B):Qt=Ie.as(B);var dn=Math.floor(Qt),Sn=Qt-dn,bn=O(Jt,function($t){return B===$t.type});return Dt&>&&Qt>gt&&(Tt=!0),Ne&&Ue&&Math.abs(z.duration.as(B))<Ue&&(wt=!0),Dt&&Ze===null&&bn.length>1&&(Ze=!0),Ie.subtract(dn,B),ye.subtract(dn,B),{rawValue:Qt,wholeValue:dn,decimalValue:Ne?Sn:0,isSmallest:Ne,isLargest:Dt,type:B,tokenLength:bn.length}});var xt=Me?Math.floor:Math.round,Dn=function(B,$e){var Ne=Math.pow(10,$e);return xt(B*Ne)/Ne},Ht=!1,ht=!1,Cn=function(B,$e){var Ne={useGrouping:Ee,groupingSeparator:an,decimalSeparator:qt,grouping:In,useToLocaleString:Ot};return Oe&&(ut<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ne.maximumSignificantDigits=ut,B.significantDigits=ut)),Tt&&!ht&&(B.isLargest?(B.wholeValue=gt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),wt&&!ht&&(B.isSmallest?(B.wholeValue=Ue,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Se<0?B.value=Dn(B.wholeValue,Se):Se===0?B.value=xt(B.wholeValue+B.decimalValue):Oe?(Me?B.value=Dn(B.rawValue,ut-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ut-=B.wholeValue.toString().length)):(Ne.fractionDigits=Se,Me?B.value=B.wholeValue+Dn(B.decimalValue,Se):B.value=B.wholeValue+B.decimalValue):Oe&&B.wholeValue?(B.value=Math.round(Dn(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ut-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Ze||Ht)&&(Ne.minimumIntegerDigits=B.tokenLength,ht&&Ne.maximumSignificantDigits<B.tokenLength&&delete Ne.maximumSignificantDigits),!Ht&&(B.value>0||Mt===""||O(ue,B.type)||O(ne,B.type))&&(Ht=!0),B.formattedValue=f(B.value,Ne,Fe),Ne.useGrouping=!1,Ne.decimalSeparator=".",B.formattedValueEn=f(B.value,Ne,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=f(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(_e=P(_e,Cn),_e=k(_e),_e.length>1){var ur=function(B){return O(_e,function($e){return $e.type===B})},_n=function(B){var $e=ur(B.type);$e&&M(B.targets,function(Ne){var Dt=ur(Ne.type);Dt&&parseInt($e.formattedValueEn,10)===Ne.value&&($e.rawValue=0,$e.wholeValue=0,$e.decimalValue=0,Dt.rawValue+=1,Dt.wholeValue+=1,Dt.decimalValue=0,Dt.formattedValueEn=Dt.wholeValue.toString(),ht=!0)})};M(s,_n)}return ht&&(Ht=!1,ut=Qe,_e=P(_e,Cn),_e=k(_e)),ne&&!(Tt&&!z.trim)?(_e=P(_e,function(B){return O(ne,function($e){return B.type===$e})?B:null}),_e=k(_e)):(bt&&(_e=R(_e,function(B){return!B.isSmallest&&!B.wholeValue&&!O(ue,B.type)})),be&&_e.length&&(_e=_e.slice(0,be)),Tn&&_e.length>1&&(_e=T(_e,function(B){return!B.wholeValue&&!O(ue,B.type)&&!B.isLargest})),ln&&(_e=P(_e,function(B,$e){return $e>0&&$e<_e.length-1&&!B.wholeValue?null:B}),_e=k(_e)),sn&&_e.length===1&&!_e[0].wholeValue&&!(!Me&&_e[0].isSmallest&&_e[0].rawValue<Ue)&&(_e=[])),ie?_e:(M(Jt,function(B){var $e=at[B.type],Ne=O(_e,function($t){return $t.type===B.type});if(!(!$e||!Ne)){var Dt=Ne.formattedValueEn.split(".");Dt[0]=parseInt(Dt[0],10),Dt[1]?Dt[1]=parseFloat("0."+Dt[1],10):Dt[1]=null;var Qt=ve.durationPluralKey($e,Dt[0],Dt[1]),dn=m($e,ve),Sn=!1,bn={};M(ve._durationLabelTypes,function($t){var Mn=O(dn,function(Rn){return Rn.type===$t.type&&Rn.key===Qt});Mn&&(bn[Mn.type]=Mn.label,c(B.text,$t.string)&&(B.text=B.text.replace($t.string,Mn.label),Sn=!0))}),Je&&!Sn&&(dn.sort(p),M(dn,function($t){if(bn[$t.type]===$t.label)return c(B.text,$t.label)?!1:void 0;if(c(B.text,$t.label))return B.text=B.text.replace($t.label,bn[$t.type]),!1}))}}),Jt=P(Jt,function(B){if(!B.type)return B.text;var $e=O(_e,function(Dt){return Dt.type===B.type});if(!$e)return"";var Ne="";return Ve&&(Ne+=B.text),(le&&Tt||!le&&wt)&&(Ne+="< ",Tt=!1,wt=!1),(le&&wt||!le&&Tt)&&(Ne+="> ",Tt=!1,wt=!1),le&&($e.value>0||Mt===""||O(ue,$e.type)||O(ne,$e.type))&&(Ne+="-",le=!1),B.type==="milliseconds"&&$e.formattedValueMS?Ne+=$e.formattedValueMS:Ne+=$e.formattedValue,Ve||(Ne+=B.text),Ne}),Jt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var V=this.duration,z=function(le){return V._data[le]},G=O(this.types,z),re=I(this.types,z);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===re)return"d __";case"weeks":return G===re?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===re)return"M __";case"years":return G===re?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function fe(V){if(!V)throw"Moment Duration Format init cannot find moment instance.";V.duration.format=q,V.duration.fn.format=ge,V.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ae,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},V.updateLocale("en",y)}var he=function(V,z,G){return V.toLocaleString(z,G)};r=Z()&&te(he),o=r&&ce(he);var oe=function(V,z,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(z,G).format(V)};return i=te(oe),a=i&&ce(oe),fe(n),fe})})(Xl)),Xl.exports}z1();const L1=["true","t","yes","y","on","1"],A1=["false","f","no","n","off","0"];function Rt(e,t=""){return{kind:Y.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function To(e){return Object.hasOwn(e,"isError")&&e.isError}function F1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Ms(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function ql(e=!1){return e?{kind:Y.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Y.Loading,allowOverlay:!1,copyData:""}}function V1(e,t){const n=t?"faded":"normal";return{kind:Y.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Zl(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function Po(e,t){return Te(e)?t||{}:Te(t)?e||{}:md(e,t)}function Rs(e){if(Te(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:it(n)):[it(t)]}catch{return[it(e)]}}function Rh(e){return typeof e=="string"||e instanceof String?!0:(e instanceof $p&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function _1(e){return e?.startsWith("{")&&e.endsWith("}")}function it(e){try{try{return P1(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function Ih(e){if(Te(e))return null;if(typeof e=="boolean")return e;const t=it(e).toLowerCase().trim();if(t==="")return null;if(L1.includes(t))return!0;if(A1.includes(t))return!1}function wi(e){if(Te(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=si.unformat(e.trim());if(ot(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Eh(e){return Te(e)?"":it(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ka(e){if(Te(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return it(e)}}function $1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const t=e.toExponential().split("e");return Math.abs(parseInt(t[1],10))}function Gr(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function Ca(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Te(t)||t===""?ot(n)?(n===0&&(e=Math.round(e)),si(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):si(e).format({thousandSeparated:!1,mantissa:$1(e),trimMantissa:!0}):t==="plain"?si(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Gr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Gr(e,{style:"percent",minimumFractionDigits:ot(n)?Math.max(n-2,0):0,maximumFractionDigits:ot(n)?Math.max(n-2,0):2}):t==="dollar"?Gr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Gr(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Gr(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Gr(e,{notation:t}):t==="accounting"?si(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Gr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):Ag.sprintf(t,e)}function wu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,o=n==="time"?void 0:"medium",i=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:o,timeStyle:i}).format(e.toDate())}catch(a){if(a instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:o,timeStyle:i}).format(e.toDate());throw a}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function ea(e){if(Te(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Ur.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Ur.utc(e);if(n.isValid())return n.toDate();const r=Ur.utc(e,[Ur.HTML5_FMT.TIME_MS,Ur.HTML5_FMT.TIME_SECONDS,Ur.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Th(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function B1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,o=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*o)/n}const N1=new RegExp(/(\r\n|\n|\r)/gm);function xi(e){return e.indexOf(`
|
|
187
|
+
`)!==-1?e.replace(N1," "):e}function W1(e,t){if(Te(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const j1=Qn("div",{target:"en99xsi0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}}),""),Is=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?nl.parse(e):nl.parse(nl.stringify(e))}catch{n=void 0}return Te(n)?me.jsx(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:ka(e)??"",onChange:()=>{}}):me.jsx(j1,{"data-testid":"stJsonColumnViewer",children:me.jsx(hp,{src:n,collapsed:2,theme:fp(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})};d.memo(Is);const G1=e=>{const t=e.theme,n=e.value.data;return me.jsx(Is,{jsonValue:n.value||n.displayValue,theme:t})},U1=e=>{const t=e.theme,n=e.value;return me.jsx(Is,{jsonValue:n.data,theme:t})},K1={kind:Y.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return vs(e,r??ka(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:o}=t.data,i=o??ka(r)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:G1})},Oh="line_chart",X1="area_chart",Dh="bar_chart",q1=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Es(e,t,n,r){const o=Po({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),i=q1(r);let a;o.color==="auto"||o.color==="auto-inverse"?a=r.colors.greenColor:a=o.color?i.get(o.color)??o.color:void 0;const l={kind:Y.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:a,yAxis:[o.y_min??0,o.y_max??1]}};return{...t,kind:e,typeIcon:e===Oh?":material/show_chart:":e===Dh?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(s){if(Te(s))return ql();const c=Rs(s),u=[];let h=[];if(c.length===0)return ql();let g=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER;for(let y=0;y<c.length;y++){const v=wi(c[y]);if(Number.isNaN(v)||Te(v))return Rt(it(c),`The value cannot be interpreted as a numeric array. ${it(v)} is not a number.`);v>g&&(g=v),v<f&&(f=v),u.push(v)}let p,m;if(c.length===1){let y;g<=0?y=g===0?1:0:y=g,p=o.y_max??y,m=o.y_min??(g>=0?0:g)}else p=o.y_max??g,m=o.y_min??f;if(Te(m)||Te(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Rt("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);u.length>0&&(g>p||f<m)?h=u.map(y=>g-f===0?g>(p||1)?p:m:(p-m)*((y-f)/(g-f))+m):h=u;let w=a;return(o.color==="auto"&&h[0]>h[h.length-1]||o.color==="auto-inverse"&&h[0]<h[h.length-1])&&(w=r.colors.redColor),{...l,copyData:u.join(","),data:{...l.data,values:h,displayValues:u.map(y=>Ca(y)),yAxis:[m,p],color:w},isMissingValue:Te(s)}},getCellValue(s){return s.kind===Y.Loading||s.data?.values===void 0?null:s.data?.values}}}function Ph(e,t){return Es(Oh,e,"line",t)}Ph.isEditableType=!1;function Hh(e,t){return Es(Dh,e,"bar",t)}Hh.isEditableType=!1;function zh(e,t){return Es(X1,e,"area",t)}zh.isEditableType=!1;function Ts(e,t){const n={kind:Y.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(rn(t.radii.md),rn(t.radii.maxCheckbox)))},getCell(r){let o=null;return o=Ih(r),o===void 0?Rt(it(r),"The value cannot be interpreted as boolean."):{...n,data:o,isMissingValue:Te(o)}},getCellValue(r){return r.data===void 0?null:r.data}}}Ts.isEditableType=!0;function xu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function Os(e,t,n,r,o,i,a){const l=Po({format:n,step:r,timezone:a},t.columnTypeOptions);let s;if(ot(l.timezone))try{s=xu(dc(),l.timezone)?.utcOffset()||void 0}catch{}let c;ot(l.min_value)&&(c=ea(l.min_value)||void 0);let u;ot(l.max_value)&&(u=ea(l.max_value)||void 0);const h={kind:Y.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:l.step?.toString()||"1",format:o,min:c,max:u}},g=f=>{const p=ea(f);return p===null?!t.isRequired:!(p===void 0||ot(c)&&i(p)<i(c)||ot(u)&&i(p)>i(u))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(f,p){if(p===!0){const x=g(f);if(x===!1)return Rt(it(f),"Invalid input.");x instanceof Date&&(f=x)}const m=ea(f);let w="",y="",v=s;if(m===void 0)return Rt(it(f),"The value cannot be interpreted as a datetime object.");if(m!==null){let x=dc.utc(m);if(!x.isValid())return Rt(it(m),`Invalid moment date. This should never happen. Please report this bug.
|
|
188
|
+
Error: ${x.toString()}`);if(l.timezone){try{x=xu(x,l.timezone)}catch(I){return Rt(x.toISOString(),`Failed to adjust to the provided timezone: ${l.timezone}.
|
|
189
|
+
Error: ${I}`)}v=x.utcOffset()}try{y=wu(x,l.format||n,e)}catch(I){return Rt(x.toISOString(),`Failed to format the date for rendering with: ${l.format}.
|
|
190
|
+
Error: ${I}`)}w=wu(x,n,e)}return{...h,copyData:w,isMissingValue:Te(m),data:{...h.data,date:m,displayDate:y,timezoneOffset:v}}},getCellValue(f){return Te(f?.data?.date)?null:i(f.data.date)}}}function Ds(e){let t="YYYY-MM-DD HH:mm:ss";e.columnTypeOptions?.step>=60?t="YYYY-MM-DD HH:mm":e.columnTypeOptions?.step<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=pp(e.arrowType),r=ot(n)||ot(e?.columnTypeOptions?.timezone);return Os("datetime",e,r?t+"Z":t,1,"datetime-local",o=>r?o.toISOString():o.toISOString().replace("Z",""),n)}Ds.isEditableType=!0;function Ps(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),Os("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}Ps.isEditableType=!0;function Hs(e){return Os("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}Hs.isEditableType=!0;function Lh(e){const t={kind:Y.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",typeIcon:":material/image:",sortMode:"default",isEditable:!1,getCell(n){const r=ot(n)?[it(n)]:[];return{...t,data:r,isMissingValue:!ot(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}Lh.isEditableType=!1;function Ah(e){const t={kind:Y.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",typeIcon:":material/code_blocks:",sortMode:"default",isEditable:!1,getCell(n){try{const r=ot(n)?xi(ka(n)):"";return{...t,copyData:r,isMissingValue:Te(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Rt(it(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}Ah.isEditableType=!1;function Fh(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(s){n=`Invalid validate regex: ${t.validate}.
|
|
191
|
+
Error: ${s}`}let r=!1,o=t.display_text,i;if(!Te(o)){if(o.startsWith(":material/")&&gp(o))o=mp(o).icon,r=!0;else if(o.includes("(")&&o.includes(")"))try{i=new RegExp(o,"us")}catch{i=void 0}}const a={kind:Y.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:vp.iconFont,linkColor:void 0}}},l=s=>{if(Te(s))return!e.isRequired;const c=it(s);return!(t.max_chars&&c.length>t.max_chars||n instanceof RegExp&&n.test(c)===!1)};return{...e,kind:"link",typeIcon:":material/link:",sortMode:"default",validateInput:l,getCell(s,c){if(Te(s))return{...a,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const u=s;if(typeof n=="string")return Rt(it(u),n);if(c&&l(u)===!1)return Rt(it(u),"Invalid input.");let h="";return u&&(i!==void 0?h=W1(i,u):h=o||u),{...a,data:u,displayData:h,isMissingValue:Te(u),onClickUri:g=>{window.open(u.startsWith("www.")?`https://${u}`:u,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:u}},getCellValue(s){return Te(s.data)?null:s.data}}}Fh.isEditableType=!0;function zs(e){const t={kind:Y.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",copyData:"",data:{kind:"multi-select-cell",values:[],options:void 0,allowCreation:!0,allowDuplicates:!0}};return{...e,kind:"list",sortMode:"default",typeIcon:":material/list:",getCell(n){if(Te(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=Rs(n);return{...t,data:{...t.data,values:r},copyData:Eh(r),...e.isEditable&&!Rh(n)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(n){return Te(n.data?.values)?null:n.data.values}}}zs.isEditableType=!0;const Z1=e=>{const t=Xp(e);return new Map(Object.entries({red:t.redbg,blue:t.bluebg,green:t.greenbg,yellow:t.yellowbg,violet:t.violetbg,purple:t.purplebg,orange:t.orangebg,gray:t.graybg,grey:t.graybg,primary:t.primarybg}))},Y1=(e,t)=>{if(Te(e))return[];const n=Z1(t);return e.filter(r=>r!==null&&r!=="").map(r=>{if(typeof r=="string")return{value:it(r).trim(),label:void 0,color:void 0};const o=r.color?_p(n.get(r.color)??r.color,t.colors.bgColor):void 0;return{value:it(r.value).trim(),label:r.label??void 0,color:o}})};function Vh(e,t){const n=Po({options:[],accept_new_options:!1},e.columnTypeOptions),r=Y1(n.options,t),o=new Set(r.map(a=>a.value)),i={kind:Y.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(a,l){if(Te(a))return{...i,data:{...i.data,values:null},isMissingValue:!0,copyData:""};let s=Rs(a);return s=s.map(c=>it(c).trim()),l&&s.length>0&&n.accept_new_options===!1&&(s=s.filter(c=>o.has(c)),s.length===0)?Rt(it(a),"The values could not be matched with the configured options."):{...i,data:{...i.data,values:s},copyData:Eh(s),...e.isEditable&&!Rh(a)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(a){return Te(a.data?.values)?null:a.data.values}}}Vh.isEditableType=!0;function Ls(e){const t=Po({step:dd(e.arrowType)?1:void 0,min_value:bp(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(yp(e.arrowType)||wp(e.arrowType)),r=Te(t.min_value)||t.min_value<0,o=ot(t.step)&&!Number.isNaN(t.step)?Th(t.step):void 0,i={kind:Y.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:o,thousandSeparator:""},a=l=>{let s=wi(l);if(Te(s))return!e.isRequired;if(Number.isNaN(s))return!1;let c=!1;return ot(t.max_value)&&s>t.max_value&&(s=t.max_value,c=!0),ot(t.min_value)&&s<t.min_value?!1:c?s:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:a,getCell(l,s){if(s===!0){const h=a(l);if(h===!1)return Rt(it(l),"Invalid input.");typeof h=="number"&&(l=h)}let c=wi(l),u="";if(ot(c)){if(Number.isNaN(c))return Rt(it(l),"The value cannot be interpreted as a number.");if(ot(o)&&(c=B1(c,o)),Number.isInteger(c)&&!Number.isSafeInteger(c))return Rt(it(l),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?u=Fl(c,e.arrowType):u=Ca(c,t.format,o)}catch(h){return Rt(it(c),ot(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${h}`:`Failed to format the number. Error: ${h}`)}}return{...i,data:c,displayData:u,isMissingValue:Te(c),copyData:Te(c)?"":it(c)}},getCellValue(l){return l.data===void 0?null:l.data}}}Ls.isEditableType=!0;function ki(e){const t={kind:Y.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",typeIcon:":material/data_object:",isEditable:!1,getCell(n){try{const r=ot(n)?it(n):null,o=ot(r)?xi(r):"";return{...t,data:r,displayData:o,isMissingValue:Te(n)}}catch(r){return Rt(it(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}ki.isEditableType=!1;function _h(e){const t=dd(e.arrowType),n=Po({min_value:0,max_value:t?100:1,format:t?"%3d%%":"percent",step:t?1:void 0},e.columnTypeOptions),r=Te(n.step)||Number.isNaN(n.step)?void 0:Th(n.step);let o;try{o=Ca(n.max_value,n.format,r)}catch{o=it(n.max_value)}const i={kind:Y.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step??.01,value:n.min_value,label:String(n.min_value),measureLabel:o}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(a){if(Te(a))return ql();if(Te(n.min_value)||Te(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Rt("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(ot(n.step)&&Number.isNaN(n.step))return Rt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const l=wi(a);if(Number.isNaN(l)||Te(l))return Rt(it(a),"The value cannot be interpreted as a number.");if(Number.isInteger(l)&&!Number.isSafeInteger(l))return Rt(it(a),"The value is larger than the maximum supported integer values in number columns (2^53).");let s="";try{s=Ca(l,n.format,r)}catch(u){return Rt(it(l),ot(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${u}`:`Failed to format the number. Error: ${u}`)}const c=Math.min(n.max_value,Math.max(n.min_value,l));return{...i,isMissingValue:Te(a),copyData:String(l),data:{...i.data,value:c,label:s,measureLabel:s.length>o.length?s:o}}},getCellValue(a){return a.kind===Y.Loading||a.data?.value===void 0?null:a.data?.value}}}_h.isEditableType=!1;const J1=e=>Te(e)?[]:e.filter(t=>ot(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=it(t.value).trim();return{value:r,label:t.label??r}}const n=it(t).trim();return{value:n,label:n}});function As(e){let t="string";const n=Po({options:hd(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=s=>typeof s=="object"&&s!==null&&"value"in s,o=s=>r(s)?typeof s.value:typeof s,i=new Set(n.options.map(o));i.size===1&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const a=J1(n.options),l={kind:Y.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...a],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(s,c){let u=null;return ot(s)&&s!==""&&(u=it(s)),c&&!l.data.allowedValues.some(h=>h===null?u===null:typeof h=="string"?h===u:typeof h=="object"&&"value"in h?h.value===u:!1)?Rt(it(u),"The value is not part of the allowed options."):{...l,isMissingValue:u===null,copyData:u||"",data:{...l.data,value:u}}},getCellValue(s){return Te(s.data?.value)||s.data?.value===""?null:t==="number"?wi(s.data?.value)??null:t==="boolean"?Ih(s.data?.value)??null:s.data?.value}}}As.isEditableType=!0;function Fs(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(i){n=`Invalid validate regex: ${t.validate}.
|
|
192
|
+
Error: ${i}`}const r={kind:Y.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},o=i=>{if(Te(i))return!e.isRequired;let a=it(i),l=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),l=!0),n instanceof RegExp&&n.test(a)===!1?!1:l?a:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:o,getCell(i,a){if(typeof n=="string")return Rt(it(i),n);if(a){const l=o(i);if(l===!1)return Rt(it(i),"Invalid input.");typeof l=="string"&&(i=l)}try{const l=ot(i)?it(i):null,s=ot(l)?xi(l):"";return{...r,isMissingValue:Te(l),data:l,displayData:s}}catch(l){return Rt("Incompatible value",`The value cannot be interpreted as string. Error: ${l}`)}},getCellValue(i){return i.data===void 0?null:i.data}}}Fs.isEditableType=!0;const ku=Qn("img",{target:"e24uaba0"})({name:"6eya2z",styles:"max-width:100%;max-height:37.5rem;object-fit:scale-down"}),Q1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?me.jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:me.jsx(ku,{src:t})}):me.jsx(ku,{src:t})},Cu=new Map(Object.entries({object:ki,text:Fs,checkbox:Ts,selectbox:As,list:zs,multiselect:Vh,number:Ls,link:Fh,datetime:Ds,date:Hs,time:Ps,line_chart:Ph,bar_chart:Hh,area_chart:zh,image:Lh,progress:_h,json:Ah})),ey=[K1];var ty=sd();const ny=vr(ty);var Rl,Su;function ry(){if(Su)return Rl;Su=1;var e=xp(),t=kp(),n=Cp(),r=sd(),o=Sp(),i=Mp(),a=Rp(),l=Ip(),s="[object Map]",c="[object Set]",u=Object.prototype,h=u.hasOwnProperty;function g(f){if(f==null)return!0;if(o(f)&&(r(f)||typeof f=="string"||typeof f.splice=="function"||i(f)||l(f)||n(f)))return!f.length;var p=t(f);if(p==s||p==c)return!f.size;if(a(f))return!e(f).length;for(var m in f)if(h.call(f,m))return!1;return!0}return Rl=g,Rl}var oy=ry();const iy=vr(oy);function Il(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const o=r.exec(n);if(o)return o[1].trim()}function ay(e,t,n){const r={};if(!n.includes(t))return e;const o=Il(t,"color",n);o&&(r.textDark=o,(e.kind===Y.Bubble||e.kind===Y.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=o),e.kind===Y.Uri&&(r.linkColor=o));const i=Il(t,"background-color",n);i&&(r.bgCell=i),i==="yellow"&&o===void 0&&(r.textDark="#31333F");const a=Il(t,"font-weight",n);return a&&(r.baseFontStyle=`${a} ${hg.sm}`),r?{...e,themeOverride:r}:e}function ly(e){return rg(e)||og(e)?Fs:ig(e)?Ds:yd(e)?Ps:ag(e)?Hs:lg(e)||sg(e)?ki:hd(e)?Ts:cg(e)?Ls:ug(e)?As:dg(e)?zs:ki}function $h(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function Vs(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function sy(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:o}=$h(n),i=e.columnTypes[t];let a=!0;return ng(i)&&(a=!1),Vs({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:o,isEditable:a,arrowType:i,isIndex:!0,isPinned:!0})}function cy(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:o}=$h(n),i=e.columnTypes[t];return Vs({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:i,group:o})}function Bh(){return Vs({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Jp.INDEX,arrowField:new Zp("",new Yp,!0),pandasType:void 0}})}function Mu(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,o=n.numDataColumns;if(r===0&&o===0)return t.push(Bh()),t;for(let i=0;i<r;i++)t.push(sy(e,i));for(let i=0;i<o;i++)t.push(cy(e,i+r));return t}function uy(e,t,n,r=void 0){let o;if(e.kind==="object"||e.kind==="json")o=e.getCell(ot(t.content)?xi(Fl(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&ot(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let i;yd(t.contentType)&&ot(t.field?.type?.unit)?i=Qp(t.content,t.field):i=Ur.utc(Number(t.content)).toDate(),o=e.getCell(i)}else if(eg(t.contentType)){const i=Te(t.content)?null:Fl(t.content,t.contentType);o=e.getCell(i)}else o=e.getCell(t.content);if(To(o))return o;if(!e.isEditable){if(n&&ot(n?.displayContent)){const i=xi(n.displayContent);o.kind===Y.Text?o={...o,displayData:i}:o.kind===Y.Number&&Te(e.columnTypeOptions?.format)?o={...o,displayData:i}:o.kind===Y.Uri&&Te(e.columnTypeOptions?.display_text)?o={...o,displayData:i}:o.kind===Y.Custom&&o.data?.kind==="date-picker-cell"&&Te(e.columnTypeOptions?.format)&&(o={...o,data:{...o.data,displayDate:i}})}r&&n?.cssId&&(o=ay(o,n.cssId,r))}return o}function Nh(e,t){return t?t?.useStretch??!1:e.useContainerWidth??!1}function Wh(e,t){return t?t.pixelWidth?t.pixelWidth:void 0:e.width||void 0}function dy(e){return e?.useContent??!1}function hy(e,t){return t?t.pixelHeight?t.pixelHeight:void 0:e.height||void 0}const ca="_index",Ru="_pos:",Iu={small:75,medium:200,large:400},jh=rs.getLogger("useColumnLoader");function fy(e){if(!Te(e)){if(typeof e=="number")return e;if(e in Iu)return Iu[e]}}const ta=(e,t)=>qp(e,t,(n,r)=>{if(ny(r))return r});function Eu(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(ca)&&(n=ta(n,t.get(ca)??{})),t.has(`${Ru}${e.indexNumber}`)&&(n=ta(n,t.get(`${Ru}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==ca&&(n=ta(n,t.get(e.name)??{})),t.has(e.id)&&(n=ta(n,t.get(e.id)??{})),iy(n)?e:md({...e},{title:n.label,width:fy(n.width),isEditable:ot(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function py(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return jh.error(t),new Map}}function Tu(e){const t=e.columnTypeOptions?.type;let n;return ot(t)&&(Cu.has(t)?n=Cu.get(t):jh.warn(`Unknown column type configured in column configuration: ${t}`)),Te(n)&&(n=ly(e.arrowType)),n}function gy(e,t,n,r,o){const i=Yr(),a=d.useMemo(()=>py(e.columns),[e.columns]),[l,s]=d.useState(a);d.useEffect(()=>{s(a)},[a]);const c=d.useMemo(()=>Nh(e,o),[e,o]),u=d.useMemo(()=>Wh(e,o),[e,o]),h=c||ot(u)&&u>0,g=ot(e.rowHeight)&&e.rowHeight>rn("4rem"),f=d.useMemo(()=>Mu(t).map(p=>{let m={...p,...Eu(p,l),isStretched:h};const w=Tu(m);return(e.editingMode===on.EditingMode.READ_ONLY||n||w.isEditableType===!1)&&(m={...m,isEditable:!1}),e.editingMode!==on.EditingMode.READ_ONLY&&m.isEditable==!0&&(m={...m,icon:"editable"},m.isRequired&&e.editingMode===on.EditingMode.DYNAMIC&&(m={...m,isHidden:!1})),w(m,i)}),[t,l,h,e.editingMode,n,i]);return{columns:d.useMemo(()=>{const p=Mu(t).map(v=>{let x={...v,...Eu(v,l),isStretched:h,isWrappingAllowed:g};const I=Tu(x);return(e.editingMode===on.EditingMode.READ_ONLY||n||I.isEditableType===!1)&&(x={...x,isEditable:!1}),e.editingMode!==on.EditingMode.READ_ONLY&&x.isEditable==!0&&(x={...x,icon:"editable"},x.isRequired&&e.editingMode===on.EditingMode.DYNAMIC&&(x={...x,isHidden:!1})),I(x,i)}).filter(v=>!v.isHidden),m=[],w=[];r?.length?(p.forEach(v=>{v.isIndex&&!r.includes(v.name)&&!r.includes(v.id)&&v.isPinned!==!1&&m.push(v)}),r.forEach(v=>{const x=p.find(I=>I.name===v||I.id===v);x&&(x.isPinned?m.push(x):w.push(x))})):p.forEach(v=>{v.isPinned?m.push(v):w.push(v)});const y=[...m,...w];return y.length>0?y:[ki(Bh())]},[t,l,g,h,n,e.editingMode,r,i]),allColumns:f,setColumnConfigMapping:s}}function Kr(e){return e.isIndex?ca:Te(e.name)?"":e.name}class na{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,i,a)=>{const l={};o.forEach((s,c)=>{const u=n.get(c);u&&(l[Kr(u)]=u.getCellValue(s))}),r.edited_rows[i]=l}),this.addedRows.forEach(o=>{const i={};let a=!1;o.forEach((l,s,c)=>{const u=n.get(s);if(u){const h=u.getCellValue(l);u.isRequired&&u.isEditable&&Ms(l)&&(a=!0),ot(h)&&(i[Kr(u)]=h)}}),a||r.added_rows.push(i)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,i)=>i===void 0?null:i)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),o=new Map;n.forEach(a=>{o.set(a.indexNumber,a)});const i=new Map;n.forEach(a=>{i.set(Kr(a),a)}),Object.keys(r.edited_rows).forEach(a=>{const l=Number(a),s=r.edited_rows[a];Object.keys(s).forEach(c=>{const u=s[c],h=i.get(c);if(h){const g=h.getCell(u);g&&(this.editedCells.has(l)||this.editedCells.set(l,new Map),this.editedCells.get(l)?.set(h.indexNumber,g))}})}),r.added_rows.forEach(a=>{const l=new Map;n.forEach(s=>{l.set(s.indexNumber,s.getCell(null))}),Object.keys(a).forEach(s=>{const c=a[s],u=i.get(s);if(u){const h=u.getCell(c);h&&l.set(u.indexNumber,h)}}),this.addedRows.push(l)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Te(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const Ci=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),o=r.get(e),i={...o||{},...n||{}};return(o?.type_config||n?.type_config)&&(i.type_config={...o?.type_config||{},...n?.type_config||{}}),r.set(e,i),r};function my(e){return{changeColumnFormat:d.useCallback((t,n)=>{e(r=>Ci({columnId:t,columnConfigMapping:r,updatedProps:{type_config:{format:n}}}))},[e])}}function vy(e,t,n,r,o,i){const a=d.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,u)=>c+(u.width??r*2),0)>n*.6,[e,n,r]),l=t||a?0:e.filter(c=>c.isPinned).length,s=d.useCallback(c=>{i(u=>Ci({columnId:c,columnConfigMapping:u,updatedProps:{pinned:!1}})),o(!0,!1)},[o,i]);return{pinColumn:d.useCallback(c=>{i(u=>Ci({columnId:c,columnConfigMapping:u,updatedProps:{pinned:!0}})),o(!0,!1)},[o,i]),unpinColumn:s,freezeColumns:l}}function by(e,t,n,r,o){return{onColumnMoved:d.useCallback((i,a)=>{const l=[...e],[s]=l.splice(i,1);l.splice(a,0,s),a<t&&!s.isPinned?n(s.id):a>=t&&s.isPinned&&r(s.id),o(l.map(c=>c.id))},[e,t,n,r,o])}}function yy(e){const[t,n]=d.useState(()=>new Map),r=d.useCallback((o,i,a,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:d.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function wy(e){switch(e.kind){case Y.Number:return e.data?.toString()??"";case Y.Boolean:return e.data?.toString()??"";case Y.Markdown:case Y.RowID:case Y.Text:case Y.Uri:return e.data??"";case Y.Bubble:case Y.Image:return e.data.join("");case Y.Drilldown:return e.data.map(t=>t.text).join("");case Y.Protected:case Y.Loading:return"";case Y.Custom:return e.copyData}}function Ou(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function xy(e,t){return e=Ou(e),t=Ou(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function ky(e,t){return e>t?1:e===t?0:-1}function Cy(e){const{sort:t,rows:n,getCellContent:r}=e,o=d.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),i=d.useMemo(()=>o.map(c=>{const u=e.columns.findIndex(h=>c.column===h||h.id!==void 0&&c.column.id===h.id);return u===-1?void 0:u}),[o,e.columns]),a=d.useMemo(()=>{const c=o.map((h,g)=>({sort:h,col:i[g]})).filter(h=>h.col!==void 0);if(c.length===0)return;const u=c.map(()=>new Array(n));for(let h=0;h<c.length;h++){const{col:g}=c[h],f=[g,0];for(let p=0;p<n;p++)f[1]=p,u[h][p]=wy(r(f))}return Tr(n).sort((h,g)=>{for(let f=0;f<c.length;f++){const{sort:p}=c[f],m=u[f][h],w=u[f][g];let y;if(p.mode==="raw"?y=ky(m,w):p.mode==="smart"?y=xy(m,w):y=m.localeCompare(w),y!==0)return(p.direction??"asc")==="desc"&&(y=-y),y}return 0})},[r,n,o,i]),l=d.useCallback(c=>a===void 0?c:a[c],[a]),s=d.useCallback(([c,u])=>a===void 0?r([c,u]):(u=a[u],r([c,u])),[r,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:l}:{getOriginalIndex:l,getCellContent:s}}function Sy(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function My(e,t,n){const[r,o]=d.useState(),{getCellContent:i,getOriginalIndex:a}=Cy({columns:t.map(c=>Zl(c)),getCellContent:n,rows:e,sort:r}),l=d.useMemo(()=>Sy(t,r),[t,r]),s=d.useCallback((c,u,h)=>{const g=l[c];let f;u==="auto"?(f="asc",r&&r.column.id===g.id&&(r.direction==="asc"?f="desc":f=void 0)):f=u,f===void 0||h&&f===r?.direction?o(void 0):o({column:Zl(g),direction:f,mode:g.sortMode})},[r,l]);return{columns:l,sortColumn:s,getOriginalIndex:a,getCellContent:i}}function Ry(e,t){const n=d.useCallback(o=>{t(i=>Ci({columnId:o,columnConfigMapping:i,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=d.useCallback(o=>{t(i=>Ci({columnId:o,columnConfigMapping:i,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function Iy(){return{provideEditor:d.useCallback(e=>{if(e.kind===Y.Text&&e.readonly&&_1(e.data))return{editor:U1}},[])}}const Ey={kind:Y.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:o,hoverAmount:i,hoverX:a}=e;let{values:l,yAxis:s,color:c,graphKind:u="area",displayValues:h,hideAxis:g}=t.data;const[f,p]=s;if(l.length===0)return!0;l=l.map(M=>Math.min(1,Math.max(0,(M-f)/(p-f))));const m=r.cellHorizontalPadding,w=m+o.x,y=o.y+3,v=o.height-6,x=o.width-m*2,I=p-f,O=p<=0?y:f>=0?y+v:y+v*(p/I);if(!g&&f<=0&&p>=0&&(n.beginPath(),n.moveTo(w,O),n.lineTo(w+x,O),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),u==="bar"){n.beginPath();const M=2,P=(l.length-1)*M,S=(x-P)/l.length;let k=w;for(const H of l){const E=y+v-H*v;n.moveTo(k,O),n.lineTo(k+S,O),n.lineTo(k+S,E),n.lineTo(k,E),k+=S+M}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{l.length===1&&(l=[l[0],l[0]],h&&(h=[h[0],h[0]])),n.beginPath();const M=(o.width-16)/(l.length-1),P=l.map((k,H)=>({x:w+M*H,y:y+v-k*v}));n.moveTo(P[0].x,P[0].y);let S=0;if(P.length>2)for(S=1;S<P.length-2;S++){const k=(P[S].x+P[S+1].x)/2,H=(P[S].y+P[S+1].y)/2;n.quadraticCurveTo(P[S].x,P[S].y,k,H)}if(n.quadraticCurveTo(P[S].x,P[S].y,P[S+1].x,P[S+1].y),n.strokeStyle=c??r.accentColor,n.lineWidth=1+i*.5,n.stroke(),n.lineTo(o.x+o.width-m,O),n.lineTo(o.x+m,O),n.closePath(),u==="area"){n.globalAlpha=.2+.2*i;const k=n.createLinearGradient(0,y,0,y+v*1.4);k.addColorStop(0,c??r.accentColor);const[H,E,R]=vi(c??r.accentColor);k.addColorStop(1,`rgba(${H}, ${E}, ${R}, 0)`),n.fillStyle=k,n.fill(),n.globalAlpha=1}if(a!==void 0&&(u==="line"||u==="area")&&h!==void 0){n.beginPath();const k=Math.min(l.length-1,Math.max(0,Math.round((a-m)/M)));n.moveTo(w+k*M,o.y+1),n.lineTo(w+k*M,o.y+o.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(h[k],w,o.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function Du(e,t,n,r,o,i){if(!(r<=0||o<=0)){if(typeof i=="number"&&i<=0){e.rect(t,n,r,o);return}typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.min(i.tl,o/2,r/2),tr:Math.min(i.tr,o/2,r/2),bl:Math.min(i.bl,o/2,r/2),br:Math.min(i.br,o/2,r/2)},i.tl=Math.max(0,i.tl),i.tr=Math.max(0,i.tr),i.br=Math.max(0,i.br),i.bl=Math.max(0,i.bl),e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}}function Pu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pu(Object(n),!0).forEach(function(r){li(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ty=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Gh(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,o=r===void 0?!1:r,i=e.defaultValue,a=i===void 0?null:i,l=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,h=e.onMenuClose,g=e.onMenuOpen,f=e.value,p=cr(e,Ty),m=d.useState(l!==void 0?l:n),w=gr(m,2),y=w[0],v=w[1],x=d.useState(s!==void 0?s:o),I=gr(x,2),O=I[0],M=I[1],P=d.useState(f!==void 0?f:a),S=gr(P,2),k=S[0],H=S[1],E=d.useCallback(function(Z,ce){typeof c=="function"&&c(Z,ce),H(Z)},[c]),R=d.useCallback(function(Z,ce){var te;typeof u=="function"&&(te=u(Z,ce)),v(te!==void 0?te:Z)},[u]),T=d.useCallback(function(){typeof g=="function"&&g(),M(!0)},[g]),D=d.useCallback(function(){typeof h=="function"&&h(),M(!1)},[h]),C=l!==void 0?l:y,J=s!==void 0?s:O,W=f!==void 0?f:k;return He(He({},p),{},{inputValue:C,menuIsOpen:J,onChange:E,onInputChange:R,onMenuClose:D,onMenuOpen:T,value:W})}function Oy(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Dy(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Py=(function(){function e(n){var r=this;this._insertTag=function(o){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,i),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Dy(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Oy(r);try{o.insertRule(n,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e})(),Hy=function(e,t,n){for(var r=0,o=0;r=o,o=Vl(),r===38&&o===12&&(t[n]=1),!xd(o);)wd();return Og(e,kd)},zy=function(e,t){var n=-1,r=44;do switch(xd(r)){case 0:r===38&&Vl()===12&&(t[n]=1),e[n]+=Hy(kd-1,t,n);break;case 2:e[n]+=Tg(r);break;case 4:if(r===44){e[++n]=Vl()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Eg(r)}while(r=wd());return e},Ly=function(e,t){return Mg(zy(Rg(e),t))},Hu=new WeakMap,Ay=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Hu.get(n))&&!r){Hu.set(e,!0);for(var o=[],i=Ly(t,o),a=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<a.length;c++,s++)e.props[s]=o[l]?i[l].replace(/&\f/g,a[c]):a[c]+" "+i[l]}}},Fy=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Uh(e,t){switch(Ig(e,t)){case 5103:return Ct+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ct+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ct+e+ha+e+vn+e+e;case 6828:case 4268:return Ct+e+vn+e+e;case 6165:return Ct+e+vn+"flex-"+e+e;case 5187:return Ct+e+At(e,/(\w+).+(:[^]+)/,Ct+"box-$1$2"+vn+"flex-$1$2")+e;case 5443:return Ct+e+vn+"flex-item-"+At(e,/flex-|-self/,"")+e;case 4675:return Ct+e+vn+"flex-line-pack"+At(e,/align-content|flex-|-self/,"")+e;case 5548:return Ct+e+vn+At(e,"shrink","negative")+e;case 5292:return Ct+e+vn+At(e,"basis","preferred-size")+e;case 6060:return Ct+"box-"+At(e,"-grow","")+Ct+e+vn+At(e,"grow","positive")+e;case 4554:return Ct+At(e,/([^-])(transform)/g,"$1"+Ct+"$2")+e;case 6187:return At(At(At(e,/(zoom-|grab)/,Ct+"$1"),/(image-set)/,Ct+"$1"),e,"")+e;case 5495:case 3959:return At(e,/(image-set\([^]*)/,Ct+"$1$`$1");case 4968:return At(At(e,/(.+:)(flex-)?(.*)/,Ct+"box-pack:$3"+vn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ct+e+e;case 4095:case 3583:case 4068:case 2532:return At(e,/(.+)-inline(.+)/,Ct+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(hc(e)-1-t>6)switch(Wr(e,t+1)){case 109:if(Wr(e,t+4)!==45)break;case 102:return At(e,/(.+:)(.+)-([^]+)/,"$1"+Ct+"$2-$3$1"+ha+(Wr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fc(e,"stretch")?Uh(At(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Wr(e,t+1)!==115)break;case 6444:switch(Wr(e,hc(e)-3-(~fc(e,"!important")&&10))){case 107:return At(e,":",":"+Ct)+e;case 101:return At(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ct+(Wr(e,14)===45?"inline-":"")+"box$3$1"+Ct+"$2$3$1"+vn+"$2box$3")+e}break;case 5936:switch(Wr(e,t+11)){case 114:return Ct+e+vn+At(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ct+e+vn+At(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ct+e+vn+At(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ct+e+vn+e+e}return e}var Vy=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case kg:e.return=Uh(e.value,e.length);break;case xg:return aa([Uo(e,{value:At(e.value,"@","@"+Ct)})],r);case bg:if(e.length)return yg(e.props,function(o){switch(wg(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return aa([Uo(e,{props:[At(o,/:(read-\w+)/,":"+ha+"$1")]})],r);case"::placeholder":return aa([Uo(e,{props:[At(o,/:(plac\w+)/,":"+Ct+"input-$1")]}),Uo(e,{props:[At(o,/:(plac\w+)/,":"+ha+"$1")]}),Uo(e,{props:[At(o,/:(plac\w+)/,vn+"input-$1")]})],r)}return""})}},_y=[Vy],$y=function(e){var t=e.key;if(t==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(p){var m=p.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||_y,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(p){for(var m=p.getAttribute("data-emotion").split(" "),w=1;w<m.length;w++)o[m[w]]=!0;a.push(p)});var l,s=[Ay,Fy];{var c,u=[gg,mg(function(p){c.insert(p)})],h=Bp(s.concat(r,u)),g=function(p){return aa(Dg(p),h)};l=function(p,m,w,y){c=w,g(p?p+"{"+m.styles+"}":m.styles),y&&(f.inserted[m.name]=!0)}}var f={key:t,sheet:new Py({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return f.sheet.hydrate(a),f},By=function(e){return e()},Ny=d.useInsertionEffect?d.useInsertionEffect:!1,Wy=Ny||By,_s={}.hasOwnProperty,Kh=d.createContext(typeof HTMLElement<"u"?$y({key:"css"}):null);Kh.Provider;var jy=function(e){return d.forwardRef(function(t,n){var r=d.useContext(Kh);return e(t,r,n)})},Gy=d.createContext({}),Yl="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Uy=function(e,t){var n={};for(var r in t)_s.call(t,r)&&(n[r]=t[r]);return n[Yl]=e,n},Ky=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Cg(t,n,r),Wy(function(){return Sg(t,n,r)}),null},Xy=jy(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[Yl],i=[r],a="";typeof e.className=="string"?a=vg(t.registered,i,e.className):e.className!=null&&(a=e.className+" ");var l=vd(i,void 0,d.useContext(Gy));a+=t.key+"-"+l.name;var s={};for(var c in e)_s.call(e,c)&&c!=="css"&&c!==Yl&&(s[c]=e[c]);return s.ref=n,s.className=a,d.createElement(d.Fragment,null,d.createElement(Ky,{cache:t,serialized:l,isStringTag:typeof o=="string"}),d.createElement(o,s))}),qy=Xy,ze=function(e,t){var n=arguments;if(t==null||!_s.call(t,"css"))return d.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=qy,o[1]=Uy(e,t);for(var i=2;i<r;i++)o[i]=n[i];return d.createElement.apply(null,o)};function $s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vd(t)}var Zy=function(){var e=$s.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function Yy(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Jy=Math.min,Qy=Math.max,Sa=Math.round,ra=Math.floor,Jl=e=>({x:e,y:e});function ew(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function La(){return typeof window<"u"}function Xh(e){return Zh(e)?(e.nodeName||"").toLowerCase():"#document"}function Or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qh(e){var t;return(t=(Zh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zh(e){return La()?e instanceof Node||e instanceof Or(e).Node:!1}function tw(e){return La()?e instanceof Element||e instanceof Or(e).Element:!1}function Bs(e){return La()?e instanceof HTMLElement||e instanceof Or(e).HTMLElement:!1}function zu(e){return!La()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Or(e).ShadowRoot}const nw=new Set(["inline","contents"]);function Yh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ns(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!nw.has(o)}const rw=new Set(["html","body","#document"]);function ow(e){return rw.has(Xh(e))}function Ns(e){return Or(e).getComputedStyle(e)}function iw(e){if(Xh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zu(e)&&e.host||qh(e);return zu(t)?t.host:t}function Jh(e){const t=iw(e);return ow(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bs(t)&&Yh(t)?t:Jh(t)}function Ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jh(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Or(o);if(i){const l=Ql(a);return t.concat(a,a.visualViewport||[],Yh(o)?o:[],l&&n?Ma(l):[])}return t.concat(o,Ma(o,[],n))}function Ql(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function aw(e){const t=Ns(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Bs(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=Sa(n)!==i||Sa(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function Ws(e){return tw(e)?e:e.contextElement}function Lu(e){const t=Ws(e);if(!Bs(t))return Jl(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=aw(t);let a=(i?Sa(n.width):n.width)/r,l=(i?Sa(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}function Au(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),i=Ws(e);let a=Jl(1);t&&(a=Lu(e));const l=Jl(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,h=o.height/a.y;if(i){const g=Or(i),f=r;let p=g,m=Ql(p);for(;m&&r&&f!==p;){const w=Lu(m),y=m.getBoundingClientRect(),v=Ns(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*w.x,I=y.top+(m.clientTop+parseFloat(v.paddingTop))*w.y;s*=w.x,c*=w.y,u*=w.x,h*=w.y,s+=x,c+=I,p=Or(m),m=Ql(p)}}return ew({width:u,height:h,x:s,y:c})}function Qh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lw(e,t){let n=null,r;const o=qh(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,s){l===void 0&&(l=!1),s===void 0&&(s=1),i();const c=e.getBoundingClientRect(),{left:u,top:h,width:g,height:f}=c;if(l||t(),!g||!f)return;const p=ra(h),m=ra(o.clientWidth-(u+g)),w=ra(o.clientHeight-(h+f)),y=ra(u),v={rootMargin:-p+"px "+-m+"px "+-w+"px "+-y+"px",threshold:Qy(0,Jy(1,s))||1};let x=!0;function I(O){const M=O[0].intersectionRatio;if(M!==s){if(!x)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!Qh(c,e.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(I,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(I,v)}n.observe(e)}return a(!0),i}function sw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,c=Ws(e),u=o||i?[...c?Ma(c):[],...Ma(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const h=c&&l?lw(c,n):null;let g=-1,f=null;a&&(f=new ResizeObserver(y=>{let[v]=y;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(t)})),n()}),c&&!s&&f.observe(c),f.observe(t));let p,m=s?Au(e):null;s&&w();function w(){const y=Au(e);m&&!Qh(m,y)&&n(),m=y,p=requestAnimationFrame(w)}return n(),()=>{var y;u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),h?.(),(y=f)==null||y.disconnect(),f=null,s&&cancelAnimationFrame(p)}}var es=d.useLayoutEffect,cw=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ra=function(){};function uw(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function dw(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat(uw(e,a)));return i.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var Ia=function(e){return ww(e)?e.filter(Boolean):fg(e)==="object"&&e!==null?[e]:[]},ef=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=cr(e,cw);return He({},t)},Ut=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(t,e),className:r(n??{},i(t,e),a)}};function Aa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function hw(e){return Aa(e)?window.innerHeight:e.clientHeight}function tf(e){return Aa(e)?window.pageYOffset:e.scrollTop}function Ea(e,t){if(Aa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function fw(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function pw(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function oa(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ra,o=tf(e),i=t-o,a=10,l=0;function s(){l+=a;var c=pw(l,o,i,n);Ea(e,c),l<n?window.requestAnimationFrame(s):r(e)}s()}function Fu(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Ea(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Ea(e,Math.max(t.offsetTop-o,0))}function gw(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Vu(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function mw(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var nf=!1,vw={get passive(){return nf=!0}},ia=typeof window<"u"?window:{};ia.addEventListener&&ia.removeEventListener&&(ia.addEventListener("p",Ra,vw),ia.removeEventListener("p",Ra,!1));var bw=nf;function yw(e){return e!=null}function ww(e){return Array.isArray(e)}function ci(e,t,n){return e?t:n}var xw=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Object.entries(e).filter(function(i){var a=gr(i,1),l=a[0];return!n.includes(l)});return o.reduce(function(i,a){var l=gr(a,2),s=l[0],c=l[1];return i[s]=c,i},{})},kw=["children","innerProps"],Cw=["children","innerProps"];function Sw(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,s=fw(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u=s.getBoundingClientRect(),h=u.height,g=n.getBoundingClientRect(),f=g.bottom,p=g.height,m=g.top,w=n.offsetParent.getBoundingClientRect(),y=w.top,v=a?window.innerHeight:hw(s),x=tf(s),I=parseInt(getComputedStyle(n).marginBottom,10),O=parseInt(getComputedStyle(n).marginTop,10),M=y-O,P=v-m,S=M+x,k=h-x-m,H=f-v+x+I,E=x+m-O,R=160;switch(o){case"auto":case"bottom":if(P>=p)return{placement:"bottom",maxHeight:t};if(k>=p&&!a)return i&&oa(s,H,R),{placement:"bottom",maxHeight:t};if(!a&&k>=r||a&&P>=r){i&&oa(s,H,R);var T=a?P-I:k-I;return{placement:"bottom",maxHeight:T}}if(o==="auto"||a){var D=t,C=a?M:S;return C>=r&&(D=Math.min(C-I-l,t)),{placement:"top",maxHeight:D}}if(o==="bottom")return i&&Ea(s,H),{placement:"bottom",maxHeight:t};break;case"top":if(M>=p)return{placement:"top",maxHeight:t};if(S>=p&&!a)return i&&oa(s,E,R),{placement:"top",maxHeight:t};if(!a&&S>=r||a&&M>=r){var J=t;return(!a&&S>=r||a&&M>=r)&&(J=a?M-O:S-O),i&&oa(s,E,R),{placement:"top",maxHeight:J}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}function Mw(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var rf=function(e){return e==="auto"?"bottom":e},Rw=function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return He((n={label:"menu"},li(n,Mw(r),"100%"),li(n,"position","absolute"),li(n,"width","100%"),li(n,"zIndex",1),n),t?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},of=d.createContext(null),Iw=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,s=d.useContext(of)||{},c=s.setPortalPlacement,u=d.useRef(null),h=d.useState(r),g=gr(h,2),f=g[0],p=g[1],m=d.useState(null),w=gr(m,2),y=w[0],v=w[1],x=l.spacing.controlHeight;return es(function(){var I=u.current;if(I){var O=i==="fixed",M=a&&!O,P=Sw({maxHeight:r,menuEl:I,minHeight:n,placement:o,shouldScroll:M,isFixedPosition:O,controlHeight:x});p(P.maxHeight),v(P.placement),c?.(P.placement)}},[r,o,i,a,n,c,x]),t({ref:u,placerProps:He(He({},e),{},{placement:y||rf(o),maxHeight:f})})},Ew=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return ze("div",Ae({},Ut(e,"menu",{menu:!0}),{ref:n},r),t)},Tw=Ew,Ow=function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return He({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},Dw=function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return ze("div",Ae({},Ut(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},af=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return He({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Pw=af,Hw=af,zw=function(e){var t=e.children,n=t===void 0?"No options":t,r=e.innerProps,o=cr(e,kw);return ze("div",Ae({},Ut(He(He({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},Lw=function(e){var t=e.children,n=t===void 0?"Loading...":t,r=e.innerProps,o=cr(e,Cw);return ze("div",Ae({},Ut(He(He({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},Aw=function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},Fw=function(e){var t=e.appendTo,n=e.children,r=e.controlElement,o=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=d.useRef(null),s=d.useRef(null),c=d.useState(rf(i)),u=gr(c,2),h=u[0],g=u[1],f=d.useMemo(function(){return{setPortalPlacement:g}},[]),p=d.useState(null),m=gr(p,2),w=m[0],y=m[1],v=d.useCallback(function(){if(r){var M=gw(r),P=a==="fixed"?0:window.pageYOffset,S=M[h]+P;(S!==w?.offset||M.left!==w?.rect.left||M.width!==w?.rect.width)&&y({offset:S,rect:M})}},[r,a,h,w?.offset,w?.rect.left,w?.rect.width]);es(function(){v()},[v]);var x=d.useCallback(function(){typeof s.current=="function"&&(s.current(),s.current=null),r&&l.current&&(s.current=sw(r,l.current,v,{elementResize:"ResizeObserver"in window}))},[r,v]);es(function(){x()},[x]);var I=d.useCallback(function(M){l.current=M,x()},[x]);if(!t&&a!=="fixed"||!w)return null;var O=ze("div",Ae({ref:I},Ut(He(He({},e),{},{offset:w.offset,position:a,rect:w.rect}),"menuPortal",{"menu-portal":!0}),o),n);return ze(of.Provider,{value:f},t?gd.createPortal(O,t):O)},Vw=function(e){var t=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},_w=function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return ze("div",Ae({},Ut(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},$w=function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return He({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(n.baseUnit*2,"px")})},Bw=function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return ze("div",Ae({},Ut(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)},Nw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Ww=function(e){var t=e.children,n=e.innerProps;return ze("div",Ae({},Ut(e,"indicatorsContainer",{indicators:!0}),n),t)},_u,jw=["size"],Gw=["innerProps","isRtl","size"],Uw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},lf=function(e){var t=e.size,n=cr(e,jw);return ze("svg",Ae({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Uw},n))},js=function(e){return ze(lf,Ae({size:20},e),ze("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},sf=function(e){return ze(lf,Ae({size:20},e),ze("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},cf=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return He({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:o*2,":hover":{color:n?i.neutral80:i.neutral40}})},Kw=cf,Xw=function(e){var t=e.children,n=e.innerProps;return ze("div",Ae({},Ut(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ze(sf,null))},qw=cf,Zw=function(e){var t=e.children,n=e.innerProps;return ze("div",Ae({},Ut(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ze(js,null))},Yw=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return He({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:o*2,marginTop:o*2})},Jw=function(e){var t=e.innerProps;return ze("span",Ae({},t,Ut(e,"indicatorSeparator",{"indicator-separator":!0})))},Qw=Zy(_u||(_u=Yy([`
|
|
193
|
+
0%, 80%, 100% { opacity: 0; }
|
|
194
|
+
40% { opacity: 1; }
|
|
195
|
+
`]))),ex=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return He({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},El=function(e){var t=e.delay,n=e.offset;return ze("span",{css:$s({animation:"".concat(Qw," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},tx=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=cr(e,Gw);return ze("div",Ae({},Ut(He(He({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ze(El,{delay:0,offset:n}),ze(El,{delay:160,offset:!0}),ze(El,{delay:320,offset:!n}))},nx=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return He({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},rx=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return ze("div",Ae({ref:o},Ut(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},ox=rx,ix=["data"],ax=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},lx=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return ze("div",Ae({},Ut(e,"group",{group:!0}),l),ze(i,Ae({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),ze("div",null,t))},sx=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return He({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},cx=function(e){var t=ef(e);t.data;var n=cr(t,ix);return ze("div",Ae({},Ut(e,"groupHeading",{"group-heading":!0}),n))},ux=lx,dx=["innerRef","isDisabled","isHidden","inputClassName"],hx=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return He(He({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},fx),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},uf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},fx={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":He({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},uf)},px=function(e){return He({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},uf)},gx=function(e){var t=e.cx,n=e.value,r=ef(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=cr(r,dx);return ze("div",Ae({},Ut(e,"input",{"input-container":!0}),{"data-value":n||""}),ze("input",Ae({className:t({input:!0},l),ref:o,style:px(a),disabled:i},s)))},mx=gx,vx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return He({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},bx=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return He({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},yx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return He({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},df=function(e){var t=e.children,n=e.innerProps;return ze("div",n,t)},wx=df,xx=df;function kx(e){var t=e.children,n=e.innerProps;return ze("div",Ae({role:"button"},n),t||ze(js,{size:14}))}var Cx=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return ze(s,{data:r,innerProps:He(He({},Ut(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},ze(c,{data:r,innerProps:He({},Ut(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),ze(u,{data:r,innerProps:He(He({},Ut(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},Sx=Cx,Mx=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return He({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},Rx=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return ze("div",Ae({},Ut(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Ix=Rx,Ex=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return He({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Tx=function(e){var t=e.children,n=e.innerProps;return ze("div",Ae({},Ut(e,"placeholder",{placeholder:!0}),n),t)},Ox=Tx,Dx=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return He({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Px=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return ze("div",Ae({},Ut(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},Hx=Px,Gs={ClearIndicator:Zw,Control:ox,DropdownIndicator:Xw,DownChevron:sf,CrossIcon:js,Group:ux,GroupHeading:cx,IndicatorsContainer:Ww,IndicatorSeparator:Jw,Input:mx,LoadingIndicator:tx,Menu:Tw,MenuList:Dw,MenuPortal:Fw,LoadingMessage:Lw,NoOptionsMessage:zw,MultiValue:Sx,MultiValueContainer:wx,MultiValueLabel:xx,MultiValueRemove:kx,Option:Ix,Placeholder:Ox,SelectContainer:_w,SingleValue:Hx,ValueContainer:Bw},zx=function(e){return He(He({},Gs),e.components)},$u=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Lx(e,t){return!!(e===t||$u(e)&&$u(t))}function Ax(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Lx(e[n],t[n]))return!1;return!0}function Fx(e,t){t===void 0&&(t=Ax);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var a=e.apply(this,o);return n={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){n=null},r}var Vx={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},_x=function(e){return ze("span",Ae({css:Vx},e))},Bu=_x,$x={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=n===void 0?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(f,p){return f&&f.length?"".concat(f.indexOf(p)+1," of ").concat(f.length):""};if(t==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if(t==="menu"&&c){var h=l?" disabled":"",g="".concat(s?" selected":"").concat(h);return"".concat(i).concat(g,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Bx=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,s=e.id,c=e.isAppleDevice,u=l.ariaLiveMessages,h=l.getOptionLabel,g=l.inputValue,f=l.isMulti,p=l.isOptionDisabled,m=l.isSearchable,w=l.menuIsOpen,y=l.options,v=l.screenReaderStatus,x=l.tabSelectsValue,I=l.isLoading,O=l["aria-label"],M=l["aria-live"],P=d.useMemo(function(){return He(He({},$x),u||{})},[u]),S=d.useMemo(function(){var D="";if(t&&P.onChange){var C=t.option,J=t.options,W=t.removedValue,Z=t.removedValues,ce=t.value,te=function(oe){return Array.isArray(oe)?null:oe},q=W||C||te(ce),ge=q?h(q):"",ae=J||Z||void 0,fe=ae?ae.map(h):[],he=He({isDisabled:q&&p(q,a),label:ge,labels:fe},t);D=P.onChange(he)}return D},[t,P,p,a,h]),k=d.useMemo(function(){var D="",C=n||r,J=!!(n&&a&&a.includes(n));if(C&&P.onFocus){var W={focused:C,label:h(C),isDisabled:p(C,a),isSelected:J,options:o,context:C===n?"menu":"value",selectValue:a,isAppleDevice:c};D=P.onFocus(W)}return D},[n,r,h,p,P,o,a,c]),H=d.useMemo(function(){var D="";if(w&&y.length&&!I&&P.onFilter){var C=v({count:o.length});D=P.onFilter({inputValue:g,resultsMessage:C})}return D},[o,g,w,P,y,v,I]),E=t?.action==="initial-input-focus",R=d.useMemo(function(){var D="";if(P.guidance){var C=r?"value":w?"menu":"input";D=P.guidance({"aria-label":O,context:C,isDisabled:n&&p(n,a),isMulti:f,isSearchable:m,tabSelectsValue:x,isInitialFocus:E})}return D},[O,n,r,f,p,m,w,P,a,x,E]),T=ze(d.Fragment,null,ze("span",{id:"aria-selection"},S),ze("span",{id:"aria-focused"},k),ze("span",{id:"aria-results"},H),ze("span",{id:"aria-guidance"},R));return ze(d.Fragment,null,ze(Bu,{id:s},E&&T),ze(Bu,{"aria-live":M,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!E&&T))},Nx=Bx,ts=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Wx=new RegExp("["+ts.map(function(e){return e.letters}).join("")+"]","g"),hf={};for(var Tl=0;Tl<ts.length;Tl++)for(var Ol=ts[Tl],Dl=0;Dl<Ol.letters.length;Dl++)hf[Ol.letters[Dl]]=Ol.base;var ff=function(e){return e.replace(Wx,function(t){return hf[t]})},jx=Fx(ff),Nu=function(e){return e.replace(/^\s+|\s+$/g,"")},Gx=function(e){return"".concat(e.label," ").concat(e.value)},Ux=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=He({ignoreCase:!0,ignoreAccents:!0,stringify:Gx,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,s=r.matchFrom,c=l?Nu(n):n,u=l?Nu(a(t)):a(t);return o&&(c=c.toLowerCase(),u=u.toLowerCase()),i&&(c=jx(c),u=ff(u)),s==="start"?u.substr(0,c.length)===c:u.indexOf(c)>-1}},Kx=["innerRef"];function Xx(e){var t=e.innerRef,n=cr(e,Kx),r=xw(n,"onExited","in","enter","exit","appear");return ze("input",Ae({ref:t},r,{css:$s({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var qx=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Zx(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,a=d.useRef(!1),l=d.useRef(!1),s=d.useRef(0),c=d.useRef(null),u=d.useCallback(function(w,y){if(c.current!==null){var v=c.current,x=v.scrollTop,I=v.scrollHeight,O=v.clientHeight,M=c.current,P=y>0,S=I-O-x,k=!1;S>y&&a.current&&(r&&r(w),a.current=!1),P&&l.current&&(i&&i(w),l.current=!1),P&&y>S?(n&&!a.current&&n(w),M.scrollTop=I,k=!0,a.current=!0):!P&&-y>x&&(o&&!l.current&&o(w),M.scrollTop=0,k=!0,l.current=!0),k&&qx(w)}},[n,r,o,i]),h=d.useCallback(function(w){u(w,w.deltaY)},[u]),g=d.useCallback(function(w){s.current=w.changedTouches[0].clientY},[]),f=d.useCallback(function(w){var y=s.current-w.changedTouches[0].clientY;u(w,y)},[u]),p=d.useCallback(function(w){if(w){var y=bw?{passive:!1}:!1;w.addEventListener("wheel",h,y),w.addEventListener("touchstart",g,y),w.addEventListener("touchmove",f,y)}},[f,g,h]),m=d.useCallback(function(w){w&&(w.removeEventListener("wheel",h,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",f,!1))},[f,g,h]);return d.useEffect(function(){if(t){var w=c.current;return p(w),function(){m(w)}}},[t,p,m]),function(w){c.current=w}}var Wu=["boxSizing","height","overflow","paddingRight","position"],ju={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Gu(e){e.cancelable&&e.preventDefault()}function Uu(e){e.stopPropagation()}function Ku(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Xu(){return"ontouchstart"in window||navigator.maxTouchPoints}var qu=!!(typeof window<"u"&&window.document&&window.document.createElement),ai=0,wo={capture:!1,passive:!1};function Yx(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=d.useRef({}),i=d.useRef(null),a=d.useCallback(function(s){if(qu){var c=document.body,u=c&&c.style;if(r&&Wu.forEach(function(p){var m=u&&u[p];o.current[p]=m}),r&&ai<1){var h=parseInt(o.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,f=window.innerWidth-g+h||0;Object.keys(ju).forEach(function(p){var m=ju[p];u&&(u[p]=m)}),u&&(u.paddingRight="".concat(f,"px"))}c&&Xu()&&(c.addEventListener("touchmove",Gu,wo),s&&(s.addEventListener("touchstart",Ku,wo),s.addEventListener("touchmove",Uu,wo))),ai+=1}},[r]),l=d.useCallback(function(s){if(qu){var c=document.body,u=c&&c.style;ai=Math.max(ai-1,0),r&&ai<1&&Wu.forEach(function(h){var g=o.current[h];u&&(u[h]=g)}),c&&Xu()&&(c.removeEventListener("touchmove",Gu,wo),s&&(s.removeEventListener("touchstart",Ku,wo),s.removeEventListener("touchmove",Uu,wo)))}},[r]);return d.useEffect(function(){if(t){var s=i.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){i.current=s}}var Jx=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Qx={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ek(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,c=Zx({isEnabled:o,onBottomArrive:i,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),u=Yx({isEnabled:n}),h=function(g){c(g),u(g)};return ze(d.Fragment,null,n&&ze("div",{onClick:Jx,css:Qx}),t(h))}var tk={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},nk=function(e){var t=e.name,n=e.onFocus;return ze("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:tk,value:"",onChange:function(){}})},rk=nk;function Us(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ok(){return Us(/^iPhone/i)}function pf(){return Us(/^Mac/i)}function ik(){return Us(/^iPad/i)||pf()&&navigator.maxTouchPoints>1}function ak(){return ok()||ik()}function lk(){return pf()||ak()}var sk=function(e){return e.label},gf=function(e){return e.label},mf=function(e){return e.value},ck=function(e){return!!e.isDisabled},uk={clearIndicator:qw,container:Vw,control:nx,dropdownIndicator:Kw,group:ax,groupHeading:sx,indicatorsContainer:Nw,indicatorSeparator:Yw,input:hx,loadingIndicator:ex,loadingMessage:Hw,menu:Rw,menuList:Ow,menuPortal:Aw,multiValue:vx,multiValueLabel:bx,multiValueRemove:yx,noOptionsMessage:Pw,option:Mx,placeholder:Ex,singleValue:Dx,valueContainer:$w},dk={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},hk=4,vf=4,fk=38,pk=vf*2,gk={baseUnit:vf,controlHeight:fk,menuGutter:pk},Pl={borderRadius:hk,colors:dk,spacing:gk},mk={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Vu(),captureMenuScroll:!Vu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Ux(),formatGroupLabel:sk,getOptionLabel:gf,getOptionValue:mf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ck,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!mw(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Zu(e,t,n,r){var o=wf(e,t,n),i=xf(e,t,n),a=yf(e,t),l=Ta(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:a,value:l,index:r}}function ua(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(a,l){return Zu(e,a,t,l)}).filter(function(a){return Ju(e,a)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Zu(e,n,t,r);return Ju(e,i)?i:void 0}).filter(yw)}function bf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Eo(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Yu(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Eo(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function vk(e,t){return bf(ua(e,t))}function Ju(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!Cf(e)||!i)&&kf(e,{label:a,value:l,data:o},r)}function bk(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o<t.length)return t[o]}return null}function yk(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Hl=function(e,t){var n,r=(n=e.find(function(o){return o.data===t}))===null||n===void 0?void 0:n.id;return r||null},yf=function(e,t){return e.getOptionLabel(t)},Ta=function(e,t){return e.getOptionValue(t)};function wf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function xf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ta(e,t);return n.some(function(o){return Ta(e,o)===r})}function kf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Cf=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},wk=1,Ks=(function(e){Ng(n,e);var t=Gg(n);function n(r){var o;if(Wg(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.controlRef=null,o.getControlRef=function(s){o.controlRef=s},o.focusedOptionRef=null,o.getFocusedOptionRef=function(s){o.focusedOptionRef=s},o.menuListRef=null,o.getMenuListRef=function(s){o.menuListRef=s},o.inputRef=null,o.getInputRef=function(s){o.inputRef=s},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(s,c){var u=o.props,h=u.onChange,g=u.name;c.name=g,o.ariaOnChange(s,c),h(s,c)},o.setValue=function(s,c,u){var h=o.props,g=h.closeMenuOnSelect,f=h.isMulti,p=h.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(o.setState({inputIsHiddenAfterUpdate:!f}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(s,{action:c,option:u})},o.selectOption=function(s){var c=o.props,u=c.blurInputOnSelect,h=c.isMulti,g=c.name,f=o.state.selectValue,p=h&&o.isOptionSelected(s,f),m=o.isOptionDisabled(s,f);if(p){var w=o.getOptionValue(s);o.setValue(f.filter(function(y){return o.getOptionValue(y)!==w}),"deselect-option",s)}else if(!m)h?o.setValue([].concat(Eo(f),[s]),"select-option",s):o.setValue(s,"select-option");else{o.ariaOnChange(s,{action:"select-option",option:s,name:g});return}u&&o.blurInput()},o.removeValue=function(s){var c=o.props.isMulti,u=o.state.selectValue,h=o.getOptionValue(s),g=u.filter(function(p){return o.getOptionValue(p)!==h}),f=ci(c,g,g[0]||null);o.onChange(f,{action:"remove-value",removedValue:s}),o.focusInput()},o.clearValue=function(){var s=o.state.selectValue;o.onChange(ci(o.props.isMulti,[],null),{action:"clear",removedValues:s})},o.popValue=function(){var s=o.props.isMulti,c=o.state.selectValue,u=c[c.length-1],h=c.slice(0,c.length-1),g=ci(s,h,h[0]||null);u&&o.onChange(g,{action:"pop-value",removedValue:u})},o.getFocusedOptionId=function(s){return Hl(o.state.focusableOptionsWithIds,s)},o.getFocusableOptionsWithIds=function(){return Yu(ua(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return dw.apply(void 0,[o.props.classNamePrefix].concat(c))},o.getOptionLabel=function(s){return yf(o.props,s)},o.getOptionValue=function(s){return Ta(o.props,s)},o.getStyles=function(s,c){var u=o.props.unstyled,h=uk[s](c,u);h.boxSizing="border-box";var g=o.props.styles[s];return g?g(h,c):h},o.getClassNames=function(s,c){var u,h;return(u=(h=o.props.classNames)[s])===null||u===void 0?void 0:u.call(h,c)},o.getElementId=function(s){return"".concat(o.state.instancePrefix,"-").concat(s)},o.getComponents=function(){return zx(o.props)},o.buildCategorizedOptions=function(){return ua(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return bf(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(s,c){o.setState({ariaSelection:He({value:s},c)})},o.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(s){o.blockOptionHover=!1},o.onControlMouseDown=function(s){if(!s.defaultPrevented){var c=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&o.onMenuClose():c&&o.openMenu("first"):(c&&(o.openAfterFocus=!0),o.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},o.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!o.props.isDisabled){var c=o.props,u=c.isMulti,h=c.menuIsOpen;o.focusInput(),h?(o.setState({inputIsHiddenAfterUpdate:!u}),o.onMenuClose()):o.openMenu("first"),s.preventDefault()}},o.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(o.clearValue(),s.preventDefault(),o.openAfterFocus=!1,s.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(s){typeof o.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Aa(s.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(s)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(s){var c=s.touches,u=c&&c.item(0);u&&(o.initialTouchX=u.clientX,o.initialTouchY=u.clientY,o.userIsDragging=!1)},o.onTouchMove=function(s){var c=s.touches,u=c&&c.item(0);if(u){var h=Math.abs(u.clientX-o.initialTouchX),g=Math.abs(u.clientY-o.initialTouchY),f=5;o.userIsDragging=h>f||g>f}},o.onTouchEnd=function(s){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(s.target)&&o.menuListRef&&!o.menuListRef.contains(s.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(s){o.userIsDragging||o.onControlMouseDown(s)},o.onClearIndicatorTouchEnd=function(s){o.userIsDragging||o.onClearIndicatorMouseDown(s)},o.onDropdownIndicatorTouchEnd=function(s){o.userIsDragging||o.onDropdownIndicatorMouseDown(s)},o.handleInputChange=function(s){var c=o.props.inputValue,u=s.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(u,{action:"input-change",prevInputValue:c}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(s){o.props.onFocus&&o.props.onFocus(s),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(s){var c=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(s),o.onInputChange("",{action:"input-blur",prevInputValue:c}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(s){if(!(o.blockOptionHover||o.state.focusedOption===s)){var c=o.getFocusableOptions(),u=c.indexOf(s);o.setState({focusedOption:s,focusedOptionId:u>-1?o.getFocusedOptionId(s):null})}},o.shouldHideSelectedOptions=function(){return Cf(o.props)},o.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),o.focus()},o.onKeyDown=function(s){var c=o.props,u=c.isMulti,h=c.backspaceRemovesValue,g=c.escapeClearsValue,f=c.inputValue,p=c.isClearable,m=c.isDisabled,w=c.menuIsOpen,y=c.onKeyDown,v=c.tabSelectsValue,x=c.openMenuOnFocus,I=o.state,O=I.focusedOption,M=I.focusedValue,P=I.selectValue;if(!m&&!(typeof y=="function"&&(y(s),s.defaultPrevented))){switch(o.blockOptionHover=!0,s.key){case"ArrowLeft":if(!u||f)return;o.focusValue("previous");break;case"ArrowRight":if(!u||f)return;o.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(M)o.removeValue(M);else{if(!h)return;u?o.popValue():p&&o.clearValue()}break;case"Tab":if(o.isComposing||s.shiftKey||!w||!v||!O||x&&o.isOptionSelected(O,P))return;o.selectOption(O);break;case"Enter":if(s.keyCode===229)break;if(w){if(!O||o.isComposing)return;o.selectOption(O);break}return;case"Escape":w?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:f}),o.onMenuClose()):p&&g&&o.clearValue();break;case" ":if(f)return;if(!w){o.openMenu("first");break}if(!O)return;o.selectOption(O);break;case"ArrowUp":w?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":w?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!w)return;o.focusOption("pageup");break;case"PageDown":if(!w)return;o.focusOption("pagedown");break;case"Home":if(!w)return;o.focusOption("first");break;case"End":if(!w)return;o.focusOption("last");break;default:return}s.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++wk),o.state.selectValue=Ia(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),a=o.buildFocusableOptions(),l=a.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=a[l],o.state.focusedOptionId=Hl(i,a[l])}return o}return jg(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Fu(this.menuListRef,this.focusedOptionRef),lk()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Fu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,i=this.state,a=i.selectValue,l=i.isFocused,s=this.buildFocusableOptions(),c=r==="first"?0:s.length-1;if(!this.props.isMulti){var u=s.indexOf(a[0]);u>-1&&(c=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var s=i.length-1,c=-1;if(i.length){switch(r){case"previous":l===0?c=0:l===-1?c=s:c=l-1;break;case"next":l>-1&&l<s&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:i[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,s=a.indexOf(i);i||(s=-1),r==="up"?l=s>0?s-1:a.length-1:r==="down"?l=(s+1)%a.length:r==="pageup"?(l=s-o,l<0&&(l=0)):r==="pagedown"?(l=s+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Pl):He(He({},Pl),this.props.theme):Pl})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,s=this.selectOption,c=this.setValue,u=this.props,h=u.isMulti,g=u.isRtl,f=u.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:h,isRtl:g,options:f,selectOption:s,selectProps:u,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,i=r.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(r,o){return wf(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return xf(this.props,r,o)}},{key:"filterOption",value:function(r,o){return kf(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:i,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var r=this.props,o=r.isDisabled,i=r.isSearchable,a=r.inputId,l=r.inputValue,s=r.tabIndex,c=r.form,u=r.menuIsOpen,h=r.required,g=this.getComponents(),f=g.Input,p=this.state,m=p.inputIsHidden,w=p.ariaSelection,y=this.commonProps,v=a||this.getElementId("input"),x=He(He(He({"aria-autocomplete":"list","aria-expanded":u,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?d.createElement(f,Ae({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:o,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:c,type:"text",value:l},x)):d.createElement(Xx,Ae({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ra,onFocus:this.onInputFocus,disabled:o,tabIndex:s,inputMode:"none",form:c,value:""},x))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,s=o.MultiValueRemove,c=o.SingleValue,u=o.Placeholder,h=this.commonProps,g=this.props,f=g.controlShouldRenderValue,p=g.isDisabled,m=g.isMulti,w=g.inputValue,y=g.placeholder,v=this.state,x=v.selectValue,I=v.focusedValue,O=v.isFocused;if(!this.hasValue()||!f)return w?null:d.createElement(u,Ae({},h,{key:"placeholder",isDisabled:p,isFocused:O,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return x.map(function(P,S){var k=P===I,H="".concat(r.getOptionLabel(P),"-").concat(r.getOptionValue(P));return d.createElement(i,Ae({},h,{components:{Container:a,Label:l,Remove:s},isFocused:k,isDisabled:p,key:H,index:S,removeProps:{onClick:function(){return r.removeValue(P)},onTouchEnd:function(){return r.removeValue(P)},onMouseDown:function(E){E.preventDefault()}},data:P}),r.formatOptionLabel(P,"value"))});if(w)return null;var M=x[0];return d.createElement(c,Ae({},h,{data:M,isDisabled:p}),this.formatOptionLabel(M,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||s)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:u,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!o||!s)return null;var u={"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,i=r.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused;return d.createElement(i,Ae({},a,{isDisabled:l,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ae({},i,{innerProps:s,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,s=o.MenuList,c=o.MenuPortal,u=o.LoadingMessage,h=o.NoOptionsMessage,g=o.Option,f=this.commonProps,p=this.state.focusedOption,m=this.props,w=m.captureMenuScroll,y=m.inputValue,v=m.isLoading,x=m.loadingMessage,I=m.minMenuHeight,O=m.maxMenuHeight,M=m.menuIsOpen,P=m.menuPlacement,S=m.menuPosition,k=m.menuPortalTarget,H=m.menuShouldBlockScroll,E=m.menuShouldScrollIntoView,R=m.noOptionsMessage,T=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!M)return null;var C=function(q,ge){var ae=q.type,fe=q.data,he=q.isDisabled,oe=q.isSelected,V=q.label,z=q.value,G=p===fe,re=he?void 0:function(){return r.onOptionHover(fe)},le=he?void 0:function(){return r.selectOption(fe)},Ie="".concat(r.getElementId("option"),"-").concat(ge),ye={id:Ie,onClick:le,onMouseMove:re,onMouseOver:re,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:oe};return d.createElement(g,Ae({},f,{innerProps:ye,data:fe,isDisabled:he,isSelected:oe,key:Ie,label:V,type:ae,value:z,isFocused:G,innerRef:G?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(q.data,"menu"))},J;if(this.hasOptions())J=this.getCategorizedOptions().map(function(q){if(q.type==="group"){var ge=q.data,ae=q.options,fe=q.index,he="".concat(r.getElementId("group"),"-").concat(fe),oe="".concat(he,"-heading");return d.createElement(i,Ae({},f,{key:he,data:ge,options:ae,Heading:a,headingProps:{id:oe,data:q.data},label:r.formatGroupLabel(q.data)}),q.options.map(function(V){return C(V,"".concat(fe,"-").concat(V.index))}))}else if(q.type==="option")return C(q,"".concat(q.index))});else if(v){var W=x({inputValue:y});if(W===null)return null;J=d.createElement(u,f,W)}else{var Z=R({inputValue:y});if(Z===null)return null;J=d.createElement(h,f,Z)}var ce={minMenuHeight:I,maxMenuHeight:O,menuPlacement:P,menuPosition:S,menuShouldScrollIntoView:E},te=d.createElement(Iw,Ae({},f,ce),function(q){var ge=q.ref,ae=q.placerProps,fe=ae.placement,he=ae.maxHeight;return d.createElement(l,Ae({},f,ce,{innerRef:ge,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:fe}),d.createElement(ek,{captureEnabled:w,onTopArrive:T,onBottomArrive:D,lockEnabled:H},function(oe){return d.createElement(s,Ae({},f,{innerRef:function(V){r.getMenuListRef(V),oe(V)},innerProps:{role:"listbox","aria-multiselectable":f.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:he,focusedOption:p}),J)}))});return k||S==="fixed"?d.createElement(c,Ae({},f,{appendTo:k,controlElement:this.controlRef,menuPlacement:P,menuPosition:S}),te):te}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,s=o.name,c=o.required,u=this.state.selectValue;if(c&&!this.hasValue()&&!a)return d.createElement(rk,{name:s,onFocus:this.onValueInputFocus});if(!(!s||a))if(l)if(i){var h=u.map(function(p){return r.getOptionValue(p)}).join(i);return d.createElement("input",{name:s,type:"hidden",value:h})}else{var g=u.length>0?u.map(function(p,m){return d.createElement("input",{key:"i-".concat(m),name:s,type:"hidden",value:r.getOptionValue(p)})}):d.createElement("input",{name:s,type:"hidden",value:""});return d.createElement("div",null,g)}else{var f=u[0]?this.getOptionValue(u[0]):"";return d.createElement("input",{name:s,type:"hidden",value:f})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,s=o.isFocused,c=o.selectValue,u=this.getFocusableOptions();return d.createElement(Nx,Ae({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:s,selectValue:c,focusableOptions:u,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,s=this.props,c=s.className,u=s.id,h=s.isDisabled,g=s.menuIsOpen,f=this.state.isFocused,p=this.commonProps=this.getCommonProps();return d.createElement(a,Ae({},p,{className:c,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:f}),this.renderLiveRegion(),d.createElement(o,Ae({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:f,menuIsOpen:g}),d.createElement(l,Ae({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(i,Ae({},p,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,s=o.ariaSelection,c=o.isFocused,u=o.prevWasFocused,h=o.instancePrefix,g=r.options,f=r.value,p=r.menuIsOpen,m=r.inputValue,w=r.isMulti,y=Ia(f),v={};if(i&&(f!==i.value||g!==i.options||p!==i.menuIsOpen||m!==i.inputValue)){var x=p?vk(r,y):[],I=p?Yu(ua(r,y),"".concat(h,"-option")):[],O=a?bk(o,y):null,M=yk(o,x),P=Hl(I,M);v={selectValue:y,focusedOption:M,focusedOptionId:P,focusableOptionsWithIds:I,focusedValue:O,clearFocusValueOnUpdate:!1}}var S=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},k=s,H=c&&u;return c&&!H&&(k={value:ci(w,y,y[0]||null),options:y,action:"initial-input-focus"},H=!u),s?.action==="initial-input-focus"&&(k=null),He(He(He({},v),S),{},{prevProps:r,ariaSelection:k,prevWasFocused:H})}}]),n})(d.Component);Ks.defaultProps=mk;var xk=d.forwardRef(function(e,t){var n=Gh(e);return d.createElement(Ks,Ae({ref:t},n))}),Sf=xk;const kk=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},Ck=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Sk=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Mk=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Rk=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:o}=e,{allowedValues:i,value:a}=t.data,[l,s]=d.useState(a),[c,u]=d.useState(r??""),h=lh(),g=d.useMemo(()=>i.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:f?.toString()??""}:f),[i]);return t.readonly?d.createElement(Mk,null,d.createElement(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):d.createElement(Ck,null,d.createElement(Sf,{className:"glide-select",inputValue:c,onInputChange:u,menuPlacement:"auto",value:g.find(f=>f.value===l),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:p})=>({...f,fontSize:h.editorFontSize,fontFamily:h.fontFamily,cursor:p?"pointer":void 0,paddingLeft:h.cellHorizontalPadding,paddingRight:h.cellHorizontalPadding,":active":{...f[":active"],color:h.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:h.bgCell,neutral5:h.bgCell,neutral10:h.bgCell,neutral20:h.bgCellMedium,neutral30:h.bgCellMedium,neutral40:h.bgCellMedium,neutral50:h.textLight,neutral60:h.textMedium,neutral70:h.textMedium,neutral80:h.textDark,neutral90:h.textDark,neutral100:h.textDark,primary:h.accentColor,primary75:h.accentColor,primary50:h.accentColor,primary25:h.accentLight}}),menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>d.createElement(Sk,null,d.createElement(kk,{className:"click-outside-ignore",...f}))},options:g,onChange:async f=>{f!==null&&(s(f.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:f.value}}))}}))},Ik={kind:Y.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{value:i}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===i:s.value===i),l=typeof a=="string"?a:a?.label??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,o.x+r.cellHorizontalPadding,o.y+o.height/2+er(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Rk,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function Ek(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const o=parseFloat(r[1]),i=r[2],a=o*t;return e.replace(n,`${Number(a.toPrecision(3))}${i}`)}return e}const Tk={marginRight:8},Ok={display:"flex",alignItems:"center",flexGrow:1},Dk={kind:Y.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{min:i,max:a,value:l,label:s,measureLabel:c}=t.data,u=o.x+r.cellHorizontalPadding,h=o.y+o.height/2,g=a-i,f=(l-i)/g,p=`${Ek(r.baseFontStyle,.9)} ${r.fontFamily}`,m=bs(n,p)/2;n.save();let w=0;s!==void 0&&(n.font=p,w=Dr(c??s,n,p).width+r.cellHorizontalPadding);const y=o.width-r.cellHorizontalPadding*2-w;if(y>=m){const v=n.createLinearGradient(u,h,u+y,h);v.addColorStop(0,r.accentColor),v.addColorStop(f,r.accentColor),v.addColorStop(f,r.bgBubble),v.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=v,Du(n,u,h-m/2,y,m,m/2),n.fill(),n.beginPath(),Du(n,u+.5,h-m/2+.5,y-1,m-1,(m-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,o.x+o.width-r.cellHorizontalPadding,h+er(n,p))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),o=t.min.toString(),i=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return d.createElement("label",{style:Ok},d.createElement("input",{style:Tk,type:"range",value:r,min:o,max:i,step:a,onChange:l,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Pk=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),zl=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Hk=e=>{const t=e.value.data,{format:n,displayDate:r}=t,o=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,i=t.timezoneOffset?t.timezoneOffset*60*1e3:0,a=t.min instanceof Date?zl(n,t.min,i):t.min,l=t.max instanceof Date?zl(n,t.max,i):t.max,s=zl(n,t.date,i);return e.value.readonly?St.createElement(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):St.createElement(Pk,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:a,max:l,step:o,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-i)}})}})},zk={kind:Y.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return vs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Hk}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}};var Lk=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Qu=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),o=String(n.getOptionValue(t)).toLowerCase(),i=String(n.getOptionLabel(t)).toLowerCase();return o===r||i===r},Ll={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(o){return Qu(e,o,r)})||n.some(function(o){return Qu(e,o,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function Ak(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,i=e.formatCreateLabel,a=i===void 0?Ll.formatCreateLabel:i,l=e.isValidNewOption,s=l===void 0?Ll.isValidNewOption:l,c=e.getNewOptionData,u=c===void 0?Ll.getNewOptionData:c,h=e.onCreateOption,g=e.options,f=g===void 0?[]:g,p=e.onChange,m=cr(e,Lk),w=m.getOptionValue,y=w===void 0?mf:w,v=m.getOptionLabel,x=v===void 0?gf:v,I=m.inputValue,O=m.isLoading,M=m.isMulti,P=m.value,S=m.name,k=d.useMemo(function(){return s(I,Ia(P),f,{getOptionValue:y,getOptionLabel:x})?u(I,a(I)):void 0},[a,u,x,y,I,s,f,P]),H=d.useMemo(function(){return(n||!O)&&k?o==="first"?[k].concat(Eo(f)):[].concat(Eo(f),[k]):f},[n,o,O,k,f]),E=d.useCallback(function(R,T){if(T.action!=="select-option")return p(R,T);var D=Array.isArray(R)?R:[R];if(D[D.length-1]===k){if(h)h(I);else{var C=u(I,I),J={action:"create-option",name:S,option:C};p(ci(M,[].concat(Eo(Ia(P)),[C]),C),J)}return}p(R,T)},[u,I,M,S,k,h,p,P]);return He(He({},m),{},{options:H,onChange:E})}var Fk=d.forwardRef(function(e,t){var n=Gh(e),r=Ak(n);return d.createElement(Ks,Ae({ref:t},r))}),Vk=Fk;const Xs="__value",_k=new RegExp(`^${Xs}\\d+__`),$k=un("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),Bk=un("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),da=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),Mf=(e,t,n)=>e==null?[]:e.map((r,o)=>{const i=n?`${Xs}${o}__`:"",a=t.find(l=>l.value===r);return a?{...a,value:`${i}${a.value}`}:{value:`${i}${r}`,label:r}}),Nk=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},Wk=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:o,portalElementRef:i}=e,{options:a,values:l,allowCreation:s,allowDuplicates:c}=t.data,u=lh(),[h,g]=d.useState(l),[f,p]=d.useState(!0),[m,w]=d.useState(n??""),y=d.useMemo(()=>da(a??[]),[a]),v=s&&c&&y.length===0,x=d.useCallback(S=>{f&&S.stopPropagation()},[f]),I={control:(S,k)=>({...S,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:k.isDisabled?"auto":S.pointerEvents,cursor:k.isDisabled?"default":S.cursor}),valueContainer:S=>({...S,flexWrap:S.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:S=>({...S,backgroundColor:u.bgCell}),option:(S,k)=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...k.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{},":active":{...S[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(S,{isDisabled:k})=>k?{display:"none"}:{...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:S=>({...S,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(S,{data:k})=>({...S,backgroundColor:k.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(S,{data:k,isDisabled:H})=>({...S,paddingRight:H?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:k.color?Bl(k.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(S,{data:k,isDisabled:H,isFocused:E})=>H?{display:"none"}:{...S,color:k.color?Bl(k.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:E?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},O=d.useCallback(S=>{const k=S.map(H=>c&&H.startsWith(Xs)?H.replace(new RegExp(_k),""):H);g(k),r({...t,data:{...t.data,values:k}})},[t,r,c]),M=S=>{switch(S.key){case"Enter":case"Tab":if(!m){o(t,[0,1]);return}c&&s&&(w(""),O([...h??[],m]),p(!1),S.preventDefault())}},P=s?Vk:Sf;return d.createElement($k,{onKeyDown:x,"data-testid":"multi-select-cell"},d.createElement(P,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:w,options:y,placeholder:t.readonly?"":s?"Add...":void 0,noOptionsMessage:S=>s&&c&&S.inputValue?`Create "${S.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:f,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:Mf(h,y,c),onKeyDown:t.readonly?void 0:M,menuPlacement:"auto",menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:I,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:S=>v?null:d.createElement(Bk,null,d.createElement(Nk,{className:"click-outside-ignore",...S}))},onChange:async S=>{S!==null&&O(S.map(k=>k.value))}}))},jk={kind:Y.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o,highlighted:i}=e,{values:a,options:l}=t.data;if(a==null)return!0;const s=da(l??[]),c={x:o.x+r.cellHorizontalPadding,y:o.y+r.cellVerticalPadding,width:o.width-2*r.cellHorizontalPadding,height:o.height-2*r.cellVerticalPadding},u=Math.max(1,Math.floor(c.height/(r.bubbleHeight+r.bubblePadding)));let{x:h}=c,g=1,f=u===1?c.y+(c.height-r.bubbleHeight)/2:c.y+(c.height-u*r.bubbleHeight-(u-1)*r.bubblePadding)/2;for(const p of a){const m=s.find(I=>I.value===p),w=m?.color??(i?r.bgBubbleSelected:r.bgBubble),y=m?.label??p,v=Dr(y,n).width+r.bubblePadding*2,x=r.bubbleHeight/2;if(h!==c.x&&h+v>c.x+c.width&&g<u&&(g++,f+=r.bubbleHeight+r.bubblePadding,h=c.x),n.fillStyle=w,n.beginPath(),Jn(n,h,f,v,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Bl(w)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(y,h+r.bubblePadding,f+x+er(n,r)),h+=v+r.bubbleMargin,h>c.x+c.width+r.cellHorizontalPadding&&g>=u)break}return!0},measure:(e,t,n)=>{const{values:r,options:o}=t.data;if(!r)return n.cellHorizontalPadding*2;const i=Mf(r,da(o??[]),t.data.allowDuplicates).map(l=>l.label??l.value),a=i.reduce((l,s)=>e.measureText(s).width+l+n.bubblePadding*2+n.bubbleMargin,0);return i.length===0?n.cellHorizontalPadding*2:a+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:Wk,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,o)=>n.indexOf(r)===o)),!t.allowCreation){const r=da(t.options??[]);n=n.filter(o=>r.find(i=>i.value===o))}if(n.length!==0)return{...t,values:n}}},Gk="None";function ed(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Uk=e=>{const{cell:t,theme:n,ctx:r}=e;vs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Gk,t.contentAlign),r.fillStyle=n.textDark};function Kk(e){const t=d.useCallback((r,o)=>{const{cell:i,theme:a,ctx:l,rect:s}=r,c=r.col;if(To(i))ed(l,s,a);else if(Ms(i)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?o():Uk(r),u.isRequired&&u.isEditable&&ed(l,s,a);return}o()},[e]),n=d.useMemo(()=>[Ey,Ik,Dk,zk,jk,...ey],[]);return{drawCell:t,customRenderers:n}}function Xk(){const e=Yr();return d.useMemo(()=>{const t={editable:n=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${n.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:xo(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:xo(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:xo(e.colors.darkenedBgMix100,.9),bgHeaderHovered:xo(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(rn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:xo(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(rn(e.spacing.sm)),cellVerticalPadding:Math.round(rn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Wp(e.colors.secondaryBg,.1),bubbleHeight:Math.round(rn("1.25rem")),bubblePadding:Math.round(rn(e.spacing.sm)),bubbleMargin:Math.round(rn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(rn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(rn("25rem")),minColumnWidth:Math.round(rn("3.125rem")),maxColumnWidth:Math.round(rn("62.5rem")),maxColumnAutoWidth:Math.round(rn("31.25rem")),defaultRowHeight:Math.round(rn("2.1875rem")),defaultHeaderHeight:Math.round(rn("2.1875rem")),bgRowHovered:Np(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const qk=rs.getLogger("useDataEditor");function Zk(e,t,n,r,o,i,a,l,s){const c=d.useCallback(([m,w],y)=>{const v=e[m];if(!v.isEditable)return;const x=v.indexNumber,I=n.current.getOriginalRowIndex(o(w)),O=r([m,w]),M=v.getCellValue(O),P=v.getCellValue(y);if(!To(O)&&P===M)return;const S=v.getCell(P,!0);To(S)?qk.warn(`Not applying the cell edit since it causes this error:
|
|
196
|
+
${S.data}`):(n.current.setCell(x,I,{...S,lastUpdated:performance.now()}),l())},[e,n,o,r,l]),u=d.useCallback(()=>{if(t)return;const m=new Map;e.forEach(w=>{m.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(m),a()},[e,n,t,a]),h=d.useCallback(()=>{t||(u(),l())},[u,l,t]),g=d.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const w=m.rows.toArray().map(y=>n.current.getOriginalRowIndex(o(y)));return n.current.deleteRows(w),a(),s(),l(),!1}if(m.current?.range){const w=[],y=m.current.range;for(let v=y.y;v<y.y+y.height;v++)for(let x=y.x;x<y.x+y.width;x++){const I=e[x];I.isEditable&&!I.isRequired&&(w.push({cell:[x,v]}),c([x,v],I.getCell(null)))}return w.length>0&&(l(),i(w)),!1}return!0},[e,n,t,i,o,l,c,s,a]),f=d.useCallback((m,w)=>{const[y,v]=m,x=[];for(let I=0;I<w.length;I++){const O=w[I];if(I+v>=n.current.getNumRows()){if(t)break;u()}for(let M=0;M<O.length;M++){const P=O[M],S=I+v,k=M+y;if(k>=e.length)break;const H=e[k];if(H.isEditable){const E=H.getCell(P,!0);if(ot(E)&&!To(E)){const R=H.indexNumber,T=n.current.getOriginalRowIndex(o(S)),D=H.getCellValue(r([k,S]));H.getCellValue(E)!==D&&(n.current.setCell(R,T,{...E,lastUpdated:performance.now()}),x.push({cell:[k,S]}))}}}x.length>0&&(l(),i(x))}return!1},[e,n,t,o,r,u,l,i]),p=d.useCallback((m,w)=>{const y=m[0];if(y>=e.length)return!0;const v=e[y];if(v.validateInput){const x=v.validateInput(v.getCellValue(w));return x===!0||x===!1?x:v.getCell(x)}return!0},[e]);return{onCellEdited:c,onPaste:f,onRowAppended:h,onDelete:g,validateCell:p}}const Rf=",",ui='"',Yk='"',If=`
|
|
197
|
+
`,Jk="\uFEFF",Qk=new RegExp(`[${[Rf,ui,If].join("")}]`),td=rs.getLogger("useDataExporter");function nd(e){return e.map(t=>e2(t)).join(Rf)+If}function e2(e){if(Te(e))return"";const t=it(e);return Qk.test(t)?`${ui}${t.replace(new RegExp(ui,"g"),Yk+ui)}${ui}`:t}async function rd(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(Jk));const i=n.map(a=>a.name);await e.write(o.encode(nd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(nd(l)))}await e.close()}function t2(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await ns(()=>import("./es6--XPcqeHG-CU-P5RWV.js"),__vite__mapDeps([14,1,2])).then(a=>a.a)).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await rd(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{td.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let a="";const l=new WritableStream({write:h=>{a+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await rd(l.getWriter(),e,t,n);const s=new Blob([a],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),u=$g({enforceDownloadInNewTab:r,url:c,filename:o});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(a){td.error("Failed to export data as CSV",a)}}},[t,n,e,r])}}function n2(e,t,n,r){return{getCellContent:d.useCallback(([o,i])=>{if(o>t.length-1)return Rt("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Rt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,s=r.current.getOriginalRowIndex(i),c=r.current.isAddedRow(s);if(a.isEditable||c){const g=r.current.getCell(l,s);if(ot(g))return{...a.getCell(a.getCellValue(g),!1),lastUpdated:g.lastUpdated};if(c)return Rt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${s}`)}const u=e.getCell(s,l),h=jp(e,s,l);return uy(a,u,h,e.styler?.cssStyles)}catch(a){return Rt("Error during cell creation",`This error should never happen. Please report this bug.
|
|
198
|
+
Error: ${a}`)}},[t,n,e,r])}}function r2(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,i]=o.location;n(i)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function o2(e,t,n,r,o){const[i,a]=d.useState({columns:Ye.empty(),rows:Ye.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.MULTI_ROW)||e.selectionMode.includes(on.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(on.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN),h=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(on.SelectionMode.MULTI_CELL)),g=h&&e.selectionMode.includes(on.SelectionMode.MULTI_CELL),f=i.rows.length>0,p=i.columns.length>0,m=i.current!==void 0,w=d.useCallback(v=>{const x=!rl(v.rows.toArray(),i.rows.toArray()),I=!rl(v.columns.toArray(),i.columns.toArray()),O=!rl(v.current,i.current),M=l&&x||c&&I||h&&O;let P=v;if(I&&P.columns.length>=0){let S=P.columns;r.forEach((k,H)=>{k.isIndex&&(S=S.remove(H))}),S.length<P.columns.length&&(P={...P,columns:S})}a(P),M&&o(P,h)},[i,l,c,h,o,r]),y=d.useCallback((v=!1,x=!1)=>{const I={columns:x?i.columns:Ye.empty(),rows:v?i.rows:Ye.empty(),current:void 0};a(I),(!v&&l||!x&&c||h)&&o(I,h)},[i,l,c,h,o]);return{gridSelection:i,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isCellSelectionActivated:h,isMultiCellSelectionActivated:g,isRowSelected:f,isColumnSelected:p,isCellSelected:m,clearSelection:y,processSelectionChange:w}}function i2(e,t,n,r,o,i,a,l,s){const c=e.rowHeight??t.defaultRowHeight,u=t.defaultHeaderHeight+c+2*t.tableBorderWidth,h=r?2:1,g=e.editingMode===on.EditingMode.DYNAMIC?1:0,f=n+g;let p=Math.max(f*c+h*t.defaultHeaderHeight+2*t.tableBorderWidth,u),m=Math.min(p,t.defaultTableHeight);const w=hy(e,s);w&&(m=Math.max(w,u),p=Math.max(w,p)),i&&(m=Math.min(m,i),p=Math.min(p,i),w||(m=p));const y=t.minColumnWidth+2*t.tableBorderWidth,v=Math.max(o,y);let x,I=v;const O=Nh(e,l),M=Wh(e,l),P=dy(l);O?x=v:M?(x=Math.min(Math.max(M,y),v),I=Math.min(Math.max(M,I),v)):P&&(x=void 0);const[S,k]=d.useState({width:x||"100%",height:m});return d.useLayoutEffect(()=>{O&&S.width==="100%"&&k(H=>({...H,width:v}))},[v]),d.useLayoutEffect(()=>{k(H=>({...H,width:x||"100%"}))},[x]),d.useLayoutEffect(()=>{k(H=>({...H,height:m}))},[m,n]),d.useLayoutEffect(()=>{if(a){const H=O||ot(M)&&M>0;k({width:H?I:"100%",height:p})}else k({width:x||"100%",height:m})},[a]),{minHeight:u,maxHeight:p,minWidth:y,maxWidth:I,rowHeight:c,resizableSize:S,setResizableSize:k}}const a2=600,l2="⚠️ Please fill out this cell.";function s2(e,t,n=[]){const[r,o]=d.useState(),i=d.useRef(null),a=d.useCallback(s=>{if(clearTimeout(i.current),i.current=0,o(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const c=s.location[0],u=s.location[1];let h;if(c<0||c>=e.length||n.includes(u))return;const g=e[c];if(s.kind==="header"&&ot(g))h=g.help;else if(s.kind==="cell"){const f=t([c,u]);To(f)?h=f.errorDetails:g.isRequired&&g.isEditable&&Ms(f)?h=l2:F1(f)&&(h=f.tooltip)}h&&(i.current=setTimeout(()=>{h&&o({content:h,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},a2))}},[e,t,o,i,n]),l=d.useCallback(()=>{o(void 0)},[o]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}const Ef=Qn("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),Er=Qn("div",{target:"e1hnsd046"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}}),""),Tf=Qn("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),c2=Qn("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS}),""),u2=Qn("div",{target:"e1hnsd043"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"}),""),d2=Qn("div",{target:"e1hnsd042"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"}),""),h2=Qn("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),f2=Qn("button",{target:"e1hnsd040"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}}),""),od=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],p2={number:od,progress:od,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function g2({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:o,onCloseMenu:i,children:a}){const l=Yr(),{colors:s,fontSizes:c,radii:u,fontWeights:h}=l,g=p2[e]||[];return g.length===0?me.jsx(me.Fragment,{}):me.jsx(Oa,{triggerType:fd.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:me.jsx(Ef,{role:"menu",children:g.map(f=>me.jsxs(Er,{onClick:()=>{o(f.format),i()},role:"menuitem",children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:f.icon}),f.label]},f.format))}),placement:Da.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Pa(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:c.sm,fontWeight:h.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:a})}const m2=d.memo(g2);function v2({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:o,onCloseMenu:i,onSortColumn:a,onHideColumn:l,column:s,onChangeFormat:c,onAutosize:u}){const h=Yr(),[g,f]=d.useState(!1),{colors:p,fontSizes:m,radii:w,fontWeights:y}=h,{isCopied:v,copyToClipboard:x}=Ep();d.useEffect(()=>{function M(P){P.preventDefault()}return document.addEventListener("wheel",M,{passive:!1}),document.addEventListener("touchmove",M,{passive:!1}),()=>{document.removeEventListener("wheel",M),document.removeEventListener("touchmove",M)}},[]);const I=d.useCallback(()=>{i()},[i]),O=d.useCallback(()=>{x(s.title)},[s.title,x]);return me.jsx(Oa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:me.jsxs(Ef,{children:[me.jsxs(c2,{children:[me.jsx(u2,{title:s.kind,children:me.jsx(qn,{iconValue:s.typeIcon||":material/notes:",size:"base",color:"inherit"})}),me.jsxs(d2,{title:s.title,children:[me.jsx(h2,{children:s.title}),me.jsx(f2,{onClick:O,title:"Copy column name","aria-label":"Copy column name",children:me.jsx(qn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),a&&me.jsxs(me.Fragment,{children:[me.jsxs(Er,{onClick:()=>{a("asc"),I()},role:"menuitem",children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),me.jsxs(Er,{onClick:()=>{a("desc"),I()},role:"menuitem",children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),me.jsx(Tf,{})]}),c&&me.jsx(m2,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:c,onCloseMenu:I,children:me.jsxs(Er,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:g,hasSubmenu:!0,children:[me.jsxs("div",{children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),u&&me.jsxs(Er,{onClick:()=>{u(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&me.jsxs(Er,{onClick:()=>{o(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&me.jsxs(Er,{onClick:()=>{r(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),l&&me.jsxs(Er,{onClick:()=>{l(),I()},children:[me.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Da.bottomRight,accessibilityType:pd.menu,showArrow:!1,popoverMargin:rn("0.375rem"),onClickOutside:g?void 0:I,onEsc:I,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${h.sizes.borderWidth} solid ${h.colors.borderColor}`,backgroundColor:Pa(h)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:y.normal,borderTopLeftRadius:w.default,borderTopRightRadius:w.default,borderBottomLeftRadius:w.default,borderBottomRightRadius:w.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:me.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const b2=d.memo(v2),y2="(index)";function Al(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const id=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const o=Yr();return me.jsx(Fg,{isIndeterminate:n,checked:t,onChange:i=>{r(i.target.checked)},"aria-label":e,checkmarkType:_g.default,labelPlacement:Vg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:o.spacing.none,marginTop:o.spacing.none,paddingLeft:o.spacing.md,paddingRight:o.spacing.md,paddingTop:o.spacing.twoXS,paddingBottom:o.spacing.twoXS,backgroundColor:i?o.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:a,$isIndeterminate:l})=>{const s=a||l?o.colors.primary:o.colors.fadedText40;return{outline:0,width:o.sizes.checkbox,height:o.sizes.checkbox,marginTop:o.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&(a||l)?`0 0 0 0.2rem ${xo(o.colors.primary,.5)}`:"",borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:o.lineHeights.small,paddingLeft:o.spacing.sm,position:"relative",color:o.colors.bodyText,fontSize:o.fontSizes.sm,fontWeight:o.fontWeights.normal}}},children:e})},w2=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:o,children:i,isOpen:a,onClose:l})=>{const s=Yr(),c=f=>!(f.isHidden===!0||Al(f,t)),u=e.every(c),h=e.some(c)&&!u,g=f=>{e.forEach(p=>{const m=Al(p,t);f?(o(p.id),m&&n(w=>[...w,p.id])):r(p.id)})};return me.jsx(Oa,{triggerType:fd.click,placement:Da.bottomRight,autoFocus:!0,focusLock:!0,content:()=>me.jsxs("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto"},children:[me.jsx(id,{label:"Select all",isIndeterminate:h,initialValue:u,onChange:f=>{g(f)}}),me.jsx(Tf,{}),me.jsx("div",{children:e.map(f=>{const p=Al(f,t);return me.jsx(id,{label:!f.title&&f.isIndex?y2:f.title,initialValue:!(f.isHidden===!0||p),onChange:m=>{m?(o(f.id),p&&n(w=>[...w,f.id])):r(f.id)}},f.id)})})]}),isOpen:a,onClickOutside:l,onClick:()=>a?l():void 0,onEsc:l,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Pa(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:me.jsx("div",{children:i})})},x2=d.memo(w2),ad=Qn("div",{target:"e1w7nams0"})(({theme:e,isInHorizontalLayout:t})=>({position:"relative",display:t?"flex":"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}),"");function k2({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=d.useState(!0),a=Yr(),{colors:l,fontSizes:s,radii:c,fontWeights:u}=a,h=d.useCallback(()=>{i(!1),r()},[r,i]);return me.jsx(Oa,{content:me.jsx(Tp,{"data-testid":"stDataFrameTooltipContent",children:me.jsx(Op,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Da.top,accessibilityType:pd.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:h,onEsc:h,overrides:{Body:{style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Pa(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:me.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const C2=d.memo(k2),ld=150,S2=15e4,M2="0.5rem";function R2({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i,customToolbarActions:a,widthConfig:l,heightConfig:s}){const{expanded:c,expand:u,collapse:h,width:g,height:f}=uc(Hg),{isInHorizontalLayout:p}=uc(Dp),m=d.useRef(null),w=d.useRef(null),y=d.useRef(null),v=Pp(),x=Xk(),{getRowThemeOverride:I,onItemHovered:O}=r2(x),{libConfig:{enforceDownloadInNewTab:M=!1}}=d.useContext(Hp),[P,S]=d.useState(!0),[k,H]=d.useState(!1),[E,R]=d.useState(!1),[T,D]=d.useState(!1),[C,J]=d.useState(),[W,Z]=d.useState(!1),ce=d.useCallback(()=>Z(we=>!we),[]),te=d.useCallback(()=>Z(!1),[]),q=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Te(e.editingMode)&&(e.editingMode=on.EditingMode.READ_ONLY);const{READ_ONLY:ge,DYNAMIC:ae}=on.EditingMode,fe=t.dimensions,he=Math.max(0,fe.numDataRows),oe=he===0&&!(e.editingMode===ae&&fe.numDataColumns>0),V=he>S2,z=!V&&!oe&&e.editingMode!==ae,G=!oe&&e.editingMode===ae&&!n,re=d.useRef(new na(he)),[le,Ie]=d.useState(re.current.getNumRows());d.useEffect(()=>{re.current=new na(he),Ie(re.current.getNumRows())},[he]);const ye=d.useCallback(()=>{re.current=new na(he),Ie(re.current.getNumRows())},[he]),[at,Ce]=d.useState(e.columnOrder);d.useEffect(()=>{Ce(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ft,allColumns:vt,setColumnConfigMapping:Be}=gy(e,t,n,at,l);d.useEffect(()=>{if(e.editingMode===ge||!r)return;const we=r.getStringValue({id:e.id,formId:e.formId});we&&(re.current.fromJson(we,ft),Ie(re.current.getNumRows()))},[]);const{getCellContent:ne}=n2(t,ft,le,re),{columns:ie,sortColumn:be,getOriginalIndex:ue,getCellContent:ve}=My(he,ft,ne),Fe=d.useCallback((we,zt)=>{if(!r)return;const Kt={selection:{rows:[],columns:[],cells:[]}};if(Kt.selection.rows=we.rows.toArray().map(jt=>ue(jt)),Kt.selection.columns=we.columns.toArray().map(jt=>Kr(ie[jt])),zt&&we.current){const{cell:jt,range:Gt}=we.current;if(Gt)for(let Pn=Gt.y;Pn<Gt.y+Gt.height;Pn++)for(let Hn=Gt.x;Hn<Gt.x+Gt.width;Hn++)ie[Hn].isIndex||Kt.selection.cells.push([ue(Pn),Kr(ie[Hn])]);else if(jt){const[Pn,Hn]=jt;ie[Pn].isIndex||Kt.selection.cells.push([ue(Hn),Kr(ie[Pn])])}}const $n=JSON.stringify(Kt),Xt=r.getStringValue({id:e.id,formId:e.formId});(Xt===void 0||Xt!==$n)&&r.setStringValue({id:e.id,formId:e.formId},$n,{fromUi:!0},i)},[ie,e.id,e.formId,r,i,ue]),{debouncedCallback:Ve}=bu(Fe,ld),{gridSelection:Je,isRowSelectionActivated:Se,isMultiRowSelectionActivated:Ze,isColumnSelectionActivated:Ee,isMultiColumnSelectionActivated:Me,isCellSelectionActivated:Oe,isMultiCellSelectionActivated:ut,isRowSelected:Qe,isColumnSelected:Ue,isCellSelected:wt,clearSelection:gt,processSelectionChange:Tt}=o2(e,oe,n,ie,Ve);d.useEffect(()=>{Oe||gt(!0,!0)},[c]);const Ot=d.useCallback(we=>{w.current?.updateCells(we)},[]);d.useEffect(()=>{if(!Se&&!Ee&&!Oe||!r)return;const we=r.getStringValue({id:e.id,formId:e.formId});if(we){const zt=ie.map(Gt=>Kr(Gt)),Kt=JSON.parse(we);let $n=Ye.empty(),Xt=Ye.empty(),jt;if(Kt.selection?.rows?.forEach(Gt=>{$n=$n.add(Gt)}),Kt.selection?.columns?.forEach(Gt=>{Xt=Xt.add(zt.indexOf(Gt))}),Oe&&!ut){const[Gt,Pn]=Kt.selection?.cells?.[0]??[];Gt!==void 0&&Pn!==void 0&&(jt=[zt.indexOf(Pn),Gt])}if($n.length>0||Xt.length>0||jt!==void 0){const Gt={rows:$n,columns:Xt,current:jt?{cell:jt,range:{x:jt[0],y:jt[1],width:1,height:1},rangeStack:[]}:void 0};Tt(Gt)}}},[]);const an=d.useCallback(()=>{le!==re.current.getNumRows()&&Ie(re.current.getNumRows())},[le]),qt=d.useCallback(()=>{if(!r)return;const we=re.current.toJson(ie);let zt=r.getStringValue({id:e.id,formId:e.formId});zt===void 0&&(zt=new na(0).toJson([])),we!==zt&&r.setStringValue({id:e.id,formId:e.formId},we,{fromUi:!0},i)},[ie,e.id,e.formId,r,i]),{debouncedCallback:In}=bu(qt,ld),{exportToCsv:Mt}=t2(ve,ie,le,M),{onCellEdited:dt,onPaste:En,onRowAppended:mt,onDelete:Zt,validateCell:kn}=Zk(ie,e.editingMode!==ae,re,ve,ue,Ot,an,In,gt),De=d.useMemo(()=>oe?[0]:G?[le]:[],[oe,G,le]),{tooltip:et,clearTooltip:bt,onItemHovered:Tn}=s2(ie,ve,De),{drawCell:ln,customRenderers:sn}=Kk(ie),{provideEditor:On}=Iy(),Yt=d.useCallback(we=>({...we,hasMenu:!oe}),[oe]),Jt=d.useMemo(()=>ie.map(we=>Yt(Zl(we))),[ie,Yt]),{columns:_e,onColumnResize:xt}=yy(Jt),Dn=t.dimensions.numHeaderRows>1,{minHeight:Ht,maxHeight:ht,minWidth:Cn,maxWidth:ur,rowHeight:_n,resizableSize:B,setResizableSize:$e}=i2(e,x,le,Dn,g||0,f,c,l,s),Ne=d.useCallback(([we,zt])=>({...V1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:x.glideTheme.textLight},span:[0,Math.max(ie.length-1,0)]}),[ie,x.glideTheme.textLight]),Dt=d.useCallback(()=>{ye(),gt()},[ye,gt]);Lg({element:e,widgetMgr:r,onFormCleared:Dt});const{pinColumn:Qt,unpinColumn:dn,freezeColumns:Sn}=vy(ie,oe,g||0,x.minColumnWidth,gt,Be),{changeColumnFormat:bn}=my(Be),{hideColumn:$t,showColumn:Mn}=Ry(gt,Be),{onColumnMoved:Rn}=by(ie,Sn,Qt,dn,Ce);return d.useEffect(()=>{let we;const zt=requestAnimationFrame(()=>{we=setTimeout(()=>{if(y.current&&w.current){const Kt=y.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Kt&&(R(Kt.height>y.current.clientHeight),D(Kt.width>y.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(zt),we&&clearTimeout(we)}},[B,le,_e]),d.useEffect(()=>{vt.length==ie.length&&Z(!1)},[vt.length,ie.length]),me.jsxs(ad,{className:"stDataFrame","data-testid":"stDataFrame",ref:y,isInHorizontalLayout:p,onPointerDown:we=>{if(y.current){const zt=y.current.getBoundingClientRect(),Kt=(v||Math.round(rn(M2)))+1;T&&zt.height-Kt<we.clientY-zt.top&&we.stopPropagation(),E&&zt.width-Kt<we.clientX-zt.left&&we.stopPropagation()}},onBlur:we=>{!P&&!q&&!we.currentTarget.contains(we.relatedTarget)&&!Oe&>(!0,!0)},children:[me.jsxs(zg,{isFullScreen:c,disableFullscreenMode:o,locked:Qe&&!Se||wt||q&&P||W,onExpand:u,onCollapse:h,target:ad,children:[a?.map(we=>we),(Se&&Qe||Ee&&Ue||Oe&&wt)&&me.jsx(yo,{label:"Clear selection",icon:Bg,onClick:()=>{gt(),bt()}}),G&&Qe&&me.jsx(yo,{label:"Delete row(s)",icon:Ug,onClick:()=>{Zt&&(Zt(Je),bt())}}),G&&!Qe&&me.jsx(yo,{label:"Add row",icon:Cd,onClick:()=>{mt&&(S(!0),mt(),bt(),w.current?.scrollTo(0,le,"vertical"))}}),!oe&&vt.length>ie.length&&me.jsx(x2,{columns:vt,columnOrder:at,setColumnOrder:Ce,hideColumn:$t,showColumn:Mn,isOpen:W,onClose:te,children:me.jsx(yo,{label:"Show/hide columns",icon:Md,onClick:ce})}),!V&&!oe&&me.jsx(yo,{label:"Download as CSV",icon:Kg,onClick:Mt}),!oe&&me.jsx(yo,{label:"Search",icon:Sd,onClick:()=>{k?H(!1):(S(!0),H(!0)),bt()}})]}),me.jsx(zp,{"data-testid":"stDataFrameResizable",ref:m,defaultSize:B,style:{border:`${x.tableBorderWidth}px solid ${x.glideTheme.borderColor}`,borderRadius:`${x.tableBorderRadius}`},minHeight:Ht,maxHeight:ht,minWidth:Cn,maxWidth:p?void 0:ur,size:B,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!p,bottomLeft:!1,topLeft:!1},grid:[1,_n],snapGap:_n/3,onResizeStop:(we,zt,Kt,$n)=>{if(m.current){const Xt=2*x.tableBorderWidth;$e({width:m.current.size.width,height:ht-m.current.size.height===Xt?m.current.size.height+Xt:m.current.size.height})}},children:me.jsx(O1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:w,columns:_e,rows:oe?1:le,minColumnWidth:x.minColumnWidth,maxColumnWidth:x.maxColumnWidth,maxColumnAutoWidth:x.maxColumnAutoWidth,rowHeight:_n,headerHeight:x.defaultHeaderHeight,getCellContent:oe?Ne:ve,onColumnResize:q?void 0:xt,resizeIndicator:"header",freezeColumns:Sn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:q?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Ee?void 0:Rn,onItemHovered:we=>{O?.(we),Tn?.(we)},keybindings:{downFill:!0,...Oe||V?{selectAll:!1}:{}},onKeyDown:we=>{(we.ctrlKey||we.metaKey)&&we.key==="f"&&(H(zt=>!zt),we.stopPropagation(),we.preventDefault())},showSearch:k,searchResults:k?void 0:[],onSearchClose:()=>{H(!1),bt()},onHeaderClicked:(we,zt)=>{!z||Ee||(k&&H(!1),Se&&Qe?gt():gt(!0,!0),be(we,"auto"))},gridSelection:Je,onGridSelectionChange:we=>{(P||q)&&(Tt(we),et!==void 0&&bt(),J(void 0),Z(!1))},theme:x.glideTheme,getRowThemeOverride:I,onMouseMove:we=>{we.kind==="out-of-bounds"&&P?S(!1):we.kind!=="out-of-bounds"&&!P&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:T?-v:void 0,paddingRight:E?-v:void 0},provideEditor:On,drawCell:ln,customRenderers:sn,imageEditorOverride:Q1,headerIcons:x.headerIcons,validateCell:kn,onHeaderMenuClick:(we,zt)=>{W||J({columnIdx:we,headerBounds:zt})},onPaste:!1,...Se&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:x.glideTheme.bgHeader,bgCellMedium:x.glideTheme.bgHeader,textMedium:x.glideTheme.textLight}},rowSelectionMode:Ze?"multi":"auto",rowSelect:n?"none":Ze?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...Ee&&{columnSelect:n?"none":Me?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Me?"multi":"auto",rangeSelectionBlending:"additive"},...Oe&&{rangeSelect:ut?"rect":"cell",rangeSelectionBlending:"additive"},...!oe&&e.editingMode!==ge&&!n&&{fillHandle:!q,onCellEdited:dt,onPaste:En,onDelete:Zt},...!oe&&e.editingMode===ae&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:x.glideTheme.bgHeader,bgCellMedium:x.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:mt,onHeaderClicked:void 0}})}),et?.content&&me.jsx(C2,{top:et.top,left:et.left,content:et.content,clearTooltip:bt}),C&&gd.createPortal(me.jsx(b2,{top:C.headerBounds.y+C.headerBounds.height,left:C.headerBounds.x+C.headerBounds.width,column:ft[C.columnIdx],onCloseMenu:()=>J(void 0),onSortColumn:z?we=>{k&&H(!1),gt(!(Se&&Qe),!0),be(C.columnIdx,we,!0)}:void 0,isColumnPinned:ft[C.columnIdx].isPinned,onUnpinColumn:()=>{dn(ft[C.columnIdx].id)},onPinColumn:()=>{Qt(ft[C.columnIdx].id)},onHideColumn:()=>{$t(ft[C.columnIdx].id)},onChangeFormat:we=>{bn(ft[C.columnIdx].id,we),setTimeout(()=>{w.current?.remeasureColumns(Ye.fromSingleSelection(C.columnIdx))},100)},onAutosize:()=>{w.current?.remeasureColumns(Ye.fromSingleSelection(C.columnIdx))}}),document.querySelector("#portal"))]})}const I2=Pg(R2),Of=d.memo(I2),E2=({data:e,height:t,customToolbarActions:n})=>me.jsx(Of,{element:new on({useContainerWidth:!0,editingMode:on.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:n,widthConfig:new cc.WidthConfig({useStretch:!0}),heightConfig:t?new cc.HeightConfig({pixelHeight:t}):void 0}),$2=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:E2,default:Of},Symbol.toStringTag,{value:"Module"}));export{ko as B,Mo as F,ah as H,E2 as T,Qg as a,un as h,$2 as i,P0 as s,ub as z};
|