streamlit-nightly 1.46.2.dev20250702__py3-none-any.whl → 1.46.2.dev20250705__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/auth_util.py +1 -1
- streamlit/elements/lib/column_types.py +9 -0
- streamlit/errors.py +6 -0
- streamlit/runtime/secrets.py +7 -3
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +214 -214
- streamlit/static/static/js/{ErrorOutline.esm.MhIoYdvl.js → ErrorOutline.esm.Dl5aYA7P.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.MFVQ8TeX.js → FileDownload.esm.b9aAtFUL.js} +1 -1
- streamlit/static/static/js/{FileHelper.4MaelLoM.js → FileHelper.CZ-fo3AT.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.B0jg0hVR.js → FormClearHelper.X_JAWIDE.js} +1 -1
- streamlit/static/static/js/{Hooks.BRUa3Uwi.js → Hooks.DgDu8WWe.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DIDrjUfW.js → InputInstructions.DRcWCO4-.js} +1 -1
- streamlit/static/static/js/{ProgressBar.D5j4Grse.js → ProgressBar.TfYA4ywP.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DSEpNV6C.js → RenderInPortalIfExists.DdXJh4rR.js} +1 -1
- streamlit/static/static/js/{Toolbar.CQcJmHso.js → Toolbar.Vgf9NeBF.js} +1 -1
- streamlit/static/static/js/{base-input.BnnSlzQu.js → base-input.DVejzOG3.js} +1 -1
- streamlit/static/static/js/{checkbox.C3U3kKA7.js → checkbox.CHzUs1FT.js} +1 -1
- streamlit/static/static/js/{createSuper.Cy5MeyJ7.js → createSuper.DtVUSUG3.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DfB1NFlz.js → data-grid-overlay-editor.0g3IWOH4.js} +1 -1
- streamlit/static/static/js/{downloader.DJTt16dd.js → downloader.C1bmi7_d.js} +1 -1
- streamlit/static/static/js/{es6.wyhZ4wJk.js → es6.DB9CkkEz.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DFyVP9Ig.js → iframeResizer.contentWindow.BUdo9Eut.js} +1 -1
- streamlit/static/static/js/{index.Dr7_LGVT.js → index.B7_hmluD.js} +1 -1
- streamlit/static/static/js/{index.B-X33K52.js → index.BFvFGupf.js} +1 -1
- streamlit/static/static/js/{index.CG52VtIR.js → index.BGQkiO_L.js} +1 -1
- streamlit/static/static/js/{index.CvEUwmm2.js → index.BLe8vNj1.js} +1 -1
- streamlit/static/static/js/{index.DJzsQdj5.js → index.BPv94ryA.js} +1 -1
- streamlit/static/static/js/{index.DT8f2xQ9.js → index.BSU3uPDy.js} +1 -1
- streamlit/static/static/js/{index.C2ZYRKqZ.js → index.BYDy3exs.js} +1 -1
- streamlit/static/static/js/{index.B22EHN7-.js → index.Bxl-lvf7.js} +1 -1
- streamlit/static/static/js/{index.Cipw6ZXy.js → index.Bz1rmVZY.js} +1 -1
- streamlit/static/static/js/{index.DyTIPa0F.js → index.C6lv7LZF.js} +1 -1
- streamlit/static/static/js/{index.DynUmaAG.js → index.CL2tKcqp.js} +1 -1
- streamlit/static/static/js/{index.Cx59kXcb.js → index.CUgLUHzz.js} +1 -1
- streamlit/static/static/js/{index.BMd4yctQ.js → index.Ca71cNwT.js} +1 -1
- streamlit/static/static/js/{index.lQYpmexK.js → index.ChFrryup.js} +1 -1
- streamlit/static/static/js/{index.DLQQdwIj.js → index.CsowBPbe.js} +1 -1
- streamlit/static/static/js/{index.DsdPm0SS.js → index.D9G9SbyS.js} +1 -1
- streamlit/static/static/js/{index.DEc9e9_6.js → index.D9lVoZ0g.js} +1 -1
- streamlit/static/static/js/{index.gMS0zlRZ.js → index.D9m0XlZY.js} +1 -1
- streamlit/static/static/js/{index.DtbQuv3u.js → index.DBSP2Mzg.js} +1 -1
- streamlit/static/static/js/{index.B465_5qO.js → index.DJFU0ONs.js} +1 -1
- streamlit/static/static/js/{index.C4H2pObU.js → index.DJM4CJwf.js} +1 -1
- streamlit/static/static/js/{index.Do1oo2Dl.js → index.DQtc0wgD.js} +1 -1
- streamlit/static/static/js/{index.DzC4L_Us.js → index.DYOc3lvA.js} +1 -1
- streamlit/static/static/js/index.DkDMkGP_.js +197 -0
- streamlit/static/static/js/{index.C_ub2Pfc.js → index.DlvTB7Ab.js} +1 -1
- streamlit/static/static/js/{index.BHoorvVC.js → index.Dmsp2dPx.js} +64 -64
- streamlit/static/static/js/index.MJ13AaAl.js +1 -0
- streamlit/static/static/js/{index.z241Yt9a.js → index.Vqz4Rf-H.js} +1 -1
- streamlit/static/static/js/{index.BNiT2b3M.js → index.WCZtB2fX.js} +1 -1
- streamlit/static/static/js/{index.Dsil7y_J.js → index.ZDNW54LS.js} +1 -1
- streamlit/static/static/js/{index.D-doFAXM.js → index.bBcPxeDg.js} +1 -1
- streamlit/static/static/js/{index.CLg6_EPb.js → index.ffsleSUc.js} +1 -1
- streamlit/static/static/js/{index.UFChjuC3.js → index.fnZJbfUF.js} +1 -1
- streamlit/static/static/js/{index.CDk53kDT.js → index.lM0dtLa7.js} +1 -1
- streamlit/static/static/js/{index.CDhJdsJ-.js → index.pxx1WhzW.js} +1 -1
- streamlit/static/static/js/{index.DcEV00Pn.js → index.rSXfDs8E.js} +1 -1
- streamlit/static/static/js/{index.BSHRz8-s.js → index.zmzbyDg-.js} +1 -1
- streamlit/static/static/js/{input.C8HOZnEd.js → input.zZ5PCHhH.js} +1 -1
- streamlit/static/static/js/{memory.8fc2LDiK.js → memory.BGxwio87.js} +1 -1
- streamlit/static/static/js/{mergeWith.xmxP-tqn.js → mergeWith.CAjjDs4h.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DtoLRumH.js → number-overlay-editor.D6O6Urda.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DqUCGXEg.js → possibleConstructorReturn.Bv3kil8b.js} +1 -1
- streamlit/static/static/js/{sandbox.de7mpc93.js → sandbox.DqowwceX.js} +1 -1
- streamlit/static/static/js/{textarea.9dU6cbLz.js → textarea.mjUutfC5.js} +1 -1
- streamlit/static/static/js/{timepicker.DANyzCwb.js → timepicker.D5asOTRg.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.Bja4AaDo.js → toConsumableArray.CbOloveN.js} +1 -1
- streamlit/static/static/js/{uniqueId.q5r0gCRd.js → uniqueId.DldNV5wM.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.B0oxOutH.js → useBasicWidgetState.DILnXvLY.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.XxzVJXCy.js → useOnInputChange.Bpbev6mM.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.Dgyv-A2q.js +1 -0
- streamlit/watcher/event_based_path_watcher.py +76 -44
- streamlit/watcher/local_sources_watcher.py +22 -19
- streamlit/watcher/polling_path_watcher.py +29 -18
- streamlit/watcher/util.py +7 -8
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250705.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250705.dist-info}/RECORD +82 -82
- streamlit/static/static/js/index.DFtXcE7L.js +0 -197
- streamlit/static/static/js/index.DRodAgy0.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.eXXoswSf.js +0 -1
- {streamlit_nightly-1.46.2.dev20250702.data → streamlit_nightly-1.46.2.dev20250705.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250705.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250705.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250705.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,197 @@
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.0g3IWOH4.js","./index.Dmsp2dPx.js","../css/index.CJVRHjQZ.css","./FormClearHelper.X_JAWIDE.js","./withFullScreenWrapper.Dgyv-A2q.js","./Toolbar.Vgf9NeBF.js","./checkbox.CHzUs1FT.js","./mergeWith.CAjjDs4h.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.CbOloveN.js","./possibleConstructorReturn.Bv3kil8b.js","./createSuper.DtVUSUG3.js","./FileDownload.esm.b9aAtFUL.js","./number-overlay-editor.D6O6Urda.js","./es6.DB9CkkEz.js"])))=>i.map(i=>d[i]);
|
2
|
+
var ch=Object.defineProperty;var dh=(e,t,n)=>t in e?ch(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ft=(e,t,n)=>dh(e,typeof t!="symbol"?t+"":t,n);import{r as f,E as Ls,_ as Ze,c as fh,g as yr,i as Ua,d as mo,e as hh,f as gh,h as mh,m as Tc,n as Dc,R as qt,o as ph,p as Oc,q as vh,t as bh,u as wh,v as yh,w as Ch,x as Sh,a as Lr,y as Fs,s as ki,z as Jr,j as lt,F as Pc,A as ya,T as _c,B as Ca,C as An,D as mr,G as Sa,H as pn,I as Lc,J as mi,K as xh,L as kh,M as Xe,N as Fc,O as ht,Q as Ji,S as jr,U as qa,V as Mh,W as Rh,X as Eh,Y as Pl,Z as Ih,$ as Th,a0 as Dh,a1 as Oh,a2 as Ac,a3 as Ph,a4 as _h,a5 as Cs,a6 as Hc,a7 as zc,a8 as Lh,a9 as Fh,aa as Ah,ab as Hh,ac as zh,ad as Vh,ae as $h,af as Nh,ag as Bh,ah as Vc,ai as Wh,aj as Uh,ak as qh,al as Yh,am as Xh,an as Gh,ao as jh,ap as Kh,aq as Zh,ar as Jh,as as Qh,at as eg,au as tg,av as ng,aw as Mn,l as As,ax as Qi,ay as Cr,az as Be,aA as rg,b as $c,aB as Nc,k as ig,aC as og,aD as ag,aE as Ya,aF as sg,aG as lg,aH as ug,aI as cg,aJ as dg}from"./index.Dmsp2dPx.js";import{u as fg}from"./FormClearHelper.X_JAWIDE.js";import{w as hg,E as gg}from"./withFullScreenWrapper.Dgyv-A2q.js";import{T as mg,a as hi}from"./Toolbar.Vgf9NeBF.js";import{L as pg,S as vg,a as bg}from"./checkbox.CHzUs1FT.js";import{m as wg}from"./mergeWith.CAjjDs4h.js";import{s as yg}from"./sprintf.D7DtBTRn.js";import{c as Cg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as vr,a as Hs,C as Sg}from"./toConsumableArray.CbOloveN.js";import{_ as xg,a as kg,b as Mg}from"./possibleConstructorReturn.Bv3kil8b.js";import{_ as Rg}from"./createSuper.DtVUSUG3.js";import{D as Eg,F as Ig}from"./FileDownload.esm.b9aAtFUL.js";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";var Xa,_l;function Tg(){if(_l)return Xa;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Xa=n,Xa}var Ga,Ll;function Dg(){if(Ll)return Ga;Ll=1;var e=Tg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return Ga=n,Ga}var Og=Dg();const Pg=yr(Og);function qc(e="This should not happen"){throw new Error(e)}function Hn(e,t="Assertion failed"){if(!e)return qc(t)}function so(e,t){return qc(t??"Hell froze over")}function _g(e,t){try{return e()}catch{return t}}const Fl=Object.prototype.hasOwnProperty;function Si(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--&&Si(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Fl.call(e,n)&&++r&&!Fl.call(t,n)||!(n in t)||!Si(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ia=null,zs=void 0;var te;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(te||(te={}));var Al;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Al||(Al={}));var oa;(function(e){e.Triangle="triangle",e.Dots="dots"})(oa||(oa={}));function Ho(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function pi(e){return!(e.kind===te.Loading||e.kind===te.Bubble||e.kind===te.RowID||e.kind===te.Protected||e.kind===te.Drilldown)}function bi(e){return e.kind===Yn.Marker||e.kind===Yn.NewRow}function eo(e){if(!pi(e)||e.kind===te.Image)return!1;switch(e.kind){case te.Text:case te.Number:case te.Markdown:case te.Uri:case te.Custom:case te.Boolean:return e.readonly!==!0;default:so(e,"A cell was passed with an invalid kind")}}function Lg(e){return Pg(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Yn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Yn||(Yn={}));function Fg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let zl;const pr=class pr{constructor(t){ft(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new pr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Fg([...this.items,n]);return new pr(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,l]of n.entries()){const[s,a]=l;if(s<=i&&r<=a){const u=[];s<r&&u.push([s,r]),i<a&&u.push([i,a]),n.splice(o,1,...u)}}return new pr(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};ft(pr,"empty",()=>zl??(zl=new pr([]))),ft(pr,"fromSingleSelection",t=>pr.empty().add(t));let bt=pr;var Ag=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,a]=s.split("_");n[a]=s}else r.push(s)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Vl=Ag,Hg=e=>e.toUpperCase()===e,zg=e=>t=>e.indexOf(t)===-1,Yc=(e,t)=>{const n={};return Object.keys(e).filter(zg(t)).forEach(r=>{n[r]=e[r]}),n};function Vg(e,t,n){const r=Yc(t,n);if(!e){const i=typeof Ua=="function"?{default:Ua}:Ua;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var $g=(e,t)=>{};function Ng(e){let t="";return n=>{const r=(o,l)=>{const{as:s=e,class:a=t}=o,u=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!Hg(s[0])):n.propsAsIs,c=Vg(u,o,["as","class"]);c.ref=l,c.className=n.atomic?Vl(n.class,c.className||a):Vl(c.className||a,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const b=d[p],w=b[0],v=b[1]||"",x=typeof w=="function"?w(o):w;$g(x,n.name),g[`--${p}`]=`${x}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==s?(c.as=s,f.createElement(e,c)):f.createElement(s,c)},i=f.forwardRef?f.forwardRef(r):o=>{const l=Yc(o,["innerRef"]);return r(l,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var bn=Ng;const Bg=bn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var ja={},$i={},zo={},Vo={},$l;function Wg(){return $l||($l=1,function(e){(function(t,n){n(e,mo(),hh())})(Vo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=l(n),o=l(r);function l(v){return v&&v.__esModule?v:{default:v}}var s=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var O=arguments[x];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(v[S]=O[S])}return v};function a(v,x){var O={};for(var S in v)x.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(v,S)&&(O[S]=v[S]);return O}function u(v,x){if(!(v instanceof x))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(x,O){for(var S=0;S<O.length;S++){var R=O[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(x,R.key,R)}}return function(x,O,S){return O&&v(x.prototype,O),S&&v(x,S),x}}();function d(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 h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function b(v){if("touches"in v){var x=v.touches[0],O=x.pageX,S=x.pageY;return{x:O,y:S}}var R=v.screenX,_=v.screenY;return{x:R,y:_}}var w=function(v){g(x,v);function x(){var O;u(this,x);for(var S=arguments.length,R=Array(S),_=0;_<S;_++)R[_]=arguments[_];var E=d(this,(O=x.__proto__||Object.getPrototypeOf(x)).call.apply(O,[this].concat(R)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var R=b(S),_=R.x,E=R.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var R=b(S),_=R.x,E=R.y,k=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:k,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,S):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var R=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var k=a(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},k),E)}}]),x}(n.Component);w.displayName="ReactSwipe",w.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},w.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=w})}(Vo)),Vo}var Nl;function Xc(){return Nl||(Nl=1,function(e){(function(t,n){n(e,Wg())})(zo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(zo)),zo}var Ni={},Bl;function Gc(){if(Bl)return Ni;Bl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,l){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":l==="horizontal","axis-vertical":l!=="horizontal"})},SLIDER:function(o,l){return(0,e.default)({thumbs:!o,slider:o,animated:!l})},ITEM:function(o,l,s){return(0,e.default)({thumb:!o,slide:o,selected:l,previous:s})},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 Ni.default=r,Ni}var Bi={},Wi={},Wl;function Ug(){if(Wl)return Wi;Wl=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Wi.outerWidth=e,Wi}var Ui={},Ul;function $s(){if(Ul)return Ui;Ul=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,l=i==="horizontal"?[o,0,0]:[0,o,0],s="translate3d",a="("+l.join(",")+")";return s+a};return Ui.default=e,Ui}var qi={},ql;function jc(){if(ql)return qi;ql=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=function(){return window};return qi.default=e,qi}var Yl;function Kc(){if(Yl)return Bi;Yl=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=a(mo()),t=l(Gc()),n=Ug(),r=l($s()),i=l(Xc()),o=l(jc());function l(E){return E&&E.__esModule?E:{default:E}}function s(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return s=function(){return E},E}function a(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var k=s();if(k&&k.has(E))return k.get(E);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(L,C,I):L[C]=E[C]}return L.default=E,k&&k.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var k=1;k<arguments.length;k++){var L=arguments[k];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function d(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var L=0;L<k.length;L++){var D=k[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,k,L){return k&&g(E.prototype,k),E}function m(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(k&&k.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),k&&p(E,k)}function p(E,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,k)}function b(E){var k=x();return function(){var D=O(E),C;if(k){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return w(this,C)}}function w(E,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(E)}function v(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}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 O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,k,L){return k in E?Object.defineProperty(E,k,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[k]=L,E}var R=function(k){return k.hasOwnProperty("key")},_=function(E){m(L,E);var k=b(L);function L(D){var C;return d(this,L),C=k.call(this,D),S(v(C),"itemsWrapperRef",void 0),S(v(C),"itemsListRef",void 0),S(v(C),"thumbsRef",void 0),S(v(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(v(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(v(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,M=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(T/M),N=z<I,G=N?I-z:0;C.setState(function(ie,Q){return{itemSize:M,visibleItems:z,firstItem:N?C.getFirstItem(Q.selectedItem):0,lastPosition:G,showArrows:N}})}}),S(v(C),"handleClickItem",function(I,T,M){if(!R(M)||M.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(I,T)}}),S(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(v(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var M=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,G=Math.max(z-C.state.visibleItems,0),ie=-G*100/C.state.visibleItems;N===M&&T>0&&(T=0),N===ie&&T<0&&(T=0);var Q=C.itemsWrapperRef.clientWidth,X=N+100/(Q/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ne){C.itemsListRef.style[ne]=(0,r.default)(X,"%",C.props.axis)}),!0}),S(v(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(v(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(v(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var M=t.default.ITEM(!1,T===C.state.selectedItem),z={key:T,ref:function(G){return C.setThumbsRef(G,T)},className:M,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},z,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,M=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),G=(0,r.default)(N,"px",this.props.axis),ie=this.props.transitionTime+"ms";return z={WebkitTransform:G,MozTransform:G,MsTransform:G,OTransform:G,transform:G,msTransform:G,WebkitTransitionDuration:ie,MozTransitionDuration:ie,MsTransitionDuration:ie,OTransitionDuration:ie,transitionDuration:ie,msTransitionDuration:ie},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:z,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(X){return C.setItemsListRef(X)},style:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!M),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return Bi.default=_,S(_,"displayName","Thumbs"),S(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Bi}var Yi={},Xl;function qg(){if(Xl)return Yi;Xl=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=function(){return document};return Yi.default=e,Yi}var Fn={},Gl;function Zc(){if(Gl)return Fn;Gl=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.setPosition=Fn.getPosition=Fn.isKeyboardEvent=Fn.defaultStatusFormatter=Fn.noop=void 0;var e=mo(),t=n($s());function n(a){return a&&a.__esModule?a:{default:a}}var r=function(){};Fn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Fn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Fn.isKeyboardEvent=o;var l=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Fn.getPosition=l;var s=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Fn.setPosition=s,Fn}var Qn={},jl;function Yg(){if(jl)return Qn;jl=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.fadeAnimationHandler=Qn.slideStopSwipingHandler=Qn.slideSwipeAnimationHandler=Qn.slideAnimationHandler=void 0;var e=mo(),t=r($s()),n=Zc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){l(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}return d}function l(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var s=function(g,h){var m={},p=h.selectedItem,b=p,w=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>w);if(v)return b<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,g.axis):b>w&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var x=(0,n.getPosition)(p,g),O=(0,t.default)(x,"%",g.axis),S=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};Qn.slideAnimationHandler=s;var a=function(g,h,m,p){var b={},w=h.axis==="horizontal",v=e.Children.count(h.children),x=0,O=(0,n.getPosition)(m.selectedItem,h),S=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=w?g.x:g.y,_=R;O===x&&R>0&&(_=0),O===S&&R<0&&(_=0);var E=O+100/(m.itemSize/_),k=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&E>-100?E-=v*100:m.selectedItem===v-1&&E<-v*100&&(E+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),b.itemListStyle=(0,n.setPosition)(E,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),b};Qn.slideSwipeAnimationHandler=a;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};Qn.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",b={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return h.swiping||(b=o(o({},b),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:b,selectedStyle:o(o({},b),{},{opacity:1,position:"relative"}),prevStyle:o({},b)}};return Qn.fadeAnimationHandler=c,Qn}var Kl;function Xg(){if(Kl)return $i;Kl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=c(mo()),t=a(Xc()),n=a(Gc()),r=a(Kc()),i=a(qg()),o=a(jc()),l=Zc(),s=Yg();function a(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in D)if(Object.prototype.hasOwnProperty.call(D,M)){var z=T?Object.getOwnPropertyDescriptor(D,M):null;z&&(z.get||z.set)?Object.defineProperty(I,M,z):I[M]=D[M]}return I.default=D,C&&C.set(D,I),I}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(I){return typeof I}:d=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(M){return Object.getOwnPropertyDescriptor(D,M).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){k(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function b(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,I){return C&&b(D.prototype,C),D}function v(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&x(D,C)}function x(D,C){return x=Object.setPrototypeOf||function(T,M){return T.__proto__=M,T},x(D,C)}function O(D){var C=_();return function(){var T=E(D),M;if(C){var z=E(this).constructor;M=Reflect.construct(T,arguments,z)}else M=T.apply(this,arguments);return S(this,M)}}function S(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function k(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){v(I,D);var C=O(I);function I(T){var M;p(this,I),M=C.call(this,T),k(R(M),"thumbsRef",void 0),k(R(M),"carouselWrapperRef",void 0),k(R(M),"listRef",void 0),k(R(M),"itemsRef",void 0),k(R(M),"timer",void 0),k(R(M),"animationHandler",void 0),k(R(M),"setThumbsRef",function(N){M.thumbsRef=N}),k(R(M),"setCarouselWrapperRef",function(N){M.carouselWrapperRef=N}),k(R(M),"setListRef",function(N){M.listRef=N}),k(R(M),"setItemsRef",function(N,G){M.itemsRef||(M.itemsRef=[]),M.itemsRef[G]=N}),k(R(M),"autoPlay",function(){e.Children.count(M.props.children)<=1||(M.clearAutoPlay(),M.props.autoPlay&&(M.timer=setTimeout(function(){M.increment()},M.props.interval)))}),k(R(M),"clearAutoPlay",function(){M.timer&&clearTimeout(M.timer)}),k(R(M),"resetAutoPlay",function(){M.clearAutoPlay(),M.autoPlay()}),k(R(M),"stopOnHover",function(){M.setState({isMouseEntered:!0},M.clearAutoPlay)}),k(R(M),"startOnLeave",function(){M.setState({isMouseEntered:!1},M.autoPlay)}),k(R(M),"isFocusWithinTheCarousel",function(){return M.carouselWrapperRef?!!((0,i.default)().activeElement===M.carouselWrapperRef||M.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(R(M),"navigateWithKeyboard",function(N){if(M.isFocusWithinTheCarousel()){var G=M.props.axis,ie=G==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},X=ie?Q.ArrowRight:Q.ArrowDown,ne=ie?Q.ArrowLeft:Q.ArrowUp;X===N.keyCode?M.increment():ne===N.keyCode&&M.decrement()}}),k(R(M),"updateSizes",function(){if(!(!M.state.initialized||!M.itemsRef||M.itemsRef.length===0)){var N=M.props.axis==="horizontal",G=M.itemsRef[0];if(G){var ie=N?G.clientWidth:G.clientHeight;M.setState({itemSize:ie}),M.thumbsRef&&M.thumbsRef.updateSizes()}}}),k(R(M),"setMountState",function(){M.setState({hasMount:!0}),M.updateSizes()}),k(R(M),"handleClickItem",function(N,G){if(e.Children.count(M.props.children)!==0){if(M.state.cancelClick){M.setState({cancelClick:!1});return}M.props.onClickItem(N,G),N!==M.state.selectedItem&&M.setState({selectedItem:N})}}),k(R(M),"handleOnChange",function(N,G){e.Children.count(M.props.children)<=1||M.props.onChange(N,G)}),k(R(M),"handleClickThumb",function(N,G){M.props.onClickThumb(N,G),M.moveTo(N)}),k(R(M),"onSwipeStart",function(N){M.setState({swiping:!0}),M.props.onSwipeStart(N)}),k(R(M),"onSwipeEnd",function(N){M.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),M.props.onSwipeEnd(N),M.clearAutoPlay(),M.state.autoPlay&&M.autoPlay()}),k(R(M),"onSwipeMove",function(N,G){M.props.onSwipeMove(G);var ie=M.props.swipeAnimationHandler(N,M.props,M.state,M.setState.bind(R(M)));return M.setState(m({},ie)),!!Object.keys(ie).length}),k(R(M),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem-(typeof N=="number"?N:1))}),k(R(M),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem+(typeof N=="number"?N:1))}),k(R(M),"moveTo",function(N){if(typeof N=="number"){var G=e.Children.count(M.props.children)-1;N<0&&(N=M.props.infiniteLoop?G:0),N>G&&(N=M.props.infiniteLoop?0:G),M.selectItem({selectedItem:N}),M.state.autoPlay&&M.state.isMouseEntered===!1&&M.resetAutoPlay()}}),k(R(M),"onClickNext",function(){M.increment(1)}),k(R(M),"onClickPrev",function(){M.decrement(1)}),k(R(M),"onSwipeForward",function(){M.increment(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),k(R(M),"onSwipeBackwards",function(){M.decrement(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),k(R(M),"changeItem",function(N){return function(G){(!(0,l.isKeyboardEvent)(G)||G.key==="Enter")&&M.moveTo(N)}}),k(R(M),"selectItem",function(N){M.setState(m({previousItem:M.state.selectedItem},N),function(){M.setState(M.animationHandler(M.props,M.state))}),M.handleOnChange(N.selectedItem,e.Children.toArray(M.props.children)[N.selectedItem])}),k(R(M),"getInitialImage",function(){var N=M.props.selectedItem,G=M.itemsRef&&M.itemsRef[N],ie=G&&G.getElementsByTagName("img")||[];return ie[0]}),k(R(M),"getVariableItemHeight",function(N){var G=M.itemsRef&&M.itemsRef[N];if(M.state.hasMount&&G&&G.children.length){var ie=G.children[0].getElementsByTagName("img")||[];if(ie.length>0){var Q=ie[0];if(!Q.complete){var X=function le(){M.forceUpdate(),Q.removeEventListener("load",le)};Q.addEventListener("load",X)}}var ne=ie[0]||G.children[0],ae=ne.clientHeight;return ae>0?ae:null}return null});var z={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return M.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&s.fadeAnimationHandler||s.slideAnimationHandler,M.state=m(m({},z),M.animationHandler(T,z)),M}return w(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(M,z){!M.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!M.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(M.selectedItem!==this.props.selectedItem||M.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),M.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 M=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var z=M.getInitialImage();z&&!z.complete?z.addEventListener("load",M.setMountState):M.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.addEventListener("mouseenter",this.stopOnHover),M.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.removeEventListener("mouseenter",this.stopOnHover),M.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var M=this.getInitialImage();M&&M.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var M;(M=this.carouselWrapperRef)===null||M===void 0||M.focus()}},{key:"renderItems",value:function(M){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,G){var ie=G===z.state.selectedItem,Q=G===z.state.previousItem,X=ie&&z.state.selectedStyle||Q&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(X=m(m({},X),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(X=m(m({},X),{},{pointerEvents:"none"}));var ne={ref:function(le){return z.setItemsRef(le,G)},key:"itemKey"+G+(M?"clone":""),className:n.default.ITEM(!0,G===z.state.selectedItem,G===z.state.previousItem),onClick:z.handleClickItem.bind(z,G,N),style:X};return e.default.createElement("li",ne,z.props.renderItem(N,{isSelected:G===z.state.selectedItem,isPrevious:G===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var M=this,z=this.props,N=z.showIndicators,G=z.labels,ie=z.renderIndicator,Q=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(X,ne){return ie&&ie(M.changeItem(ne),ne===M.state.selectedItem,ne,G.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 M=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",G=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=G&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=G&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,X=this.renderItems(!0),ne=X.shift(),ae=X.pop(),le={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},Oe={};if(N){if(le.onSwipeLeft=this.onSwipeForward,le.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var J=this.getVariableItemHeight(this.state.selectedItem);Oe.height=J||"auto"}}else le.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,le.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,le.style=m(m({},le.style),{},{height:this.state.itemSize}),Oe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ie,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:Oe},z?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},le,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ne):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return M.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ne)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return $i.default=L,k(L,"displayName","Carousel"),k(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,M){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(M," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var M=T;if(T.type!=="img"&&(M=e.Children.toArray(T.props.children).find(function(z){return z.type==="img"})),!!M)return M});return I.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:l.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:s.slideSwipeAnimationHandler,stopSwipingHandler:s.slideStopSwipingHandler}),$i}var Zl={},Jl;function Gg(){return Jl||(Jl=1),Zl}var Ql;function jg(){return Ql||(Ql=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Xg()),n=Gg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(ja)),ja}var Kg=jg(),Ka,eu;function Zg(){if(eu)return Ka;eu=1;var e=mh(),t=function(){return e.Date.now()};return Ka=t,Ka}var Za,tu;function Jc(){if(tu)return Za;tu=1;var e=Tc(),t=Zg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function l(s,a,u){var c,d,g,h,m,p,b=0,w=!1,v=!1,x=!0;if(typeof s!="function")throw new TypeError(r);a=n(a)||0,e(u)&&(w=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,a):g,x="trailing"in u?!!u.trailing:x);function O(I){var T=c,M=d;return c=d=void 0,b=I,h=s.apply(M,T),h}function S(I){return b=I,m=setTimeout(E,a),w?O(I):h}function R(I){var T=I-p,M=I-b,z=a-T;return v?o(z,g-M):z}function _(I){var T=I-p,M=I-b;return p===void 0||T>=a||T<0||v&&M>=g}function E(){var I=t();if(_(I))return k(I);m=setTimeout(E,R(I))}function k(I){return m=void 0,x&&c?O(I):(c=d=void 0,h)}function L(){m!==void 0&&clearTimeout(m),b=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return S(p);if(v)return clearTimeout(m),m=setTimeout(E,a),O(p)}return m===void 0&&(m=setTimeout(E,a)),h}return C.cancel=L,C.flush=D,C}return Za=l,Za}var Jg=Jc();const Qc=yr(Jg);function vn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,s=a=>{var u;(u=o.current)==null||u.call(l,a)};return l.addEventListener(e,s,{passive:r,capture:i}),()=>{l.removeEventListener(e,s,{capture:i})}},[e,n,r,i])}function Or(e,t){return e===void 0?void 0:t}const Qg=Math.PI;function nu(e){return e*Qg/180}const ed=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),td=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},nd=(e,t,n)=>Math.min(e,t-n*2),rd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Ns=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},em=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function tm(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const l=f.useRef(Qc(s=>{o.current&&i(s)},n));return f.useLayoutEffect(()=>{o.current&&l.current(()=>e())},t),r}const nm="֑-߿יִ-﷽ﹰ-ﻼ",rm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",im=new RegExp("^[^"+rm+"]*["+nm+"]");function Bs(e){return im.test(e)?"rtl":"not-rtl"}let $o;function Ss(){if(typeof document>"u")return 0;if($o!==void 0)return $o;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(),$o=n-r,$o}const Xr=Symbol();function om(e){const t=f.useRef([Xr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(s=>{const a=t.current[0];a!==Xr&&(s=typeof s=="function"?s(a):s,s===a)||(a!==Xr&&i({}),r(u=>typeof s=="function"?s(a===Xr?u:a):s),t.current[0]=Xr)},[]),l=f.useCallback(()=>{t.current[0]=Xr,i({})},[]);return[t.current[0]===Xr?n:t.current[0],o,l]}function id(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function am(e){const t=f.useRef(e);return Si(e,t.current)||(t.current=e),t.current}const sm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const l=o.length>1;return f.createElement(Bg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Kg.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},o.map(s=>{const a=(i==null?void 0:i(s))??f.createElement("img",{draggable:!1,src:s});return f.createElement("div",{className:"gdg-centering-container",key:s},a)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Ns,null)))};function od(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Qr=od();function lm(e){Qr=e}const ad=/[&<>"']/,um=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cm=new RegExp(sd.source,"g"),dm={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=e=>dm[e];function Cn(e,t){if(t){if(ad.test(e))return e.replace(um,ru)}else if(sd.test(e))return e.replace(cm,ru);return e}const fm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(fm,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const hm=/(^|[^\[])\^/g;function Bt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(hm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const gm=/[^\w:]/g,mm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(gm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!mm.test(n)&&(n=wm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const No={},pm=/^[^:]+:\/*[^/]*$/,vm=/^([^:]+:)[\s\S]*$/,bm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wm(e,t){No[" "+e]||(pm.test(e)?No[" "+e]=e+"/":No[" "+e]=Qo(e,"/",!0)),e=No[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(vm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(bm,"$1")+t:e+t}const aa={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,l,s)=>{let a=!1,u=l;for(;--u>=0&&s[u]==="\\";)a=!a;return a?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Qo(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function ym(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Cm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?Cn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const s={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,s}return{type:"image",raw:n,href:i,title:o,text:Cn(l)}}function Sm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
3
|
+
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
|
4
|
+
`)}class Ws{constructor(t){this.options=t||Qr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Qo(r,`
|
5
|
+
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Sm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=Qo(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,l,s,a,u,c,d,g,h,m,p=n[1].trim();const b=p.length>1,w={type:"list",raw:"",ordered:b,start:b?+p.slice(0,-1):"",loose:!1,items:[]};p=b?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=b?p:"[*+-]");const v=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
|
6
|
+
`,1)[0].replace(/^\t+/,O=>" ".repeat(3*O.length)),d=t.split(`
|
7
|
+
`,1)[0],this.options.pedantic?(l=2,h=c.trimLeft()):(l=n[2].search(/[^ ]/),l=l>4?1:l,h=c.slice(l),l+=n[1].length),a=!1,!c&&/^ *$/.test(d)&&(r+=d+`
|
8
|
+
`,t=t.substring(d.length+1),m=!0),!m){const O=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),S=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),_=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;t&&(g=t.split(`
|
9
|
+
`,1)[0],d=g,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(d)||_.test(d)||O.test(d)||S.test(t)));){if(d.search(/[^ ]/)>=l||!d.trim())h+=`
|
10
|
+
`+d.slice(l);else{if(a||c.search(/[^ ]/)>=4||R.test(c)||_.test(c)||S.test(c))break;h+=`
|
11
|
+
`+d}!a&&!d.trim()&&(a=!0),r+=g+`
|
12
|
+
`,t=t.substring(g.length+1),c=d.slice(l)}}w.loose||(u?w.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(o=i[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),w.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:h}),w.raw+=r}w.items[w.items.length-1].raw=r.trimRight(),w.items[w.items.length-1].text=h.trimRight(),w.raw=w.raw.trimRight();const x=w.items.length;for(s=0;s<x;s++)if(this.lexer.state.top=!1,w.items[s].tokens=this.lexer.blockTokens(w.items[s].text,[]),!w.loose){const O=w.items[s].tokens.filter(R=>R.type==="space"),S=O.length>0&&O.some(R=>/\n.*\n/.test(R.raw));w.loose=S}if(w.loose)for(s=0;s<x;s++)w.items[s].loose=!0;return w}}html(t){const n=this.rules.block.html.exec(t);if(n){const r={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(n[0]):Cn(n[0]);r.type="paragraph",r.text=i,r.tokens=this.lexer.inline(i)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:ou(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
13
|
+
`):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,l,s,a;for(o=0;o<i;o++)/^ *-+: *$/.test(r.align[o])?r.align[o]="right":/^ *:-+: *$/.test(r.align[o])?r.align[o]="center":/^ *:-+ *$/.test(r.align[o])?r.align[o]="left":r.align[o]=null;for(i=r.rows.length,o=0;o<i;o++)r.rows[o]=ou(r.rows[o],r.header.length).map(u=>({text:u}));for(i=r.header.length,l=0;l<i;l++)r.header[l].tokens=this.lexer.inline(r.header[l].text);for(i=r.rows.length,l=0;l<i;l++)for(a=r.rows[l],s=0;s<a.length;s++)a[s].tokens=this.lexer.inline(a[s].text);return r}}}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)===`
|
14
|
+
`?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:Cn(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:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Cn(n[0]):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 l=Qo(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{const l=ym(n[2],"()");if(l>-1){const a=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],o=l[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),su(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$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))){let i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return su(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){const l=i[0].length-1;let s,a,u=l,c=0;const d=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+l);(i=d.exec(n))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(a=s.length,i[3]||i[4]){u+=a;continue}else if((i[5]||i[6])&&l%3&&!((l+a)%3)){c+=a;continue}if(u-=a,u>0)continue;a=Math.min(a,a+u+c);const g=t.slice(0,l+i.index+(i[0].length-s.length)+a);if(Math.min(l,a)%2){const m=g.slice(1,-1);return{type:"em",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}const h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=Cn(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,n){const r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=Cn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=Cn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=Cn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let l;do l=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(l!==r[0]);i=Cn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):Cn(r[0]):r[0]:i=Cn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}}const Ge={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:aa,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ge._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ge.def=Bt(Ge.def).replace("label",Ge._label).replace("title",Ge._title).getRegex();Ge.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ge.listItemStart=Bt(/^( *)(bull) */).replace("bull",Ge.bullet).getRegex();Ge.list=Bt(Ge.list).replace(/bull/g,Ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ge.def.source+")").getRegex();Ge._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Ge._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Ge.html=Bt(Ge.html,"i").replace("comment",Ge._comment).replace("tag",Ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ge.paragraph=Bt(Ge._paragraph).replace("hr",Ge.hr).replace("heading"," {0,3}#{1,6} ").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",Ge._tag).getRegex();Ge.blockquote=Bt(Ge.blockquote).replace("paragraph",Ge.paragraph).getRegex();Ge.normal={...Ge};Ge.gfm={...Ge.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};Ge.gfm.table=Bt(Ge.gfm.table).replace("hr",Ge.hr).replace("heading"," {0,3}#{1,6} ").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",Ge._tag).getRegex();Ge.gfm.paragraph=Bt(Ge._paragraph).replace("hr",Ge.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ge.gfm.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",Ge._tag).getRegex();Ge.pedantic={...Ge.normal,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ge._comment).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:aa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(Ge.normal._paragraph).replace("hr",Ge.hr).replace("heading",` *#{1,6} *[^
|
15
|
+
]`).replace("lheading",Ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Me={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:aa,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:aa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Me._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";Me.punctuation=Bt(Me.punctuation).replace(/punctuation/g,Me._punctuation).getRegex();Me.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Me.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Me._comment=Bt(Ge._comment).replace("(?:-->|$)","-->").getRegex();Me.emStrong.lDelim=Bt(Me.emStrong.lDelim).replace(/punct/g,Me._punctuation).getRegex();Me.emStrong.rDelimAst=Bt(Me.emStrong.rDelimAst,"g").replace(/punct/g,Me._punctuation).getRegex();Me.emStrong.rDelimUnd=Bt(Me.emStrong.rDelimUnd,"g").replace(/punct/g,Me._punctuation).getRegex();Me._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Me._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Me._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])?)+(?![-_])/;Me.autolink=Bt(Me.autolink).replace("scheme",Me._scheme).replace("email",Me._email).getRegex();Me._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Me.tag=Bt(Me.tag).replace("comment",Me._comment).replace("attribute",Me._attribute).getRegex();Me._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Me._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Me._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Me.link=Bt(Me.link).replace("label",Me._label).replace("href",Me._href).replace("title",Me._title).getRegex();Me.reflink=Bt(Me.reflink).replace("label",Me._label).replace("ref",Ge._label).getRegex();Me.nolink=Bt(Me.nolink).replace("ref",Ge._label).getRegex();Me.reflinkSearch=Bt(Me.reflinkSearch,"g").replace("reflink",Me.reflink).replace("nolink",Me.nolink).getRegex();Me.normal={...Me};Me.pedantic={...Me.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",Me._label).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Me._label).getRegex()};Me.gfm={...Me.normal,escape:Bt(Me.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_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.!#$%&'*+\/=?_`{\|}~-]+@)))/};Me.gfm.url=Bt(Me.gfm.url,"i").replace("email",Me.gfm._extended_email).getRegex();Me.breaks={...Me.gfm,br:Bt(Me.br).replace("{2,}","*").getRegex(),text:Bt(Me.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function xm(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function lu(e){let t="",n,r;const i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class Fr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Qr,this.options.tokenizer=this.options.tokenizer||new Ws,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:Ge.normal,inline:Me.normal};this.options.pedantic?(n.block=Ge.pedantic,n.inline=Me.pedantic):this.options.gfm&&(n.block=Ge.gfm,this.options.breaks?n.inline=Me.breaks:n.inline=Me.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ge,inline:Me}}static lex(t,n){return new Fr(n).lex(t)}static lexInline(t,n){return new Fr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
16
|
+
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,a,u)=>a+" ".repeat(u.length));let r,i,o,l;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(r=s.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
17
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
18
|
+
`+r.raw,i.text+=`
|
19
|
+
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
20
|
+
`+r.raw,i.text+=`
|
21
|
+
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const a=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},a),typeof u=="number"&&u>=0&&(s=Math.min(s,u))}),s<1/0&&s>=0&&(o=t.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],l&&i.type==="paragraph"?(i.raw+=`
|
22
|
+
`+r.raw,i.text+=`
|
23
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),l=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
|
24
|
+
`+r.raw,i.text+=`
|
25
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(t){const s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,i,o,l=t,s,a,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)c.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+au("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,s.index)+"["+au("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,s.index+s[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(a||(u=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.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),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.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),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,l,u)){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,lu)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,lu))){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let g;this.options.extensions.startInline.forEach(function(h){g=h.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,xm)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),a=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class Us{constructor(t){this.options=t||Qr}code(t,n,r){const i=(n||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,i);o!=null&&o!==t&&(r=!0,t=o)}return t=t.replace(/\n$/,"")+`
|
26
|
+
`,i?'<pre><code class="'+this.options.langPrefix+Cn(i)+'">'+(r?t:Cn(t,!0))+`</code></pre>
|
27
|
+
`:"<pre><code>"+(r?t:Cn(t,!0))+`</code></pre>
|
28
|
+
`}blockquote(t){return`<blockquote>
|
29
|
+
${t}</blockquote>
|
30
|
+
`}html(t){return t}heading(t,n,r,i){if(this.options.headerIds){const o=this.options.headerPrefix+i.slug(r);return`<h${n} id="${o}">${t}</h${n}>
|
31
|
+
`}return`<h${n}>${t}</h${n}>
|
32
|
+
`}hr(){return this.options.xhtml?`<hr/>
|
33
|
+
`:`<hr>
|
34
|
+
`}list(t,n,r){const i=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+i+o+`>
|
35
|
+
`+t+"</"+i+`>
|
36
|
+
`}listitem(t){return`<li>${t}</li>
|
37
|
+
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
|
38
|
+
`}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
39
|
+
<thead>
|
40
|
+
`+t+`</thead>
|
41
|
+
`+n+`</table>
|
42
|
+
`}tablerow(t){return`<tr>
|
43
|
+
${t}</tr>
|
44
|
+
`}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
|
45
|
+
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class ud{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class cd{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Ar{constructor(t){this.options=t||Qr,this.options.renderer=this.options.renderer||new Us,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ud,this.slugger=new cd}static parse(t,n){return new Ar(n).parse(t)}static parseInline(t,n){return new Ar(n).parseInline(t)}parse(t,n=!0){let r="",i,o,l,s,a,u,c,d,g,h,m,p,b,w,v,x,O,S,R;const _=t.length;for(i=0;i<_;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(R=this.options.extensions.renderers[h.type].call({parser:this},h),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=R||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,ld(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",s=h.header.length,o=0;o<s;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",s=h.rows.length,o=0;o<s;o++){for(u=h.rows[o],c="",a=u.length,l=0;l<a;l++)c+=this.renderer.tablecell(this.parseInline(u[l].tokens),{header:!1,align:h.align[l]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(m=h.ordered,p=h.start,b=h.loose,s=h.items.length,g="",o=0;o<s;o++)v=h.items[o],x=v.checked,O=v.task,w="",v.task&&(S=this.renderer.checkbox(x),b?v.tokens.length>0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=S+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type==="text"&&(v.tokens[0].tokens[0].text=S+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:S}):w+=S),w+=this.parse(v.tokens,b),g+=this.renderer.listitem(w,O,x);r+=this.renderer.list(g,m,p);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<_&&t[i+1].type==="text";)h=t[++i],g+=`
|
46
|
+
`+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const E='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(E);return}else throw new Error(E)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",i,o,l;const s=t.length;for(i=0;i<s;i++){if(o=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(l=this.options.extensions.renderers[o.type].call({parser:this},o),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=l||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(a);return}else throw new Error(a)}}}return r}}class sa{constructor(t){this.options=t||Qr}preprocess(t){return t}postprocess(t){return t}}ft(sa,"passThroughHooks",new Set(["preprocess","postprocess"]));function km(e,t,n){return r=>{if(r.message+=`
|
47
|
+
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Cn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function dd(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...Je.defaults,...o};const l=km(r.silent,r.async,i);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Cm(r),r.hooks&&(r.hooks.options=r),i){const s=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(d){return l(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&Je.walkTokens(a,r.walkTokens),g=t(a,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=s,d?l(d):i(null,g)};if(!s||s.length<3||(delete r.highlight,!a.length))return u();let c=0;Je.walkTokens(a,function(d){d.type==="code"&&(c++,setTimeout(()=>{s(d.text,d.lang,function(g,h){if(g)return u(g);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(s=>e(s,r)).then(s=>r.walkTokens?Promise.all(Je.walkTokens(s,r.walkTokens)).then(()=>s):s).then(s=>t(s,r)).then(s=>r.hooks?r.hooks.postprocess(s):s).catch(l);try{r.hooks&&(n=r.hooks.preprocess(n));const s=e(n,r);r.walkTokens&&Je.walkTokens(s,r.walkTokens);let a=t(s,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(s){return l(s)}}}function Je(e,t,n){return dd(Fr.lex,Ar.parse)(e,t,n)}Je.options=Je.setOptions=function(e){return Je.defaults={...Je.defaults,...e},lm(Je.defaults),Je};Je.getDefaults=od;Je.defaults=Qr;Je.use=function(...e){const t=Je.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=Je.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...l){let s=i.renderer.apply(this,l);return s===!1&&(s=o.apply(this,l)),s}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=Je.defaults.renderer||new Us;for(const o in n.renderer){const l=i[o];i[o]=(...s)=>{let a=n.renderer[o].apply(i,s);return a===!1&&(a=l.apply(i,s)),a}}r.renderer=i}if(n.tokenizer){const i=Je.defaults.tokenizer||new Ws;for(const o in n.tokenizer){const l=i[o];i[o]=(...s)=>{let a=n.tokenizer[o].apply(i,s);return a===!1&&(a=l.apply(i,s)),a}}r.tokenizer=i}if(n.hooks){const i=Je.defaults.hooks||new sa;for(const o in n.hooks){const l=i[o];sa.passThroughHooks.has(o)?i[o]=s=>{if(Je.defaults.async)return Promise.resolve(n.hooks[o].call(i,s)).then(u=>l.call(i,u));const a=n.hooks[o].call(i,s);return l.call(i,a)}:i[o]=(...s)=>{let a=n.hooks[o].apply(i,s);return a===!1&&(a=l.apply(i,s)),a}}r.hooks=i}if(n.walkTokens){const i=Je.defaults.walkTokens;r.walkTokens=function(o){let l=[];return l.push(n.walkTokens.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}Je.setOptions(r)})};Je.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Je,r)),r.type){case"table":{for(const i of r.header)n=n.concat(Je.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(Je.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Je.walkTokens(r.items,t));break}default:Je.defaults.extensions&&Je.defaults.extensions.childTokens&&Je.defaults.extensions.childTokens[r.type]?Je.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(Je.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(Je.walkTokens(r.tokens,t)))}return n};Je.parseInline=dd(Fr.lexInline,Ar.parseInline);Je.Parser=Ar;Je.parser=Ar.parse;Je.Renderer=Us;Je.TextRenderer=ud;Je.Lexer=Fr;Je.lexer=Fr.lex;Je.Tokenizer=Ws;Je.Slugger=cd;Je.Hooks=sa;Je.parse=Je;Je.options;Je.setOptions;Je.use;Je.walkTokens;Je.parseInline;Ar.parse;Fr.lex;const Mm=bn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Rm extends qt.PureComponent{constructor(){super(...arguments);ft(this,"targetElement",null);ft(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:r}=this;if(n===null)return;const{contents:i,createNode:o}=r,l=Je(i),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let a=o==null?void 0:o(l);if(a===void 0){const c=document.createElement("template");c.innerHTML=l,a=c.content}n.append(a);const u=n.getElementsByTagName("a");for(const c of u)c.target="_blank",c.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),qt.createElement(Mm,{ref:this.containerRefHook})}}const Em=bn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Im=bn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),Tm=bn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let uu=0;const ei=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:l,...s}=e,{onChange:a,className:u}=s,c=f.useRef(null),d=n??"";Hn(a!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(uu=(uu+1)%1e7));f.useEffect(()=>{const m=c.current;if(m===null||m.disabled)return;const p=d.toString().length;m.focus(),m.setSelectionRange(i?0:p,p)},[]),f.useLayoutEffect(()=>{var m;if(l!==void 0){const p=typeof l=="number"?[l,null]:l;(m=c.current)==null||m.setSelectionRange(p[0],p[1])}},[l]);const h=f.useCallback(m=>{m.key==="Enter"&&m.shiftKey&&o===!0||r==null||r(m)},[o,r]);return f.createElement(Tm,{className:"gdg-growing-entry"},f.createElement(Im,{className:u},d+`
|
48
|
+
`),f.createElement(Em,{...s,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},Ja={};let Tr=null;function Dm(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function la(e){const t=e.toLowerCase().trim();if(Ja[t]!==void 0)return Ja[t];Tr=Tr||Dm(),Tr.style.color="#000",Tr.style.color=t;const n=getComputedStyle(Tr).color;Tr.style.color="#fff",Tr.style.color=t;const r=getComputedStyle(Tr).color;if(r!==n)return[0,0,0,1];let i=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(o=>Number.isNaN(o)?0:o),Ja[t]=i,i}function Zr(e,t){const[n,r,i]=la(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const cu=new Map;function du(e,t){const n=`${e}-${t}`,r=cu.get(n);if(r!==void 0)return r;const i=zn(e,t);return cu.set(n,i),i}function zn(e,t){if(t===void 0)return e;const[n,r,i,o]=la(e);if(o===1)return e;const[l,s,a,u]=la(t),c=o+u*(1-o),d=(o*n+u*l*(1-o))/c,g=(o*r+u*s*(1-o))/c,h=(o*i+u*a*(1-o))/c;return`rgba(${d}, ${g}, ${h}, ${c})`}var vi=new Map,wi=new Map,xs=new Map;function Om(){vi.clear(),xs.clear(),wi.clear()}function Pm(e,t,n,r,i){var o,l,s;let a=0,u={};for(let d of e)a+=(o=n.get(d))!=null?o:i,u[d]=((l=u[d])!=null?l:0)+1;let c=t-a;for(let d of Object.keys(u)){let g=u[d],h=(s=n.get(d))!=null?s:i,m=h*g/a,p=c*m*r/g,b=h+p;n.set(d,b)}}function _m(e,t){var n;let r=new Map,i=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),i+=c}let o=i/r.size,l=3,s=(t/o+l)/(l+1),a=r.keys();for(let u of a)r.set(u,((n=r.get(u))!=null?n:o)*s);return r}function no(e,t,n,r){var i,o;let l=wi.get(n);if(r&&l!==void 0&&l.count>2e4){let u=xs.get(n);if(u===void 0&&(u=_m(e,l.size),xs.set(n,u)),l.count>5e5){let d=0;for(let g of t)d+=(i=u.get(g))!=null?i:l.size;return d*1.01}let c=e.measureText(t);return Pm(t,c.width,u,Math.max(.05,1-l.count/2e5),l.size),wi.set(n,{count:l.count+t.length,size:l.size}),c.width}let s=e.measureText(t),a=s.width/t.length;if(((o=l==null?void 0:l.count)!=null?o:0)>2e4)return s.width;if(l===void 0)wi.set(n,{count:t.length,size:a});else{let u=a-l.size,c=t.length/(l.count+t.length),d=l.size+u*c;wi.set(n,{count:l.count+t.length,size:d})}return s.width}function Lm(e,t,n,r,i,o,l,s){if(t.length<=1)return t.length;if(i<n)return-1;let a=Math.floor(n/i*o),u=no(e,t.slice(0,Math.max(0,a)),r,l);if(u!==n)if(u<n){for(;u<n;)a++,u=no(e,t.slice(0,Math.max(0,a)),r,l);a--}else for(;u>n;){let c=t.lastIndexOf(" ",a-1);c>0?a=c:a--,u=no(e,t.slice(0,Math.max(0,a)),r,l)}if(t[a]!==" "){let c=0;c=t.lastIndexOf(" ",a),c>0&&(a=c)}return a}function Fm(e,t,n,r,i,o){let l=`${t}_${n}_${r}px`,s=vi.get(l);if(s!==void 0)return s;if(r<=0)return[];let a=[],u=t.split(`
|
49
|
+
`),c=wi.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let m=no(e,h.slice(0,Math.max(0,d)),n,g),p=Math.min(h.length,d);if(m<=r)a.push(h);else{for(;m>r;){let b=Lm(e,h,r,n,m,p,g),w=h.slice(0,Math.max(0,b));h=h.slice(w.length),a.push(w),m=no(e,h.slice(0,Math.max(0,d)),n,g),p=Math.min(h.length,d)}m>0&&a.push(h)}}return a=a.map((h,m)=>m===0?h.trimEnd():h.trim()),vi.set(l,a),vi.size>500&&vi.delete(vi.keys().next().value),a}function Am(e,t){return qt.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 Hm(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(ro(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function lo(e,t){return(e??"")===(t??"")}function zm(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 fd(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function ro(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function hd(e){return[e.x+e.width-1,e.y+e.height-1]}function fu(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,l=n.y+n.height-1,[s,a]=e;if(a<o||a>l)return!1;if(t.span===void 0)return s>=r&&s<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function Vm(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&fu(e,t,o)&&i++;for(const l of n.current.rangeStack)fu(e,t,l)&&i++;return i}function gd(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,l)=>({...o,sticky:e[l].sticky})),n=r}return n}function xi(e,t){let n=0;const r=gd(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function ti(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function ks(e,t,n,r,i){const o=gd(e,r),l=[];for(const u of o)if(u.sticky)l.push(u);else break;if(l.length>0)for(const u of l)n-=u.width;let s=t,a=i??0;for(;a<=n&&s<o.length;)a+=o[s].width,s++;for(let u=t;u<s;u++){const c=o[u];c.sticky||l.push(c)}return l}function $m(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function Nm(e,t,n,r,i,o,l,s,a,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let m=0;m<u;m++){const p=o-1-m,b=typeof l=="number"?l:l(p);if(d-=b,e>=d)return p}const g=o-u,h=e-(a??0);if(typeof l=="number"){const m=Math.floor((h-c)/l)+s;return m>=g?void 0:m}else{let m=c;for(let p=s;p<g;p++){const b=l(p);if(h<=m+b)return p;m+=b}return}}let ea=0,io={};const Bm=typeof window>"u";async function Wm(){var e;Bm||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,ea=0,io={},Om())}Wm();function md(e,t,n,r){return`${e}_${r??(t==null?void 0:t.font)}_${n}`}function ni(e,t,n,r="middle"){const i=md(e,t,r,n);let o=io[i];return o===void 0&&(o=t.measureText(e),io[i]=o,ea++),ea>1e4&&(io={},ea=0),o}function pd(e,t){const n=md(e,void 0,"middle",t);return io[n]}function cr(e,t){return typeof t!="string"&&(t=t.baseFontFull),Um(e,t)}function hu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const gu=[];function Um(e,t){for(const o of gu)if(o.key===t)return o.val;const n=hu(e,"alphabetic"),i=-(hu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return gu.push({key:t,val:i}),i}function qm(e,t,n,r,i,o){const{ctx:l,rect:s,theme:a}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;l.globalAlpha=d,l.fillStyle=a.bgSearchResult,l.fillRect(s.x+1,s.y+1,s.width-(i?2:1),s.height-(o?2:1)),l.globalAlpha=1,r!==void 0&&(r.fillStyle=a.bgSearchResult)}return u<c}function po(e,t,n){const{ctx:r,theme:i}=e,o=t??{},l=n??i.textDark;return l!==o.fillStyle&&(r.fillStyle=l,o.fillStyle=l),o}function qs(e,t,n,r,i){const{rect:o,ctx:l,theme:s}=e;l.fillStyle=s.textDark,lr({ctx:l,rect:o,theme:s},t,n,r,i)}function vd(e,t,n,r,i,o,l,s,a){a==="right"?e.fillText(t,n+i-(s.cellHorizontalPadding+.5),r+o/2+l):a==="center"?e.fillText(t,n+i/2,r+o/2+l):e.fillText(t,n+s.cellHorizontalPadding+.5,r+o/2+l)}function Ys(e,t){const n=ni("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Ym(e,t){e.includes(`
|
50
|
+
`)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Xm(e,t,n,r,i,o,l,s,a,u){const c=s.baseFontFull,d=Fm(e,t,c,i-s.cellHorizontalPadding*2,u??!1),g=Ys(e,c),h=s.lineHeight*g,m=g+h*(d.length-1),p=m+s.cellVerticalPadding>o;p&&(e.save(),e.rect(n,r,i,o),e.clip());const b=r+o/2-m/2;let w=Math.max(r+s.cellVerticalPadding,b);for(const v of d)if(vd(e,v,n,w,i,g,l,s,a),w+=h,w>r+o)break;p&&e.restore()}function lr(e,t,n,r,i){const{ctx:o,rect:l,theme:s}=e,{x:a,y:u,width:c,height:d}=l;r=r??!1,r||(t=Ym(t,c));const g=cr(o,s),h=Bs(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let m=!1;n==="right"?(o.textAlign="right",m=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,m=!0),r?Xm(o,t,a,u,c,d,g,s,n,i):vd(o,t,a,u,c,d,g,s,n),m&&(o.textAlign="start"),h&&(o.direction="inherit")}}function ur(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function Gm(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 jm(e,t,n){const r=function(s,a){const u=a.x-s.x,c=a.y-s.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:a.y-s.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let l=t[o-1];for(let s=0;s<o;s++){let a=t[s%o];const u=t[(s+1)%o],c=r(a,l),d=r(a,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(g<-1?-1:g>1?1:g),p=1,b=!1;h<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,b=!0):m>0&&(p=-1,b=!0),i=a.radius!==void 0?a.radius:n;const w=m/2;let v=Math.abs(Math.cos(w)*i/Math.sin(w)),x;v>Math.min(c.len/2,d.len/2)?(v=Math.min(c.len/2,d.len/2),x=Math.abs(v*Math.sin(w)/Math.cos(w))):x=i;let O=a.x+d.nx*v,S=a.y+d.ny*v;O+=-d.ny*x*p,S+=d.nx*x*p,e.arc(O,S,x,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,b),l=a,a=u}e.closePath()}function Ms(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m){const p={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return p;const b=o-i;if(e>=d){const w=l>e?-1:1,v=xi(h);p.x+=v+a;for(let x=l;x!==e;x+=w)p.x+=h[w===1?x:x-1].width*w}else for(let w=0;w<e;w++)p.x+=h[w].width;if(p.width=h[e].width+1,t===-1)p.y=i,p.height=b;else if(t===-2){p.y=0,p.height=i;let w=e;const v=h[e].group,x=h[e].sticky;for(;w>0&&lo(h[w-1].group,v)&&h[w-1].sticky===x;){const S=h[w-1];p.x-=S.width,p.width+=S.width,w--}let O=e;for(;O+1<h.length&&lo(h[O+1].group,v)&&h[O+1].sticky===x;){const S=h[O+1];p.width+=S.width,O++}if(!x){const S=xi(h),R=p.x-S;R<0&&(p.x-=R,p.width+=R),p.x+p.width>n&&(p.width=n-p.x)}}else if(t>=c-g){let w=c-t;for(p.y=r;w>0;){const v=t+w-1;p.height=typeof m=="number"?m:m(v),p.y-=p.height,w--}p.height+=1}else{const w=s>t?-1:1;if(typeof m=="number"){const v=t-s;p.y+=v*m}else for(let v=s;v!==t;v+=w)p.y+=m(v)*w;p.height=(typeof m=="number"?m:m(t))+1}return p}const Xs=1<<21;function er(e,t){return(t+2)*Xs+e}function bd(e){return e%Xs}function Gs(e){return Math.floor(e/Xs)-2}function js(e){const t=bd(e),n=Gs(e);return[t,n]}class wd{constructor(){ft(this,"visibleWindow",{x:0,y:0,width:0,height:0});ft(this,"freezeCols",0);ft(this,"freezeRows",[]);ft(this,"isInWindow",t=>{const n=bd(t),r=Gs(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,l=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&l})}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&&Si(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class Km extends wd{constructor(){super(...arguments);ft(this,"cache",new Map);ft(this,"setValue",(n,r)=>{this.cache.set(er(n[0],n[1]),r)});ft(this,"getValue",n=>this.cache.get(er(n[0],n[1])));ft(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class oo{constructor(t=[]){ft(this,"cells");this.cells=new Set(t.map(n=>er(n[0],n[1])))}add(t){this.cells.add(er(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(er(t[0],t[1]))}remove(t){this.cells.delete(er(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Gs(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(er(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 js(t)}}function Zm(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 yd={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 Cd(){return yd}const Sd=qt.createContext(yd);function Jm(){return qt.useContext(Sd)}function br(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=zn(r[i],n[i]):n[i]=r[i]);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 Rs=150;function Qm(e,t,n,r){var o;const i=r(t);return((o=i==null?void 0:i.measure)==null?void 0:o.call(i,e,t,n))??Rs}function xd(e,t,n,r,i,o,l,s,a){let u=0;const c=i===void 0?[]:i.map(h=>{const m=Qm(e,h[r],t,a);return u=Math.max(u,m),m});if(c.length>5&&s){u=0;let h=0;for(const p of c)h+=p;const m=h/c.length;for(let p=0;p<c.length;p++)c[p]>=m*2?c[p]=0:u=Math.max(u,c[p])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(l),Math.ceil(u)));return{...n,width:g}}function ep(e,t,n,r,i,o,l,s,a){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(l);u.current=t,c.current=n,d.current=l;const[g,h]=f.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})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g==null||g.remove()}),[g]);const m=f.useRef({}),p=f.useRef(),[b,w]=f.useState();return f.useLayoutEffect(()=>{const v=c.current;if(v===void 0||e.every(Ho))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),O=0;x<u.current&&x>1&&(x--,O=1);const S={x:0,y:0,width:e.length,height:Math.min(u.current,x)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const E=v(S,a.signal),k=O>0?v(R,a.signal):void 0;let L;typeof E=="object"?L=E:L=await Hl(E),k!==void 0&&(typeof k=="object"?L=[...L,...k]:L=[...L,...await Hl(k)]),p.current=e,w(L)})()},[a.signal,e]),f.useMemo(()=>{let x=e.every(Ho)?e:h===null?e.map(_=>Ho(_)?_:{..._,width:Rs}):(h.font=d.current.baseFontFull,e.map((_,E)=>{if(Ho(_))return _;if(m.current[_.id]!==void 0)return{..._,width:m.current[_.id]};if(b===void 0||p.current!==e||_.id===void 0)return{..._,width:Rs};const k=xd(h,l,_,E,b,i,o,!0,s);return m.current[_.id]=k.width,k})),O=0,S=0;const R=[];for(const[_,E]of x.entries())O+=E.width,E.grow!==void 0&&E.grow>0&&(S+=E.grow,R.push(_));if(O<r&&R.length>0){const _=[...x],E=r-O;let k=E;for(let L=0;L<R.length;L++){const D=R[L],C=(x[D].grow??0)/S,I=L===R.length-1?k:Math.min(k,Math.floor(E*C));_[D]={...x[D],growOffset:I,width:x[D].width+I},k-=I}x=_}return{sizedColumns:x,nonGrowWidth:O}},[r,e,h,b,l,i,o,s])}var Qa,mu;function tp(){if(mu)return Qa;mu=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 Qa=e,Qa}var es,pu;function np(){if(pu)return es;pu=1;var e=tp(),t=Dc();function n(r,i,o){return o===void 0&&(o=i,i=void 0),o!==void 0&&(o=t(o),o=o===o?o:0),i!==void 0&&(i=t(i),i=i===i?i:0),e(t(r),i,o)}return es=n,es}var rp=np();const Un=yr(rp);var ts,vu;function ip(){if(vu)return ts;vu=1;function e(){}return ts=e,ts}var ns,bu;function op(){if(bu)return ns;bu=1;var e=ph(),t=ip(),n=Oc(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return ns=i,ns}var rs,wu;function ap(){if(wu)return rs;wu=1;var e=vh(),t=bh(),n=yh(),r=wh(),i=op(),o=Oc(),l=200;function s(a,u,c){var d=-1,g=t,h=a.length,m=!0,p=[],b=p;if(c)m=!1,g=n;else if(h>=l){var w=u?null:i(a);if(w)return o(w);m=!1,g=r,b=new e}else b=u?[]:p;e:for(;++d<h;){var v=a[d],x=u?u(v):v;if(v=c||v!==0?v:0,m&&x===x){for(var O=b.length;O--;)if(b[O]===x)continue e;u&&b.push(x),p.push(v)}else g(b,x,c)||(b!==p&&b.push(x),p.push(v))}return p}return rs=s,rs}var is,yu;function sp(){if(yu)return is;yu=1;var e=ap();function t(n){return n&&n.length?e(n):[]}return is=t,is}var lp=sp();const up=yr(lp);var cp=Ch();const Cu=yr(cp),Yt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',dp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
51
|
+
${Yt}<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>`},fp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
52
|
+
${Yt}<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>`},hp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
53
|
+
<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}"/>
|
54
|
+
<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}"/>
|
55
|
+
</svg>`},gp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
56
|
+
<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}"/>
|
57
|
+
<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}"/>
|
58
|
+
</svg>`},mp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
59
|
+
<path
|
60
|
+
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"
|
61
|
+
fill="${n}"
|
62
|
+
/>
|
63
|
+
<path
|
64
|
+
fill-rule="evenodd"
|
65
|
+
clip-rule="evenodd"
|
66
|
+
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"
|
67
|
+
fill="${t}"
|
68
|
+
/>
|
69
|
+
</svg>`},kd=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
70
|
+
<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}"/>
|
71
|
+
<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}"/>
|
72
|
+
<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}"/>
|
73
|
+
</svg>
|
74
|
+
`},pp=e=>{const t=e.bgColor;return`${Yt}
|
75
|
+
<path stroke="${t}" stroke-width="2" d="M12 3v14"/>
|
76
|
+
<path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
|
77
|
+
<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}"/>
|
78
|
+
</svg>
|
79
|
+
`},vp=kd,bp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
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="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}"/>
|
82
|
+
</svg>`},wp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
83
|
+
${Yt}
|
84
|
+
<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}"/>
|
85
|
+
<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}"/>
|
86
|
+
<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}"/>
|
87
|
+
<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}"/>
|
88
|
+
<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}"/>
|
89
|
+
<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}"/>
|
90
|
+
<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}"/>
|
91
|
+
</svg>`},yp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
92
|
+
<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}"/>
|
93
|
+
<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}"/>
|
94
|
+
<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}"/>
|
95
|
+
</svg>`},Cp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
96
|
+
${Yt}
|
97
|
+
<path fill="${t}" d="M3 3h14v14H3z"/>
|
98
|
+
<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}"/>
|
99
|
+
</svg>`},Sp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
100
|
+
${Yt}
|
101
|
+
<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}"/>
|
102
|
+
<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}"/>
|
103
|
+
</svg>`},xp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
104
|
+
<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}"/>
|
105
|
+
<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}"/>
|
106
|
+
</svg>`},kp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
107
|
+
${Yt}
|
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 2z" fill="${n}"/>
|
109
|
+
<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}"/>
|
110
|
+
<path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
|
111
|
+
</svg>`},Mp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
112
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
113
|
+
<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}"/>
|
114
|
+
<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}"/>
|
115
|
+
</svg>`},Rp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
116
|
+
${Yt}
|
117
|
+
<rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
|
118
|
+
<rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
|
119
|
+
<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}"/>
|
120
|
+
</svg>`},Ep=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
121
|
+
<path fill="${t}" d="M4 3h12v14H4z"/>
|
122
|
+
<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}"/>
|
123
|
+
</svg>`},Ip=e=>{const t=e.fgColor,n=e.bgColor;return`
|
124
|
+
${Yt}
|
125
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
126
|
+
<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}"/>
|
127
|
+
</svg>`},Tp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
128
|
+
${Yt}
|
129
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
130
|
+
<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}"/>
|
131
|
+
</svg>`},Dp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
132
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
133
|
+
<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}"/>
|
134
|
+
</svg>`},Op=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
135
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
136
|
+
<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}"/>
|
137
|
+
<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}"/>
|
138
|
+
<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}"/>
|
139
|
+
<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}"/>
|
140
|
+
</svg>`},Pp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
141
|
+
${Yt}
|
142
|
+
<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}"/>
|
143
|
+
<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}"/>
|
144
|
+
</svg>`},_p=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
145
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
146
|
+
<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}"/>
|
147
|
+
</svg>`},Lp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
148
|
+
${Yt}
|
149
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
150
|
+
<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}"/>
|
151
|
+
</svg>`},Fp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
152
|
+
<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}"/>
|
153
|
+
<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}"/>
|
154
|
+
<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}"/>
|
155
|
+
</svg>`},Ap=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
156
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
157
|
+
<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}"/>
|
158
|
+
</svg>`},Hp=e=>{const t=e.fgColor;return`
|
159
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
160
|
+
<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"/>
|
161
|
+
</svg>`},zp=e=>{const t=e.fgColor;return`
|
162
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
163
|
+
<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"/>
|
164
|
+
</svg>
|
165
|
+
`},Vp={headerRowID:dp,headerNumber:hp,headerCode:fp,headerString:gp,headerBoolean:mp,headerAudioUri:vp,headerVideoUri:bp,headerEmoji:wp,headerImage:yp,headerUri:kd,headerPhone:Cp,headerMarkdown:Sp,headerDate:xp,headerTime:kp,headerEmail:Mp,headerReference:Rp,headerIfThenElse:Ep,headerSingleValue:Ip,headerLookup:Tp,headerTextTemplate:Dp,headerMath:Op,headerRollup:Pp,headerJoinStrings:_p,headerSplitString:Lp,headerGeoDistance:Fp,headerArray:Ap,rowOwnerOverlay:Hp,protectedColumnOverlay:zp,renameIcon:pp};function $p(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Np{constructor(t,n){ft(this,"onSettled");ft(this,"spriteMap",new Map);ft(this,"headerIcons");ft(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,l,s,a=1){const[u,c]=$p(n,s),d=l*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const m=this.headerIcons[t];if(m===void 0)return;h=document.createElement("canvas");const p=h.getContext("2d");if(p===null)return;const b=new Image;b.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const w=b.decode();if(w===void 0)return;this.inFlight++,w.then(()=>{p.drawImage(b,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else a<1&&(r.globalAlpha=a),r.drawImage(h,0,0,d,d,i,o,l,l),a<1&&(r.globalAlpha=1)}}function Md(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function xa(e,t,n,r,i,o,l,s,a){s=s??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>s&&a(u,c,h,!1,l&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const m=i(c);u-=m,a(u,c,m,!0,l&&c===r-1)}}}function Hr(e,t,n,r,i,o){let l=0,s=0;const a=i+r;for(const u of e){const c=u.sticky?s:l+n;if(o(u,c,a,u.sticky?0:s,t)===!0)break;l+=u.width,s+=u.sticky?u.width:0}}function Rd(e,t,n,r,i){let o=0,l=0;for(let s=0;s<e.length;s++){const a=e[s];let u=s+1,c=a.width;for(a.sticky&&(l+=c);u<e.length&&lo(e[u].group,a.group)&&e[u].sticky===e[s].sticky;){const p=e[u];c+=p.width,u++,s++,p.sticky&&(l+=p.width)}const d=a.sticky?0:n,g=o+d,h=a.sticky?0:Math.max(0,l-g),m=Math.min(c-h,t-(g+h));i([a.sourceIndex,e[u-1].sourceIndex],a.group??"",g+h,0,m,r),o+=c}}function Ed(e,t,n,r,i,o,l){var g;const[s,a]=e;let u,c;const d=((g=l.find(h=>!h.sticky))==null?void 0:g.sourceIndex)??0;if(a>d){const h=Math.max(s,d);let m=t,p=r;for(let b=o.sourceIndex-1;b>=h;b--)m-=l[b].width,p+=l[b].width;for(let b=o.sourceIndex+1;b<=a;b++)p+=l[b].width;c={x:m,y:n,width:p,height:i}}if(d>s){const h=Math.min(a,d-1);let m=t,p=r;for(let b=o.sourceIndex-1;b>=s;b--)m-=l[b].width,p+=l[b].width;for(let b=o.sourceIndex+1;b<=h;b++)p+=l[b].width;u={x:m,y:n,width:p,height:i}}return[u,c]}function Bp(e,t,n,r){if(r==="any")return Id(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),fd([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,l=n-e.y+1,s=e.y+e.height-n,a=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:l,r==="horizontal"?Number.MAX_SAFE_INTEGER:s);return a===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:a===l?{x:e.x,y:n,width:e.width,height:e.y-n}:a===o?{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 uo(e,t,n,r,i,o,l,s){return e<=i+l&&i<=e+n&&t<=o+s&&o<=t+r}function Kr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Id(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Wp(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 Up(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 i=-4,o=-4,l=t+4,s=n+4,a=i-e.x,u=e.x+e.width-l,c=o-e.y,d=e.y+e.height-s,g=a>0?e.x+Math.floor(a/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,m=c>0?e.y+Math.floor(c/r)*r:e.y,p=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:m,width:h-g,height:p-m}}function qp(e,t,n,r,i){const[o,l,s,a]=t,[u,c,d,g]=i,{x:h,y:m,width:p,height:b}=e,w=[];if(p<=0||b<=0)return w;const v=h+p,x=m+b,O=h<o,S=m<l,R=h+p>s,_=m+b>a,E=h>=o&&h<s||v>o&&v<=s||h<o&&v>s,k=m>=l&&m<a||x>l&&x<=a||m<l&&x>a;if(E&&k){const D=Math.max(h,o),C=Math.max(m,l),I=Math.min(v,s),T=Math.min(x,a);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(O&&S){const D=h,C=m,I=Math.min(v,o),T=Math.min(x,l);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:0,width:u+1,height:c+1}})}if(S&&E){const D=Math.max(h,o),C=m,I=Math.min(v,s),T=Math.min(x,l);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(S&&R){const D=Math.max(h,s),C=m,I=v,T=Math.min(x,l);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(O&&k){const D=h,C=Math.max(m,l),I=Math.min(v,o),T=Math.min(x,a);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(R&&k){const D=Math.max(h,s),C=Math.max(m,l),I=v,T=Math.min(x,a);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(O&&_){const D=h,C=Math.max(m,a),I=Math.min(v,o),T=x;w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(_&&E){const D=Math.max(h,o),C=Math.max(m,a),I=Math.min(v,s),T=x;w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(R&&_){const D=Math.max(h,s),C=Math.max(m,a),I=v,T=x;w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return w}const Yp={kind:te.Loading,allowOverlay:!1};function Su(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p,b,w,v,x,O,S,R,_,E,k,L,D,C,I,T,M,z,N,G){let ie=(x==null?void 0:x.size)??Number.MAX_SAFE_INTEGER;const Q=performance.now();let X=I.baseFontFull;e.font=X;const ne={ctx:e},ae=[0,0],le=b>0?ti(a,b,u):0;let Oe,J;const F=Md(v);return Hr(t,s,o,l,i,(P,B,he,Te,Fe)=>{const ge=Math.max(0,Te-B),ze=B+ge,Ie=i+1,je=P.width-ge,wt=r-i-1;if(v.length>0){let Ve=!1;for(let _e=0;_e<v.length;_e++){const rt=v[_e];if(uo(ze,Ie,je,wt,rt.x,rt.y,rt.width,rt.height)){Ve=!0;break}}if(!Ve)return}const nt=()=>{e.save(),e.beginPath(),e.rect(ze,Ie,je,wt),e.clip()},oe=O.columns.hasIndex(P.sourceIndex),He=d(P.group??"").overrideTheme,me=P.themeOverride===void 0&&He===void 0?I:br(I,He,P.themeOverride),ue=me.baseFontFull;ue!==X&&(X=ue,e.font=ue),nt();let ce;return xa(Fe,he,r,a,u,b,w,F,(Ve,_e,rt,de,pe)=>{var gn,mn,wn;if(_e<0||(ae[0]=P.sourceIndex,ae[1]=_e,x!==void 0&&!x.has(ae)))return;if(v.length>0){let ot=!1;for(let Gt=0;Gt<v.length;Gt++){const Pt=v[Gt];if(uo(B,Ve,P.width,rt,Pt.x,Pt.y,Pt.width,Pt.height)){ot=!0;break}}if(!ot)return}const st=O.rows.hasIndex(_e),ke=h.hasIndex(_e),Qe=_e<a?c(ae):Yp;let yt=B,mt=P.width,$e=!1,Dt=!1;if(Qe.span!==void 0){const[ot,Gt]=Qe.span,Pt=`${_e},${ot},${Gt},${P.sticky}`;if(J===void 0&&(J=new Set),J.has(Pt)){ie--;return}else{const on=Ed(Qe.span,B,Ve,P.width,rt,P,n),Rt=P.sticky?on[0]:on[1];if(!P.sticky&&on[0]!==void 0&&(Dt=!0),Rt!==void 0){yt=Rt.x,mt=Rt.width,J.add(Pt),e.restore(),ce=void 0,e.save(),e.beginPath();const Vt=Math.max(0,Te-Rt.x);e.rect(Rt.x+Vt,Ve,Rt.width-Vt,rt),Oe===void 0&&(Oe=[]),Oe.push({x:Rt.x+Vt,y:Ve,width:Rt.width-Vt,height:rt}),e.clip(),$e=!0}}}const Xt=g==null?void 0:g(_e),It=pe&&((gn=P.trailingRowOptions)==null?void 0:gn.themeOverride)!==void 0?(mn=P.trailingRowOptions)==null?void 0:mn.themeOverride:void 0,zt=Qe.themeOverride===void 0&&Xt===void 0&&It===void 0?me:br(me,Xt,It,Qe.themeOverride);e.beginPath();const Qt=zm(ae,Qe,O);let Ot=Vm(ae,Qe,O,p);const Rn=Qe.span!==void 0&&O.columns.some(ot=>Qe.span!==void 0&&ot>=Qe.span[0]&&ot<=Qe.span[1]);Qt&&!m&&p?Ot=0:Qt&&p&&(Ot=Math.max(Ot,1)),Rn&&Ot++,Qt||(st&&Ot++,oe&&!pe&&Ot++);const Wt=Qe.kind===te.Protected?zt.bgCellMedium:zt.bgCell;let pt;if((de||Wt!==I.bgCell)&&(pt=zn(Wt,pt)),Ot>0||ke){ke&&(pt=zn(zt.bgHeader,pt));for(let ot=0;ot<Ot;ot++)pt=zn(zt.accentLight,pt)}else if(S!==void 0){for(const ot of S)if(ot[0]===P.sourceIndex&&ot[1]===_e){pt=zn(zt.bgSearchResult,pt);break}}if(R!==void 0)for(let ot=0;ot<R.length;ot++){const Gt=R[ot],Pt=Gt.range;Gt.style!=="solid-outline"&&Pt.x<=P.sourceIndex&&P.sourceIndex<Pt.x+Pt.width&&Pt.y<=_e&&_e<Pt.y+Pt.height&&(pt=zn(Gt.color,pt))}let un=!1;if(x!==void 0){const ot=Ve+1,Pt=(de?ot+rt-1:Math.min(ot+rt-1,r-le))-ot;(Pt!==rt-1||yt+1<=Te)&&(un=!0,e.save(),e.beginPath(),e.rect(yt+1,ot,mt-1,Pt),e.clip()),pt=pt===void 0?zt.bgCell:zn(pt,zt.bgCell)}const hn=P.sourceIndex===n.length-1,Pe=_e===a-1;pt!==void 0&&(e.fillStyle=pt,ce!==void 0&&(ce.fillStyle=pt),x!==void 0?e.fillRect(yt+1,Ve+1,mt-(hn?2:1),rt-(Pe?2:1)):e.fillRect(yt,Ve,mt,rt)),Qe.style==="faded"&&(e.globalAlpha=.6);let At;for(let ot=0;ot<k.length;ot++){const Gt=k[ot];if(Gt.item[0]===P.sourceIndex&&Gt.item[1]===_e){At=Gt;break}}if(mt>G&&!Dt){const ot=zt.baseFontFull;ot!==X&&(e.font=ot,X=ot),ce=Td(e,Qe,P.sourceIndex,_e,hn,Pe,yt,Ve,mt,rt,Ot>0,zt,pt??zt.bgCell,_,E,(At==null?void 0:At.hoverAmount)??0,L,C,Q,D,ce,T,M,z,N)}return un&&e.restore(),Qe.style==="faded"&&(e.globalAlpha=1),ie--,$e&&(e.restore(),(wn=ce==null?void 0:ce.deprep)==null||wn.call(ce,ne),ce=void 0,nt(),X=ue,e.font=ue),ie<=0}),e.restore(),ie<=0}),Oe}const Xi=[0,0],Gi={x:0,y:0,width:0,height:0},os=[void 0,()=>{}];let Es=!1;function Xp(){Es=!0}function Td(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p,b,w,v,x,O,S,R,_,E){var M,z;let k,L;b!==void 0&&b[0][0]===n&&b[0][1]===r&&(k=b[1][0],L=b[1][1]);let D;Xi[0]=n,Xi[1]=r,Gi.x=l,Gi.y=s,Gi.width=a,Gi.height=u,os[0]=R.getValue(Xi),os[1]=N=>R.setValue(Xi,N),Es=!1;const C={ctx:e,theme:d,col:n,row:r,cell:t,rect:Gi,highlighted:c,cellFillColor:g,hoverAmount:p,frameTime:v,hoverX:k,drawState:os,hoverY:L,imageLoader:h,spriteManager:m,hyperWrapping:w,overrideCursor:k!==void 0?E:void 0,requestAnimationFrame:Xp},I=qm(C,t.lastUpdated,v,O,i,o),T=_(t);if(T!==void 0){(O==null?void 0:O.renderer)!==T&&((M=O==null?void 0:O.deprep)==null||M.call(O,C),O=void 0);const N=(z=T.drawPrep)==null?void 0:z.call(T,C,O);x!==void 0&&!bi(C.cell)?x(C,()=>T.draw(C,t)):T.draw(C,t),D=N===void 0?void 0:{deprep:N==null?void 0:N.deprep,fillStyle:N==null?void 0:N.fillStyle,font:N==null?void 0:N.font,renderer:T}}return(I||Es)&&(S==null||S(Xi)),D}function Ks(e,t,n,r,i,o,l,s,a=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+l/2),m=g==="circle"?1e4:t.roundingRadius??4;let p=nd(c??t.checkboxMaxSize,l,t.cellVerticalPadding),b=p/2;const w=td(d,r,o,t.cellHorizontalPadding,p),v=ed(w,h,p),x=rd(r+a,i+u,v);switch(n){case!0:{e.beginPath(),ur(e,w-p/2,h-p/2,p,p,m),g==="circle"&&(b*=.8,p*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(w-b+p/4.23,h-b+p/1.97),e.lineTo(w-b+p/2.42,h-b+p/1.44),e.lineTo(w-b+p/1.29,h-b+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ia:case!1:{e.beginPath(),ur(e,w-p/2+.5,h-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case zs:{e.beginPath(),ur(e,w-p/2,h-p/2,p,p,m),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(b*=.8,p*=.8),e.beginPath(),e.moveTo(w-p/3,h),e.lineTo(w+p/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:so()}}function Gp(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p,b,w,v){var k,L,D,C;const x=l+s;if(x<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,x);const O=(k=r==null?void 0:r[0])==null?void 0:k[0],S=(L=r==null?void 0:r[0])==null?void 0:L[1],R=(D=r==null?void 0:r[1])==null?void 0:D[0],_=(C=r==null?void 0:r[1])==null?void 0:C[1],E=d.headerFontFull;e.font=E,Hr(t,0,o,0,x,(I,T,M,z)=>{var P;if(b!==void 0&&!b.has([I.sourceIndex,-1]))return;const N=Math.max(0,z-T);e.save(),e.beginPath(),e.rect(T+N,s,I.width-N,l),e.clip();const G=p(I.group??"").overrideTheme,ie=I.themeOverride===void 0&&G===void 0?d:br(d,G,I.themeOverride);ie.bgHeader!==d.bgHeader&&(e.fillStyle=ie.bgHeader,e.fill()),ie!==d&&(e.font=ie.headerFontFull);const Q=c.columns.hasIndex(I.sourceIndex),X=a!==void 0||u||I.headerRowMarkerDisabled===!0,ne=!X&&S===-1&&O===I.sourceIndex,ae=X?0:((P=h.find(B=>B.item[0]===I.sourceIndex&&B.item[1]===-1))==null?void 0:P.hoverAmount)??0,le=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===I.sourceIndex,Oe=Q?ie.accentColor:le?ie.bgHeaderHasFocus:ie.bgHeader,J=n?s:0,F=I.sourceIndex===0?0:1;Q?(e.fillStyle=Oe,e.fillRect(T+F,J,I.width-F,l)):(le||ae>0)&&(e.beginPath(),e.rect(T+F,J,I.width-F,l),le&&(e.fillStyle=ie.bgHeaderHasFocus,e.fill()),ae>0&&(e.globalAlpha=ae,e.fillStyle=ie.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Pd(e,T,J,I.width,l,I,Q,ie,ne,ne?R:void 0,ne?_:void 0,le,ae,g,w,v),e.restore()}),n&&jp(e,t,i,o,s,r,d,g,h,m,p,b)}function jp(e,t,n,r,i,o,l,s,a,u,c,d){const[h,m]=(o==null?void 0:o[0])??[];let p=0;Rd(t,n,r,i,(b,w,v,x,O,S)=>{if(d!==void 0&&!d.hasItemInRectangle({x:b[0],y:-2,width:b[1]-b[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(v,x,O,S),e.clip();const R=c(w),_=(R==null?void 0:R.overrideTheme)===void 0?l:br(l,R.overrideTheme),E=m===-2&&h!==void 0&&h>=b[0]&&h<=b[1],k=E?_.bgGroupHeaderHovered??_.bgHeaderHovered:_.bgGroupHeader??_.bgHeader;if(k!==l.bgHeader&&(e.fillStyle=k,e.fill()),e.fillStyle=_.textGroupHeader??_.textHeader,R!==void 0){let L=v;if(R.icon!==void 0&&(s.drawSprite(R.icon,"normal",e,L+8,(i-20)/2,20,_),L+=26),e.fillText(R.name,L+8,i/2+cr(e,l.headerFontFull)),R.actions!==void 0&&E){const D=Dd({x:v,y:x,width:O,height:S},R.actions);e.beginPath();const C=D[0].x-10,I=v+O-C;e.rect(C,0,I,i);const T=e.createLinearGradient(C,0,C+I,0),M=Zr(k,0);T.addColorStop(0,M),T.addColorStop(10/I,k),T.addColorStop(1,k),e.fillStyle=T,e.fill(),e.globalAlpha=.6;const[z,N]=(o==null?void 0:o[1])??[-1,-1];for(let G=0;G<R.actions.length;G++){const ie=R.actions[G],Q=D[G],X=Kr(Q,z+v,N);X&&(e.globalAlpha=1),s.drawSprite(ie.icon,"normal",e,Q.x+Q.width/2-10,Q.y+Q.height/2-10,20,_),X&&(e.globalAlpha=.6)}e.globalAlpha=1}}v!==0&&u(b[0])&&(e.beginPath(),e.moveTo(v+.5,0),e.lineTo(v+.5,i),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=v+O}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()}const Bo=30;function Kp(e,t,n,r,i){return{x:e+n-Bo,y:Math.max(t,t+r/2-Bo/2),width:Bo,height:Math.min(Bo,r)}}function Dd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,l=26;for(let s=0;s<t.length;s++)n.push({x:r,y:i,width:l,height:o}),r+=26;return n}function ji(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function Od(e,t,n,r,i,o,l,s){var w;const a=l.cellHorizontalPadding,u=l.headerIconSize,c=Kp(n,r,i,o);let d=n+a;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const m={x:d,y:r,width:i-d,height:o};let p;if(t.indicatorIcon!==void 0){const v=e===void 0?((w=pd(t.title,l.headerFontFull))==null?void 0:w.width)??0:ni(t.title,e,l.headerFontFull).width;m.width=v,d+=v+a,p={x:d,y:r+(o-u)/2,width:u,height:u}}const b=n+i/2;return{menuBounds:ji(c,b,s),iconBounds:ji(g,b,s),iconOverlayBounds:ji(h,b,s),textBounds:ji(m,b,s),indicatorIconBounds:ji(p,b,s)}}function xu(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const v=o.rowMarkerChecked;v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const x=o.headerRowMarkerTheme!==void 0?br(s,o.headerRowMarkerTheme):s;Ks(e,x,v,t,n,r,i,!1,void 0,void 0,s.checkboxMaxSize,"center",o.rowMarker),v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const b=l?s.textHeaderSelected:s.textHeader,w=o.hasMenu===!0&&(a||h&&l)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let v=l?"selected":"normal";o.style==="highlight"&&(v=l?"selected":"special"),g.drawSprite(o.icon,v,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,s),o.overlayIcon!==void 0&&p.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,l?"selected":"special",e,p.iconOverlayBounds.x,p.iconOverlayBounds.y,p.iconOverlayBounds.width,s)}if(w&&r>35){const x=m?35:r-35,O=m?35*.7:r-35*.7,S=x/r,R=O/r,_=e.createLinearGradient(t,0,t+r,0),E=Zr(b,0);_.addColorStop(m?1:0,b),_.addColorStop(S,b),_.addColorStop(R,E),_.addColorStop(m?0:1,E),e.fillStyle=_}else e.fillStyle=b;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+i/2+cr(e,s.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!w||!uo(p.menuBounds.x,p.menuBounds.y,p.menuBounds.width,p.menuBounds.height,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,p.indicatorIconBounds.height))){let v=l?"selected":"normal";o.style==="highlight"&&(v=l?"selected":"special"),g.drawSprite(o.indicatorIcon,v,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,s)}if(w&&p.menuBounds!==void 0){const v=p.menuBounds,x=u!==void 0&&c!==void 0&&Kr(v,u+t,c+n);if(x||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===oa.Triangle){e.beginPath();const O=v.x+v.width/2-5.5,S=v.y+v.height/2-3;jm(e,[{x:O,y:S},{x:O+11,y:S},{x:O+5.5,y:S+6}],1),e.fillStyle=b,e.fill()}else if(o.menuIcon===oa.Dots){e.beginPath();const O=v.x+v.width/2,S=v.y+v.height/2;Gm(e,O,S),e.fillStyle=b,e.fill()}else{const O=v.x+(v.width-s.headerIconSize)/2,S=v.y+(v.height-s.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,O,S,s.headerIconSize,s)}x||(e.globalAlpha=1)}}function Pd(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p){const b=Bs(o.title)==="rtl",w=Od(e,o,t,n,r,i,s,b);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:l,hoverAmount:g,isHovered:a,hasSelectedCell:d,spriteManager:h,menuBounds:(w==null?void 0:w.menuBounds)??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>xu(e,t,n,r,i,o,l,s,a,u,c,g,h,p,b,w)):xu(e,t,n,r,i,o,l,s,a,u,c,g,h,p,b,w)}function Zp(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p,b,w,v){if(w!==void 0||t[t.length-1]!==n[t.length-1])return;const x=Md(b);Hr(t,a,l,s,o,(O,S,R,_,E)=>{if(O!==t[t.length-1])return;S+=O.width;const k=Math.max(S,_);k>r||(e.save(),e.beginPath(),e.rect(k,o+1,1e4,i-o-1),e.clip(),xa(E,R,i,u,c,m,p,x,(L,D,C,I)=>{if(!I&&b.length>0&&!b.some(G=>uo(S,L,1e4,C,G.x,G.y,G.width,G.height)))return;const T=g.hasIndex(D),M=h.hasIndex(D);e.beginPath();const z=d==null?void 0:d(D),N=z===void 0?v:br(v,z);N.bgCell!==v.bgCell&&(e.fillStyle=N.bgCell,e.fillRect(S,L,1e4,C)),M&&(e.fillStyle=N.bgHeader,e.fillRect(S,L,1e4,C)),T&&(e.fillStyle=N.accentLight,e.fillRect(S,L,1e4,C))}),e.restore())})}function Jp(e,t,n,r,i,o,l,s,a){let u=!1;for(const m of t)if(!m.sticky){u=l(m.sourceIndex);break}const c=a.horizontalBorderColor??a.borderColor,d=a.borderColor,g=u?xi(t):0;let h;if(g!==0&&(h=du(d,a.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const m=d===c&&h!==void 0?h:du(c,a.bgCell),p=ti(o,i,s);e.beginPath(),e.moveTo(0,r-p+.5),e.lineTo(n,r-p+.5),e.strokeStyle=m,e.stroke()}}const _d=(e,t,n)=>{let r=0,i=t,o=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const s of e)r=Math.min(r,s.x-1),i=Math.max(i,s.x+s.width+1),o=Math.min(o,s.y-1),l=Math.max(l,s.y+s.height+1)}return{minX:r,maxX:i,minY:o,maxY:l}};function Qp(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m){var C;const p=m.bgCell,{minX:b,maxX:w,minY:v,maxY:x}=_d(s,o,l),O=[],S=l-ti(h,g,u);let R=a,_=n,E=0;for(;R+i<S;){const I=R+i,T=u(_);if(I>=v&&I<=x-1){const M=c==null?void 0:c(_),z=M==null?void 0:M.bgCell;z!==void 0&&z!==p&&_>=h-g&&O.push({x:b,y:I,w:w-b,h:T,color:z})}R+=T,_<h-g&&(E=R),_++}let k=0;const L=Math.min(S,x)-E;if(L>0)for(let I=0;I<t.length;I++){const T=t[I];if(T.width===0)continue;const M=T.sticky?k:k+r,z=(C=T.themeOverride)==null?void 0:C.bgCell;z!==void 0&&z!==p&&M>=b&&M<=w&&d(I+1)&&O.push({x:M,y:E,w:T.width,h:L,color:z}),k+=T.width}if(O.length===0)return;let D;e.beginPath();for(let I=O.length-1;I>=0;I--){const T=O[I];D===void 0?D=T.color:T.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=T.color),e.rect(T.x,T.y,T.w,T.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function ku(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p,b,w=!1){if(a!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,l);for(const C of a)e.rect(C.x+1,C.y+1,C.width-1,C.height-1);e.clip("evenodd")}const v=b.horizontalBorderColor??b.borderColor,x=b.borderColor,{minX:O,maxX:S,minY:R,maxY:_}=_d(s,o,l),E=[];e.beginPath();let k=.5;for(let C=0;C<t.length;C++){const I=t[C];if(I.width===0)continue;k+=I.width;const T=I.sticky?k:k+r;T>=O&&T<=S&&h(C+1)&&E.push({x1:T,y1:Math.max(u,R),x2:T,y2:Math.min(l,_),color:x})}let L=l+.5;for(let C=p-m;C<p;C++){const I=d(C);L-=I,E.push({x1:O,y1:L,x2:S,y2:L,color:v})}if(w!==!0){let C=c+.5,I=n;const T=L;for(;C+i<T;){const M=C+i;if(M>=R&&M<=_-1){const z=g==null?void 0:g(I);E.push({x1:O,y1:M,x2:S,y2:M,color:(z==null?void 0:z.horizontalBorderColor)??(z==null?void 0:z.borderColor)??v})}C+=d(I),I++}}const D=Sh(E,C=>C.color);for(const C of Object.keys(D)){e.strokeStyle=C;for(const I of D[C])e.moveTo(I.x1,I.y1),e.lineTo(I.x2,I.y2);e.stroke(),e.beginPath()}a!==void 0&&e.restore()}function e0(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p,b,w,v){const x=[];e.imageSmoothingEnabled=!1;const O=Math.min(i.cellYOffset,l),S=Math.max(i.cellYOffset,l);let R=0;if(typeof w=="number")R+=(S-O)*w;else for(let T=O;T<S;T++)R+=w(T);l>i.cellYOffset&&(R=-R),R+=a-i.translateY;const _=Math.min(i.cellXOffset,o),E=Math.max(i.cellXOffset,o);let k=0;for(let T=_;T<E;T++)k+=p[T].width;o>i.cellXOffset&&(k=-k),k+=s-i.translateX;const L=xi(b);if(k!==0&&R!==0)return{regions:[]};const D=u>0?ti(g,u,w):0,C=c-L-Math.abs(k),I=d-h-D-Math.abs(R)-1;if(C>150&&I>150){const T={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(R>0?(T.sy=(h+1)*m,T.sh=I*m,T.dy=(R+h+1)*m,T.dh=I*m,x.push({x:0,y:h,width:c,height:R+1})):R<0&&(T.sy=(-R+h+1)*m,T.sh=I*m,T.dy=(h+1)*m,T.dh=I*m,x.push({x:0,y:d+R-D,width:c,height:-R+D})),k>0?(T.sx=L*m,T.sw=C*m,T.dx=(k+L)*m,T.dw=C*m,x.push({x:L-1,y:0,width:k+2,height:d})):k<0&&(T.sx=(L-k)*m,T.sw=C*m,T.dx=L*m,T.dw=C*m,x.push({x:c+k,y:0,width:-k,height:d})),e.setTransform(1,0,0,1,0,0),v){if(L>0&&k!==0&&R===0&&(r===void 0||(n==null?void 0:n[1])!==!1)){const M=L*m,z=d*m;e.drawImage(t,0,0,M,z,0,0,M,z)}if(D>0&&k===0&&R!==0&&(r===void 0||(n==null?void 0:n[0])!==!1)){const M=(d-D)*m,z=c*m,N=D*m;e.drawImage(t,0,M,z,N,0,M,z,N)}}e.drawImage(t,T.sx,T.sy,T.sw,T.sh,T.dx,T.dy,T.dw,T.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:x}}function t0(e,t,n,r,i,o,l,s,a,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Hr(a,n,r,i,s,(d,g,h,m)=>{if(d.sourceIndex===u){const p=Math.max(g,m)+1;return c.push({x:p,y:0,width:o-p,height:l}),!0}}),c}function n0(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 i=e.mappedColumns[r],o=t.mappedColumns[r];if(Si(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:l,...s}=i,{width:a,...u}=o;if(!Si(s,u))return!1;n=r}return n===void 0?!0:n}return!0}function Mu(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p){const b=m==null?void 0:m.filter(_=>_.style!=="no-outline");if(b===void 0||b.length===0)return;const w=xi(s),v=ti(h,g,d),x=[a,0,s.length,h-g],O=[w,0,t,n-v],S=b.map(_=>{const E=_.range,k=_.style??"dashed";return qp(E,x,t,n,O).map(L=>{const D=L.rect,C=Ms(D.x,D.y,t,n,c,u+c,r,i,o,l,h,a,g,s,d),I=D.width===1&&D.height===1?C:Ms(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,l,h,a,g,s,d);return D.x+D.width>=s.length&&(I.width-=1),D.y+D.height>=h&&(I.height-=1),{color:_.color,style:k,clip:L.clip,rect:Up({x:C.x,y:C.y,width:I.x+I.width-C.x,height:I.y+I.height-C.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let _=!1;for(const E of S)for(const k of E)if((k==null?void 0:k.rect)!==void 0&&uo(0,0,t,n,k.rect.x,k.rect.y,k.rect.width,k.rect.height)){const L=_,D=!Wp(k.clip,k.rect);e.beginPath(),D&&(e.save(),e.rect(k.clip.x,k.clip.y,k.clip.width,k.clip.height),e.clip()),k.style==="dashed"&&!_?(e.setLineDash([5,3]),_=!0):(k.style==="solid"||k.style==="solid-outline")&&_&&(e.setLineDash([]),_=!1),e.strokeStyle=k.style==="solid-outline"?zn(zn(k.color,p.borderColor),p.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),D&&(e.restore(),_=L)}_&&e.setLineDash([])};return R(),R}function Ru(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function as(e,t,n,r,i,o,l,s,a,u,c,d,g,h,m,p,b){if(c.current===void 0)return;const w=c.current.range,v=c.current.cell,x=[w.x+w.width-1,w.y+w.height-1];if(v[1]>=b&&x[1]>=b||!l.some(T=>T.sourceIndex===v[0]||T.sourceIndex===x[0]))return;const[S,R]=c.current.cell,_=g(c.current.cell),E=_.span??[S,S],k=R>=b-h,L=h>0&&!k?ti(b,h,d)-1:0,D=x[1];let C;if(Hr(l,r,i,o,u,(T,M,z,N,G)=>{if(T.sticky&&S>T.sourceIndex)return;const ie=T.sourceIndex<E[0],Q=T.sourceIndex>E[1],X=T.sourceIndex===x[0];if(!(!X&&(ie||Q)))return xa(G,z,n,b,d,h,m,void 0,(ne,ae,le)=>{if(ae!==R&&ae!==D)return;let Oe=M,J=T.width;if(_.span!==void 0){const P=Ed(_.span,M,ne,T.width,le,T,s),B=T.sticky?P[0]:P[1];B!==void 0&&(Oe=B.x,J=B.width)}return ae===D&&X&&p&&(C=()=>{var P;N>Oe&&!T.sticky&&(e.beginPath(),e.rect(N,0,t-N,n),e.clip()),e.beginPath(),e.rect(Oe+J-4,ne+le-4,4,4),e.fillStyle=((P=T.themeOverride)==null?void 0:P.accentColor)??a.accentColor,e.fill()}),C!==void 0}),C!==void 0}),C===void 0)return;const I=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-L),e.clip(),C==null||C(),e.restore()};return I(),I}function r0(e,t,n,r,i,o,l,s,a){a===void 0||a.size===0||(e.beginPath(),Rd(t,n,o,r,(u,c,d,g,h,m)=>{a.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,m)}),Hr(t,s,o,l,i,(u,c,d,g)=>{const h=Math.max(0,g-c),m=c+h+1,p=u.width-h-1;a.has([u.sourceIndex,-1])&&e.rect(m,r,p,i-r)}),e.clip())}function i0(e,t,n,r,i,o,l,s,a,u){let c=0;return Hr(e,o,r,i,n,(d,g,h,m,p)=>(xa(p,h,t,l,s,a,u,void 0,(b,w,v,x)=>{x||(c=Math.max(w,c))}),!0)),c}function Eu(e,t){var hn;const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:l,cellYOffset:s,translateX:a,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:m,drawFocus:p,headerHeight:b,groupHeaderHeight:w,disabledRows:v,rowHeight:x,verticalBorder:O,overrideCursor:S,isResizing:R,selection:_,fillHandle:E,freezeTrailingRows:k,rows:L,getCellContent:D,getGroupDetails:C,getRowThemeOverride:I,isFocused:T,drawHeaderCallback:M,prelightCells:z,drawCellCallback:N,highlightRegions:G,resizeCol:ie,imageLoader:Q,lastBlitData:X,hoverValues:ne,hyperWrapping:ae,hoverInfo:le,spriteManager:Oe,maxScaleFactor:J,hasAppendRow:F,touchMode:P,enqueue:B,renderStateProvider:he,getCellRenderer:Te,renderStrategy:Fe,bufferACtx:ge,bufferBCtx:ze,damage:Ie,minimumCellWidth:je,resizeIndicator:wt}=e;if(i===0||o===0)return;const nt=Fe==="double-buffer",oe=Math.min(J,Math.ceil(window.devicePixelRatio??1)),He=Fe!=="direct"&&n0(e,t),me=n.canvas;(me.width!==i*oe||me.height!==o*oe)&&(me.width=i*oe,me.height=o*oe,me.style.width=i+"px",me.style.height=o+"px");const ue=r.canvas,ce=d?w+b:b,Ve=ce+1;(ue.width!==i*oe||ue.height!==Ve*oe)&&(ue.width=i*oe,ue.height=Ve*oe,ue.style.width=i+"px",ue.style.height=Ve+"px");const _e=ge.canvas,rt=ze.canvas;nt&&(_e.width!==i*oe||_e.height!==o*oe)&&(_e.width=i*oe,_e.height=o*oe,X.current!==void 0&&(X.current.aBufferScroll=void 0)),nt&&(rt.width!==i*oe||rt.height!==o*oe)&&(rt.width=i*oe,rt.height=o*oe,X.current!==void 0&&(X.current.bBufferScroll=void 0));const de=X.current;if(He===!0&&l===(de==null?void 0:de.cellXOffset)&&s===(de==null?void 0:de.cellYOffset)&&a===(de==null?void 0:de.translateX)&&u===(de==null?void 0:de.translateY))return;let pe=null;nt&&(pe=n);const st=r;let ke;nt?Ie!==void 0?ke=(de==null?void 0:de.lastBuffer)==="b"?ze:ge:ke=(de==null?void 0:de.lastBuffer)==="b"?ge:ze:ke=n;const Qe=ke.canvas,yt=nt?Qe===_e?rt:_e:me,mt=typeof x=="number"?()=>x:x;st.save(),ke.save(),st.beginPath(),ke.beginPath(),st.textBaseline="middle",ke.textBaseline="middle",oe!==1&&(st.scale(oe,oe),ke.scale(oe,oe));const $e=ks(c,l,i,h,a);let Dt=[];const Xt=p&&((hn=_.current)==null?void 0:hn.cell[1])===s&&u===0;let It=!1;if(G!==void 0){for(const Pe of G)if(Pe.style!=="no-outline"&&Pe.range.y===s&&u===0){It=!0;break}}const zt=()=>{Gp(st,$e,d,le,i,a,b,w,h,R,_,m,Oe,ne,O,C,Ie,M,P),ku(st,$e,s,a,u,i,o,void 0,void 0,w,ce,mt,I,O,k,L,m,!0),st.beginPath(),st.moveTo(0,Ve-.5),st.lineTo(i,Ve-.5),st.strokeStyle=zn(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),st.stroke(),It&&Mu(st,i,o,l,s,a,u,c,g,b,w,x,k,L,G,m),Xt&&as(st,i,o,s,a,u,$e,c,m,ce,_,mt,D,k,F,E,L)};if(Ie!==void 0){const Pe=$e[$e.length-1].sourceIndex+1,At=Ie.hasItemInRegion([{x:l,y:-2,width:Pe,height:2},{x:l,y:s,width:Pe,height:300},{x:0,y:s,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:l,y:L-k,width:Pe,height:k,when:k>0}]),gn=mn=>{Su(mn,$e,c,o,ce,a,u,s,L,mt,D,C,I,v,T,p,k,F,Dt,Ie,_,z,G,Q,Oe,ne,le,N,ae,m,B,he,Te,S,je);const wn=_.current;E&&p&&wn!==void 0&&Ie.has(hd(wn.range))&&as(mn,i,o,s,a,u,$e,c,m,ce,_,mt,D,k,F,E,L)};At&&(gn(ke),pe!==null&&(pe.save(),pe.scale(oe,oe),pe.textBaseline="middle",gn(pe),pe.restore()),Ie.hasHeader()&&(r0(st,$e,i,w,ce,a,u,s,Ie),zt())),ke.restore(),st.restore();return}if((He!==!0||l!==(de==null?void 0:de.cellXOffset)||a!==(de==null?void 0:de.translateX)||Xt!==(de==null?void 0:de.mustDrawFocusOnHeader)||It!==(de==null?void 0:de.mustDrawHighlightRingsOnHeader))&&zt(),He===!0){Hn(yt!==void 0&&de!==void 0);const{regions:Pe}=e0(ke,yt,yt===_e?de.aBufferScroll:de.bBufferScroll,yt===_e?de.bBufferScroll:de.aBufferScroll,de,l,s,a,u,k,i,o,L,ce,oe,c,$e,x,nt);Dt=Pe}else He!==!1&&(Hn(de!==void 0),Dt=t0(de,l,s,a,u,i,o,ce,$e,He));Jp(ke,$e,i,o,k,L,O,mt,m);const Qt=Mu(ke,i,o,l,s,a,u,c,g,b,w,x,k,L,G,m),Ot=p?as(ke,i,o,s,a,u,$e,c,m,ce,_,mt,D,k,F,E,L):void 0;if(ke.fillStyle=m.bgCell,Dt.length>0){ke.beginPath();for(const Pe of Dt)ke.rect(Pe.x,Pe.y,Pe.width,Pe.height);ke.clip(),ke.fill(),ke.beginPath()}else ke.fillRect(0,0,i,o);const Rn=Su(ke,$e,c,o,ce,a,u,s,L,mt,D,C,I,v,T,p,k,F,Dt,Ie,_,z,G,Q,Oe,ne,le,N,ae,m,B,he,Te,S,je);Zp(ke,$e,c,i,o,ce,a,u,s,L,mt,I,_.rows,v,k,F,Dt,Ie,m),Qp(ke,$e,s,a,u,i,o,Dt,ce,mt,I,O,k,L,m),ku(ke,$e,s,a,u,i,o,Dt,Rn,w,ce,mt,I,O,k,L,m),Qt==null||Qt(),Ot==null||Ot(),R&&wt!=="none"&&Hr($e,0,a,0,ce,(Pe,At)=>Pe.sourceIndex===ie?(Ru(st,At+Pe.width,0,ce+1,zn(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),wt==="full"&&Ru(ke,At+Pe.width,ce,o,zn(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),pe!==null&&(pe.fillStyle=m.bgCell,pe.fillRect(0,0,i,o),pe.drawImage(ke.canvas,0,0));const Wt=i0($e,o,ce,a,u,s,L,mt,k,F);Q==null||Q.setWindow({x:l,y:s,width:$e.length,height:Wt-s},g,Array.from({length:k},(Pe,At)=>L-1-At));const pt=de!==void 0&&(l!==de.cellXOffset||a!==de.translateX),un=de!==void 0&&(s!==de.cellYOffset||u!==de.translateY);X.current={cellXOffset:l,cellYOffset:s,translateX:a,translateY:u,mustDrawFocusOnHeader:Xt,mustDrawHighlightRingsOnHeader:It,lastBuffer:nt?Qe===_e?"a":"b":void 0,aBufferScroll:Qe===_e?[pt,un]:de==null?void 0:de.aBufferScroll,bBufferScroll:Qe===rt?[pt,un]:de==null?void 0:de.bBufferScroll},ke.restore(),st.restore()}const o0=80;function a0(e){const t=e-1;return t*t*t+1}class s0{constructor(t){ft(this,"callback");ft(this,"currentHoveredItem");ft(this,"leavingItems",[]);ft(this,"lastAnimationTime");ft(this,"addToLeavingItems",t=>{this.leavingItems.some(r=>ro(r.item,t.item))||this.leavingItems.push(t)});ft(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(r=>ro(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),(n==null?void 0:n.hoverAmount)??0});ft(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ft(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ft(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:a0(t.hoverAmount)})));ft(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/o0;for(const o of this.leavingItems)o.hoverAmount=Un(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Un(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});ft(this,"setHovered",t=>{var n;if(!ro((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const r=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:r}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class l0{constructor(t){ft(this,"fn");ft(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Zs(e){return new l0(e)}const u0=Zs(()=>window.navigator.userAgent.includes("Firefox")),ua=Zs(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ca=Zs(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function c0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(js);t.current=[],r.current(new oo(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:l)},[]);return f.useCallback(o=>{t.current.length===0&&i();const l=er(o[0],o[1]);t.current.includes(l)||t.current.push(l)},[i])}const Pr="header",qn="group-header",da="out-of-bounds";var yi;(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"})(yi||(yi={}));function Ld(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}const Iu=6,d0=(e,t)=>{if(e.kind===te.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},f0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:l,cellYOffset:s,headerHeight:a,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:b,enableGroups:w,isFilling:v,onCanvasFocused:x,onCanvasBlur:O,isFocused:S,selection:R,freezeColumns:_,onContextMenu:E,freezeTrailingRows:k,fixedShadowX:L=!0,fixedShadowY:D=!0,drawFocusRing:C,onMouseDown:I,onMouseUp:T,onMouseMoveRaw:M,onMouseMove:z,onItemHovered:N,dragAndDropState:G,firstColAccessible:ie,onKeyDown:Q,onKeyUp:X,highlightRegions:ne,canvasRef:ae,onDragStart:le,onDragEnd:Oe,eventTargetRef:J,isResizing:F,resizeColumn:P,isDragging:B,isDraggable:he=!1,allowResize:Te,disabledRows:Fe,hasAppendRow:ge,getGroupDetails:ze,theme:Ie,prelightCells:je,headerIcons:wt,verticalBorder:nt,drawCell:oe,drawHeader:He,onCellFocused:me,onDragOverCell:ue,onDrop:ce,onDragLeave:Ve,imageWindowLoader:_e,smoothScrollX:rt=!1,smoothScrollY:de=!1,experimental:pe,getCellRenderer:st,resizeIndicator:ke="full"}=e,Qe=e.translateX??0,yt=e.translateY??0,mt=Math.max(_,Math.min(o.length-1,l)),$e=f.useRef(null),Dt=f.useRef((pe==null?void 0:pe.eventTarget)??window),Xt=Dt.current,It=_e,zt=f.useRef(),[Qt,Ot]=f.useState(!1),Rn=f.useRef([]),Wt=f.useRef(),[pt,un]=f.useState(),[hn,Pe]=f.useState(),At=f.useRef(null),[gn,mn]=f.useState(),[wn,ot]=f.useState(!1),Gt=f.useRef(wn);Gt.current=wn;const Pt=f.useMemo(()=>new Np(wt,()=>{ve.current=void 0,tn.current()}),[wt]),on=w?c+a:a,Rt=f.useRef(-1),Vt=((pe==null?void 0:pe.enableFirefoxRescaling)??!1)&&u0.value,et=((pe==null?void 0:pe.enableSafariRescaling)??!1)&&ua.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Vt&&!et||(Rt.current!==-1&&Ot(!0),window.clearTimeout(Rt.current),Rt.current=window.setTimeout(()=>{Ot(!1),Rt.current=-1},200))},[s,mt,Qe,yt,Vt,et]);const _t=Am(o,_),Tt=f.useMemo(()=>L?xi(_t,G):0,[_t,G,L]),$t=f.useCallback((V,se,we)=>{const Ce=V.getBoundingClientRect();if(se>=_t.length||we>=g)return;const fe=Ce.width/n,xe=Ms(se,we,n,r,c,on,mt,s,Qe,yt,g,_,k,_t,d);return fe!==1&&(xe.x*=fe,xe.y*=fe,xe.width*=fe,xe.height*=fe),xe.x+=Ce.x,xe.y+=Ce.y,xe},[n,r,c,on,mt,s,Qe,yt,g,_,k,_t,d]),Nt=f.useCallback((V,se,we,Ce)=>{const fe=V.getBoundingClientRect(),xe=fe.width/n,it=(se-fe.left)/xe,at=(we-fe.top)/xe,Re=5,kt=ks(_t,mt,n,void 0,Qe);let Se=0,We=0;Ce instanceof MouseEvent&&(Se=Ce.button,We=Ce.buttons);const Ue=$m(it,kt,Qe),gt=Nm(at,r,w,a,c,g,d,s,yt,k),ln=(Ce==null?void 0:Ce.shiftKey)===!0,Tn=(Ce==null?void 0:Ce.ctrlKey)===!0,St=(Ce==null?void 0:Ce.metaKey)===!0,en=Ce!==void 0&&!(Ce instanceof MouseEvent)||(Ce==null?void 0:Ce.pointerType)==="touch",Gn=[it<0?-1:n<it?1:0,at<on?-1:r<at?1:0];let xn;if(Ue===-1||at<0||it<0||gt===void 0||it>n||at>r){const Et=it>n?1:it<0?-1:0,Dn=at>r?1:at<0?-1:0;let _n=Et*2,xt=Dn*2;Et===0&&(_n=Ue===-1?yi.EndPadding:yi.Center),Dn===0&&(xt=gt===void 0?yi.EndPadding:yi.Center);let nn=!1;if(Ue===-1&>===-1){const Rr=$t(V,_t.length-1,-1);Hn(Rr!==void 0),nn=se<Rr.x+Rr.width+Re}const Mr=it>n&&it<n+Ss()||at>r&&at<r+Ss();xn={kind:da,location:[Ue!==-1?Ue:it<0?0:_t.length-1,gt??g-1],region:[_n,xt],shiftKey:ln,ctrlKey:Tn,metaKey:St,isEdge:nn,isTouch:en,button:Se,buttons:We,scrollEdge:Gn,isMaybeScrollbar:Mr}}else if(gt<=-1){let Et=$t(V,Ue,gt);Hn(Et!==void 0);let Dn=Et!==void 0&&Et.x+Et.width-se<=Re;const _n=Ue-1;se-Et.x<=Re&&_n>=0?(Dn=!0,Et=$t(V,_n,gt),Hn(Et!==void 0),xn={kind:w&>===-2?qn:Pr,location:[_n,gt],bounds:Et,group:_t[_n].group??"",isEdge:Dn,shiftKey:ln,ctrlKey:Tn,metaKey:St,isTouch:en,localEventX:se-Et.x,localEventY:we-Et.y,button:Se,buttons:We,scrollEdge:Gn}):xn={kind:w&>===-2?qn:Pr,group:_t[Ue].group??"",location:[Ue,gt],bounds:Et,isEdge:Dn,shiftKey:ln,ctrlKey:Tn,metaKey:St,isTouch:en,localEventX:se-Et.x,localEventY:we-Et.y,button:Se,buttons:We,scrollEdge:Gn}}else{const Et=$t(V,Ue,gt);Hn(Et!==void 0);const Dn=Et!==void 0&&Et.x+Et.width-se<Re;let _n=!1;if(u&&R.current!==void 0){const xt=hd(R.current.range),nn=$t(V,xt[0],xt[1]);if(nn!==void 0){const Mr=nn.x+nn.width-2,Rr=nn.y+nn.height-2;_n=Math.abs(Mr-se)<Iu&&Math.abs(Rr-we)<Iu}}xn={kind:"cell",location:[Ue,gt],bounds:Et,isEdge:Dn,shiftKey:ln,ctrlKey:Tn,isFillHandle:_n,metaKey:St,isTouch:en,localEventX:se-Et.x,localEventY:we-Et.y,button:Se,buttons:We,scrollEdge:Gn}}return xn},[n,_t,mt,Qe,r,w,a,c,g,d,s,yt,k,$t,u,R,on]),[En]=pt??[],tr=f.useRef(()=>{}),On=f.useRef(pt);On.current=pt;const[$,tt]=f.useMemo(()=>{const V=document.createElement("canvas"),se=document.createElement("canvas");return V.style.display="none",V.style.opacity="0",V.style.position="fixed",se.style.display="none",se.style.opacity="0",se.style.position="fixed",[V.getContext("2d",{alpha:!1}),se.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!($===null||tt===null))return document.documentElement.append($.canvas),document.documentElement.append(tt.canvas),()=>{$.canvas.remove(),tt.canvas.remove()}},[$,tt]);const Ne=f.useMemo(()=>new Km,[]),Ht=Vt&&Qt?1:et&&Qt?2:5,Sn=(pe==null?void 0:pe.disableMinimumCellWidth)===!0?1:10,ve=f.useRef(),ut=f.useRef(null),Zt=f.useRef(null),Lt=f.useCallback(()=>{var it;const V=$e.current,se=At.current;if(V===null||se===null||(ut.current===null&&(ut.current=V.getContext("2d",{alpha:!1}),V.width=0,V.height=0),Zt.current===null&&(Zt.current=se.getContext("2d",{alpha:!1}),se.width=0,se.height=0),ut.current===null||Zt.current===null||$===null||tt===null))return;let we=!1;const Ce=at=>{we=!0,mn(at)},fe=ve.current,xe={headerCanvasCtx:Zt.current,canvasCtx:ut.current,bufferACtx:$,bufferBCtx:tt,width:n,height:r,cellXOffset:mt,cellYOffset:s,translateX:Math.round(Qe),translateY:Math.round(yt),mappedColumns:_t,enableGroups:w,freezeColumns:_,dragAndDropState:G,theme:Ie,headerHeight:a,groupHeaderHeight:c,disabledRows:Fe??bt.empty(),rowHeight:d,verticalBorder:nt,isResizing:F,resizeCol:P,isFocused:S,selection:R,fillHandle:u,drawCellCallback:oe,hasAppendRow:ge,overrideCursor:Ce,maxScaleFactor:Ht,freezeTrailingRows:k,rows:g,drawFocus:C,getCellContent:h,getGroupDetails:ze??(at=>({name:at})),getRowThemeOverride:m,drawHeaderCallback:He,prelightCells:je,highlightRegions:ne,imageLoader:It,lastBlitData:Wt,damage:zt.current,hoverValues:Rn.current,hoverInfo:On.current,spriteManager:Pt,scrolling:Qt,hyperWrapping:(pe==null?void 0:pe.hyperWrapping)??!1,touchMode:wn,enqueue:tr.current,renderStateProvider:Ne,renderStrategy:(pe==null?void 0:pe.renderStrategy)??(ua.value?"double-buffer":"single-buffer"),getCellRenderer:st,minimumCellWidth:Sn,resizeIndicator:ke};xe.damage===void 0?(ve.current=xe,Eu(xe,fe)):Eu(xe,void 0),!we&&(xe.damage===void 0||xe.damage.has((it=On==null?void 0:On.current)==null?void 0:it[0]))&&mn(void 0)},[$,tt,n,r,mt,s,Qe,yt,_t,w,_,G,Ie,a,c,Fe,d,nt,F,ge,P,S,R,u,k,g,C,Ht,h,ze,m,oe,He,je,ne,It,Pt,Qt,pe==null?void 0:pe.hyperWrapping,pe==null?void 0:pe.renderStrategy,wn,Ne,st,Sn,ke]),tn=f.useRef(Lt);f.useLayoutEffect(()=>{Lt(),tn.current=Lt},[Lt]),f.useLayoutEffect(()=>{(async()=>{var se;((se=document==null?void 0:document.fonts)==null?void 0:se.ready)!==void 0&&(await document.fonts.ready,ve.current=void 0,tn.current())})()},[]);const Pn=f.useCallback(V=>{zt.current=V,tn.current(),zt.current=void 0},[]),ri=c0(Pn);tr.current=ri;const dr=f.useCallback(V=>{Pn(new oo(V.map(se=>se.cell)))},[Pn]);It.setCallback(Pn);const[fr,nr]=f.useState(!1),[zr,Sr]=En??[],Mi=zr!==void 0&&Sr===-1&&o[zr].headerRowMarkerDisabled!==!0,Ea=zr!==void 0&&Sr===-2;let Ri=!1,Ei=!1,Vr=gn;if(Vr===void 0&&zr!==void 0&&Sr!==void 0&&Sr>-1&&Sr<g){const V=h([zr,Sr],!0);Ri=V.kind===Yn.NewRow||V.kind===Yn.Marker&&V.markerKind!=="number",Ei=V.kind===te.Boolean&&Vs(V),Vr=V.cursor}const In=B?"grabbing":(hn??!1)||F?"col-resize":fr||v?"crosshair":Vr!==void 0?Vr:Mi||Ri||Ei||Ea?"pointer":"default",Ii=f.useMemo(()=>({contain:"strict",display:"block",cursor:In}),[In]),Ti=f.useRef("default"),ii=J==null?void 0:J.current;ii!=null&&Ti.current!==Ii.cursor&&(ii.style.cursor=Ti.current=Ii.cursor);const hr=f.useCallback((V,se,we,Ce)=>{if(ze===void 0)return;const fe=ze(V);if(fe.actions!==void 0){const xe=Dd(se,fe.actions);for(const[it,at]of xe.entries())if(Kr(at,we+se.x,Ce+at.y))return fe.actions[it]}},[ze]),gr=f.useCallback((V,se,we,Ce)=>{const fe=_t[se];if(!B&&!F&&!(hn??!1)){const xe=$t(V,se,-1);Hn(xe!==void 0);const it=Od(void 0,fe,xe.x,xe.y,xe.width,xe.height,Ie,Bs(fe.title)==="rtl");if(fe.hasMenu===!0&&it.menuBounds!==void 0&&Kr(it.menuBounds,we,Ce))return{area:"menu",bounds:it.menuBounds};if(fe.indicatorIcon!==void 0&&it.indicatorIconBounds!==void 0&&Kr(it.indicatorIconBounds,we,Ce))return{area:"indicator",bounds:it.indicatorIconBounds}}},[_t,$t,hn,B,F,Ie]),$r=f.useRef(0),rr=f.useRef(),ir=f.useRef(!1),Nr=f.useCallback(V=>{const se=$e.current,we=J==null?void 0:J.current;if(se===null||V.target!==se&&V.target!==we)return;ir.current=!0;let Ce,fe;if(V instanceof MouseEvent?(Ce=V.clientX,fe=V.clientY):(Ce=V.touches[0].clientX,fe=V.touches[0].clientY),V.target===we&&we!==null){const it=we.getBoundingClientRect();if(Ce>it.right||fe>it.bottom)return}const xe=Nt(se,Ce,fe,V);rr.current=xe.location,xe.isTouch&&($r.current=Date.now()),Gt.current!==xe.isTouch&&ot(xe.isTouch),!(xe.kind===Pr&&gr(se,xe.location[0],Ce,fe)!==void 0)&&(xe.kind===qn&&hr(xe.group,xe.bounds,xe.localEventX,xe.localEventY)!==void 0||(I==null||I(xe),!xe.isTouch&&he!==!0&&he!==xe.kind&&xe.button<3&&xe.button!==1&&V.preventDefault()))},[J,he,Nt,hr,gr,I]);vn("touchstart",Nr,Xt,!1),vn("mousedown",Nr,Xt,!1);const bo=f.useRef(0),Di=f.useCallback(V=>{var We,Ue;const se=bo.current;bo.current=Date.now();const we=$e.current;if(ir.current=!1,T===void 0||we===null)return;const Ce=J==null?void 0:J.current,fe=V.target!==we&&V.target!==Ce;let xe,it,at=!0;if(V instanceof MouseEvent){if(xe=V.clientX,it=V.clientY,at=V.button<3,V.pointerType==="touch")return}else xe=V.changedTouches[0].clientX,it=V.changedTouches[0].clientY;let Re=Nt(we,xe,it,V);Re.isTouch&&$r.current!==0&&Date.now()-$r.current>500&&(Re={...Re,isLongTouch:!0}),se!==0&&Date.now()-se<(Re.isTouch?1e3:500)&&(Re={...Re,isDoubleClick:!0}),Gt.current!==Re.isTouch&&ot(Re.isTouch),!fe&&V.cancelable&&at&&V.preventDefault();const[kt]=Re.location,Se=gr(we,kt,xe,it);if(Re.kind===Pr&&Se!==void 0){(Re.button!==0||((We=rr.current)==null?void 0:We[0])!==kt||((Ue=rr.current)==null?void 0:Ue[1])!==-1)&&T(Re,!0);return}else if(Re.kind===qn){const gt=hr(Re.group,Re.bounds,Re.localEventX,Re.localEventY);if(gt!==void 0){Re.button===0&>.onClick(Re);return}}T(Re,fe)},[T,J,Nt,gr,hr]);vn("mouseup",Di,Xt,!1),vn("touchend",Di,Xt,!1);const Ke=f.useCallback(V=>{var kt,Se;const se=$e.current;if(se===null)return;const we=J==null?void 0:J.current,Ce=V.target!==se&&V.target!==we;let fe,xe,it=!0;V instanceof MouseEvent?(fe=V.clientX,xe=V.clientY,it=V.button<3):(fe=V.changedTouches[0].clientX,xe=V.changedTouches[0].clientY);const at=Nt(se,fe,xe,V);Gt.current!==at.isTouch&&ot(at.isTouch),!Ce&&V.cancelable&&it&&V.preventDefault();const[Re]=at.location;if(at.kind===Pr){const We=gr(se,Re,fe,xe);We!==void 0&&at.button===0&&((kt=rr.current)==null?void 0:kt[0])===Re&&((Se=rr.current)==null?void 0:Se[1])===-1&&(We.area==="menu"?p==null||p(Re,We.bounds):We.area==="indicator"&&(b==null||b(Re,We.bounds)))}else if(at.kind===qn){const We=hr(at.group,at.bounds,at.localEventX,at.localEventY);We!==void 0&&at.button===0&&We.onClick(at)}},[J,Nt,gr,p,b,hr]);vn("click",Ke,Xt,!1);const wo=f.useCallback(V=>{const se=$e.current,we=J==null?void 0:J.current;if(se===null||V.target!==se&&V.target!==we||E===void 0)return;const Ce=Nt(se,V.clientX,V.clientY,V);E(Ce,()=>{V.cancelable&&V.preventDefault()})},[J,Nt,E]);vn("contextmenu",wo,(J==null?void 0:J.current)??null,!1);const yo=f.useCallback(V=>{zt.current=new oo(V.map(se=>se.item)),Rn.current=V,tn.current(),zt.current=void 0},[]),Vn=f.useMemo(()=>new s0(yo),[yo]),Co=f.useRef(Vn);Co.current=Vn,f.useLayoutEffect(()=>{const V=Co.current;if(En===void 0||En[1]<0){V.setHovered(En);return}const se=h(En,!0),we=st(se),Ce=we===void 0&&se.kind===te.Custom||(we==null?void 0:we.needsHover)!==void 0&&(typeof we.needsHover=="boolean"?we.needsHover:we.needsHover(se));V.setHovered(Ce?En:void 0)},[h,st,En]);const Xn=f.useRef(),Oi=f.useCallback(V=>{var at;const se=$e.current;if(se===null)return;const we=J==null?void 0:J.current,Ce=V.target!==se&&V.target!==we,fe=Nt(se,V.clientX,V.clientY,V);if(fe.kind!=="out-of-bounds"&&Ce&&!ir.current&&!fe.isTouch)return;const xe=(Re,kt)=>{un(Se=>Se===Re||(Se==null?void 0:Se[0][0])===(Re==null?void 0:Re[0][0])&&(Se==null?void 0:Se[0][1])===(Re==null?void 0:Re[0][1])&&((Se==null?void 0:Se[1][0])===(Re==null?void 0:Re[1][0])&&(Se==null?void 0:Se[1][1])===(Re==null?void 0:Re[1][1])||!kt)?Se:Re)};if(!Ld(fe,Xn.current))mn(void 0),N==null||N(fe),xe(fe.kind===da?void 0:[fe.location,[fe.localEventX,fe.localEventY]],!0),Xn.current=fe;else if(fe.kind==="cell"||fe.kind===Pr||fe.kind===qn){let Re=!1,kt=!0;if(fe.kind==="cell"){const We=h(fe.location);kt=((at=st(We))==null?void 0:at.needsHoverPosition)??We.kind===te.Custom,Re=kt}else Re=!0;const Se=[fe.location,[fe.localEventX,fe.localEventY]];xe(Se,kt),On.current=Se,Re&&Pn(new oo([fe.location]))}const it=fe.location[0]>=(ie?0:1);Pe(fe.kind===Pr&&fe.isEdge&&it&&Te===!0),nr(fe.kind==="cell"&&fe.isFillHandle),M==null||M(V),z(fe)},[J,Nt,ie,Te,M,z,N,h,st,Pn]);vn("mousemove",Oi,Xt,!0);const So=f.useCallback(V=>{const se=$e.current;if(se===null)return;let we,Ce;R.current!==void 0&&(we=$t(se,R.current.cell[0],R.current.cell[1]),Ce=R.current.cell),Q==null||Q({bounds:we,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Ce})},[Q,R,$t]),xo=f.useCallback(V=>{const se=$e.current;if(se===null)return;let we,Ce;R.current!==void 0&&(we=$t(se,R.current.cell[0],R.current.cell[1]),Ce=R.current.cell),X==null||X({bounds:we,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Ce})},[X,R,$t]),Ia=f.useCallback(V=>{if($e.current=V,ae!==void 0&&(ae.current=V),pe!=null&&pe.eventTarget)Dt.current=pe.eventTarget;else if(V===null)Dt.current=window;else{const se=V.getRootNode();se===document&&(Dt.current=window),Dt.current=se}},[ae,pe==null?void 0:pe.eventTarget]),Ta=f.useCallback(V=>{const se=$e.current;if(se===null||he===!1||F){V.preventDefault();return}let we,Ce;const fe=Nt(se,V.clientX,V.clientY);if(he!==!0&&fe.kind!==he){V.preventDefault();return}const xe=(We,Ue)=>{we=We,Ce=Ue};let it,at,Re;const kt=(We,Ue,gt)=>{it=We,at=Ue,Re=gt};let Se=!1;if(le==null||le({...fe,setData:xe,setDragImage:kt,preventDefault:()=>Se=!0,defaultPrevented:()=>Se}),!Se&&we!==void 0&&Ce!==void 0&&V.dataTransfer!==null)if(V.dataTransfer.setData(we,Ce),V.dataTransfer.effectAllowed="copyLink",it!==void 0&&at!==void 0&&Re!==void 0)V.dataTransfer.setDragImage(it,at,Re);else{const[We,Ue]=fe.location;if(Ue!==void 0){const gt=document.createElement("canvas"),ln=$t(se,We,Ue);Hn(ln!==void 0);const Tn=Math.ceil(window.devicePixelRatio??1);gt.width=ln.width*Tn,gt.height=ln.height*Tn;const St=gt.getContext("2d");St!==null&&(St.scale(Tn,Tn),St.textBaseline="middle",Ue===-1?(St.font=Ie.headerFontFull,St.fillStyle=Ie.bgHeader,St.fillRect(0,0,gt.width,gt.height),Pd(St,0,0,ln.width,ln.height,_t[We],!1,Ie,!1,void 0,void 0,!1,0,Pt,He,!1)):(St.font=Ie.baseFontFull,St.fillStyle=Ie.bgCell,St.fillRect(0,0,gt.width,gt.height),Td(St,h([We,Ue]),0,Ue,!1,!1,0,0,ln.width,ln.height,!1,Ie,Ie.bgCell,It,Pt,1,void 0,!1,0,void 0,void 0,void 0,Ne,st,()=>{}))),gt.style.left="-100%",gt.style.position="absolute",gt.style.width=`${ln.width}px`,gt.style.height=`${ln.height}px`,document.body.append(gt),V.dataTransfer.setDragImage(gt,ln.width/2,ln.height/2),window.setTimeout(()=>{gt.remove()},0)}}else V.preventDefault()},[he,F,Nt,le,$t,Ie,_t,Pt,He,h,It,Ne,st]);vn("dragstart",Ta,(J==null?void 0:J.current)??null,!1,!1);const $n=f.useRef(),xr=f.useCallback(V=>{const se=$e.current;if(ce!==void 0&&V.preventDefault(),se===null||ue===void 0)return;const we=Nt(se,V.clientX,V.clientY),[Ce,fe]=we.location,xe=Ce-(ie?0:1),[it,at]=$n.current??[];(it!==xe||at!==fe)&&($n.current=[xe,fe],ue([xe,fe],V.dataTransfer))},[ie,Nt,ue,ce]);vn("dragover",xr,(J==null?void 0:J.current)??null,!1,!1);const Nn=f.useCallback(()=>{$n.current=void 0,Oe==null||Oe()},[Oe]);vn("dragend",Nn,(J==null?void 0:J.current)??null,!1,!1);const U=f.useCallback(V=>{const se=$e.current;if(se===null||ce===void 0)return;V.preventDefault();const we=Nt(se,V.clientX,V.clientY),[Ce,fe]=we.location,xe=Ce-(ie?0:1);ce([xe,fe],V.dataTransfer)},[ie,Nt,ce]);vn("drop",U,(J==null?void 0:J.current)??null,!1,!1);const Jt=f.useCallback(()=>{Ve==null||Ve()},[Ve]);vn("dragleave",Jt,(J==null?void 0:J.current)??null,!1,!1);const kr=f.useRef(R);kr.current=R;const oi=f.useRef(null),ai=f.useCallback(V=>{var se;$e.current===null||!$e.current.contains(document.activeElement)||(V===null&&kr.current.current!==void 0?(se=ae==null?void 0:ae.current)==null||se.focus({preventScroll:!0}):V!==null&&V.focus({preventScroll:!0}),oi.current=V)},[ae]);f.useImperativeHandle(t,()=>({focus:()=>{var se;const V=oi.current;V===null||!document.contains(V)?(se=ae==null?void 0:ae.current)==null||se.focus({preventScroll:!0}):V.focus({preventScroll:!0})},getBounds:(V,se)=>{if(!(ae===void 0||ae.current===null))return $t(ae.current,V??0,se??-1)},damage:dr,getMouseArgsForPosition:(V,se,we)=>{if(!(ae===void 0||ae.current===null))return Nt(ae.current,V,se,we)}}),[ae,dr,$t]);const Pi=f.useRef(),Da=tm(()=>{var at,Re,kt;if(n<50||(pe==null?void 0:pe.disableAccessibilityTree)===!0)return null;let V=ks(_t,mt,n,G,Qe);const se=ie?0:-1;!ie&&((at=V[0])==null?void 0:at.sourceIndex)===0&&(V=V.slice(1));const[we,Ce]=((Re=R.current)==null?void 0:Re.cell)??[],fe=(kt=R.current)==null?void 0:kt.range,xe=V.map(Se=>Se.sourceIndex),it=Lr(s,Math.min(g,s+i));return we!==void 0&&Ce!==void 0&&!(xe.includes(we)&&it.includes(Ce))&&ai(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":_t.length+se},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},V.map(Se=>f.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(Se.sourceIndex),"aria-colindex":Se.sourceIndex+1+se,tabIndex:-1,onFocus:We=>{if(We.target!==oi.current)return me==null?void 0:me([Se.sourceIndex,-1])},key:Se.sourceIndex},Se.title)))),f.createElement("tbody",{role:"rowgroup"},it.map(Se=>f.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(Se),key:Se,"aria-rowindex":Se+2},V.map(We=>{const Ue=We.sourceIndex,gt=er(Ue,Se),ln=we===Ue&&Ce===Se,Tn=fe!==void 0&&Ue>=fe.x&&Ue<fe.x+fe.width&&Se>=fe.y&&Se<fe.y+fe.height,St=`glide-cell-${Ue}-${Se}`,en=[Ue,Se],Gn=h(en,!0);return f.createElement("td",{key:gt,role:"gridcell","aria-colindex":Ue+1+se,"aria-selected":Tn,"aria-readonly":bi(Gn)||!eo(Gn),id:St,"data-testid":St,onClick:()=>{const xn=ae==null?void 0:ae.current;if(xn!=null)return Q==null?void 0:Q({bounds:$t(xn,Ue,Se),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:en})},onFocusCapture:xn=>{var Et,Dn;if(!(xn.target===oi.current||((Et=Pi.current)==null?void 0:Et[0])===Ue&&((Dn=Pi.current)==null?void 0:Dn[1])===Se))return Pi.current=en,me==null?void 0:me(en)},ref:ln?ai:void 0,tabIndex:-1},d0(Gn,st))})))))},[n,_t,mt,G,Qe,g,s,i,R,ai,h,ae,Q,$t,me],200),_i=_===0||!L?0:mt>_?1:Un(-Qe/100,0,1),K=-s*32+yt,cn=D?Un(-K/100,0,1):0,dn=f.useMemo(()=>{if(!_i&&!cn)return null;const V={position:"absolute",top:0,left:Tt,width:n-Tt,height:r,opacity:_i,pointerEvents:"none",transition:rt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},se={position:"absolute",top:on,left:0,width:n,height:r,opacity:cn,pointerEvents:"none",transition:de?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,_i>0&&f.createElement("div",{id:"shadow-x",style:V}),cn>0&&f.createElement("div",{id:"shadow-y",style:se}))},[_i,cn,Tt,n,rt,on,r,de]),Oa=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:So,onKeyUp:xo,onFocus:x,onBlur:O,ref:Ia,style:Ii},Da),f.createElement("canvas",{ref:At,style:Oa}),dn)},h0=f.memo(f.forwardRef(f0));function Ki(e,t,n,r){return Un(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const g0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,l]=f.useState(),[s,a]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,m]=f.useState(),[p,b]=f.useState(),[w,v]=f.useState(!1),[x,O]=f.useState(),{onHeaderMenuClick:S,onHeaderIndicatorClick:R,getCellContent:_,onColumnMoved:E,onColumnResize:k,onColumnResizeStart:L,onColumnResizeEnd:D,gridRef:C,maxColumnWidth:I,minColumnWidth:T,onRowMoved:M,lockColumns:z,onColumnProposeMove:N,onMouseDown:G,onMouseUp:ie,onItemHovered:Q,onDragStart:X,canvasRef:ne}=e,ae=(k??D??L)!==void 0,{columns:le,selection:Oe}=e,J=Oe.columns,F=f.useCallback(oe=>{const[He,me]=oe.location;o!==void 0&&s!==He&&He>=z?(c(!0),a(He)):h!==void 0&&me!==void 0?(v(!0),b(Math.max(0,me))):r===void 0&&!u&&!w&&(Q==null||Q(oe))},[o,h,s,Q,z,r,u,w]),P=E!==void 0,B=f.useCallback(oe=>{var He;if(oe.button===0){const[me,ue]=oe.location;if(oe.kind==="out-of-bounds"&&oe.isEdge&&ae){const ce=(He=C==null?void 0:C.current)==null?void 0:He.getBounds(le.length-1,-1);ce!==void 0&&(n(ce.x),i(le.length-1))}else if(oe.kind==="header"&&me>=z){const ce=ne==null?void 0:ne.current;if(oe.isEdge&&ae&&ce){n(oe.bounds.x),i(me);const _e=ce.getBoundingClientRect().width/ce.offsetWidth,rt=oe.bounds.width/_e;L==null||L(le[me],rt,me,rt+(le[me].growOffset??0))}else oe.kind==="header"&&P&&(g(oe.bounds.x),l(me))}else oe.kind==="cell"&&z>0&&me===0&&ue!==void 0&&M!==void 0&&(O(oe.bounds.y),m(ue))}G==null||G(oe)},[G,ae,z,M,C,le,P,L,ne]),he=f.useCallback((oe,He)=>{u||w||S==null||S(oe,He)},[u,w,S]),Te=f.useCallback((oe,He)=>{u||w||R==null||R(oe,He)},[u,w,R]),Fe=f.useRef(-1),ge=f.useCallback(()=>{Fe.current=-1,m(void 0),b(void 0),O(void 0),v(!1),l(void 0),a(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),ze=f.useCallback((oe,He)=>{if(oe.button===0){if(r!==void 0){if((J==null?void 0:J.hasIndex(r))===!0)for(const ue of J){if(ue===r)continue;const ce=le[ue],Ve=Ki(ce,Fe.current,T,I);k==null||k(ce,Ve,ue,Ve+(ce.growOffset??0))}const me=Ki(le[r],Fe.current,T,I);if(D==null||D(le[r],me,r,me+(le[r].growOffset??0)),J.hasIndex(r))for(const ue of J){if(ue===r)continue;const ce=le[ue],Ve=Ki(ce,Fe.current,T,I);D==null||D(ce,Ve,ue,Ve+(ce.growOffset??0))}}ge(),o!==void 0&&s!==void 0&&(N==null?void 0:N(o,s))!==!1&&(E==null||E(o,s)),h!==void 0&&p!==void 0&&(M==null||M(h,p))}ie==null||ie(oe,He)},[ie,r,o,s,h,p,J,D,le,T,I,k,E,M,ge,N]),Ie=f.useMemo(()=>{if(!(o===void 0||s===void 0)&&o!==s&&(N==null?void 0:N(o,s))!==!1)return{src:o,dest:s}},[o,s,N]),je=f.useCallback(oe=>{const He=ne==null?void 0:ne.current;if(o!==void 0&&d!==void 0)Math.abs(oe.clientX-d)>20&&c(!0);else if(h!==void 0&&x!==void 0)Math.abs(oe.clientY-x)>20&&v(!0);else if(r!==void 0&&t!==void 0&&He){const ue=He.getBoundingClientRect().width/He.offsetWidth,ce=(oe.clientX-t)/ue,Ve=le[r],_e=Ki(Ve,ce,T,I);if(k==null||k(Ve,_e,r,_e+(Ve.growOffset??0)),Fe.current=ce,(J==null?void 0:J.first())===r)for(const rt of J){if(rt===r)continue;const de=le[rt],pe=Ki(de,Fe.current,T,I);k==null||k(de,pe,rt,pe+(de.growOffset??0))}}},[o,d,h,x,r,t,le,T,I,k,J,ne]),wt=f.useCallback((oe,He)=>{if(h===void 0||p===void 0)return _(oe,He);let[me,ue]=oe;return ue===p?ue=h:(ue>p&&(ue-=1),ue>=h&&(ue+=1)),_([me,ue],He)},[h,p,_]),nt=f.useCallback(oe=>{X==null||X(oe),oe.defaultPrevented()||ge()},[ge,X]);return f.createElement(h0,{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:wt,isResizing:r!==void 0,onHeaderMenuClick:he,onHeaderIndicatorClick:Te,isDragging:u,onItemHovered:F,onDragStart:nt,onMouseDown:B,allowResize:ae,onMouseUp:ze,dragAndDropState:Ie,onMouseMoveRaw:je,ref:C})};function m0(e){const t=f.useRef(null),[n,r]=f.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return f.useLayoutEffect(()=>{const i=l=>{for(const s of l){const{width:a,height:u}=s&&s.contentRect||{};r(c=>c.width===a&&c.height===u?c:{width:a,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const p0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),l=f.useRef(0),s=f.useRef(t);s.current=t;const a=n.current;f.useEffect(()=>{const u=()=>{var g,h;if(i.current===!1&&a!==null){const m=[a.scrollLeft,a.scrollTop];if(((g=o.current)==null?void 0:g[0])===m[0]&&((h=o.current)==null?void 0:h[1])===m[1])if(l.current>10){o.current=null,i.current=null;return}else l.current++;else l.current=0,s.current(m[0],m[1]),o.current=m;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,l.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&a!==null){const g=a;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,a])},v0=()=>e=>e.isSafari?"scroll":"auto",b0=bn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[v0()]}}),w0=33554400,y0=5e6;function C0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return vn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),vn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const S0=e=>{var Oe,J;const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:l,className:s,preventDiagonalScrolling:a=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:m,initialSize:p}=e,b=[],w=(g==null?void 0:g.sticky)??!1,v=(g==null?void 0:g.fill)??!1,x=f.useRef(0),O=f.useRef(0),S=f.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,_=f.useRef(R);f.useEffect(()=>{if(_.current!==R){x.current=0,O.current=0,_.current=R;const F=S.current;F!==null&&M.current(F.scrollLeft,F.scrollTop)}},[R]);const E=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),k=f.useRef(null),L=C0(200),[D,C]=f.useState(!0),I=f.useRef(0);f.useLayoutEffect(()=>{if(!D||L||E.current.lockDirection===void 0)return;const F=S.current;if(F===null)return;const[P,B]=E.current.lockDirection;P!==void 0?F.scrollLeft=P:B!==void 0&&(F.scrollTop=B),E.current.lockDirection=void 0},[L,D]);const T=f.useCallback((F,P)=>{var me;const B=S.current;if(B===null)return;P=P??B.scrollTop,F=F??B.scrollLeft;const he=E.current.scrollTop,Te=E.current.scrollLeft,Fe=F-Te,ge=P-he;L&&Fe!==0&&ge!==0&&(Math.abs(Fe)>3||Math.abs(ge)>3)&&a&&E.current.lockDirection===void 0&&(E.current.lockDirection=Math.abs(Fe)<Math.abs(ge)?[Te,void 0]:[void 0,he]);const ze=E.current.lockDirection;F=(ze==null?void 0:ze[0])??F,P=(ze==null?void 0:ze[1])??P,E.current.scrollLeft=F,E.current.scrollTop=P;const Ie=B.clientWidth,je=B.clientHeight,wt=P,nt=O.current-wt,oe=B.scrollHeight-je;O.current=wt;let He;if(oe>0&&r>B.scrollHeight+5)if(Math.abs(nt)>2e3||wt===0||wt===oe){const ue=Math.max(0,Math.min(1,wt/oe)),ce=r-je;He=ue*ce,x.current=He}else x.current-=nt,He=x.current;else He=wt,x.current=He;He=Math.max(0,Math.min(He,r-je)),x.current=He,ze!==void 0&&(window.clearTimeout(I.current),C(!1),I.current=window.setTimeout(()=>C(!0),200)),o({x:F,y:He,width:Ie-c,height:je-u,paddingRight:((me=k.current)==null?void 0:me.clientWidth)??0})},[u,c,r,o,a,L]);p0(h&&ua.value,T,S);const M=f.useRef(T);M.current=T;const z=f.useRef(),N=f.useRef(!1);f.useLayoutEffect(()=>{N.current?T():N.current=!0},[T,u,c]);const G=f.useCallback(F=>{S.current=F,m!==void 0&&(m.current=F)},[m]);let ie=0,Q=0;const X=Math.min(r,w0);for(b.push(f.createElement("div",{key:ie++,style:{width:i,height:0}}));Q<X;){const F=Math.min(y0,X-Q);b.push(f.createElement("div",{key:ie++,style:{width:0,height:F}})),Q+=F}const{ref:ne,width:ae,height:le}=m0(p);return typeof window<"u"&&(((Oe=z.current)==null?void 0:Oe.height)!==le||((J=z.current)==null?void 0:J.width)!==ae)&&(window.setTimeout(()=>M.current(),0),z.current={width:ae,height:le}),(ae??0)===0||(le??0)===0?f.createElement("div",{ref:ne}):f.createElement("div",{ref:ne},f.createElement(b0,{isSafari:ua.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:G,style:z.current,draggable:l,onDragStart:F=>{l||(F.stopPropagation(),F.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>T()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},b),d!==void 0&&f.createElement(f.Fragment,null,!v&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:k,style:{height:le,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:v?1:void 0,right:w?c??0:void 0,pointerEvents:"auto"}},d))))))},x0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:l,freezeColumns:s,experimental:a,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:m,rightElement:p,rightElementProps:b,overscrollX:w,overscrollY:v,initialSize:x,smoothScrollX:O=!1,smoothScrollY:S=!1,isDraggable:R}=e,{paddingRight:_,paddingBottom:E}=a??{},[k,L]=c,D=f.useRef(),C=f.useRef(),I=f.useRef(),T=f.useRef(),M=u+Math.max(0,w??0);let z=l?i+o:i;if(typeof r=="number")z+=n*r;else for(let Q=0;Q<n;Q++)z+=r(Q);v!==void 0&&(z+=v);const N=f.useRef(),G=f.useCallback(()=>{var Te,Fe;if(N.current===void 0)return;const Q={...N.current};let X=0,ne=Q.x<0?-Q.x:0,ae=0,le=0;Q.x=Q.x<0?0:Q.x;let Oe=0;for(let ge=0;ge<s;ge++)Oe+=t[ge].width;for(const ge of t){const ze=X-Oe;if(Q.x>=ze+ge.width)X+=ge.width,le++,ae++;else if(Q.x>ze)X+=ge.width,O?ne+=ze-Q.x:le++,ae++;else if(Q.x+Q.width>ze)X+=ge.width,ae++;else break}let J=0,F=0,P=0;if(typeof r=="number")S?(F=Math.floor(Q.y/r),J=F*r-Q.y):F=Math.ceil(Q.y/r),P=Math.ceil(Q.height/r)+F,J<0&&P++;else{let ge=0;for(let ze=0;ze<n;ze++){const Ie=r(ze),je=ge+(S?0:Ie/2);if(Q.y>=ge+Ie)ge+=Ie,F++,P++;else if(Q.y>je)ge+=Ie,S?J+=je-Q.y:F++,P++;else if(Q.y+Q.height>Ie/2+ge)ge+=Ie,P++;else break}}F=Math.max(0,Math.min(F,n-1)),P=Math.max(F,Math.min(P,n));const B={x:le,y:F,width:ae-le,height:P-F},he=D.current;(he===void 0||he.y!==B.y||he.x!==B.x||he.height!==B.height||he.width!==B.width||C.current!==ne||I.current!==J||Q.width!==((Te=T.current)==null?void 0:Te[0])||Q.height!==((Fe=T.current)==null?void 0:Fe[1]))&&(g==null||g({x:le,y:F,width:ae-le,height:P-F},Q.width,Q.height,Q.paddingRight??0,ne,J),D.current=B,C.current=ne,I.current=J,T.current=[Q.width,Q.height])},[t,r,n,g,s,O,S]),ie=f.useCallback(Q=>{N.current=Q,G()},[G]);return f.useEffect(()=>{G()},[G]),f.createElement(S0,{scrollRef:h,className:d,kineticScrollPerfHack:a==null?void 0:a.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:R===!0||typeof R=="string",scrollWidth:M+(_??0),scrollHeight:z+(E??0),clientHeight:L,rightElement:p,paddingBottom:E,paddingRight:_,rightElementProps:b,update:ie,initialSize:x},f.createElement(g0,{eventTargetRef:h,width:k,height:L,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}))},k0=bn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),M0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),R0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),E0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),I0=10,T0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:l,searchResults:s,onSearchValueChange:a,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=f.useState(""),b=l??m,w=f.useCallback(X=>{p(X),a==null||a(X)},[a]),[v,x]=f.useState(),O=f.useRef(v);O.current=v,f.useEffect(()=>{s!==void 0&&(s.length>0?x(X=>({rowsSearched:r,results:s.length,selectedIndex:(X==null?void 0:X.selectedIndex)??-1})):x(void 0))},[r,s]);const S=f.useRef();S.current===void 0&&(S.current=new AbortController);const R=f.useRef(),[_,E]=f.useState([]),k=s??_,L=f.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,S.current.abort())},[]),D=f.useRef(n);D.current=n;const C=f.useCallback(X=>{const ne=new RegExp(X.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=D.current,le=Math.min(10,r),Oe=0;x(void 0),E([]);const J=[],F=async()=>{var wt;if(u===void 0)return;const P=performance.now(),B=r-Oe;let he=u({x:0,y:ae,width:i.length,height:Math.min(le,B,r-ae)},S.current.signal);typeof he=="function"&&(he=await he());let Te=!1;for(const[nt,oe]of he.entries())for(const[He,me]of oe.entries()){let ue;switch(me.kind){case te.Text:case te.Number:ue=me.displayData;break;case te.Uri:case te.Markdown:ue=me.data;break;case te.Boolean:ue=typeof me.data=="boolean"?me.data.toString():void 0;break;case te.Image:case te.Bubble:ue=me.data.join("🐳");break;case te.Custom:ue=me.copyData;break}ue!==void 0&&ne.test(ue)&&(J.push([He,nt+ae]),Te=!0)}const Fe=performance.now();Te&&E([...J]),Oe+=he.length,Hn(Oe<=r);const ge=((wt=O.current)==null?void 0:wt.selectedIndex)??-1;x({results:J.length,rowsSearched:Oe,selectedIndex:ge}),c==null||c(J,ge),ae+le>=r?ae=0:ae+=le;const ze=Fe-P,Ie=Math.max(ze,1),je=I0/Ie;le=Math.ceil(le*je),Oe<r&&J.length<1e3&&(R.current=window.requestAnimationFrame(F))};L(),R.current=window.requestAnimationFrame(F)},[L,i.length,u,c,r]),I=f.useCallback(()=>{var X;g==null||g(),x(void 0),E([]),c==null||c([],-1),L(),(X=t==null?void 0:t.current)==null||X.focus()},[L,t,g,c]),T=f.useCallback(X=>{w(X.target.value),s===void 0&&(X.target.value===""?(x(void 0),E([]),L()):C(X.target.value))},[C,L,w,s]);f.useEffect(()=>{d&&o.current!==null&&(w(""),o.current.focus({preventScroll:!0}))},[d,o,w]);const M=f.useCallback(X=>{var ae;if((ae=X==null?void 0:X.stopPropagation)==null||ae.call(X),v===void 0)return;const ne=(v.selectedIndex+1)%v.results;x({...v,selectedIndex:ne}),c==null||c(k,ne)},[v,c,k]),z=f.useCallback(X=>{var ae;if((ae=X==null?void 0:X.stopPropagation)==null||ae.call(X),v===void 0)return;let ne=(v.selectedIndex-1)%v.results;ne<0&&(ne+=v.results),x({...v,selectedIndex:ne}),c==null||c(k,ne)},[c,k,v]),N=f.useCallback(X=>{(X.ctrlKey||X.metaKey)&&X.nativeEvent.code==="KeyF"||X.key==="Escape"?(I(),X.stopPropagation(),X.preventDefault()):X.key==="Enter"&&(X.shiftKey?z():M())},[I,M,z]);f.useEffect(()=>()=>{L()},[L]);const[G,ie]=f.useState(!1);f.useEffect(()=>{if(d)ie(!0);else{const X=setTimeout(()=>ie(!1),150);return()=>clearTimeout(X)}},[d]);const Q=f.useMemo(()=>{if(!d&&!G)return null;let X;v!==void 0&&(X=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(X=`${v.selectedIndex+1} of ${X}`));const ne=Oe=>{Oe.stopPropagation()},le={width:`${Math.floor(((v==null?void 0:v.rowsSearched)??0)/r*100)}%`};return f.createElement(k0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:ne,onMouseMove:ne,onMouseUp:ne,onClick:ne},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:T,value:b,tabIndex:d?void 0:-1,onKeyDownCapture:N}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:z,disabled:((v==null?void 0:v.results)??0)===0},M0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:M,disabled:((v==null?void 0:v.results)??0)===0},R0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:I},E0)),v!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},X)),f.createElement("div",{className:"gdg-search-progress",style:le})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,G,v,r,h,o,T,b,N,z,M,g,I]);return f.createElement(f.Fragment,null,f.createElement(x0,{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}),Q)};class D0 extends f.PureComponent{constructor(){super(...arguments);ft(this,"wrapperRef",f.createRef());ft(this,"clickOutside",n=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(n))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(n.target)){let r=n.target;for(;r!==null;){if(r.classList.contains("click-outside-ignore"))return;r=r.parentElement}this.props.onClickOutside()}})}componentDidMount(){const n=this.props.customEventTarget??document;n.addEventListener("touchend",this.clickOutside,!0),n.addEventListener("mousedown",this.clickOutside,!0),n.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const n=this.props.customEventTarget??document;n.removeEventListener("touchend",this.clickOutside,!0),n.removeEventListener("mousedown",this.clickOutside,!0),n.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:n,isOutsideClick:r,customEventTarget:i,...o}=this.props;return f.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}}const O0=()=>e=>Math.max(16,e.targetHeight-10),P0=bn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[O0(),"px"]}}),_0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[l,s]=qt.useState(n);return qt.createElement(D0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},qt.createElement(P0,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:a=>a.target.setSelectionRange(0,l.length),onChange:a=>s(a.target.value),onKeyDown:a=>{a.key==="Enter"?o(l):a.key==="Escape"&&r()},autoFocus:!0}))};function L0(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 ct(e,t,n){const r=Fd(e,t);return r&&(n.didMatch=!0),r}function Fd(e,t){if(e.length===0)return!1;if(e.includes("|")){const a=e.split("|");for(const u of a)if(Fd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const l=e.split("+"),s=l.pop();if(!L0(s,t))return!1;if(l[0]==="any")return!0;for(const a of l)switch(a){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":ca.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function F0(e,t,n,r,i,o,l){const s=qt.useCallback((c,d,g,h)=>{var x;(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!l&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const m=n==="mixed"&&(g||h==="drag"),p=r==="mixed"&&m,b=i==="mixed"&&m;let w={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?((x=e.current)==null?void 0:x.rangeStack)??[]:[]},columns:p?e.columns:bt.empty(),rows:b?e.rows:bt.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&w.current!==void 0&&e.current!==void 0&&(w={...w,current:{...w.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(w,d)},[r,e,n,o,l,i,t]),a=qt.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:bt.empty(),rows:c};else{const m=g&&n==="mixed",p=g&&r==="mixed";h={current:m?e.current:void 0,columns:p?e.columns:bt.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=qt.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:bt.empty(),columns:c};else{const m=g&&n==="mixed",p=g&&i==="mixed";h={current:m?e.current:void 0,rows:p?e.rows:bt.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[s,a,u]}function A0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:te.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return(e==null?void 0:e(u,r.signal))??[]},[r.signal,t,e,i]),l=e!==void 0?o:void 0,s=f.useCallback(u=>{if(l===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=l(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:te.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:te.Loading,allowOverlay:!1},...g])}return l(c,r.signal)},[r.signal,l,n]);return[e!==void 0?s:void 0,l]}function H0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case te.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===zs?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case te.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case te.Image:case te.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case te.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case te.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case te.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case te.Markdown:case te.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case te.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case te.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case te.Protected:return{formatted:"************",rawValue:"",format:"string"};default:so()}}function z0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(l=>l.span!==void 0&&l.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:H0(l))})}function Tu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function V0(e){var n;const t=[];for(const r of e){const i=[];for(const o of r)o.format==="url"?i.push(((n=o.rawValue)==null?void 0:n.toString())??""):o.format==="string-array"?i.push(o.formatted.map(l=>Tu(l,!0)).join(",")):i.push(o.doNotEscape===!0?o.formatted:Tu(o.formatted,!1));t.push(i.join(" "))}return t.join(`
|
166
|
+
`)}function ss(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Du(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function $0(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function N0(e){var n;const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const r of e){t.push("<tr>");for(const i of r){const o=`gdg-format="${i.format}"`;i.format==="url"?t.push(`<td ${o}><a href="${i.rawValue}">${ss(i.formatted)}</a></td>`):i.format==="string-array"?t.push(`<td ${o}><ol>${i.formatted.map((l,s)=>`<li gdg-raw-value=${Du(i.rawValue[s])}>`+ss(l)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Du(((n=i.rawValue)==null?void 0:n.toString())??"")} ${o}>${ss(i.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function B0(e,t){const n=z0(e,t),r=V0(n),i=N0(n);return{textPlain:r,textHtml:i}}function Ou(e){var l;const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],i=[];let o;for(;r.length>0;){const s=r.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")r.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const a=s.cloneNode(!0),c=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,d=(c==null?void 0:c.children.length)===1&&c.children[0].nodeName==="FONT",g=a.querySelectorAll("br");for(const p of g)p.replaceWith(`
|
167
|
+
`);const h=a.getAttribute("gdg-raw-value"),m=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)o==null||o.push({rawValue:((l=a.querySelector("a"))==null?void 0:l.getAttribute("href"))??"",formatted:a.textContent??"",format:m});else if(a.querySelector("ol")!==null){const p=a.querySelectorAll("li");o==null||o.push({rawValue:[...p].map(b=>b.getAttribute("gdg-raw-value")??""),formatted:[...p].map(b=>b.textContent??""),format:"string-array"})}else if(h!==null)o==null||o.push({rawValue:$0(h),formatted:a.textContent??"",format:m});else{let p=a.textContent??"";d&&(p=p.replace(/\n(?!\n)/g,"")),o==null||o.push({rawValue:p??"",formatted:p??"",format:m})}}}return o!==void 0&&i.push(o),i}function W0(e,t,n,r,i){var s;const o=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if((e==null?void 0:e.current)===void 0)break;const a=(s=e.current)==null?void 0:s.range,u=[];if(a.width>2){const g=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof g=="function")return o;u.push(...g);const h=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof h=="function")return o;u.push(...h)}else{const g=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof g=="function")return o;u.push(...g)}let c=a.x-n,d=a.x+a.width-1-n;for(const g of u)for(const h of g)h.span!==void 0&&(c=Math.min(h.span[0],c),d=Math.max(h.span[1],d));c===a.x-n&&d===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:a.y,width:d-c+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function Pu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function U0(e){let t;(function(s){s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,`
|
168
|
+
`);let l=0;for(const s of e){switch(o){case t.None:s===" "||s===`
|
169
|
+
`?(r.push(e.slice(i,l)),i=l+1,s===`
|
170
|
+
`&&(n.push(r),r=[])):s==='"'&&(o=t.inString);break;case t.inString:s==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?o=t.inString:((s===" "||s===`
|
171
|
+
`)&&(r.push(Pu(e.slice(i,l))),i=l+1,s===`
|
172
|
+
`&&(n.push(r),r=[])),o=t.None);break}l++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(s=>s.map(a=>({rawValue:a,formatted:a,format:"string"})))}function _u(e,t,n){var s;const r=B0(e,t),i=a=>{var u;(u=window.navigator.clipboard)==null||u.writeText(a)},o=(a,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},l=(a,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",a),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(a,u)||i(a)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?l(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Ad(e){return e!==!0}function Lu(e){return typeof e=="string"?e:`${e}px`}const q0=()=>e=>e.innerWidth,Y0=()=>e=>e.innerHeight,X0=bn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[q0()],"wmyidgi-1":[Y0()]}}),G0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(X0,{innerHeight:Lu(n),innerWidth:Lu(t),...i},r)},j0=2,K0=1300;function Z0(e,t,n){const r=qt.useRef(0),[i,o]=e??[0,0];qt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let l=!1,s=0;const a=u=>{var c;if(!l){if(s===0)s=u;else{const d=u-s;r.current=Math.min(1,r.current+d/K0);const g=r.current**1.618*d*j0;(c=t.current)==null||c.scrollBy(i*g,o*g),s=u,n==null||n()}window.requestAnimationFrame(a)}};return window.requestAnimationFrame(a),()=>{l=!0}},[t,i,o,n])}function J0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:l,remSize:s}){const[a,u,c,d,g,h]=qt.useMemo(()=>{if(!l||s===16)return[e,t,n,r,i,o];const m=s/16,p=e,b=Cd();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,s,e,l,r]);return{rowHeight:a,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const Dr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function dt(e,t){return e===!0?t:e===!1?"":e}function Fu(e){const t=ca.value;return{activateCell:dt(e.activateCell," |Enter|shift+Enter"),clear:dt(e.clear,"any+Escape"),closeOverlay:dt(e.closeOverlay,"any+Escape"),acceptOverlayDown:dt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:dt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:dt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:dt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:dt(e.delete,t?"Backspace|Delete":"Delete"),downFill:dt(e.downFill,"primary+_68"),scrollToSelectedCell:dt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:dt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:dt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:dt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:dt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:dt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:dt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:dt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:dt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:dt(e.goToFirstCell,"primary+Home"),goToFirstColumn:dt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:dt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:dt(e.goToLastCell,"primary+End"),goToLastColumn:dt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:dt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:dt(e.goToNextPage,"PageDown"),goToPreviousPage:dt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:dt(e.rightFill,"primary+_82"),search:dt(e.search,"primary+f"),selectAll:dt(e.selectAll,"primary+a"),selectColumn:dt(e.selectColumn,"ctrl+ "),selectGrowDown:dt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:dt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:dt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:dt(e.selectGrowUp,"shift+ArrowUp"),selectRow:dt(e.selectRow,"shift+ "),selectToFirstCell:dt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:dt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:dt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:dt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:dt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:dt(e.selectToLastRow,"primary+shift+ArrowDown")}}function Q0(e){const t=am(e);return qt.useMemo(()=>{if(t===void 0)return Fu(Dr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Dr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Dr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Dr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Dr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Dr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Dr.selectToLastCell};return Fu({...Dr,...n})},[t])}function ev(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const l={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(l.subGroups=r.subGroups.map((s,a)=>t(s,i+1,[...o,a])).sort((s,a)=>s.headerIndex-a.headerIndex)),l}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Js(e,t){const n=[];function r(s,a,u=!1){let c=a!==null?a-s.headerIndex:t-s.headerIndex;if(s.subGroups!==void 0&&(c=s.subGroups[0].headerIndex-s.headerIndex),c--,n.push({rowIndex:-1,headerIndex:s.headerIndex,contentIndex:-1,skip:u,isCollapsed:s.isCollapsed,depth:s.depth,path:s.path,rows:c}),s.subGroups)for(let d=0;d<s.subGroups.length;d++){const g=d<s.subGroups.length-1?s.subGroups[d+1].headerIndex:a;r(s.subGroups[d],g,u||s.isCollapsed)}}const i=ev(e.groups);for(let s=0;s<i.length;s++){const a=s<i.length-1?i[s+1].headerIndex:null;r(i[s],a)}let o=0,l=0;for(const s of n)s.contentIndex=l,l+=s.rows,s.rowIndex=o,o+=s.isCollapsed?1:s.rows+1;return n.filter(s=>s.skip===!1).map(s=>{const{skip:a,...u}=s;return u})}function Is(e,t){if(t===void 0||Js.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function tv(e,t,n,r){const i=qt.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]),o=qt.useMemo(()=>i==null?void 0:i.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),l=qt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),s=qt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o!=null&&o[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),a=qt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Or(r??(e==null?void 0:e.themeOverride),qt.useCallback(c=>{if(e===void 0)return r==null?void 0:r(c,c,c);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Is(c,i);return d?e.themeOverride:r==null?void 0:r(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:s,rows:t,rowNumberMapper:a,getRowThemeOverride:u}:{rowHeight:s,rows:l,rowNumberMapper:a,getRowThemeOverride:u}}function nv(e,t){const n=qt.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:qt.useCallback(r=>{if(typeof r=="number")return Is(r,n);const i=Is(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Hd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,l)=>l===r?{...o,...n}:o):e.map((o,l)=>l===r?{...o,subGroups:Hd(o.subGroups??[],i,n)}:o)}function zd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:zd(e[n].subGroups??[],r)}function rv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function iv(e,t,n,r,i){const[o,l]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,o]),[a,u,c]=om(s),d=f.useRef(i);d.current=i;const g=rv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(a.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const m=(a.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:a,setVisibleRegion:u,scrollRef:g}}const ov=f.lazy(async()=>await Fs(()=>import("./data-grid-overlay-editor.0g3IWOH4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let av=0;function sv(e){return up(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return Lr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Wo(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 Uo={kind:te.Loading,allowOverlay:!1},qo={columns:bt.empty(),rows:bt.empty(),current:void 0},lv=(e,t)=>{var Tl,Dl,Ol;const[n,r]=f.useState(qo),[i,o]=f.useState(),l=f.useRef(null),s=f.useRef(null),[a,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:b,columns:w,rows:v,getCellContent:x,onCellClicked:O,onCellActivated:S,onFillPattern:R,onFinishedEditing:_,coercePasteValue:E,drawHeader:k,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:M="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:G,onHeaderContextMenu:ie,getCellsForSelection:Q,onGroupHeaderContextMenu:X,onGroupHeaderRenamed:ne,onCellEdited:ae,onCellsEdited:le,onSearchResultsChanged:Oe,searchResults:J,onSearchValueChange:F,searchValue:P,onKeyDown:B,onKeyUp:he,keybindings:Te,editOnType:Fe=!0,onRowAppended:ge,onColumnMoved:ze,validateCell:Ie,highlightRegions:je,rangeSelect:wt="rect",columnSelect:nt="multi",rowSelect:oe="multi",rangeSelectionBlending:He="exclusive",columnSelectionBlending:me="exclusive",rowSelectionBlending:ue="exclusive",onDelete:ce,onDragStart:Ve,onMouseMove:_e,onPaste:rt,copyHeaders:de=!1,freezeColumns:pe=0,cellActivationBehavior:st="second-click",rowSelectionMode:ke="auto",onHeaderMenuClick:Qe,onHeaderIndicatorClick:yt,getGroupDetails:mt,rowGrouping:$e,onSearchClose:Dt,onItemHovered:Xt,onSelectionCleared:It,showSearch:zt,onVisibleRegionChanged:Qt,gridSelection:Ot,onGridSelectionChange:Rn,minColumnWidth:Wt=50,maxColumnWidth:pt=500,maxColumnAutoWidth:un,provideEditor:hn,trailingRowOptions:Pe,freezeTrailingRows:At=0,allowedFillDirections:gn="orthogonal",scrollOffsetX:mn,scrollOffsetY:wn,verticalBorder:ot,onDragOverCell:Gt,onDrop:Pt,onColumnResize:on,onColumnResizeEnd:Rt,onColumnResizeStart:Vt,customRenderers:et,fillHandle:_t,experimental:Tt,fixedShadowX:$t,fixedShadowY:Nt,headerIcons:En,imageWindowLoader:tr,initialSize:On,isDraggable:$,onDragLeave:tt,onRowMoved:Ne,overscrollX:Ht,overscrollY:Sn,preventDiagonalScrolling:ve,rightElement:ut,rightElementProps:Zt,trapFocus:Lt=!1,smoothScrollX:tn,smoothScrollY:Pn,scaleToRem:ri=!1,rowHeight:dr=34,headerHeight:fr=36,groupHeaderHeight:nr=fr,theme:zr,isOutsideClick:Sr,renderers:Mi,resizeIndicator:Ea,scrollToActiveCell:Ri=!0,drawFocusRing:Ei=!0}=e,Vr=Ei==="no-editor"?i===void 0:Ei,jt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,In=(jt==null?void 0:jt.kind)??e.rowMarkers??"none",Ii=(jt==null?void 0:jt.width)??e.rowMarkerWidth,Ti=(jt==null?void 0:jt.startIndex)??e.rowMarkerStartIndex??1,ii=(jt==null?void 0:jt.theme)??e.rowMarkerTheme,hr=jt==null?void 0:jt.headerTheme,gr=jt==null?void 0:jt.headerAlwaysVisible,$r=oe!=="multi"||(jt==null?void 0:jt.headerDisabled)===!0,rr=(jt==null?void 0:jt.checkboxStyle)??"square",ir=Math.max(Wt,20),Nr=Math.max(pt,ir),bo=Math.max(un??Nr,ir),Di=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ke,rowNumberMapper:wo,rowHeight:yo,getRowThemeOverride:Vn}=tv($e,v,dr,h),Co=f.useMemo(()=>Number.parseFloat(Di.fontSize),[Di]),{rowHeight:Xn,headerHeight:Oi,groupHeaderHeight:So,theme:xo,overscrollX:Ia,overscrollY:Ta}=J0({groupHeaderHeight:nr,headerHeight:fr,overscrollX:Ht,overscrollY:Sn,remSize:Co,rowHeight:yo,scaleToRem:ri,theme:zr}),$n=Q0(Te),xr=Ii??(v>1e4?48:v>1e3?44:v>100?36:32),Nn=In!=="none",U=Nn?1:0,Jt=ge!==void 0,kr=(Pe==null?void 0:Pe.sticky)===!0,[oi,ai]=f.useState(!1),Pi=zt??oi,Da=f.useCallback(()=>{Dt!==void 0?Dt():ai(!1)},[Dt]),K=f.useMemo(()=>Ot===void 0?void 0:Wo(Ot,U),[Ot,U])??n,cn=f.useRef();cn.current===void 0&&(cn.current=new AbortController),f.useEffect(()=>()=>cn==null?void 0:cn.current.abort(),[]);const[dn,Oa]=A0(Q,x,U,cn.current,Ke),V=f.useCallback((y,A,H)=>{if(Ie===void 0)return!0;const W=[y[0]-U,y[1]];return Ie==null?void 0:Ie(W,A,H)},[U,Ie]),se=f.useRef(Ot),we=f.useCallback((y,A)=>{A&&(y=W0(y,dn,U,M,cn.current)),Rn!==void 0?(se.current=Wo(y,-U),Rn(se.current)):r(y)},[Rn,dn,U,M]),Ce=Or(on,f.useCallback((y,A,H,W)=>{on==null||on(w[H-U],A,H-U,W)},[on,U,w])),fe=Or(Rt,f.useCallback((y,A,H,W)=>{Rt==null||Rt(w[H-U],A,H-U,W)},[Rt,U,w])),xe=Or(Vt,f.useCallback((y,A,H,W)=>{Vt==null||Vt(w[H-U],A,H-U,W)},[Vt,U,w])),it=Or(k,f.useCallback((y,A)=>(k==null?void 0:k({...y,columnIndex:y.columnIndex-U},A))??!1,[k,U])),at=Or(L,f.useCallback((y,A)=>(L==null?void 0:L({...y,col:y.col-U},A))??!1,[L,U])),Re=f.useCallback(y=>{if(ce!==void 0){const A=ce(Wo(y,-U));return typeof A=="boolean"?A:Wo(A,U)}return!0},[ce,U]),[kt,Se,We]=F0(K,we,He,me,ue,wt,T),Ue=f.useMemo(()=>br(Cd(),xo),[xo]),[gt,ln]=f.useState([0,0,0]),Tn=f.useMemo(()=>{if(Mi===void 0)return{};const y={};for(const A of Mi)y[A.kind]=A;return y},[Mi]),St=f.useCallback(y=>y.kind!==te.Custom?Tn[y.kind]:et==null?void 0:et.find(A=>A.isMatch(y)),[et,Tn]);let{sizedColumns:en,nonGrowWidth:Gn}=ep(w,Ke,Oa,gt[0]-(U===0?0:xr)-gt[2],ir,bo,Ue,St,cn.current);In!=="none"&&(Gn+=xr);const xn=f.useMemo(()=>en.some(y=>y.group!==void 0),[en]),Et=xn?Oi+So:Oi,Dn=K.rows.length,_n=In==="none"?void 0:Dn===0?!1:Dn===Ke?!0:void 0,xt=f.useMemo(()=>In==="none"?en:[{title:"",width:xr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ii,rowMarker:rr,rowMarkerChecked:_n,headerRowMarkerTheme:hr,headerRowMarkerAlwaysVisible:gr,headerRowMarkerDisabled:$r},...en],[In,en,xr,ii,rr,_n,hr,gr,$r]),nn=f.useRef({height:1,width:1,x:0,y:0}),Mr=f.useRef(!1),{setVisibleRegion:Rr,visibleRegion:Br,scrollRef:Ut}=iv(mn,wn,Xn,nn,()=>Mr.current=!0);nn.current=Br;const _f=Br.x+U,ko=Br.y,fn=f.useRef(null),kn=f.useCallback(y=>{var A;y===!0?(A=fn.current)==null||A.focus():window.requestAnimationFrame(()=>{var H;(H=fn.current)==null||H.focus()})},[]),yn=Jt?Ke+1:Ke,Bn=f.useCallback(y=>{const A=U===0?y:y.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),H=le==null?void 0:le(A);if(H!==!0)for(const W of A)ae==null||ae(W.location,W.value);return H},[ae,le,U]),[Wr,Pa]=f.useState(),Mo=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,si=Vr?(Tl=K.current)==null?void 0:Tl.cell:void 0,Ro=si==null?void 0:si[0],Eo=si==null?void 0:si[1],Lf=f.useMemo(()=>{if((je===void 0||je.length===0)&&(Mo??Ro??Eo??Wr)===void 0)return;const y=[];if(je!==void 0)for(const A of je){const H=xt.length-A.range.x-U;H>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(H,A.range.width)},style:A.style})}return Wr!==void 0&&y.push({color:Zr(Ue.accentColor,0),range:Wr,style:"dashed"}),Mo!==void 0&&y.push({color:Zr(Ue.accentColor,.5),range:Mo,style:"solid-outline"}),Ro!==void 0&&Eo!==void 0&&y.push({color:Ue.accentColor,range:{x:Ro,y:Eo,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Wr,Mo,Ro,Eo,je,xt.length,Ue.accentColor,U]),ml=f.useRef(xt);ml.current=xt;const Ln=f.useCallback(([y,A],H=!1)=>{var Z,Y,j,ee,re,be,De;const W=Jt&&A===yn-1;if(y===0&&Nn){if(W)return Uo;const ye=wo(A);return ye===void 0?Uo:{kind:Yn.Marker,allowOverlay:!1,checkboxStyle:rr,checked:(K==null?void 0:K.rows.hasIndex(A))===!0,markerKind:In==="clickable-number"?"number":In,row:Ti+ye,drawHandle:Ne!==void 0,cursor:In==="clickable-number"?"pointer":void 0}}else if(W){const Ae=y===U?(Pe==null?void 0:Pe.hint)??"":"",Ee=ml.current[y];if(((Z=Ee==null?void 0:Ee.trailingRowOptions)==null?void 0:Z.disabled)===!0)return Uo;{const vt=((Y=Ee==null?void 0:Ee.trailingRowOptions)==null?void 0:Y.hint)??Ae,qe=((j=Ee==null?void 0:Ee.trailingRowOptions)==null?void 0:j.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:Yn.NewRow,hint:vt,allowOverlay:!1,icon:qe}}}else{const ye=y-U;if(H||(Tt==null?void 0:Tt.strict)===!0){const Ee=nn.current,vt=Ee.x>ye||ye>Ee.x+Ee.width||Ee.y>A||A>Ee.y+Ee.height||A>=La.current,qe=ye===((re=(ee=Ee.extras)==null?void 0:ee.selected)==null?void 0:re[0])&&A===((be=Ee.extras)==null?void 0:be.selected[1]);let Le=!1;if(((De=Ee.extras)==null?void 0:De.freezeRegions)!==void 0){for(const Mt of Ee.extras.freezeRegions)if(Kr(Mt,ye,A)){Le=!0;break}}if(vt&&!qe&&!Le)return Uo}let Ae=x([ye,A]);return U!==0&&Ae.span!==void 0&&(Ae={...Ae,span:[Ae.span[0]+U,Ae.span[1]+U]}),Ae}},[Jt,yn,Nn,wo,rr,K==null?void 0:K.rows,In,Ti,Ne,U,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Tt==null?void 0:Tt.strict,x]),_a=f.useCallback(y=>{let A=(mt==null?void 0:mt(y))??{name:y};return ne!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:H=>Aa({group:A.name,bounds:H.bounds})}]}),A},[mt,ne]),Io=f.useCallback(y=>{var j;const[A,H]=y.cell,W=xt[A],q=(W==null?void 0:W.group)!==void 0?(j=_a(W.group))==null?void 0:j.overrideTheme:void 0,Z=W==null?void 0:W.themeOverride,Y=Vn==null?void 0:Vn(H);o({...y,theme:br(Ue,q,Z,Y,y.content.themeOverride)})},[Vn,xt,_a,Ue]),li=f.useCallback((y,A,H)=>{var Y;if(K.current===void 0)return;const[W,q]=K.current.cell,Z=Ln([W,q]);if(Z.kind!==te.Boolean&&Z.allowOverlay){let j=Z;if(H!==void 0)switch(j.kind){case te.Number:{const ee=_g(()=>H==="-"?-0:Number.parseFloat(H),0);j={...j,data:Number.isNaN(ee)?0:ee};break}case te.Text:case te.Markdown:case te.Uri:j={...j,data:H};break}Io({target:y,content:j,initialValue:H,cell:[W,q],highlight:H===void 0,forceEditMode:H!==void 0})}else Z.kind===te.Boolean&&A&&Z.readonly!==!0&&(Bn([{location:K.current.cell,value:{...Z,data:Ad(Z.data)}}]),(Y=fn.current)==null||Y.damage([{cell:K.current.cell}]))},[Ln,K,Bn,Io]),pl=f.useCallback((y,A)=>{var q;const H=(q=fn.current)==null?void 0:q.getBounds(y,A);if(H===void 0||Ut.current===null)return;const W=Ln([y,A]);W.allowOverlay&&Io({target:H,content:W,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[Ln,Ut,Io]),an=f.useCallback((y,A,H="both",W=0,q=0,Z=void 0)=>{if(Ut.current!==null){const Y=fn.current,j=s.current,ee=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,re=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,be=typeof y!="number"&&y.unit==="px"?y.amount:void 0,De=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(Y!==null&&j!==null){let ye={x:0,y:0,width:0,height:0},Ae=0,Ee=0;if((ee!==void 0||re!==void 0)&&(ye=Y.getBounds((ee??0)+U,re??0)??ye,ye.width===0||ye.height===0))return;const vt=j.getBoundingClientRect(),qe=vt.width/j.offsetWidth;if(be!==void 0&&(ye={...ye,x:be-vt.left-Ut.current.scrollLeft,width:1}),De!==void 0&&(ye={...ye,y:De+vt.top-Ut.current.scrollTop,height:1}),ye!==void 0){const Le={x:ye.x-W,y:ye.y-q,width:ye.width+2*W,height:ye.height+2*q};let Mt=0;for(let Wa=0;Wa<pe;Wa++)Mt+=en[Wa].width;let Kt=0;const sn=At+(kr?1:0);sn>0&&(Kt=ti(yn,sn,Xn));let Zn=Mt*qe+vt.left+U*xr*qe,ar=vt.right,Jn=vt.top+Et*qe,sr=vt.bottom-Kt*qe;const Fo=ye.width+W*2;switch(Z==null?void 0:Z.hAlign){case"start":ar=Zn+Fo;break;case"end":Zn=ar-Fo;break;case"center":Zn=Math.floor((Zn+ar)/2)-Fo/2,ar=Zn+Fo;break}const Ao=ye.height+q*2;switch(Z==null?void 0:Z.vAlign){case"start":sr=Jn+Ao;break;case"end":Jn=sr-Ao;break;case"center":Jn=Math.floor((Jn+sr)/2)-Ao/2,sr=Jn+Ao;break}Zn>Le.x?Ae=Le.x-Zn:ar<Le.x+Le.width&&(Ae=Le.x+Le.width-ar),Jn>Le.y?Ee=Le.y-Jn:sr<Le.y+Le.height&&(Ee=Le.y+Le.height-sr),H==="vertical"||typeof y=="number"&&y<pe?Ae=0:(H==="horizontal"||typeof A=="number"&&A>=yn-sn)&&(Ee=0),(Ae!==0||Ee!==0)&&(qe!==1&&(Ae/=qe,Ee/=qe),Ut.current.scrollTo({left:Ae+Ut.current.scrollLeft,top:Ee+Ut.current.scrollTop,behavior:(Z==null?void 0:Z.behavior)??"auto"}))}}}},[U,At,xr,Ut,Et,pe,en,yn,kr,Xn]),vl=f.useRef(pl),bl=f.useRef(x),La=f.useRef(Ke);vl.current=pl,bl.current=x,La.current=Ke;const ui=f.useCallback(async(y,A=!0,H)=>{var re;const W=xt[y];if(((re=W==null?void 0:W.trailingRowOptions)==null?void 0:re.disabled)===!0)return;const q=ge==null?void 0:ge();let Z,Y=!0;q!==void 0&&(Z=await q,Z==="top"&&(Y=!1),typeof Z=="number"&&(Y=!1));let j=0;const ee=()=>{if(La.current<=Ke){j<500&&window.setTimeout(ee,j),j=50+j*2;return}const be=typeof Z=="number"?Z:Y?Ke:0;Lo.current(y-U,be,"both",0,0,H?{behavior:H}:void 0),kt({cell:[y,be],range:{x:y,y:be,width:1,height:1}},!1,!1,"edit");const De=bl.current([y-U,be]);De.allowOverlay&&eo(De)&&De.readonly!==!0&&A&&window.setTimeout(()=>{vl.current(y,be)},0)};ee()},[xt,ge,U,Ke,kt]),To=f.useCallback(y=>{var H,W;const A=((W=(H=en[y])==null?void 0:H.trailingRowOptions)==null?void 0:W.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof A=="number")return A+(Nn?1:0);if(typeof A=="object"){const q=w.indexOf(A);if(q>=0)return q+(Nn?1:0)}},[en,w,Nn,Pe==null?void 0:Pe.targetColumn]),Er=f.useRef(),ci=f.useRef(),Li=f.useCallback((y,A)=>{var q;const[H,W]=A;return br(Ue,(q=xt[H])==null?void 0:q.themeOverride,Vn==null?void 0:Vn(W),y.themeOverride)},[Vn,xt,Ue]),{mapper:Ur}=nv($e,v),jn=$e==null?void 0:$e.navigationBehavior,Fi=f.useCallback(y=>{var be,De,ye;const A=ca.value?y.metaKey:y.ctrlKey,H=A&&oe==="multi",W=A&&nt==="multi",[q,Z]=y.location,Y=K.columns,j=K.rows,[ee,re]=((be=K.current)==null?void 0:be.cell)??[];if(y.kind==="cell"){if(ci.current=void 0,qr.current=[q,Z],q===0&&Nn){if(Jt===!0&&Z===Ke||In==="number"||oe==="none")return;const Ae=Ln(y.location);if(Ae.kind!==Yn.Marker)return;if(Ne!==void 0){const qe=St(Ae);Hn((qe==null?void 0:qe.kind)===Yn.Marker);const Le=(De=qe==null?void 0:qe.onClick)==null?void 0:De.call(qe,{...y,cell:Ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Li(Ae,y.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Ae.checked)return}o(void 0),kn();const Ee=j.hasIndex(Z),vt=Er.current;if(oe==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&vt!==void 0&&j.hasIndex(vt)){const qe=[Math.min(vt,Z),Math.max(vt,Z)+1];H||ke==="multi"?Se(void 0,qe,!0):Se(bt.fromSingleSelection(qe),void 0,H)}else oe==="multi"&&(H||y.isTouch||ke==="multi")?Ee?Se(j.remove(Z),void 0,!0):(Se(void 0,Z,!0),Er.current=Z):Ee&&j.length===1?Se(bt.empty(),void 0,A):(Se(bt.fromSingleSelection(Z),void 0,A),Er.current=Z)}else if(q>=U&&Jt&&Z===Ke){const Ae=To(q);ui(Ae??q)}else if(ee!==q||re!==Z){const Ae=Ln(y.location),Ee=St(Ae);if((Ee==null?void 0:Ee.onSelect)!==void 0){let Le=!1;if(Ee.onSelect({...y,cell:Ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Le=!0,theme:Li(Ae,y.location)}),Le)return}if(jn==="block"&&Ur(Z).isGroupHeader)return;const vt=kr&&Z===Ke,qe=kr&&K!==void 0&&((ye=K.current)==null?void 0:ye.cell[1])===Ke;if((y.shiftKey||y.isLongTouch===!0)&&ee!==void 0&&re!==void 0&&K.current!==void 0&&!qe){if(vt)return;const Le=Math.min(q,ee),Mt=Math.max(q,ee),Kt=Math.min(Z,re),sn=Math.max(Z,re);kt({...K.current,range:{x:Le,y:Kt,width:Mt-Le+1,height:sn-Kt+1}},!0,A,"click"),Er.current=void 0,kn()}else kt({cell:[q,Z],range:{x:q,y:Z,width:1,height:1}},!0,A,"click"),Er.current=void 0,o(void 0),kn()}}else if(y.kind==="header")if(qr.current=[q,Z],o(void 0),Nn&&q===0)Er.current=void 0,ci.current=void 0,!$r&&oe==="multi"&&(j.length!==Ke?Se(bt.fromSingleSelection([0,Ke]),void 0,A):Se(bt.empty(),void 0,A),kn());else{const Ae=ci.current;if(nt==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Ae!==void 0&&Y.hasIndex(Ae)){const Ee=[Math.min(Ae,q),Math.max(Ae,q)+1];W?We(void 0,Ee,A):We(bt.fromSingleSelection(Ee),void 0,A)}else W?(Y.hasIndex(q)?We(Y.remove(q),void 0,A):We(void 0,q,A),ci.current=q):nt!=="none"&&(Y.hasIndex(q)?We(Y.remove(q),void 0,A):We(bt.fromSingleSelection(q),void 0,A),ci.current=q);Er.current=void 0,kn()}else y.kind===qn?qr.current=[q,Z]:y.kind===da&&!y.isMaybeScrollbar&&(we(qo,!1),o(void 0),kn(),It==null||It(),Er.current=void 0,ci.current=void 0)},[oe,nt,K,Nn,U,Jt,Ke,In,Ln,Ne,kn,ke,St,Li,Se,To,ui,jn,Ur,kr,kt,We,we,It]),Ai=f.useRef(!1),qr=f.useRef(),wl=f.useRef(Br),Wn=f.useRef(),Ff=f.useCallback(y=>{if(di.current=!1,wl.current=nn.current,y.button!==0&&y.button!==1){Wn.current=void 0;return}const A=performance.now();Wn.current={button:y.button,time:A,location:y.location},(y==null?void 0:y.kind)==="header"&&(Ai.current=!0);const H=y.kind==="cell"&&y.isFillHandle;!H&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:H}),qr.current=void 0,!y.isTouch&&y.button===0&&!H?Fi(y):!y.isTouch&&y.button===1&&(qr.current=y.location))},[K,Fi]),[Fa,Aa]=f.useState(),yl=f.useCallback(y=>{if(y.kind!==qn||nt!=="multi")return;const A=ca.value?y.metaKey:y.ctrlKey,[H]=y.location,W=K.columns;if(H<U)return;const q=xt[H];let Z=H,Y=H;for(let j=H-1;j>=U&&lo(q.group,xt[j].group);j--)Z--;for(let j=H+1;j<xt.length&&lo(q.group,xt[j].group);j++)Y++;if(kn(),A)if(W.hasAll([Z,Y+1])){let j=W;for(let ee=Z;ee<=Y;ee++)j=j.remove(ee);We(j,void 0,A)}else We(void 0,[Z,Y+1],A);else We(bt.fromSingleSelection([Z,Y+1]),void 0,A)},[nt,kn,K.columns,xt,U,We]),di=f.useRef(!1),Do=f.useCallback(async y=>{if(dn!==void 0&&Ce!==void 0){const A=nn.current.y,H=nn.current.height;let W=dn({x:y,y:A,width:1,height:Math.min(H,Ke-A)},cn.current.signal);typeof W!="object"&&(W=await W());const q=en[y-U],Y=document.createElement("canvas").getContext("2d",{alpha:!1});if(Y!==null){Y.font=Ue.baseFontFull;const j=xd(Y,Ue,q,0,W,ir,Nr,!1,St);Ce==null||Ce(q,j.width,y,j.width)}}},[en,dn,Nr,Ue,ir,Ce,U,Ke,St]),[Af,Ha]=f.useState(),fi=f.useCallback(async(y,A)=>{var j,ee;const H=(j=y.current)==null?void 0:j.range;if(H===void 0||dn===void 0||A.current===void 0)return;const W=A.current.range;if(R!==void 0){let re=!1;if(R({fillDestination:{...W,x:W.x-U},patternSource:{...H,x:H.x-U},preventDefault:()=>re=!0}),re)return}let q=dn(H,cn.current.signal);typeof q!="object"&&(q=await q());const Z=q,Y=[];for(let re=0;re<W.width;re++)for(let be=0;be<W.height;be++){const De=[W.x+re,W.y+be];if(fd(De,H))continue;const ye=Z[be%H.height][re%H.width];bi(ye)||!eo(ye)||Y.push({location:De,value:{...ye}})}Bn(Y),(ee=fn.current)==null||ee.damage(Y.map(re=>({cell:re.location})))},[dn,Bn,R,U]),Cl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};fi(y,K)},[fi,K]),Sl=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};fi(y,K)},[fi,K]),Hf=f.useCallback((y,A)=>{var be,De;const H=a;if(u(void 0),Pa(void 0),Ha(void 0),Ai.current=!1,A)return;if((H==null?void 0:H.fillHandle)===!0&&K.current!==void 0&&((be=H.previousSelection)==null?void 0:be.current)!==void 0){if(Wr===void 0)return;const ye={...K,current:{...K.current,range:Id(H.previousSelection.current.range,Wr)}};fi(H.previousSelection,ye),we(ye,!0);return}const[W,q]=y.location,[Z,Y]=qr.current??[],j=()=>{di.current=!0},ee=ye=>{var Ee,vt,qe;const Ae=ye.isTouch||Z===W&&Y===q;if(Ae&&(O==null||O([W-U,q],{...ye,preventDefault:j})),ye.button===1)return!di.current;if(!di.current){const Le=Ln(y.location),Mt=St(Le);if(Mt!==void 0&&Mt.onClick!==void 0&&Ae){const sn=Mt.onClick({...ye,cell:Le,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:Li(Le,y.location),preventDefault:j});sn!==void 0&&!bi(sn)&&pi(sn)&&(Bn([{location:ye.location,value:sn}]),(Ee=fn.current)==null||Ee.damage([{cell:ye.location}]))}if(di.current||K.current===void 0)return!1;let Kt=!1;switch(Le.activationBehaviorOverride??st){case"double-click":case"second-click":{if(((qe=(vt=H==null?void 0:H.previousSelection)==null?void 0:vt.current)==null?void 0:qe.cell)===void 0)break;const[sn,Zn]=K.current.cell,[ar,Jn]=H.previousSelection.current.cell;Kt=W===sn&&W===ar&&q===Zn&&q===Jn&&(ye.isDoubleClick===!0||st==="second-click");break}case"single-click":{Kt=!0;break}}if(Kt)return S==null||S([W-U,q]),li(ye.bounds,!1),!0}return!1},re=y.location[0]-U;if(y.isTouch){const ye=nn.current,Ae=wl.current;if(ye.x!==Ae.x||ye.y!==Ae.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&ro((De=K.current)==null?void 0:De.cell,y.location)){N==null||N([re,y.location[1]],{...y,preventDefault:j});return}else if(y.kind==="header"&&K.columns.hasIndex(W)){ie==null||ie(re,{...y,preventDefault:j});return}else if(y.kind===qn){if(re<0)return;X==null||X(re,{...y,preventDefault:j});return}}y.kind==="cell"?ee(y)||Fi(y):y.kind===qn?z==null||z(re,{...y,preventDefault:j}):(y.kind===Pr&&(C==null||C(re,{...y,preventDefault:j})),Fi(y));return}if(y.kind==="header"){if(re<0)return;y.isEdge?y.isDoubleClick===!0&&Do(W):y.button===0&&W===Z&&q===Y&&(C==null||C(re,{...y,preventDefault:j}))}if(y.kind===qn){if(re<0)return;y.button===0&&W===Z&&q===Y&&(z==null||z(re,{...y,preventDefault:j}),di.current||yl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&ee(y),qr.current=void 0},[a,K,U,Wr,fi,we,O,Ln,St,st,Li,Bn,S,li,N,ie,X,Fi,z,C,Do,yl]),zf=f.useCallback(y=>{const A={...y,location:[y.location[0]-U,y.location[1]]};_e==null||_e(A),a!==void 0&&y.buttons===0&&(u(void 0),Pa(void 0),Ha(void 0),Ai.current=!1),Ha(H=>{var W;return Ai.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===(H==null?void 0:H[0])&&y.scrollEdge[1]===H[1]?H:a===void 0||(((W=Wn.current)==null?void 0:W.location[0])??0)<U?void 0:y.scrollEdge})},[a,_e,U]),Vf=f.useCallback((y,A)=>{Qe==null||Qe(y-U,A)},[Qe,U]),$f=f.useCallback((y,A)=>{yt==null||yt(y-U,A)},[yt,U]),or=(Dl=K==null?void 0:K.current)==null?void 0:Dl.cell,Nf=f.useCallback((y,A,H,W,q,Z)=>{Mr.current=!1;let Y=or;Y!==void 0&&(Y=[Y[0]-U,Y[1]]);const j=pe===0?void 0:{x:0,y:y.y,width:pe,height:y.height},ee=[];j!==void 0&&ee.push(j),At>0&&(ee.push({x:y.x-U,y:Ke-At,width:y.width,height:At}),pe>0&&ee.push({x:0,y:Ke-At,width:pe,height:At}));const re={x:y.x-U,y:y.y,width:y.width,height:Jt&&y.y+y.height>=Ke?y.height-1:y.height,tx:q,ty:Z,extras:{selected:Y,freezeRegion:j,freezeRegions:ee}};nn.current=re,Rr(re),ln([A,H,W]),Qt==null||Qt(re,re.tx,re.ty,re.extras)},[or,U,Jt,Ke,pe,At,Rr,Qt]),Bf=Or(I,f.useCallback((y,A)=>(I==null?void 0:I(y-U,A-U))!==!1,[I,U])),Wf=Or(ze,f.useCallback((y,A)=>{ze==null||ze(y-U,A-U),nt!=="none"&&We(bt.fromSingleSelection(A),void 0,!0)},[nt,ze,U,We])),za=f.useRef(!1),Uf=f.useCallback(y=>{if(y.location[0]===0&&U>0){y.preventDefault();return}Ve==null||Ve({...y,location:[y.location[0]-U,y.location[1]]}),y.defaultPrevented()||(za.current=!0),u(void 0)},[Ve,U]),qf=f.useCallback(()=>{za.current=!1},[]),xl=$e==null?void 0:$e.selectionBehavior,Oo=f.useCallback(y=>{if(xl!=="block-spanning")return;const{isGroupHeader:A,path:H,groupRows:W}=Ur(y);if(A)return[y,y];const q=H[H.length-1],Z=y-q,Y=y+W-q-1;return[Z,Y]},[Ur,xl]),Va=f.useRef(),$a=f.useCallback(y=>{var A,H,W;if(!Ld(y,Va.current)&&(Va.current=y,!(((A=Wn==null?void 0:Wn.current)==null?void 0:A.button)!==void 0&&Wn.current.button>=1))){if(y.buttons!==0&&a!==void 0&&((H=Wn.current)==null?void 0:H.location[0])===0&&y.location[0]===0&&U===1&&oe==="multi"&&a.previousSelection&&!a.previousSelection.rows.hasIndex(Wn.current.location[1])&&K.rows.hasIndex(Wn.current.location[1])){const q=Math.min(Wn.current.location[1],y.location[1]),Z=Math.max(Wn.current.location[1],y.location[1])+1;Se(bt.fromSingleSelection([q,Z]),void 0,!1)}if(y.buttons!==0&&a!==void 0&&K.current!==void 0&&!za.current&&!Ai.current&&(wt==="rect"||wt==="multi-rect")){const[q,Z]=K.current.cell;let[Y,j]=y.location;if(j<0&&(j=nn.current.y),a.fillHandle===!0&&((W=a.previousSelection)==null?void 0:W.current)!==void 0){const ee=a.previousSelection.current.range;j=Math.min(j,Jt?Ke-1:Ke);const re=Bp(ee,Y,j,gn);Pa(re)}else{if(Jt&&Z===Ke)return;if(Jt&&j===Ke)if(y.kind===da)j--;else return;Y=Math.max(Y,U);const be=Oo(Z);j=be===void 0?j:Un(j,be[0],be[1]);const De=Y-q,ye=j-Z,Ae={x:De>=0?q:Y,y:ye>=0?Z:j,width:Math.abs(De)+1,height:Math.abs(ye)+1};kt({...K.current,range:Ae},!0,!1,"drag")}}Xt==null||Xt({...y,location:[y.location[0]-U,y.location[1]]})}},[a,U,oe,K,wt,Xt,Se,Jt,Ke,gn,Oo,kt]),Yf=f.useCallback(()=>{var Y,j;const y=Va.current;if(y===void 0)return;const[A,H]=y.scrollEdge;let[W,q]=y.location;const Z=nn.current;A===-1?W=((j=(Y=Z.extras)==null?void 0:Y.freezeRegion)==null?void 0:j.x)??Z.x:A===1&&(W=Z.x+Z.width),H===-1?q=Math.max(0,Z.y):H===1&&(q=Math.min(Ke-1,Z.y+Z.height)),W=Un(W,0,xt.length-1),q=Un(q,0,Ke-1),$a({...y,location:[W,q]})},[xt.length,$a,Ke]);Z0(Af,Ut,Yf);const Kn=f.useCallback(y=>{if(K.current===void 0)return;const[A,H]=y,[W,q]=K.current.cell,Z=K.current.range;let Y=Z.x,j=Z.x+Z.width,ee=Z.y,re=Z.y+Z.height;const[be,De]=Oo(q)??[0,Ke-1],ye=De+1;if(H!==0)switch(H){case 2:{re=ye,ee=q,an(0,re,"vertical");break}case-2:{ee=be,re=q+1,an(0,ee,"vertical");break}case 1:{ee<q?(ee++,an(0,ee,"vertical")):(re=Math.min(ye,re+1),an(0,re,"vertical"));break}case-1:{re>q+1?(re--,an(0,re,"vertical")):(ee=Math.max(be,ee-1),an(0,ee,"vertical"));break}default:so()}if(A!==0)if(A===2)j=xt.length,Y=W,an(j-1-U,0,"horizontal");else if(A===-2)Y=U,j=W+1,an(Y-U,0,"horizontal");else{let Ae=[];if(dn!==void 0){const Ee=dn({x:Y,y:ee,width:j-Y-U,height:re-ee},cn.current.signal);typeof Ee=="object"&&(Ae=sv(Ee))}if(A===1){let Ee=!1;if(Y<W){if(Ae.length>0){const vt=Lr(Y+1,W+1).find(qe=>!Ae.includes(qe-U));vt!==void 0&&(Y=vt,Ee=!0)}else Y++,Ee=!0;Ee&&an(Y,0,"horizontal")}Ee||(j=Math.min(xt.length,j+1),an(j-1-U,0,"horizontal"))}else if(A===-1){let Ee=!1;if(j>W+1){if(Ae.length>0){const vt=Lr(j-1,W,-1).find(qe=>!Ae.includes(qe-U));vt!==void 0&&(j=vt,Ee=!0)}else j--,Ee=!0;Ee&&an(j-U,0,"horizontal")}Ee||(Y=Math.max(U,Y-1),an(Y-U,0,"horizontal"))}else so()}kt({cell:K.current.cell,range:{x:Y,y:ee,width:j-Y,height:re-ee}},!0,!1,"keyboard-select")},[dn,Oo,K,xt.length,U,Ke,an,kt]),Na=f.useRef(Ri);Na.current=Ri;const Ir=f.useCallback((y,A,H,W)=>{const q=yn-(H?0:1);y=Un(y,U,en.length-1+U),A=Un(A,0,q);const Z=or==null?void 0:or[0],Y=or==null?void 0:or[1];if(y===Z&&A===Y)return!1;if(W&&K.current!==void 0){const j=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&j.push(K.current.range),we({...K,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:j}},!0)}else kt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Na.current&&an(y-U,A),!0},[yn,U,en.length,or,K,an,we,kt]),Xf=f.useCallback((y,A)=>{(i==null?void 0:i.cell)!==void 0&&y!==void 0&&pi(y)&&(Bn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{var q;(q=fn.current)==null||q.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[H,W]=A;if(K.current!==void 0&&(H!==0||W!==0)){const q=K.current.cell[1]===yn-1&&y!==void 0;Ir(Un(K.current.cell[0]+H,0,xt.length-1),Un(K.current.cell[1]+W,0,yn-1),q,!1)}_==null||_(y,A)},[i==null?void 0:i.cell,kn,K,_,Bn,yn,Ir,xt.length]),Gf=f.useMemo(()=>`gdg-overlay-${av++}`,[]),Yr=f.useCallback(y=>{var H,W,q,Z;kn();const A=[];for(let Y=y.x;Y<y.x+y.width;Y++)for(let j=y.y;j<y.y+y.height;j++){const ee=x([Y-U,j]);if(!ee.allowOverlay&&ee.kind!==te.Boolean)continue;let re;if(ee.kind===te.Custom){const be=St(ee),De=(H=be==null?void 0:be.provideEditor)==null?void 0:H.call(be,{...ee,location:[Y-U,j]});(be==null?void 0:be.onDelete)!==void 0?re=be.onDelete(ee):Lg(De)&&(re=(W=De==null?void 0:De.deletedValue)==null?void 0:W.call(De,ee))}else if(pi(ee)&&ee.allowOverlay||ee.kind===te.Boolean){const be=St(ee);re=(q=be==null?void 0:be.onDelete)==null?void 0:q.call(be,ee)}re!==void 0&&!bi(re)&&pi(re)&&A.push({location:[Y,j],value:re})}Bn(A),(Z=fn.current)==null||Z.damage(A.map(Y=>({cell:Y.location})))},[kn,x,St,Bn,U]),Hi=i!==void 0,kl=f.useCallback(y=>{var vt,qe;const A=()=>{y.stopPropagation(),y.preventDefault()},H={didMatch:!1},{bounds:W}=y,q=K.columns,Z=K.rows,Y=$n;if(!Hi&&ct(Y.clear,y,H))we(qo,!1),It==null||It();else if(!Hi&&ct(Y.selectAll,y,H))we({columns:bt.empty(),rows:bt.empty(),current:{cell:((vt=K.current)==null?void 0:vt.cell)??[U,0],range:{x:U,y:0,width:w.length,height:Ke},rangeStack:[]}},!1);else if(ct(Y.search,y,H))(qe=l==null?void 0:l.current)==null||qe.focus({preventScroll:!0}),ai(!0);else if(ct(Y.delete,y,H)){const Le=(Re==null?void 0:Re(K))??!0;if(Le!==!1){const Mt=Le===!0?K:Le;if(Mt.current!==void 0){Yr(Mt.current.range);for(const Kt of Mt.current.rangeStack)Yr(Kt)}for(const Kt of Mt.rows)Yr({x:U,y:Kt,width:w.length,height:1});for(const Kt of Mt.columns)Yr({x:Kt,y:0,width:1,height:Ke})}}if(H.didMatch)return A(),!0;if(K.current===void 0)return!1;let[j,ee]=K.current.cell;const[,re]=K.current.cell;let be=!1,De=!1;if(ct(Y.scrollToSelectedCell,y,H)?Lo.current(j-U,ee):nt!=="none"&&ct(Y.selectColumn,y,H)?q.hasIndex(j)?We(q.remove(j),void 0,!0):nt==="single"?We(bt.fromSingleSelection(j),void 0,!0):We(void 0,j,!0):oe!=="none"&&ct(Y.selectRow,y,H)?Z.hasIndex(ee)?Se(Z.remove(ee),void 0,!0):oe==="single"?Se(bt.fromSingleSelection(ee),void 0,!0):Se(void 0,ee,!0):!Hi&&W!==void 0&&ct(Y.activateCell,y,H)?ee===Ke&&Jt?window.setTimeout(()=>{const Le=To(j);ui(Le??j)},0):(S==null||S([j-U,ee]),li(W,!0)):K.current.range.height>1&&ct(Y.downFill,y,H)?Sl():K.current.range.width>1&&ct(Y.rightFill,y,H)?Cl():ct(Y.goToNextPage,y,H)?ee+=Math.max(1,nn.current.height-4):ct(Y.goToPreviousPage,y,H)?ee-=Math.max(1,nn.current.height-4):ct(Y.goToFirstCell,y,H)?(o(void 0),ee=0,j=0):ct(Y.goToLastCell,y,H)?(o(void 0),ee=Number.MAX_SAFE_INTEGER,j=Number.MAX_SAFE_INTEGER):ct(Y.selectToFirstCell,y,H)?(o(void 0),Kn([-2,-2])):ct(Y.selectToLastCell,y,H)?(o(void 0),Kn([2,2])):Hi?(ct(Y.closeOverlay,y,H)&&o(void 0),ct(Y.acceptOverlayDown,y,H)&&(o(void 0),ee++),ct(Y.acceptOverlayUp,y,H)&&(o(void 0),ee--),ct(Y.acceptOverlayLeft,y,H)&&(o(void 0),j--),ct(Y.acceptOverlayRight,y,H)&&(o(void 0),j++)):(ct(Y.goDownCell,y,H)?ee+=1:ct(Y.goUpCell,y,H)?ee-=1:ct(Y.goRightCell,y,H)?j+=1:ct(Y.goLeftCell,y,H)?j-=1:ct(Y.goDownCellRetainSelection,y,H)?(ee+=1,be=!0):ct(Y.goUpCellRetainSelection,y,H)?(ee-=1,be=!0):ct(Y.goRightCellRetainSelection,y,H)?(j+=1,be=!0):ct(Y.goLeftCellRetainSelection,y,H)?(j-=1,be=!0):ct(Y.goToLastRow,y,H)?ee=Ke-1:ct(Y.goToFirstRow,y,H)?ee=Number.MIN_SAFE_INTEGER:ct(Y.goToLastColumn,y,H)?j=Number.MAX_SAFE_INTEGER:ct(Y.goToFirstColumn,y,H)?j=Number.MIN_SAFE_INTEGER:(wt==="rect"||wt==="multi-rect")&&(ct(Y.selectGrowDown,y,H)?Kn([0,1]):ct(Y.selectGrowUp,y,H)?Kn([0,-1]):ct(Y.selectGrowRight,y,H)?Kn([1,0]):ct(Y.selectGrowLeft,y,H)?Kn([-1,0]):ct(Y.selectToLastRow,y,H)?Kn([0,2]):ct(Y.selectToFirstRow,y,H)?Kn([0,-2]):ct(Y.selectToLastColumn,y,H)?Kn([2,0]):ct(Y.selectToFirstColumn,y,H)&&Kn([-2,0])),De=H.didMatch),jn!==void 0&&jn!=="normal"&&ee!==re){const Le=jn==="skip-up"||jn==="skip"||jn==="block",Mt=jn==="skip-down"||jn==="skip"||jn==="block",Kt=ee<re;if(Kt&&Le){for(;ee>=0&&Ur(ee).isGroupHeader;)ee--;ee<0&&(ee=re)}else if(!Kt&&Mt){for(;ee<Ke&&Ur(ee).isGroupHeader;)ee++;ee>=Ke&&(ee=re)}}const Ae=Ir(j,ee,!1,be),Ee=H.didMatch;return Ee&&(Ae||!De||Lt)&&A(),Ee},[jn,Hi,K,$n,nt,oe,wt,U,Ur,Ke,Ir,we,It,w.length,Re,Lt,Yr,We,Se,Jt,To,ui,S,li,Sl,Cl,Kn]),zi=f.useCallback(y=>{let A=!1;if(B!==void 0&&B({...y,...y.location&&{location:[y.location[0]-U,y.location[1]]},cancel:()=>{A=!0}}),A||kl(y)||K.current===void 0)return;const[H,W]=K.current.cell,q=nn.current;if(Fe&&!y.metaKey&&!y.ctrlKey&&K.current!==void 0&&y.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(y.key)&&y.bounds!==void 0&&eo(x([H-U,Math.max(0,Math.min(W,Ke-1))]))){if((!Jt||W!==Ke)&&(q.y>W||W>q.y+q.height||q.x>H||H>q.x+q.width))return;S==null||S([H-U,W]),li(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[Fe,B,kl,K,x,U,Ke,Jt,S,li]),jf=f.useCallback((y,A)=>{const H=y.location[0]-U;if(y.kind==="header"&&(ie==null||ie(H,{...y,preventDefault:A})),y.kind===qn){if(H<0)return;X==null||X(H,{...y,preventDefault:A})}if(y.kind==="cell"){const[W,q]=y.location;N==null||N([H,q],{...y,preventDefault:A}),Hm(K,y.location)||Ir(W,q,!1,!1)}},[K,N,X,ie,U,Ir]),Ba=f.useCallback(async y=>{var Y,j,ee;if(!$n.paste)return;function A(re,be,De,ye){var Ee,vt;const Ae=typeof De=="object"?(De==null?void 0:De.join(`
|
173
|
+
`))??"":(De==null?void 0:De.toString())??"";if(!bi(re)&&eo(re)&&re.readonly!==!0){const qe=E==null?void 0:E(Ae,re);if(qe!==void 0&&pi(qe))return{location:be,value:qe};const Le=St(re);if(Le===void 0)return;if(Le.kind===te.Custom){Hn(re.kind===te.Custom);const Mt=(Ee=Le.onPaste)==null?void 0:Ee.call(Le,Ae,re.data);return Mt===void 0?void 0:{location:be,value:{...re,data:Mt}}}else{const Mt=(vt=Le.onPaste)==null?void 0:vt.call(Le,Ae,re,{formatted:ye,formattedString:typeof ye=="string"?ye:ye==null?void 0:ye.join(`
|
174
|
+
`),rawValue:De});return Mt===void 0?void 0:(Hn(Mt.kind===re.kind),{location:be,value:Mt})}}}const H=K.columns,W=K.rows,q=((Y=Ut.current)==null?void 0:Y.contains(document.activeElement))===!0||((j=s.current)==null?void 0:j.contains(document.activeElement))===!0;let Z;if(K.current!==void 0?Z=[K.current.range.x,K.current.range.y]:H.length===1?Z=[H.first()??0,0]:W.length===1&&(Z=[U,W.first()??0]),q&&Z!==void 0){let re,be;const De="text/plain",ye="text/html";if(navigator.clipboard.read!==void 0){const qe=await navigator.clipboard.read();for(const Le of qe){if(Le.types.includes(ye)){const Kt=await(await Le.getType(ye)).text(),sn=Ou(Kt);if(sn!==void 0){re=sn;break}}Le.types.includes(De)&&(be=await(await Le.getType(De)).text())}}else if(navigator.clipboard.readText!==void 0)be=await navigator.clipboard.readText();else if(y!==void 0&&(y==null?void 0:y.clipboardData)!==null){if(y.clipboardData.types.includes(ye)){const qe=y.clipboardData.getData(ye);re=Ou(qe)}re===void 0&&y.clipboardData.types.includes(De)&&(be=y.clipboardData.getData(De))}else return;const[Ae,Ee]=Z,vt=[];do{if(rt===void 0){const qe=Ln(Z),Le=be??(re==null?void 0:re.map(Kt=>Kt.map(sn=>sn.rawValue).join(" ")).join(" "))??"",Mt=A(qe,Z,Le,void 0);Mt!==void 0&&vt.push(Mt);break}if(re===void 0){if(be===void 0)return;re=U0(be)}if(rt===!1||typeof rt=="function"&&(rt==null?void 0:rt([Z[0]-U,Z[1]],re.map(qe=>qe.map(Le=>{var Mt;return((Mt=Le.rawValue)==null?void 0:Mt.toString())??""}))))!==!0)return;for(const[qe,Le]of re.entries()){if(qe+Ee>=Ke)break;for(const[Mt,Kt]of Le.entries()){const sn=[Mt+Ae,qe+Ee],[Zn,ar]=sn;if(Zn>=xt.length||ar>=yn)continue;const Jn=Ln(sn),sr=A(Jn,sn,Kt.rawValue,Kt.formatted);sr!==void 0&&vt.push(sr)}}}while(!1);Bn(vt),(ee=fn.current)==null||ee.damage(vt.map(qe=>({cell:qe.location})))}},[E,St,Ln,K,$n.paste,Ut,xt.length,Bn,yn,rt,U,Ke]);vn("paste",Ba,d,!1,!0);const Vi=f.useCallback(async(y,A)=>{var Y,j;if(!$n.copy)return;const H=A===!0||((Y=Ut.current)==null?void 0:Y.contains(document.activeElement))===!0||((j=s.current)==null?void 0:j.contains(document.activeElement))===!0,W=K.columns,q=K.rows,Z=(ee,re)=>{if(!de)_u(ee,re,y);else{const be=re.map(De=>({kind:te.Text,data:w[De].title,displayData:w[De].title,allowOverlay:!1}));_u([be,...ee],re,y)}};if(H&&dn!==void 0){if(K.current!==void 0){let ee=dn(K.current.range,cn.current.signal);typeof ee!="object"&&(ee=await ee()),Z(ee,Lr(K.current.range.x-U,K.current.range.x+K.current.range.width-U))}else if(q!==void 0&&q.length>0){const re=[...q].map(be=>{const De=dn({x:U,y:be,width:w.length,height:1},cn.current.signal);return typeof De=="object"?De[0]:De().then(ye=>ye[0])});if(re.some(be=>be instanceof Promise)){const be=await Promise.all(re);Z(be,Lr(w.length))}else Z(re,Lr(w.length))}else if(W.length>0){const ee=[],re=[];for(const be of W){let De=dn({x:be,y:0,width:1,height:Ke},cn.current.signal);typeof De!="object"&&(De=await De()),ee.push(De),re.push(be-U)}if(ee.length===1)Z(ee[0],re);else{const be=ee.reduce((De,ye)=>De.map((Ae,Ee)=>[...Ae,...ye[Ee]]));Z(be,re)}}}},[w,dn,K,$n.copy,U,Ut,Ke,de]);vn("copy",Vi,d,!1,!1);const Kf=f.useCallback(async y=>{var H,W;if(!(!$n.cut||!(((H=Ut.current)==null?void 0:H.contains(document.activeElement))===!0||((W=s.current)==null?void 0:W.contains(document.activeElement))===!0))&&(await Vi(y),K.current!==void 0)){let q={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:bt.empty(),columns:bt.empty()};const Z=Re==null?void 0:Re(q);if(Z===!1||(q=Z===!0?q:Z,q.current===void 0))return;Yr(q.current.range)}},[Yr,K,$n.cut,Vi,Ut,Re]);vn("cut",Kf,d,!1,!1);const Zf=f.useCallback((y,A)=>{if(Oe!==void 0){U!==0&&(y=y.map(q=>[q[0]-U,q[1]])),Oe(y,A);return}if(y.length===0||A===-1)return;const[H,W]=y[A];c.current!==void 0&&c.current[0]===H&&c.current[1]===W||(c.current=[H,W],Ir(H,W,!1,!1))},[Oe,U,Ir]),[Po,_o]=((Ol=Ot==null?void 0:Ot.current)==null?void 0:Ol.cell)??[],Lo=f.useRef(an);Lo.current=an,f.useLayoutEffect(()=>{var y,A,H,W;Na.current&&!Mr.current&&Po!==void 0&&_o!==void 0&&(Po!==((A=(y=se.current)==null?void 0:y.current)==null?void 0:A.cell[0])||_o!==((W=(H=se.current)==null?void 0:H.current)==null?void 0:W.cell[1]))&&Lo.current(Po,_o),Mr.current=!1},[Po,_o]);const Ml=K.current!==void 0&&(K.current.cell[0]>=xt.length||K.current.cell[1]>=yn);f.useLayoutEffect(()=>{Ml&&we(qo,!1)},[Ml,we]);const Jf=f.useMemo(()=>Jt===!0&&(Pe==null?void 0:Pe.tint)===!0?bt.fromSingleSelection(yn-1):bt.empty(),[yn,Jt,Pe==null?void 0:Pe.tint]),Qf=f.useCallback(y=>typeof ot=="boolean"?ot:(ot==null?void 0:ot(y-U))??!0,[U,ot]),eh=f.useMemo(()=>{if(Fa===void 0||s.current===null)return null;const{bounds:y,group:A}=Fa,H=s.current.getBoundingClientRect();return f.createElement(_0,{bounds:y,group:A,canvasBounds:H,onClose:()=>Aa(void 0),onFinish:W=>{Aa(void 0),ne==null||ne(A,W)}})},[ne,Fa]),th=Math.min(xt.length,pe+(Nn?1:0));f.useImperativeHandle(t,()=>({appendRow:(y,A)=>ui(y+U,A),updateCells:y=>{var A;return U!==0&&(y=y.map(H=>({cell:[H.cell[0]+U,H.cell[1]]}))),(A=fn.current)==null?void 0:A.damage(y)},getBounds:(y,A)=>{var H;if(!((s==null?void 0:s.current)===null||(Ut==null?void 0:Ut.current)===null)){if(y===void 0&&A===void 0){const W=s.current.getBoundingClientRect(),q=W.width/Ut.current.clientWidth;return{x:W.x-Ut.current.scrollLeft*q,y:W.y-Ut.current.scrollTop*q,width:Ut.current.scrollWidth*q,height:Ut.current.scrollHeight*q}}return(H=fn.current)==null?void 0:H.getBounds((y??0)+U,A)}},focus:()=>{var y;return(y=fn.current)==null?void 0:y.focus()},emit:async y=>{switch(y){case"delete":zi({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":zi({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":zi({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 Vi(void 0,!0);break;case"paste":await Ba();break}},scrollTo:an,remeasureColumns:y=>{for(const A of y)Do(A+U)},getMouseArgsForPosition:(y,A,H)=>{if((fn==null?void 0:fn.current)===null)return;const W=fn.current.getMouseArgsForPosition(y,A,H);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[ui,Do,Ut,Vi,zi,Ba,U,an]);const[Rl,El]=or??[],nh=f.useCallback(y=>{const[A,H]=y;if(H===-1){nt!=="none"&&(We(bt.fromSingleSelection(A),void 0,!1),kn());return}Rl===A&&El===H||(kt({cell:y,range:{x:A,y:H,width:1,height:1}},!0,!1,"keyboard-nav"),an(A,H))},[nt,kn,an,Rl,El,kt,We]),[rh,ih]=f.useState(!1),Il=f.useRef(Qc(y=>{ih(y)},5)),oh=f.useCallback(()=>{Il.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&a===void 0&&kt({cell:[U,ko],range:{x:U,y:ko,width:1,height:1}},!0,!1,"keyboard-select")},[ko,K,a,U,kt]),ah=f.useCallback(()=>{Il.current(!1)},[]),[sh,lh]=f.useMemo(()=>{let y;const A=(Tt==null?void 0:Tt.scrollbarWidthOverride)??Ss(),H=Ke+(Jt?1:0);if(typeof Xn=="number")y=Et+H*Xn;else{let q=0;const Z=Math.min(H,10);for(let Y=0;Y<Z;Y++)q+=Xn(Y);q=Math.floor(q/Z),y=Et+H*q}y+=A;const W=xt.reduce((q,Z)=>Z.width+q,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,y)}px`]},[xt,Tt==null?void 0:Tt.scrollbarWidthOverride,Xn,Ke,Jt,Et]),uh=f.useMemo(()=>Zm(Ue),[Ue]);return f.createElement(Sd.Provider,{value:Ue},f.createElement(G0,{style:uh,className:G,inWidth:p??sh,inHeight:b??lh},f.createElement(T0,{fillHandle:_t,drawFocusRing:Vr,experimental:Tt,fixedShadowX:$t,fixedShadowY:Nt,getRowThemeOverride:Vn,headerIcons:En,imageWindowLoader:tr,initialSize:On,isDraggable:$,onDragLeave:tt,onRowMoved:Ne,overscrollX:Ia,overscrollY:Ta,preventDiagonalScrolling:ve,rightElement:ut,rightElementProps:Zt,smoothScrollX:tn,smoothScrollY:Pn,className:G,enableGroups:xn,onCanvasFocused:oh,onCanvasBlur:ah,canvasRef:s,onContextMenu:jf,theme:Ue,cellXOffset:_f,cellYOffset:ko,accessibilityHeight:Br.height,onDragEnd:qf,columns:xt,nonGrowWidth:Gn,drawHeader:it,onColumnProposeMove:Bf,drawCell:at,disabledRows:Jf,freezeColumns:th,lockColumns:U,firstColAccessible:U===0,getCellContent:Ln,minColumnWidth:ir,maxColumnWidth:Nr,searchInputRef:l,showSearch:Pi,onSearchClose:Da,highlightRegions:Lf,getCellsForSelection:dn,getGroupDetails:_a,headerHeight:Oi,isFocused:rh,groupHeaderHeight:xn?So:0,freezeTrailingRows:At+(Jt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:Jt,onColumnResize:Ce,onColumnResizeEnd:fe,onColumnResizeStart:xe,onCellFocused:nh,onColumnMoved:Wf,onDragStart:Uf,onHeaderMenuClick:Vf,onHeaderIndicatorClick:$f,onItemHovered:$a,isFilling:(a==null?void 0:a.fillHandle)===!0,onMouseMove:zf,onKeyDown:zi,onKeyUp:he,onMouseDown:Ff,onMouseUp:Hf,onDragOverCell:Gt,onDrop:Pt,onSearchResultsChanged:Zf,onVisibleRegionChanged:Nf,clientSize:gt,rowHeight:Xn,searchResults:J,searchValue:P,onSearchValueChange:F,rows:yn,scrollRef:Ut,selection:K,translateX:Br.tx,translateY:Br.ty,verticalBorder:Qf,gridRef:fn,getCellRenderer:St,resizeIndicator:Ea}),eh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(ov,{...i,validateCell:V,bloom:D,id:Gf,getCellRenderer:St,className:(Tt==null?void 0:Tt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:hn,imageEditorOverride:g,onFinishEditing:Xf,markdownDivCreateNode:m,isOutsideClick:Sr,customEventTarget:Tt==null?void 0:Tt.eventTarget}))))},uv=f.forwardRef(lv);function Au(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:l,height:s,x:a,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+s/2),g=nd(c,s,o.cellVerticalPadding),h=td(t.contentAlign??"center",a,l,o.cellHorizontalPadding,g),m=ed(h,d,g),p=rd(a+n,u+r,m);return Vs(t)&&p}const cv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:te.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>dv(e,e.cell.data,Vs(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Au(e)&&e.preventDefault()},onClick:e=>{if(Au(e))return{...e.cell,data:Ad(e.cell.data)}},onPaste:(e,t)=>{let n=ia;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=zs),n===t.data?void 0:{...t,data:n}}};function dv(e,t,n,r,i){if(!n&&t===ia)return;const{ctx:o,hoverAmount:l,theme:s,rect:a,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:b}=a;let w=!1;if(i>0){let v=n?1-i+i*l:.4;if(t===ia&&(v*=l),v===0)return;v<1&&(w=!0,o.globalAlpha=v)}Ks(o,s,t,h,m,p,b,u,c,d,r,g),w&&(o.globalAlpha=1)}const fv=bn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),hv=e=>{const{bubbles:t}=e;return f.createElement(fv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},gv={getAccessibilityString:e=>id(e.data),kind:te.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>mv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(hv,{bubbles:t.data})},onPaste:()=>{}};function mv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:l,y:s,width:a,height:u}=n;let c=l+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>l+a)break;const h=ni(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)ur(i,g.x,s+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,s+u/2+cr(i,r))}const pv=bn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),vv=e=>{const{drilldowns:t}=e;return f.createElement(pv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},bv={getAccessibilityString:e=>id(e.data.map(t=>t.text)),kind:te.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>yv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(vv,{drilldowns:t.data})},onPaste:()=>{}},ls={};function wv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,l=n-o*2,s=4,a=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(ls[g]!==void 0)return{el:ls[g],height:a,width:d,middleWidth:s*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=a,m.scale(i,i),ls[g]=h,m.beginPath(),ur(m,o,o,c,l,r),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),ur(m,o+.5,o+.5,c,l,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:a,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function yv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:l,row:s}=e,{x:a,width:u}=n,c=r.baseFontFull,d=Ys(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=r.bubblePadding,b=r.bubbleMargin;let w=a+r.cellHorizontalPadding;const v=r.roundingRadius??6,x=wv(r.bgCell,r.drilldownBorder,g,v),O=[];for(const S of t){if(w>a+u)break;const _=ni(S.text,i,c).width;let E=0;S.img!==void 0&&o.loadOrGetImage(S.img,l,s)!==void 0&&(E=m-8+4);const k=_+E+p*2;O.push({x:w,width:k}),w+=k+b}if(x!==null){const{el:S,height:R,middleWidth:_,sideWidth:E,width:k,dpr:L,padding:D}=x,C=E/L,I=D/L;for(const T of O){const M=Math.floor(T.x),z=Math.floor(T.width),N=z-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,E,R,M-I,h,C,g),N>0&&i.drawImage(S,E,0,_,R,M+(C-I),h,N,g),i.drawImage(S,k-E,0,E,R,M+z-(C-I),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[S,R]of O.entries()){const _=t[S];let E=R.x+p;if(_.img!==void 0){const k=o.loadOrGetImage(_.img,l,s);if(k!==void 0){const L=m-8;let D=0,C=0,I=k.width,T=k.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),ur(i,E,h+g/2-L/2,L,L,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,I,T,E,h+g/2-L/2,L,L),i.restore(),E+=L+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+g/2+cr(i,r))}}const Cv={getAccessibilityString:e=>e.data.join(", "),kind:te.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Sv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??sm;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},us=4;function Sv(e,t,n,r){const{rect:i,col:o,row:l,theme:s,ctx:a,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,m=g-s.cellVerticalPadding*2,p=[];let b=0;for(let v=0;v<t.length;v++){const x=t[v];if(x.length===0)continue;const O=u.loadOrGetImage(x,o,l);if(O!==void 0){p[v]=O;const S=O.width*(m/O.height);b+=S+us}}if(b===0)return;b-=us;let w=c+s.cellHorizontalPadding;r==="right"?w=Math.floor(c+h-s.cellHorizontalPadding-b):r==="center"&&(w=Math.floor(c+h/2-b/2));for(const v of p){if(v===void 0)continue;const x=v.width*(m/v.height);n>0&&(a.beginPath(),ur(a,w,d+s.cellVerticalPadding,x,m,n),a.save(),a.clip()),a.drawImage(v,w,d+s.cellVerticalPadding,x,m),n>0&&a.restore(),w+=x+us}}function xv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const kv={getAccessibilityString:()=>"",kind:te.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(xv(n,r)*t.skeletonWidthVariability));const a=l.cellHorizontalPadding;s+a*2>=o.width&&(s=o.width-a*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*l.cellVerticalPadding);ur(i,o.x+a,o.y+(o.height-u)/2,s,u,l.roundingRadius??3),i.fillStyle=Zr(l.textDark,.1),i.fill()},onPaste:()=>{}},Mv=()=>e=>e.targetWidth,Hu=bn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Mv(),"px"]}}),Rv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:l,validatedSelection:s}=e,a=t.data,u=t.readonly===!0,[c,d]=f.useState(a===""||r),g=f.useCallback(()=>{d(m=>!m)},[]),h=a?"gdg-ml-6":"";return c?f.createElement(Hu,{targetWidth:o.width-20},f.createElement(ei,{autoFocus:!0,highlight:!1,validatedSelection:s,value:a,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t)},f.createElement(em,null))):f.createElement(Hu,{targetWidth:o.width},f.createElement(Rm,{contents:a,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Ns,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Ev={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:po,measure:(e,t,n)=>{const r=t.data.split(`
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>lr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:l,validatedSelection:s}=e;return f.createElement(Rv,{onFinish:i,targetRect:r,value:n,validatedSelection:s,onChange:a=>t({...n,data:a.target.value}),forceEditMode:l,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Iv={getAccessibilityString:e=>e.row.toString(),kind:Yn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Tv,measure:()=>44,draw:e=>Ov(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:l}=t,s=n.drawHandle?7+(o-7)/2:o/2,a=l/2;if(Math.abs(r-s)<=10&&Math.abs(i-a)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Tv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==i&&(n.font=i,o.font=i),o.deprep=Dv,n.textAlign="center",o}function Dv(e){const{ctx:t}=e;t.textAlign="start"}function Ov(e,t,n,r,i,o){const{ctx:l,rect:s,hoverAmount:a,theme:u}=e,{x:c,y:d,width:g,height:h}=s,m=n?1:r==="checkbox-visible"?.6+.4*a:a;if(r!=="number"&&m>0){l.globalAlpha=m;const p=7*(n?a:1);if(Ks(l,u,n,i?c+p:c,d,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){l.globalAlpha=a,l.beginPath();for(const b of[3,6])for(const w of[-5,-1,3])l.rect(c+b,d+h/2+w,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),b=u.markerFontFull,w=c+g/2;r==="both"&&a!==0&&(l.globalAlpha=1-a),l.fillStyle=u.textLight,l.font=b,l.fillText(p,w,d+h/2+cr(l,b)),a!==0&&(l.globalAlpha=1)}}const Pv={getAccessibilityString:()=>"",kind:Yn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>_v(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function _v(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:l,spriteManager:s}=e,{x:a,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(a+1,u+1,c,d-2),r.fillStyle=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=d-8,b=a+8/2,w=u+8/2;s.drawSprite(n,"normal",r,b,w,p,l,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,b=g?0:(1-o)*m*.5,w=l.cellHorizontalPadding+4;p>0&&(r.moveTo(a+w+b,u+d/2),r.lineTo(a+w+b+p,u+d/2),r.moveTo(a+w+b+p*.5,u+d/2-p*.5),r.lineTo(a+w+b+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,h+a+l.cellHorizontalPadding+.5,u+d/2+cr(r,l)),r.beginPath()}function Vd(e,t,n,r,i,o,l){e.textBaseline="alphabetic";const s=Lv(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),ur(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??Zr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}function Lv(e,t,n,r,i){const o=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+l/2+1,width:t.width-o,height:t.height-l-1};const s=ni(n,e,r.baseFontFull,"alphabetic"),a=t.height-l,u=Math.min(a,s.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:s.width+o*3,height:u-1}}const Fv=f.lazy(async()=>await Fs(()=>import("./number-overlay-editor.D6O6Urda.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Av={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:po,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:l}=e,{hoverEffect:s,displayData:a,hoverEffectTheme:u}=n;s===!0&&t>0&&Vd(r,i,u,a,o,t,l),lr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(Fv,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},Hv={getAccessibilityString:()=>"",measure:()=>108,kind:te.Protected,needsHover:!1,needsHoverPosition:!1,draw:zv,onPaste:()=>{}};function zv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:l}=r;t.beginPath();const s=2.5;let a=i+n.cellHorizontalPadding+s;const u=o+l/2,c=Math.cos(nu(30))*s,d=Math.sin(nu(30))*s;for(let g=0;g<12;g++)t.moveTo(a,u-s),t.lineTo(a,u+s),t.moveTo(a+c,u-d),t.lineTo(a-c,u+d),t.moveTo(a-c,u-d),t.lineTo(a+c,u+d),a+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Vv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>po(e,t,e.theme.textLight),draw:e=>lr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return qt.createElement(ei,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:po,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:l,overrideCursor:s}=e,{displayData:a,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Vd(i,l,g,a,o,n,s),lr(e,a,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
176
|
+
`,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(ei,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:l=>r({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Nv=bn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Bv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:l}=e,[s,a]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{a(!0)},[]);return s?f.createElement(ei,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Nv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Ns,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function $d(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,s=e.actualBoundingBoxAscent;return r==="right"?i=t.width-l-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-l/2),{x:i,y:o,width:l,height:s}}function zu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const s=pd(l,o.baseFontFull);if(s===void 0)return!1;const a=$d(s,n,o,t.contentAlign);return Kr({x:a.x-4,y:a.y-4,width:a.width+8,height:a.height+8},r,i)}const Wv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:po,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:l,ctx:s}=e,a=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=ni(a,s,n.baseFontFull),d=$d(c,l,n,t.contentAlign),{x:g,y:h,width:m,height:p}=d;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const b=cr(s,n.baseFontFull);r("pointer");const w=5,v=h-b;s.beginPath(),s.moveTo(l.x+g,Math.floor(l.y+v+p+w)+.5),s.lineTo(l.x+g+m,Math.floor(l.y+v+p+w)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,lr({...e,rect:{...l,x:l.x-1}},a,t.contentAlign),lr({...e,rect:{...l,x:l.x-2}},a,t.contentAlign),lr({...e,rect:{...l,x:l.x+1}},a,t.contentAlign),lr({...e,rect:{...l,x:l.x+2}},a,t.contentAlign),s.restore()}}s.fillStyle=u?n.linkColor:n.textDark,lr(e,a,t.contentAlign)},onSelect:e=>{zu(e)&&e.preventDefault()},onClick:e=>{var r;const{cell:t}=e;zu(e)&&((r=t.onClickUri)==null||r.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(Bv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Uv=[Iv,Pv,cv,gv,bv,Cv,kv,Ev,Av,Hv,Vv,$v,Wv];var cs,Vu;function qv(){if(Vu)return cs;Vu=1;var e=Jc(),t=Tc(),n="Expected a function";function r(i,o,l){var s=!0,a=!0;if(typeof i!="function")throw new TypeError(n);return t(l)&&(s="leading"in l?!!l.leading:s,a="trailing"in l?!!l.trailing:a),e(i,o,{leading:s,maxWait:o,trailing:a})}return cs=r,cs}var Yv=qv();const Xv=yr(Yv),ds=[];class Gv extends wd{constructor(){super(...arguments);ft(this,"imageLoaded",()=>{});ft(this,"loadedLocations",[]);ft(this,"cache",{});ft(this,"sendLoaded",Xv(()=>{this.imageLoaded(new oo(this.loadedLocations)),this.loadedLocations=[]},20));ft(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const i=this.cache[r];let o=!1;for(let l=0;l<i.cells.length;l++){const s=i.cells[l];if(this.isInWindow(s)){o=!0;break}}o?i.cells=i.cells.filter(this.isInWindow):(i.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,i,o){let l=!1;const s=ds.pop()??new Image;let a=!1;const u={img:void 0,cells:[er(r,i)],url:n,cancel:()=>{a||(a=!0,ds.length<12?ds.unshift(s):l||(s.src=""))}},c=new Promise(d=>s.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{s.src=n,await c,await s.decode();const d=this.cache[o];if(d!==void 0&&!a){d.img=s;for(const g of d.cells)this.loadedLocations.push(js(g));l=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,r,i){const o=n,l=this.cache[o];if(l!==void 0){const s=er(r,i);return l.cells.includes(s)||l.cells.push(s),l.img}else this.loadImage(n,r,i,o)}}const jv=(e,t)=>{const n=f.useMemo(()=>({...Vp,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Uv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Gv,[e.imageWindowLoader]);return f.createElement(uv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Kv=f.forwardRef(jv);function $u(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...l)=>{r.current=l,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Nd=ki("div",{target:"ee4nolw0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),_r=ki("div",{target:"ee4nolw1"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),Zv=ki("div",{target:"ee4nolw2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),Nu=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],Jv={number:Nu,progress:Nu,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function Qv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:l}){const s=Jr(),{colors:a,fontSizes:u,radii:c,fontWeights:d}=s,g=Jv[e]||[];return g.length===0?lt(Pc,{}):lt(Sa,{triggerType:_c.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:lt(Nd,{role:"menu",children:g.map(h=>An(_r,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:ya.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Ca(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:l})}const e1=f.memo(Qv);function t1({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:l,onHideColumn:s,columnKind:a,onChangeFormat:u,onAutosize:c}){const d=Jr(),[g,h]=f.useState(!1),{colors:m,fontSizes:p,radii:b,fontWeights:w}=d;f.useEffect(()=>{function x(O){O.preventDefault()}return document.addEventListener("wheel",x,{passive:!1}),document.addEventListener("touchmove",x,{passive:!1}),()=>{document.removeEventListener("wheel",x),document.removeEventListener("touchmove",x)}},[]);const v=f.useCallback(()=>{o()},[o]);return lt(Sa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:An(Nd,{children:[l&&An(Pc,{children:[An(_r,{onClick:()=>{l("asc"),v()},role:"menuitem",children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),An(_r,{onClick:()=>{l("desc"),v()},role:"menuitem",children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),lt(Zv,{})]}),u&<(e1,{columnKind:a,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:v,children:An(_r,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[An("div",{children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&An(_r,{onClick:()=>{c(),v()},children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&An(_r,{onClick:()=>{i(),v()},children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&An(_r,{onClick:()=>{r(),v()},children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),s&&An(_r,{onClick:()=>{s(),v()},children:[lt(mr,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:ya.bottomRight,accessibilityType:Lc.menu,showArrow:!1,popoverMargin:pn("0.375rem"),onClickOutside:g?void 0:v,onEsc:v,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:Ca(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:w.normal,borderTopLeftRadius:b.default,borderTopRightRadius:b.default,borderBottomLeftRadius:b.default,borderBottomRightRadius:b.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:lt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const n1=f.memo(t1),r1="(index)",i1=({label:e,initialValue:t,onChange:n})=>{const r=Jr();return lt(bg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:vg.default,labelPlacement:pg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:i?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:o})=>{const l=o?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&o?`0 0 0 0.2rem ${mi(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},o1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:l,onClose:s})=>{const a=Jr();return lt(Sa,{triggerType:_c.click,placement:ya.bottomRight,autoFocus:!0,focusLock:!0,content:()=>lt("div",{style:{paddingTop:a.spacing.sm,paddingBottom:a.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return lt(i1,{label:!u.title&&u.isIndex?r1:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:l,onClickOutside:s,onClick:()=>l?s():void 0,onEsc:s,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:a.radii.default,borderTopRightRadius:a.radii.default,borderBottomLeftRadius:a.radii.default,borderBottomRightRadius:a.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:Ca(a)?a.colors.bgColor:a.colors.secondaryBg,color:a.colors.bodyText,fontSize:a.fontSizes.sm,fontWeight:a.fontWeights.normal,minWidth:a.sizes.minMenuWidth,maxWidth:`calc(${a.sizes.minMenuWidth} * 2)`,maxHeight:a.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:lt("div",{children:o})})},a1=f.memo(o1);var s1=xh();const l1=yr(s1);var ta={exports:{}};/*! Moment Duration Format v2.2.2
|
177
|
+
* https://github.com/jsmreese/moment-duration-format
|
178
|
+
* Date: 2018-02-16
|
179
|
+
*
|
180
|
+
* Duration format plugin function for the Moment.js library
|
181
|
+
* http://momentjs.com/
|
182
|
+
*
|
183
|
+
* Copyright 2018 John Madhavan-Reese
|
184
|
+
* Released under the MIT license
|
185
|
+
*/var u1=ta.exports,Bu;function c1(){return Bu||(Bu=1,function(e,t){(function(n,r){try{e.exports=r(kh)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(u1,function(n){var r=!1,i=!1,o=!1,l=!1,s="escape years months weeks days hours minutes seconds milliseconds general".split(" "),a=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(F,P){return P.length>F.length?!1:F.indexOf(P)!==-1}function c(F){for(var P="";F;)P+="0",F-=1;return P}function d(F){for(var P=F.split("").reverse(),B=0,he=!0;he&&B<P.length;)B?P[B]==="9"?P[B]="0":(P[B]=(parseInt(P[B],10)+1).toString(),he=!1):(parseInt(P[B],10)<5&&(he=!1),P[B]="0"),B+=1;return he&&P.push("1"),P.reverse().join("")}function g(F,P){var B=_(M(P).sort(),function(Te){return Te+":"+P[Te]}).join(","),he=F+"+"+B;return g.cache[he]||(g.cache[he]=Intl.NumberFormat(F,P)),g.cache[he]}g.cache={};function h(F,P,B){var he=P.useToLocaleString,Te=P.useGrouping,Fe=Te&&P.grouping.slice(),ge=P.maximumSignificantDigits,ze=P.minimumIntegerDigits||1,Ie=P.fractionDigits||0,je=P.groupingSeparator,wt=P.decimalSeparator;if(he&&B){var nt={minimumIntegerDigits:ze,useGrouping:Te};if(Ie&&(nt.maximumFractionDigits=Ie,nt.minimumFractionDigits=Ie),ge&&F>0&&(nt.maximumSignificantDigits=ge),o){if(!l){var oe=T({},P);oe.useGrouping=!1,oe.decimalSeparator=".",F=parseFloat(h(F,oe),10)}return g(B,nt).format(F)}else{if(!i){var oe=T({},P);oe.useGrouping=!1,oe.decimalSeparator=".",F=parseFloat(h(F,oe),10)}return F.toLocaleString(B,nt)}}var He;ge?He=F.toPrecision(ge+1):He=F.toFixed(Ie+1);var me,ue,ce,Ve=He.split("e");ce=Ve[1]||"",Ve=Ve[0].split("."),ue=Ve[1]||"",me=Ve[0]||"";var _e=me.length,rt=ue.length,de=_e+rt,pe=me+ue;(ge&&de===ge+1||!ge&&rt===Ie+1)&&(pe=d(pe),pe.length===de+1&&(_e=_e+1),rt&&(pe=pe.slice(0,-1)),me=pe.slice(0,_e),ue=pe.slice(_e)),ge&&(ue=ue.replace(/0*$/,""));var st=parseInt(ce,10);st>0?ue.length<=st?(ue=ue+c(st-ue.length),me=me+ue,ue=""):(me=me+ue.slice(0,st),ue=ue.slice(st)):st<0&&(ue=c(Math.abs(st)-me.length)+me+ue,me="0"),ge||(ue=ue.slice(0,Ie),ue.length<Ie&&(ue=ue+c(Ie-ue.length)),me.length<ze&&(me=c(ze-me.length)+me));var ke="";if(Te){Ve=me;for(var Qe;Ve.length;)Fe.length&&(Qe=Fe.shift()),ke&&(ke=je+ke),ke=Ve.slice(-Qe)+ke,Ve=Ve.slice(0,-Qe)}else ke=me;return ue&&(ke=ke+wt+ue),ke}function m(F,P){return F.label.length>P.label.length?-1:F.label.length<P.label.length?1:0}function p(F,P){var B=[];return R(M(P),function(he){if(he.slice(0,15)==="_durationLabels"){var Te=he.slice(15).toLowerCase();R(M(P[he]),function(Fe){Fe.slice(0,1)===F&&B.push({type:Te,key:Fe,label:P[he][Fe]})})}}),B}function b(F,P,B){return P===1&&B===null?F:F+F}var w={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:b};function v(F){return Object.prototype.toString.call(F)==="[object Array]"}function x(F){return Object.prototype.toString.call(F)==="[object Object]"}function O(F,P){for(var B=F.length;B-=1;)if(P(F[B]))return F[B]}function S(F,P){var B=0,he=F&&F.length||0,Te;for(typeof P!="function"&&(Te=P,P=function(Fe){return Fe===Te});B<he;){if(P(F[B]))return F[B];B+=1}}function R(F,P){var B=0,he=F.length;if(!(!F||!he))for(;B<he;){if(P(F[B],B)===!1)return;B+=1}}function _(F,P){var B=0,he=F.length,Te=[];if(!F||!he)return Te;for(;B<he;)Te[B]=P(F[B],B),B+=1;return Te}function E(F,P){return _(F,function(B){return B[P]})}function k(F){var P=[];return R(F,function(B){B&&P.push(B)}),P}function L(F){var P=[];return R(F,function(B){S(P,B)||P.push(B)}),P}function D(F,P){var B=[];return R(F,function(he){R(P,function(Te){he===Te&&B.push(he)})}),L(B)}function C(F,P){var B=[];return R(F,function(he,Te){if(!P(he))return B=F.slice(Te),!1}),B}function I(F,P){var B=F.slice().reverse();return C(B,P).reverse()}function T(F,P){for(var B in P)P.hasOwnProperty(B)&&(F[B]=P[B]);return F}function M(F){var P=[];for(var B in F)F.hasOwnProperty(B)&&P.push(B);return P}function z(F,P){var B=0,he=F.length;if(!F||!he)return!1;for(;B<he;){if(P(F[B],B)===!0)return!0;B+=1}return!1}function N(F){var P=[];return R(F,function(B){P=P.concat(B)}),P}function G(){var F=0;try{F.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function ie(F){return F(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function Q(F){var P=!0;return P=P&&F(1,"en",{minimumIntegerDigits:1})==="1",P=P&&F(1,"en",{minimumIntegerDigits:2})==="01",P=P&&F(1,"en",{minimumIntegerDigits:3})==="001",!(!P||(P=P&&F(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",P=P&&F(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",P=P&&F(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",P=P&&F(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!P)||(P=P&&F(99.99,"en",{maximumSignificantDigits:1})==="100",P=P&&F(99.99,"en",{maximumSignificantDigits:2})==="100",P=P&&F(99.99,"en",{maximumSignificantDigits:3})==="100",P=P&&F(99.99,"en",{maximumSignificantDigits:4})==="99.99",P=P&&F(99.99,"en",{maximumSignificantDigits:5})==="99.99",!P)||(P=P&&F(1e3,"en",{useGrouping:!0})==="1,000",P=P&&F(1e3,"en",{useGrouping:!1})==="1000",!P))}function X(){var F=[].slice.call(arguments),P={},B;if(R(F,function(ge,ze){if(!ze){if(!v(ge))throw"Expected array as the first argument to durationsFormat.";B=ge}if(typeof ge=="string"||typeof ge=="function"){P.template=ge;return}if(typeof ge=="number"){P.precision=ge;return}x(ge)&&T(P,ge)}),!B||!B.length)return[];P.returnMomentTypes=!0;var he=_(B,function(ge){return ge.format(P)}),Te=D(s,L(E(N(he),"type"))),Fe=P.largest;return Fe&&(Te=Te.slice(0,Fe)),P.returnMomentTypes=!1,P.outputTypes=Te,_(B,function(ge){return ge.format(P)})}function ne(){var F=[].slice.call(arguments),P=T({},this.format.defaults),B=this.asMilliseconds(),he=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(B=0,he=0);var Te=B<0,Fe=n.duration(Math.abs(B),"milliseconds"),ge=n.duration(Math.abs(he),"months");R(F,function($){if(typeof $=="string"||typeof $=="function"){P.template=$;return}if(typeof $=="number"){P.precision=$;return}x($)&&T(P,$)});var ze={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Ie={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=s;var je=function($){return S(s,function(tt){return Ie[tt].test($)})},wt=new RegExp(_(s,function($){return Ie[$].source}).join("|"),"g");P.duration=this;var nt=typeof P.template=="function"?P.template.apply(P):P.template,oe=P.outputTypes,He=P.returnMomentTypes,me=P.largest,ue=[];oe||(v(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&R(P.stopTrim.match(wt),function($){var tt=je($);tt==="escape"||tt==="general"||ue.push(tt)}));var ce=n.localeData();ce||(ce={}),R(M(w),function($){if(typeof w[$]=="function"){ce[$]||(ce[$]=w[$]);return}ce["_"+$]||(ce["_"+$]=w[$])}),R(M(ce._durationTimeTemplates),function($){nt=nt.replace("_"+$+"_",ce._durationTimeTemplates[$])});var Ve=P.userLocale||n.locale(),_e=P.useLeftUnits,rt=P.usePlural,de=P.precision,pe=P.forceLength,st=P.useGrouping,ke=P.trunc,Qe=P.useSignificantDigits&&de>0,yt=Qe?P.precision:0,mt=yt,$e=P.minValue,Dt=!1,Xt=P.maxValue,It=!1,zt=P.useToLocaleString,Qt=P.groupingSeparator,Ot=P.decimalSeparator,Rn=P.grouping;zt=zt&&(r||o);var Wt=P.trim;v(Wt)&&(Wt=Wt.join(" ")),Wt===null&&(me||Xt||Qe)&&(Wt="all"),(Wt===null||Wt===!0||Wt==="left"||Wt==="right")&&(Wt="large"),Wt===!1&&(Wt="");var pt=function($){return $.test(Wt)},un=/large/,hn=/small/,Pe=/both/,At=/mid/,gn=/^all|[^sm]all/,mn=/final/,wn=me>0||z([un,Pe,gn],pt),ot=z([hn,Pe,gn],pt),Gt=z([At,gn],pt),Pt=z([mn,gn],pt),on=_(nt.match(wt),function($,tt){var Ne=je($);return $.slice(0,1)==="*"&&($=$.slice(1),Ne!=="escape"&&Ne!=="general"&&ue.push(Ne)),{index:tt,length:$.length,text:"",token:Ne==="escape"?$.replace(Ie.escape,"$1"):$,type:Ne==="escape"||Ne==="general"?null:Ne}}),Rt={index:0,length:0,token:"",text:"",type:null},Vt=[];_e&&on.reverse(),R(on,function($){if($.type){(Rt.type||Rt.text)&&Vt.push(Rt),Rt=$;return}_e?Rt.text=$.token+Rt.text:Rt.text+=$.token}),(Rt.type||Rt.text)&&Vt.push(Rt),_e&&Vt.reverse();var et=D(s,L(k(E(Vt,"type"))));if(!et.length)return E(Vt,"text").join("");et=_(et,function($,tt){var Ne=tt+1===et.length,Ht=!tt,Sn;$==="years"||$==="months"?Sn=ge.as($):Sn=Fe.as($);var ve=Math.floor(Sn),ut=Sn-ve,Zt=S(Vt,function(Lt){return $===Lt.type});return Ht&&Xt&&Sn>Xt&&(It=!0),Ne&&$e&&Math.abs(P.duration.as($))<$e&&(Dt=!0),Ht&&pe===null&&Zt.length>1&&(pe=!0),Fe.subtract(ve,$),ge.subtract(ve,$),{rawValue:Sn,wholeValue:ve,decimalValue:Ne?ut:0,isSmallest:Ne,isLargest:Ht,type:$,tokenLength:Zt.length}});var _t=ke?Math.floor:Math.round,Tt=function($,tt){var Ne=Math.pow(10,tt);return _t($*Ne)/Ne},$t=!1,Nt=!1,En=function($,tt){var Ne={useGrouping:st,groupingSeparator:Qt,decimalSeparator:Ot,grouping:Rn,useToLocaleString:zt};return Qe&&(yt<=0?($.rawValue=0,$.wholeValue=0,$.decimalValue=0):(Ne.maximumSignificantDigits=yt,$.significantDigits=yt)),It&&!Nt&&($.isLargest?($.wholeValue=Xt,$.decimalValue=0):($.wholeValue=0,$.decimalValue=0)),Dt&&!Nt&&($.isSmallest?($.wholeValue=$e,$.decimalValue=0):($.wholeValue=0,$.decimalValue=0)),$.isSmallest||$.significantDigits&&$.significantDigits-$.wholeValue.toString().length<=0?de<0?$.value=Tt($.wholeValue,de):de===0?$.value=_t($.wholeValue+$.decimalValue):Qe?(ke?$.value=Tt($.rawValue,yt-$.wholeValue.toString().length):$.value=$.rawValue,$.wholeValue&&(yt-=$.wholeValue.toString().length)):(Ne.fractionDigits=de,ke?$.value=$.wholeValue+Tt($.decimalValue,de):$.value=$.wholeValue+$.decimalValue):Qe&&$.wholeValue?($.value=Math.round(Tt($.wholeValue,$.significantDigits-$.wholeValue.toString().length)),yt-=$.wholeValue.toString().length):$.value=$.wholeValue,$.tokenLength>1&&(pe||$t)&&(Ne.minimumIntegerDigits=$.tokenLength,Nt&&Ne.maximumSignificantDigits<$.tokenLength&&delete Ne.maximumSignificantDigits),!$t&&($.value>0||Wt===""||S(ue,$.type)||S(oe,$.type))&&($t=!0),$.formattedValue=h($.value,Ne,Ve),Ne.useGrouping=!1,Ne.decimalSeparator=".",$.formattedValueEn=h($.value,Ne,"en"),$.tokenLength===2&&$.type==="milliseconds"&&($.formattedValueMS=h($.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),$};if(et=_(et,En),et=k(et),et.length>1){var tr=function($){return S(et,function(tt){return tt.type===$})},On=function($){var tt=tr($.type);tt&&R($.targets,function(Ne){var Ht=tr(Ne.type);Ht&&parseInt(tt.formattedValueEn,10)===Ne.value&&(tt.rawValue=0,tt.wholeValue=0,tt.decimalValue=0,Ht.rawValue+=1,Ht.wholeValue+=1,Ht.decimalValue=0,Ht.formattedValueEn=Ht.wholeValue.toString(),Nt=!0)})};R(a,On)}return Nt&&($t=!1,yt=mt,et=_(et,En),et=k(et)),oe&&!(It&&!P.trim)?(et=_(et,function($){return S(oe,function(tt){return $.type===tt})?$:null}),et=k(et)):(wn&&(et=C(et,function($){return!$.isSmallest&&!$.wholeValue&&!S(ue,$.type)})),me&&et.length&&(et=et.slice(0,me)),ot&&et.length>1&&(et=I(et,function($){return!$.wholeValue&&!S(ue,$.type)&&!$.isLargest})),Gt&&(et=_(et,function($,tt){return tt>0&&tt<et.length-1&&!$.wholeValue?null:$}),et=k(et)),Pt&&et.length===1&&!et[0].wholeValue&&!(!ke&&et[0].isSmallest&&et[0].rawValue<$e)&&(et=[])),He?et:(R(Vt,function($){var tt=ze[$.type],Ne=S(et,function(Lt){return Lt.type===$.type});if(!(!tt||!Ne)){var Ht=Ne.formattedValueEn.split(".");Ht[0]=parseInt(Ht[0],10),Ht[1]?Ht[1]=parseFloat("0."+Ht[1],10):Ht[1]=null;var Sn=ce.durationPluralKey(tt,Ht[0],Ht[1]),ve=p(tt,ce),ut=!1,Zt={};R(ce._durationLabelTypes,function(Lt){var tn=S(ve,function(Pn){return Pn.type===Lt.type&&Pn.key===Sn});tn&&(Zt[tn.type]=tn.label,u($.text,Lt.string)&&($.text=$.text.replace(Lt.string,tn.label),ut=!0))}),rt&&!ut&&(ve.sort(m),R(ve,function(Lt){if(Zt[Lt.type]===Lt.label)return u($.text,Lt.label)?!1:void 0;if(u($.text,Lt.label))return $.text=$.text.replace(Lt.label,Zt[Lt.type]),!1}))}}),Vt=_(Vt,function($){if(!$.type)return $.text;var tt=S(et,function(Ht){return Ht.type===$.type});if(!tt)return"";var Ne="";return _e&&(Ne+=$.text),(Te&&It||!Te&&Dt)&&(Ne+="< ",It=!1,Dt=!1),(Te&&Dt||!Te&&It)&&(Ne+="> ",It=!1,Dt=!1),Te&&(tt.value>0||Wt===""||S(ue,tt.type)||S(oe,tt.type))&&(Ne+="-",Te=!1),$.type==="milliseconds"&&tt.formattedValueMS?Ne+=tt.formattedValueMS:Ne+=tt.formattedValue,_e||(Ne+=$.text),Ne}),Vt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var F=this.duration,P=function(Fe){return F._data[Fe]},B=S(this.types,P),he=O(this.types,P);switch(B){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(B===he)return"d __";case"weeks":return B===he?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(B===he)return"M __";case"years":return B===he?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function le(F){if(!F)throw"Moment Duration Format init cannot find moment instance.";F.duration.format=X,F.duration.fn.format=ne,F.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]},F.updateLocale("en",w)}var Oe=function(F,P,B){return F.toLocaleString(P,B)};r=G()&&Q(Oe),i=r&&ie(Oe);var J=function(F,P,B){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,B).format(F)};return o=Q(J),l=o&&ie(J),le(n),le})}(ta)),ta.exports}c1();const d1=["true","t","yes","y","on","1"],f1=["false","f","no","n","off","0"];function Ft(e,t=""){return{kind:te.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Ci(e){return Object.hasOwn(e,"isError")&&e.isError}function h1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function ka(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Ts(e=!1){return e?{kind:te.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:te.Loading,allowOverlay:!1,copyData:""}}function g1(e,t){const n=t?"faded":"normal";return{kind:te.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Ds(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 vo(e,t){return Xe(e)?t||{}:Xe(t)?e||{}:Fc(e,t)}function Bd(e){if(Xe(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(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:Ct(n)):[Ct(t)]}catch{return[Ct(e)]}}function m1(e){return e&&e.startsWith("{")&&e.endsWith("}")}function Ct(e){try{try{return l1(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Wd(e){if(Xe(e))return null;if(typeof e=="boolean")return e;const t=Ct(e).toLowerCase().trim();if(t==="")return null;if(d1.includes(t))return!0;if(f1.includes(t))return!1}function co(e){if(Xe(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=Ji.unformat(e.trim());if(ht(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function fa(e){if(Xe(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return Ct(e)}}function p1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function 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 ha(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Xe(t)||t===""?ht(n)?(n===0&&(e=Math.round(e)),Ji(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):Ji(e).format({thousandSeparated:!1,mantissa:p1(e),trimMantissa:!0}):t==="plain"?Ji(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:ht(n)?Math.max(n-2,0):0,maximumFractionDigits:ht(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",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Gr(e,{style:"currency",currency:"JPY",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Gr(e,{notation:t}):t==="accounting"?Ji(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"):yg.sprintf(t,e)}function Wu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(l){if(l instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw l}}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 Yo(e){if(Xe(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=jr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=jr.utc(e);if(n.isValid())return n.toDate();const r=jr.utc(e,[jr.HTML5_FMT.TIME_MS,jr.HTML5_FMT.TIME_SECONDS,jr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Ud(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 v1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const b1=new RegExp(/(\r\n|\n|\r)/gm);function fo(e){return e.indexOf(`
|
186
|
+
`)!==-1?e.replace(b1," "):e}function w1(e,t){if(Xe(t))return"";try{const n=t.match(e);return n&&n[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const y1=ki("div",{target:"e48kivf0"})(({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"}})),qd=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?qa.parse(e):qa.parse(qa.stringify(e))}catch{n=void 0}return Xe(n)?lt(ei,{highlight:!0,autoFocus:!1,disabled:!0,value:fa(e)??"",onChange:()=>{}}):lt(y1,{"data-testid":"stJsonColumnViewer",children:lt(Mh,{src:n,collapsed:2,theme:Rh(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"}})})},C1=e=>{const t=e.theme,n=e.value.data;return lt(qd,{jsonValue:n.value||n.displayValue,theme:t})},S1=e=>{const t=e.theme,n=e.value;return lt(qd,{jsonValue:n.data,theme:t})},x1={kind:te.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return qs(e,r??fa(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??fa(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:C1})},k1="line_chart",M1="area_chart",R1="bar_chart";function Qs(e,t,n){const r=vo({y_min:null,y_max:null},t.columnTypeOptions),i={kind:te.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[r.y_min??0,r.y_max??1]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(o){if(Xe(o))return Ts();const l=Bd(o),s=[];let a=[];if(l.length===0)return Ts();let u=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER;for(let h=0;h<l.length;h++){const m=co(l[h]);if(Number.isNaN(m)||Xe(m))return Ft(Ct(l),`The value cannot be interpreted as a numeric array. ${Ct(m)} is not a number.`);m>u&&(u=m),m<c&&(c=m),s.push(m)}let d,g;if(l.length===1){let h;u<=0?h=u===0?1:0:h=u,d=r.y_max??h,g=r.y_min??(u>=0?0:u)}else d=r.y_max??u,g=r.y_min??c;return Xe(g)||Xe(d)||Number.isNaN(g)||Number.isNaN(d)||g>=d?Ft("Invalid min/max y-axis configuration",`The y_min (${g}) and y_max (${d}) configuration options must be valid numbers.`):(s.length>0&&(u>d||c<g)?a=s.map(h=>u-c===0?u>(d||1)?d:g:(d-g)*((h-c)/(u-c))+g):a=s,{...i,copyData:s.join(","),data:{...i.data,values:a,displayValues:s.map(h=>ha(h)),yAxis:[g,d]},isMissingValue:Xe(o)})},getCellValue(o){var l,s;return o.kind===te.Loading||((l=o.data)==null?void 0:l.values)===void 0?null:(s=o.data)==null?void 0:s.values}}}function Yd(e){return Qs(k1,e,"line")}Yd.isEditableType=!1;function Xd(e){return Qs(R1,e,"bar")}Xd.isEditableType=!1;function Gd(e){return Qs(M1,e,"area")}Gd.isEditableType=!1;function el(e){const t={kind:te.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(n){let r=null;return r=Wd(n),r===void 0?Ft(Ct(n),"The value cannot be interpreted as boolean."):{...t,data:r,isMissingValue:Xe(r)}},getCellValue(n){return n.data===void 0?null:n.data}}}el.isEditableType=!0;function Uu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function tl(e,t,n,r,i,o,l){var h,m;const s=vo({format:n,step:r,timezone:l},t.columnTypeOptions);let a;if(ht(s.timezone))try{a=((h=Uu(Pl(),s.timezone))==null?void 0:h.utcOffset())||void 0}catch{}let u;ht(s.min_value)&&(u=Yo(s.min_value)||void 0);let c;ht(s.max_value)&&(c=Yo(s.max_value)||void 0);const d={kind:te.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:((m=s.step)==null?void 0:m.toString())||"1",format:i,min:u,max:c}},g=p=>{const b=Yo(p);return b===null?!t.isRequired:!(b===void 0||ht(u)&&o(b)<o(u)||ht(c)&&o(b)>o(c))};return{...t,kind:e,sortMode:"default",validateInput:g,getCell(p,b){if(b===!0){const S=g(p);if(S===!1)return Ft(Ct(p),"Invalid input.");S instanceof Date&&(p=S)}const w=Yo(p);let v="",x="",O=a;if(w===void 0)return Ft(Ct(p),"The value cannot be interpreted as a datetime object.");if(w!==null){let S=Pl.utc(w);if(!S.isValid())return Ft(Ct(w),`Invalid moment date. This should never happen. Please report this bug.
|
187
|
+
Error: ${S.toString()}`);if(s.timezone){try{S=Uu(S,s.timezone)}catch(R){return Ft(S.toISOString(),`Failed to adjust to the provided timezone: ${s.timezone}.
|
188
|
+
Error: ${R}`)}O=S.utcOffset()}try{x=Wu(S,s.format||n,e)}catch(R){return Ft(S.toISOString(),`Failed to format the date for rendering with: ${s.format}.
|
189
|
+
Error: ${R}`)}v=Wu(S,n,e)}return{...d,copyData:v,isMissingValue:Xe(w),data:{...d.data,date:w,displayDate:x,timezoneOffset:O}}},getCellValue(p){var b;return Xe((b=p==null?void 0:p.data)==null?void 0:b.date)?null:o(p.data.date)}}}function nl(e){var i,o,l;let t="YYYY-MM-DD HH:mm:ss";((i=e.columnTypeOptions)==null?void 0:i.step)>=60?t="YYYY-MM-DD HH:mm":((o=e.columnTypeOptions)==null?void 0:o.step)<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=Eh(e.arrowType),r=ht(n)||ht((l=e==null?void 0:e.columnTypeOptions)==null?void 0:l.timezone);return tl("datetime",e,r?t+"Z":t,1,"datetime-local",s=>r?s.toISOString():s.toISOString().replace("Z",""),n)}nl.isEditableType=!0;function rl(e){var n,r;let t="HH:mm:ss";return((n=e.columnTypeOptions)==null?void 0:n.step)>=60?t="HH:mm":((r=e.columnTypeOptions)==null?void 0:r.step)<1&&(t="HH:mm:ss.SSS"),tl("time",e,t,1,"time",i=>i.toISOString().split("T")[1].replace("Z",""))}rl.isEditableType=!0;function il(e){return tl("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}il.isEditableType=!0;function jd(e){const t={kind:te.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(n){const r=ht(n)?[Ct(n)]:[];return{...t,data:r,isMissingValue:!ht(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}jd.isEditableType=!1;function Kd(e){const t={kind:te.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",sortMode:"default",isEditable:!1,getCell(n){try{const r=ht(n)?fo(fa(n)):"";return{...t,copyData:r,isMissingValue:Xe(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Ft(Ct(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){var r;return((r=n.data)==null?void 0:r.value)??null}}}Kd.isEditableType=!1;function Zd(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n=`Invalid validate regex: ${t.validate}.
|
190
|
+
Error: ${a}`}let r=!1,i=t.display_text,o;if(!Xe(i)){if(i.startsWith(":material/")&&Ih(i))i=Th(i).icon,r=!0;else if(i.includes("(")&&i.includes(")"))try{o=new RegExp(i,"us")}catch{o=void 0}}const l={kind:te.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:Dh.iconFont,linkColor:void 0}}},s=a=>{if(Xe(a))return!e.isRequired;const u=Ct(a);return!(t.max_chars&&u.length>t.max_chars||n instanceof RegExp&&n.test(u)===!1)};return{...e,kind:"link",sortMode:"default",validateInput:s,getCell(a,u){if(Xe(a))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=a;if(typeof n=="string")return Ft(Ct(c),n);if(u&&s(c)===!1)return Ft(Ct(c),"Invalid input.");let d="";return c&&(o!==void 0?d=w1(o,c):d=i||c),{...l,data:c,displayData:d,isMissingValue:Xe(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(a){return Xe(a.data)?null:a.data}}}Zd.isEditableType=!0;function ol(e){const t={kind:te.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(n){const r=Xe(n)?[]:Bd(n);return{...t,data:r,isMissingValue:Xe(n),copyData:Xe(n)?"":Ct(r.map(i=>typeof i=="string"&&i.includes(",")?i.replace(/,/g," "):i))}},getCellValue(n){return Xe(n.data)||ka(n)?null:n.data}}}ol.isEditableType=!1;function al(e){const t=vo({step:Ac(e.arrowType)?1:void 0,min_value:Oh(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Ph(e.arrowType)||_h(e.arrowType)),r=Xe(t.min_value)||t.min_value<0,i=ht(t.step)&&!Number.isNaN(t.step)?Ud(t.step):void 0,o={kind:te.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:i,thousandSeparator:""},l=s=>{let a=co(s);if(Xe(a))return!e.isRequired;if(Number.isNaN(a))return!1;let u=!1;return ht(t.max_value)&&a>t.max_value&&(a=t.max_value,u=!0),ht(t.min_value)&&a<t.min_value?!1:u?a:!0};return{...e,kind:"number",sortMode:"smart",validateInput:l,getCell(s,a){if(a===!0){const d=l(s);if(d===!1)return Ft(Ct(s),"Invalid input.");typeof d=="number"&&(s=d)}let u=co(s),c="";if(ht(u)){if(Number.isNaN(u))return Ft(Ct(s),"The value cannot be interpreted as a number.");if(ht(i)&&(u=v1(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Ft(Ct(s),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=Cs(u,e.arrowType):c=ha(u,t.format,i)}catch(d){return Ft(Ct(u),ht(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}}return{...o,data:u,displayData:c,isMissingValue:Xe(u),copyData:Xe(u)?"":Ct(u)}},getCellValue(s){return s.data===void 0?null:s.data}}}al.isEditableType=!0;function ho(e){const t={kind:te.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(n){try{const r=ht(n)?Ct(n):null,i=ht(r)?fo(r):"";return{...t,data:r,displayData:i,isMissingValue:Xe(n)}}catch(r){return Ft(Ct(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}ho.isEditableType=!1;function Jd(e){const t=Ac(e.arrowType),n=vo({min_value:0,max_value:t?100:1,format:t?"%3d%%":"percent",step:t?1:void 0},e.columnTypeOptions),r=Xe(n.step)||Number.isNaN(n.step)?void 0:Ud(n.step);let i;try{i=ha(n.max_value,n.format,r)}catch{i=Ct(n.max_value)}const o={kind:te.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:i}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(l){if(Xe(l))return Ts();if(Xe(n.min_value)||Xe(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Ft("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(ht(n.step)&&Number.isNaN(n.step))return Ft("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const s=co(l);if(Number.isNaN(s)||Xe(s))return Ft(Ct(l),"The value cannot be interpreted as a number.");if(Number.isInteger(s)&&!Number.isSafeInteger(s))return Ft(Ct(l),"The value is larger than the maximum supported integer values in number columns (2^53).");let a="";try{a=ha(s,n.format,r)}catch(c){return Ft(Ct(s),ht(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${c}`:`Failed to format the number. Error: ${c}`)}const u=Math.min(n.max_value,Math.max(n.min_value,s));return{...o,isMissingValue:Xe(l),copyData:String(s),data:{...o.data,value:u,label:a,measureLabel:a.length>i.length?a:i}}},getCellValue(l){var s,a;return l.kind===te.Loading||((s=l.data)==null?void 0:s.value)===void 0?null:(a=l.data)==null?void 0:a.value}}}Jd.isEditableType=!1;function sl(e){let t="string";const n=vo({options:Hc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=new Set(n.options.map(o=>typeof o));r.size===1&&(r.has("number")||r.has("bigint")?t="number":r.has("boolean")&&(t="boolean"));const i={kind:te.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...n.options.filter(o=>o!==null&&o!=="").map(o=>Ct(o))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(o,l){let s=null;return ht(o)&&o!==""&&(s=Ct(o)),l&&!i.data.allowedValues.includes(s)?Ft(Ct(s),"The value is not part of the allowed options."):{...i,isMissingValue:s===null,copyData:s||"",data:{...i.data,value:s}}},getCellValue(o){var l,s,a,u,c;return Xe((l=o.data)==null?void 0:l.value)||((s=o.data)==null?void 0:s.value)===""?null:t==="number"?co((a=o.data)==null?void 0:a.value)??null:t==="boolean"?Wd((u=o.data)==null?void 0:u.value)??null:(c=o.data)==null?void 0:c.value}}}sl.isEditableType=!0;function ll(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
|
191
|
+
Error: ${o}`}const r={kind:te.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Xe(o))return!e.isRequired;let l=Ct(o),s=!1;return t.max_chars&&l.length>t.max_chars&&(l=l.slice(0,t.max_chars),s=!0),n instanceof RegExp&&n.test(l)===!1?!1:s?l:!0};return{...e,kind:"text",sortMode:"default",validateInput:i,getCell(o,l){if(typeof n=="string")return Ft(Ct(o),n);if(l){const s=i(o);if(s===!1)return Ft(Ct(o),"Invalid input.");typeof s=="string"&&(o=s)}try{const s=ht(o)?Ct(o):null,a=ht(s)?fo(s):"";return{...r,isMissingValue:Xe(s),data:s,displayData:a}}catch(s){return Ft("Incompatible value",`The value cannot be interpreted as string. Error: ${s}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ll.isEditableType=!0;const qu=ki("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),E1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?lt("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:lt(qu,{src:t})}):lt(qu,{src:t})},Yu=new Map(Object.entries({object:ho,text:ll,checkbox:el,selectbox:sl,list:ol,number:al,link:Zd,datetime:nl,date:il,time:rl,line_chart:Yd,bar_chart:Xd,area_chart:Gd,image:jd,progress:Jd,json:Kd})),I1=[x1];var T1=zc();const D1=yr(T1);var fs,Xu;function O1(){if(Xu)return fs;Xu=1;var e=Lh(),t=Fh(),n=Ah(),r=zc(),i=Hh(),o=zh(),l=Vh(),s=$h(),a="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function g(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||s(h)||n(h)))return!h.length;var m=t(h);if(m==a||m==u)return!h.size;if(l(h))return!e(h).length;for(var p in h)if(d.call(h,p))return!1;return!0}return fs=g,fs}var P1=O1();const _1=yr(P1);function hs(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function L1(e,t,n){const r={};if(!n.includes(t))return e;const i=hs(t,"color",n);i&&(r.textDark=i,e.kind===te.Bubble&&(r.textBubble=i),e.kind===te.Uri&&(r.linkColor=i));const o=hs(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const l=hs(t,"font-weight",n);return l&&(r.baseFontStyle=`${l} ${tg.sm}`),r?{...e,themeOverride:r}:e}function F1(e){return Yh(e)||Xh(e)?ll:Gh(e)?nl:Vc(e)?rl:jh(e)?il:Kh(e)||Zh(e)?ho:Hc(e)?el:Jh(e)?al:Qh(e)?sl:eg(e)?ol:ho}function Qd(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 ul(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function A1(e,t){const n=e.columnNames.map(s=>s[t]),{title:r,group:i}=Qd(n),o=e.columnTypes[t];let l=!0;return qh(o)&&(l=!1),ul({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:l,arrowType:o,isIndex:!0,isPinned:!0})}function H1(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:i}=Qd(n),o=e.columnTypes[t];return ul({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function ef(){return ul({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:ng.INDEX,arrowField:new Nh("",new Bh,!0),pandasType:void 0}})}function Gu(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(ef()),t;for(let o=0;o<r;o++)t.push(A1(e,o));for(let o=0;o<i;o++)t.push(H1(e,o+r));return t}function z1(e,t,n,r=void 0){var o,l,s,a,u,c;let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(ht(t.content)?fo(Cs(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&ht(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;Vc(t.contentType)&&ht((l=(o=t.field)==null?void 0:o.type)==null?void 0:l.unit)?d=Wh(t.content,t.field):d=jr.utc(Number(t.content)).toDate(),i=e.getCell(d)}else if(Uh(t.contentType)){const d=Xe(t.content)?null:Cs(t.content,t.contentType);i=e.getCell(d)}else i=e.getCell(t.content);if(Ci(i))return i;if(!e.isEditable){if(n&&ht(n==null?void 0:n.displayContent)){const d=fo(n.displayContent);i.kind===te.Text?i={...i,displayData:d}:i.kind===te.Number&&Xe((s=e.columnTypeOptions)==null?void 0:s.format)?i={...i,displayData:d}:i.kind===te.Uri&&Xe((a=e.columnTypeOptions)==null?void 0:a.display_text)?i={...i,displayData:d}:i.kind===te.Custom&&((u=i.data)==null?void 0:u.kind)==="date-picker-cell"&&Xe((c=e.columnTypeOptions)==null?void 0:c.format)&&(i={...i,data:{...i.data,displayDate:d}})}r&&(n!=null&&n.cssId)&&(i=L1(i,n.cssId,r))}return i}const na="_index",ju="_pos:",Ku={small:75,medium:200,large:400},tf=As.getLogger("useColumnLoader");function V1(e){if(!Xe(e)){if(typeof e=="number")return e;if(e in Ku)return Ku[e]}}const Xo=(e,t)=>wg(e,t,(r,i)=>{if(D1(i))return i});function Zu(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(na)&&(n=Xo(n,t.get(na)??{})),t.has(`${ju}${e.indexNumber}`)&&(n=Xo(n,t.get(`${ju}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==na&&(n=Xo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Xo(n,t.get(e.id)??{})),_1(n)?e:Fc({...e},{title:n.label,width:V1(n.width),isEditable:ht(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 $1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return tf.error(t),new Map}}function Ju(e){var r;const t=(r=e.columnTypeOptions)==null?void 0:r.type;let n;return ht(t)&&(Yu.has(t)?n=Yu.get(t):tf.warn(`Unknown column type configured in column configuration: ${t}`)),Xe(n)&&(n=F1(e.arrowType)),n}function N1(e,t,n,r){const i=Jr(),o=f.useMemo(()=>$1(e.columns),[e.columns]),[l,s]=f.useState(o);f.useEffect(()=>{s(o)},[o]);const a=e.useContainerWidth||ht(e.width)&&e.width>0,u=ht(e.rowHeight)&&e.rowHeight>pn("4rem"),c=f.useMemo(()=>Gu(t).map(g=>{let h={...g,...Zu(g,l),isStretched:a};const m=Ju(h);return(e.editingMode===Mn.EditingMode.READ_ONLY||n||m.isEditableType===!1)&&(h={...h,isEditable:!1}),e.editingMode!==Mn.EditingMode.READ_ONLY&&h.isEditable==!0&&(h={...h,icon:"editable"},h.isRequired&&e.editingMode===Mn.EditingMode.DYNAMIC&&(h={...h,isHidden:!1})),m(h,i)}),[t,l,a,e.editingMode,n,i]);return{columns:f.useMemo(()=>{const g=Gu(t).map(b=>{let w={...b,...Zu(b,l),isStretched:a,isWrappingAllowed:u};const v=Ju(w);return(e.editingMode===Mn.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(w={...w,isEditable:!1}),e.editingMode!==Mn.EditingMode.READ_ONLY&&w.isEditable==!0&&(w={...w,icon:"editable"},w.isRequired&&e.editingMode===Mn.EditingMode.DYNAMIC&&(w={...w,isHidden:!1})),v(w,i)}).filter(b=>!b.isHidden),h=[],m=[];r!=null&&r.length?(g.forEach(b=>{b.isIndex&&!r.includes(b.name)&&!r.includes(b.id)&&b.isPinned!==!1&&h.push(b)}),r.forEach(b=>{const w=g.find(v=>v.name===b||v.id===b);w&&(w.isPinned?h.push(w):m.push(w))})):g.forEach(b=>{b.isPinned?h.push(b):m.push(b)});const p=[...h,...m];return p.length>0?p:[ho(ef())]},[t,l,u,a,n,e.editingMode,r,i]),allColumns:c,setColumnConfigMapping:s}}function ao(e){return e.isIndex?na:Xe(e.name)?"":e.name}class Go{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,l,s)=>{const a={};o.forEach((u,c)=>{const d=n.get(c);d&&(a[ao(d)]=d.getCellValue(u))}),r.edited_rows[l]=a}),this.addedRows.forEach(o=>{const l={};let s=!1;o.forEach((a,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(a);d.isRequired&&d.isEditable&&ka(a)&&(s=!0),ht(g)&&(l[ao(d)]=g)}}),s||r.added_rows.push(l)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,l)=>l===void 0?null:l)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(l=>{i.set(l.indexNumber,l)});const o=new Map;n.forEach(l=>{o.set(ao(l),l)}),Object.keys(r.edited_rows).forEach(l=>{const s=Number(l),a=r.edited_rows[l];Object.keys(a).forEach(u=>{var g;const c=a[u],d=o.get(u);if(d){const h=d.getCell(c);h&&(this.editedCells.has(s)||this.editedCells.set(s,new Map),(g=this.editedCells.get(s))==null||g.set(d.indexNumber,h))}})}),r.added_rows.forEach(l=>{const s=new Map;n.forEach(a=>{s.set(a.indexNumber,a.getCell(null))}),Object.keys(l).forEach(a=>{const u=l[a],c=o.get(a);if(c){const d=c.getCell(u);d&&s.set(c.indexNumber,d)}}),this.addedRows.push(s)}),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(!(Xe(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 go=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i!=null&&i.type_config||n!=null&&n.type_config)&&(o.type_config={...(i==null?void 0:i.type_config)||{},...(n==null?void 0:n.type_config)||{}}),r.set(e,o),r};function B1(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>go({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function W1(e,t,n,r,i,o){const l=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),s=t||l?0:e.filter(c=>c.isPinned).length,a=f.useCallback(c=>{o(d=>go({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>go({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:a,freezeColumns:s}}function U1(e,t,n,r,i){return{onColumnMoved:f.useCallback((l,s)=>{const a=[...e],[u]=a.splice(l,1);a.splice(s,0,u),s<t&&!u.isPinned?n(u.id):s>=t&&u.isPinned&&r(u.id),i(a.map(c=>c.id))},[e,t,n,r,i])}}function q1(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,l,s,a)=>{o.id&&n(new Map(t).set(o.id,a))},[t]);return{columns:f.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 Y1(e){var t,n;switch(e.kind){case te.Number:return((t=e.data)==null?void 0:t.toString())??"";case te.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case te.Markdown:case te.RowID:case te.Text:case te.Uri:return e.data??"";case te.Bubble:case te.Image:return e.data.join("");case te.Drilldown:return e.data.map(r=>r.text).join("");case te.Protected:case te.Loading:return"";case te.Custom:return e.copyData}}function Qu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function X1(e,t){return e=Qu(e),t=Qu(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 G1(e,t){return e>t?1:e===t?0:-1}function j1(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),l=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let m=0;m<n;m++)h[1]=m,c[d][m]=Y1(r(h))}return Lr(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:m}=u[h],p=c[h][d],b=c[h][g];let w;if(m.mode==="raw"?w=G1(p,b):m.mode==="smart"?w=X1(p,b):w=p.localeCompare(b),w!==0)return(m.direction??"asc")==="desc"&&(w=-w),w}return 0})},[r,n,i,o]),s=f.useCallback(u=>l===void 0?u:l[u],[l]),a=f.useCallback(([u,c])=>l===void 0?r([u,c]):(c=l[c],r([u,c])),[r,l]);return l===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:a}}function K1(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 Z1(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:l}=j1({columns:t.map(u=>Ds(u)),getCellContent:n,rows:e,sort:r}),s=f.useMemo(()=>K1(t,r),[t,r]),a=f.useCallback((u,c,d)=>{const g=s[u];let h;c==="auto"?(h="asc",r&&r.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===(r==null?void 0:r.direction)?i(void 0):i({column:Ds(g),direction:h,mode:g.sortMode})},[r,s]);return{columns:s,sortColumn:a,getOriginalIndex:l,getCellContent:o}}function J1(e,t){const n=f.useCallback(i=>{t(o=>go({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>go({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function Q1(){return{provideEditor:f.useCallback(t=>{if(t.kind===te.Text&&t.readonly&&m1(t.data))return{editor:S1}},[])}}const eb={kind:te.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:l}=e;let{values:s,yAxis:a,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,m]=a;if(s.length===0)return!0;s=s.map(R=>Math.min(1,Math.max(0,(R-h)/(m-h))));const p=r.cellHorizontalPadding,b=p+i.x,w=i.y+3,v=i.height-6,x=i.width-p*2,O=m-h,S=m<=0?w:h>=0?w+v:w+v*(m/O);if(!g&&h<=0&&m>=0&&(n.beginPath(),n.moveTo(b,S),n.lineTo(b+x,S),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const R=2,_=(s.length-1)*R,E=(x-_)/s.length;let k=b;for(const L of s){const D=w+v-L*v;n.moveTo(k,S),n.lineTo(k+E,S),n.lineTo(k+E,D),n.lineTo(k,D),k+=E+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const R=(i.width-16)/(s.length-1),_=s.map((k,L)=>({x:b+R*L,y:w+v-k*v}));n.moveTo(_[0].x,_[0].y);let E=0;if(_.length>2)for(E=1;E<_.length-2;E++){const k=(_[E].x+_[E+1].x)/2,L=(_[E].y+_[E+1].y)/2;n.quadraticCurveTo(_[E].x,_[E].y,k,L)}if(n.quadraticCurveTo(_[E].x,_[E].y,_[E+1].x,_[E+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-p,S),n.lineTo(i.x+p,S),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const k=n.createLinearGradient(0,w,0,w+v*1.4);k.addColorStop(0,u??r.accentColor);const[L,D,C]=la(u??r.accentColor);k.addColorStop(1,`rgba(${L}, ${D}, ${C}, 0)`),n.fillStyle=k,n.fill(),n.globalAlpha=1}if(l!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const k=Math.min(s.length-1,Math.max(0,Math.round((l-p)/R)));n.moveTo(b+k*R,i.y+1),n.lineTo(b+k*R,i.y+i.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(d[k],b,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function ec(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tc(Object(n),!0).forEach(function(r){Qi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var tb=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function nb(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,l=o===void 0?null:o,s=e.inputValue,a=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,m=Cr(e,tb),p=f.useState(s!==void 0?s:n),b=vr(p,2),w=b[0],v=b[1],x=f.useState(a!==void 0?a:i),O=vr(x,2),S=O[0],R=O[1],_=f.useState(h!==void 0?h:l),E=vr(_,2),k=E[0],L=E[1],D=f.useCallback(function(G,ie){typeof u=="function"&&u(G,ie),L(G)},[u]),C=f.useCallback(function(G,ie){var Q;typeof c=="function"&&(Q=c(G,ie)),v(Q!==void 0?Q:G)},[c]),I=f.useCallback(function(){typeof g=="function"&&g(),R(!0)},[g]),T=f.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),M=s!==void 0?s:w,z=a!==void 0?a:S,N=h!==void 0?h:k;return Ye(Ye({},m),{},{inputValue:M,menuIsOpen:z,onChange:D,onInputChange:C,onMenuClose:T,onMenuOpen:I,value:N})}function rb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const ib=Math.min,ob=Math.max,ga=Math.round,jo=Math.floor,ma=e=>({x:e,y:e});function ab(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ma(){return typeof window<"u"}function nf(e){return of(e)?(e.nodeName||"").toLowerCase():"#document"}function wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rf(e){var t;return(t=(of(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function of(e){return Ma()?e instanceof Node||e instanceof wr(e).Node:!1}function sb(e){return Ma()?e instanceof Element||e instanceof wr(e).Element:!1}function cl(e){return Ma()?e instanceof HTMLElement||e instanceof wr(e).HTMLElement:!1}function nc(e){return!Ma()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function af(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=dl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function lb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ub(e){return["html","body","#document"].includes(nf(e))}function dl(e){return wr(e).getComputedStyle(e)}function cb(e){if(nf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nc(e)&&e.host||rf(e);return nc(t)?t.host:t}function sf(e){const t=cb(e);return ub(t)?e.ownerDocument?e.ownerDocument.body:e.body:cl(t)&&af(t)?t:sf(t)}function pa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=sf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=wr(i);if(o){const s=Os(l);return t.concat(l,l.visualViewport||[],af(i)?i:[],s&&n?pa(s):[])}return t.concat(i,pa(i,[],n))}function Os(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function db(e){const t=dl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cl(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=ga(n)!==o||ga(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function fl(e){return sb(e)?e:e.contextElement}function rc(e){const t=fl(e);if(!cl(t))return ma(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=db(t);let l=(o?ga(n.width):n.width)/r,s=(o?ga(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const fb=ma(0);function hb(e){const t=wr(e);return!lb()||!t.visualViewport?fb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gb(e,t,n){return!1}function ic(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=fl(e);let l=ma(1);t&&(l=rc(e));const s=gb()?hb(o):ma(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const g=wr(o),h=r;let m=g,p=Os(m);for(;p&&r&&h!==m;){const b=rc(p),w=p.getBoundingClientRect(),v=dl(p),x=w.left+(p.clientLeft+parseFloat(v.paddingLeft))*b.x,O=w.top+(p.clientTop+parseFloat(v.paddingTop))*b.y;a*=b.x,u*=b.y,c*=b.x,d*=b.y,a+=x,u+=O,m=wr(p),p=Os(m)}}return ab({width:c,height:d,x:a,y:u})}function mb(e,t){let n=null,r;const i=rf(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(s||t(),!d||!g)return;const h=jo(c),m=jo(i.clientWidth-(u+d)),p=jo(i.clientHeight-(c+g)),b=jo(u),v={rootMargin:-h+"px "+-m+"px "+-p+"px "+-b+"px",threshold:ob(0,ib(1,a))||1};let x=!0;function O(S){const R=S[0].intersectionRatio;if(R!==a){if(!x)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(O,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,v)}n.observe(e)}return l(!0),o}function pb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=fl(e),c=i||o?[...u?pa(u):[],...pa(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const d=u&&s?mb(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(w=>{let[v]=w;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!a&&h.observe(u),h.observe(t));let m,p=a?ic(e):null;a&&b();function b(){const w=ic(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,m=requestAnimationFrame(b)}return n(),()=>{var w;c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,a&&cancelAnimationFrame(m)}}var Ps=f.useLayoutEffect,vb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],va=function(){};function bb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function wb(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var l in t)t.hasOwnProperty(l)&&t[l]&&o.push("".concat(bb(e,l)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var oc=function(t){return Ib(t)?t.filter(Boolean):rg(t)==="object"&&t!==null?[t]:[]},lf=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Cr(t,vb);return Ye({},n)},rn=function(t,n,r){var i=t.cx,o=t.getStyles,l=t.getClassNames,s=t.className;return{css:o(n,t),className:i(r??{},l(n,t),s)}};function Ra(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function yb(e){return Ra(e)?window.innerHeight:e.clientHeight}function uf(e){return Ra(e)?window.pageYOffset:e.scrollTop}function ba(e,t){if(Ra(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Cb(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function Sb(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Ko(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:va,i=uf(e),o=t-i,l=10,s=0;function a(){s+=l;var u=Sb(s,i,o,n);ba(e,u),s<n?window.requestAnimationFrame(a):r(e)}a()}function ac(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ba(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ba(e,Math.max(t.offsetTop-i,0))}function xb(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 sc(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function kb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var cf=!1,Mb={get passive(){return cf=!0}},Zo=typeof window<"u"?window:{};Zo.addEventListener&&Zo.removeEventListener&&(Zo.addEventListener("p",va,Mb),Zo.removeEventListener("p",va,!1));var Rb=cf;function Eb(e){return e!=null}function Ib(e){return Array.isArray(e)}function Jo(e,t,n){return e?t:n}var Tb=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(l){var s=vr(l,1),a=s[0];return!r.includes(a)});return o.reduce(function(l,s){var a=vr(s,2),u=a[0],c=a[1];return l[u]=c,l},{})},Db=["children","innerProps"],Ob=["children","innerProps"];function Pb(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,l=e.isFixedPosition,s=e.controlHeight,a=Cb(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=a.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,m=g.height,p=g.top,b=n.offsetParent.getBoundingClientRect(),w=b.top,v=l?window.innerHeight:yb(a),x=uf(a),O=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),R=w-S,_=v-p,E=R+x,k=d-x-p,L=h-v+x+O,D=x+p-S,C=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:t};if(k>=m&&!l)return o&&Ko(a,L,C),{placement:"bottom",maxHeight:t};if(!l&&k>=r||l&&_>=r){o&&Ko(a,L,C);var I=l?_-O:k-O;return{placement:"bottom",maxHeight:I}}if(i==="auto"||l){var T=t,M=l?R:E;return M>=r&&(T=Math.min(M-O-s,t)),{placement:"top",maxHeight:T}}if(i==="bottom")return o&&ba(a,L),{placement:"bottom",maxHeight:t};break;case"top":if(R>=m)return{placement:"top",maxHeight:t};if(E>=m&&!l)return o&&Ko(a,D,C),{placement:"top",maxHeight:t};if(!l&&E>=r||l&&R>=r){var z=t;return(!l&&E>=r||l&&R>=r)&&(z=l?R-S:E-S),o&&Ko(a,D,C),{placement:"top",maxHeight:z}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function _b(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var df=function(t){return t==="auto"?"bottom":t},Lb=function(t,n){var r,i=t.placement,o=t.theme,l=o.borderRadius,s=o.spacing,a=o.colors;return Ye((r={label:"menu"},Qi(r,_b(i),"100%"),Qi(r,"position","absolute"),Qi(r,"width","100%"),Qi(r,"zIndex",1),r),n?{}:{backgroundColor:a.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},ff=f.createContext(null),Fb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,l=t.menuPosition,s=t.menuShouldScrollIntoView,a=t.theme,u=f.useContext(ff)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=vr(g,2),m=h[0],p=h[1],b=f.useState(null),w=vr(b,2),v=w[0],x=w[1],O=a.spacing.controlHeight;return Ps(function(){var S=d.current;if(S){var R=l==="fixed",_=s&&!R,E=Pb({maxHeight:i,menuEl:S,minHeight:r,placement:o,shouldScroll:_,isFixedPosition:R,controlHeight:O});p(E.maxHeight),x(E.placement),c==null||c(E.placement)}},[i,o,l,s,r,c,O]),n({ref:d,placerProps:Ye(Ye({},t),{},{placement:v||df(o),maxHeight:m})})},Ab=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Be("div",Ze({},rn(t,"menu",{menu:!0}),{ref:r},i),n)},Hb=Ab,zb=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Ye({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},Vb=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return Be("div",Ze({},rn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},hf=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Ye({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},$b=hf,Nb=hf,Bb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=Cr(t,Db);return Be("div",Ze({},rn(Ye(Ye({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},Wb=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=Cr(t,Ob);return Be("div",Ze({},rn(Ye(Ye({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},Ub=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},qb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,l=t.menuPlacement,s=t.menuPosition,a=f.useRef(null),u=f.useRef(null),c=f.useState(df(l)),d=vr(c,2),g=d[0],h=d[1],m=f.useMemo(function(){return{setPortalPlacement:h}},[]),p=f.useState(null),b=vr(p,2),w=b[0],v=b[1],x=f.useCallback(function(){if(i){var _=xb(i),E=s==="fixed"?0:window.pageYOffset,k=_[g]+E;(k!==(w==null?void 0:w.offset)||_.left!==(w==null?void 0:w.rect.left)||_.width!==(w==null?void 0:w.rect.width))&&v({offset:k,rect:_})}},[i,s,g,w==null?void 0:w.offset,w==null?void 0:w.rect.left,w==null?void 0:w.rect.width]);Ps(function(){x()},[x]);var O=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&a.current&&(u.current=pb(i,a.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);Ps(function(){O()},[O]);var S=f.useCallback(function(_){a.current=_,O()},[O]);if(!n&&s!=="fixed"||!w)return null;var R=Be("div",Ze({ref:S},rn(Ye(Ye({},t),{},{offset:w.offset,position:s,rect:w.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Be(ff.Provider,{value:m},n?$c.createPortal(R,n):R)},Yb=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Xb=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return Be("div",Ze({},rn(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},Gb=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,l=t.selectProps.controlShouldRenderValue;return Ye({alignItems:"center",display:i&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},jb=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return Be("div",Ze({},rn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},Kb=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Zb=function(t){var n=t.children,r=t.innerProps;return Be("div",Ze({},rn(t,"indicatorsContainer",{indicators:!0}),r),n)},lc,Jb=["size"],Qb=["innerProps","isRtl","size"],ew={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},gf=function(t){var n=t.size,r=Cr(t,Jb);return Be("svg",Ze({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ew},r))},hl=function(t){return Be(gf,Ze({size:20},t),Be("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"}))},mf=function(t){return Be(gf,Ze({size:20},t),Be("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"}))},pf=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Ye({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?l.neutral60:l.neutral20,padding:o*2,":hover":{color:r?l.neutral80:l.neutral40}})},tw=pf,nw=function(t){var n=t.children,r=t.innerProps;return Be("div",Ze({},rn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Be(mf,null))},rw=pf,iw=function(t){var n=t.children,r=t.innerProps;return Be("div",Ze({},rn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Be(hl,null))},ow=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Ye({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:o*2,marginTop:o*2})},aw=function(t){var n=t.innerProps;return Be("span",Ze({},n,rn(t,"indicatorSeparator",{"indicator-separator":!0})))},sw=ig(lc||(lc=rb([`
|
192
|
+
0%, 80%, 100% { opacity: 0; }
|
193
|
+
40% { opacity: 1; }
|
194
|
+
`]))),lw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,l=o.colors,s=o.spacing.baseUnit;return Ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?l.neutral60:l.neutral20,padding:s*2})},gs=function(t){var n=t.delay,r=t.offset;return Be("span",{css:Nc({animation:"".concat(sw," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},uw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,l=Cr(t,Qb);return Be("div",Ze({},rn(Ye(Ye({},l),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Be(gs,{delay:0,offset:r}),Be(gs,{delay:160,offset:!0}),Be(gs,{delay:320,offset:!r}))},cw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,l=o.colors,s=o.borderRadius,a=o.spacing;return Ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?l.neutral5:l.neutral0,borderColor:r?l.neutral10:i?l.primary:l.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},dw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,l=t.innerProps,s=t.menuIsOpen;return Be("div",Ze({ref:o},rn(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":s}),l,{"aria-disabled":r||void 0}),n)},fw=dw,hw=["data"],gw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},mw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,l=t.Heading,s=t.headingProps,a=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Be("div",Ze({},rn(t,"group",{group:!0}),a),Be(l,Ze({},s,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Be("div",null,n))},pw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Ye({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},vw=function(t){var n=lf(t);n.data;var r=Cr(n,hw);return Be("div",Ze({},rn(t,"groupHeading",{"group-heading":!0}),r))},bw=mw,ww=["innerRef","isDisabled","isHidden","inputClassName"],yw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,l=o.spacing,s=o.colors;return Ye(Ye({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},Cw),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:s.neutral80})},vf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Cw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},vf)},Sw=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},vf)},xw=function(t){var n=t.cx,r=t.value,i=lf(t),o=i.innerRef,l=i.isDisabled,s=i.isHidden,a=i.inputClassName,u=Cr(i,ww);return Be("div",Ze({},rn(t,"input",{"input-container":!0}),{"data-value":r||""}),Be("input",Ze({className:n({input:!0},a),ref:o,style:Sw(s),disabled:l},u)))},kw=xw,Mw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Rw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,l=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Ew=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors,s=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:s?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},bf=function(t){var n=t.children,r=t.innerProps;return Be("div",r,n)},Iw=bf,Tw=bf;function Dw(e){var t=e.children,n=e.innerProps;return Be("div",Ze({role:"button"},n),t||Be(hl,{size:14}))}var Ow=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,l=t.isDisabled,s=t.removeProps,a=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Be(u,{data:i,innerProps:Ye(Ye({},rn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:a},Be(c,{data:i,innerProps:Ye({},rn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},n),Be(d,{data:i,innerProps:Ye(Ye({},rn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:a}))},Pw=Ow,_w=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.theme,s=l.spacing,a=l.colors;return Ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?a.primary:i?a.primary25:"transparent",color:r?a.neutral20:o?a.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?a.primary:a.primary50}})},Lw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.innerRef,s=t.innerProps;return Be("div",Ze({},rn(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":r},s),n)},Fw=Lw,Aw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},Hw=function(t){var n=t.children,r=t.innerProps;return Be("div",Ze({},rn(t,"placeholder",{placeholder:!0}),r),n)},zw=Hw,Vw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,l=i.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},$w=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Be("div",Ze({},rn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Nw=$w,wf={ClearIndicator:iw,Control:fw,DropdownIndicator:nw,DownChevron:mf,CrossIcon:hl,Group:bw,GroupHeading:vw,IndicatorsContainer:Zb,IndicatorSeparator:aw,Input:kw,LoadingIndicator:uw,Menu:Hb,MenuList:Vb,MenuPortal:qb,LoadingMessage:Wb,NoOptionsMessage:Bb,MultiValue:Pw,MultiValueContainer:Iw,MultiValueLabel:Tw,MultiValueRemove:Dw,Option:Fw,Placeholder:zw,SelectContainer:Xb,SingleValue:Nw,ValueContainer:jb},Bw=function(t){return Ye(Ye({},wf),t.components)},uc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ww(e,t){return!!(e===t||uc(e)&&uc(t))}function Uw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Ww(e[n],t[n]))return!1;return!0}function qw(e,t){t===void 0&&(t=Uw);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var l=e.apply(this,i);return n={lastResult:l,lastArgs:i,lastThis:this},l}return r.clear=function(){n=null},r}var Yw={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"},Xw=function(t){return Be("span",Ze({css:Yw},t))},cc=Xw,Gw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,l=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,l=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return l?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,l=o===void 0?"":o,s=t.selectValue,a=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,b){return p&&p.length?"".concat(p.indexOf(b)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(l," focused, ").concat(d(s,r),".");if(n==="menu"&&c){var g=a?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(l).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},jw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,l=t.isFocused,s=t.selectValue,a=t.selectProps,u=t.id,c=t.isAppleDevice,d=a.ariaLiveMessages,g=a.getOptionLabel,h=a.inputValue,m=a.isMulti,p=a.isOptionDisabled,b=a.isSearchable,w=a.menuIsOpen,v=a.options,x=a.screenReaderStatus,O=a.tabSelectsValue,S=a.isLoading,R=a["aria-label"],_=a["aria-live"],E=f.useMemo(function(){return Ye(Ye({},Gw),d||{})},[d]),k=f.useMemo(function(){var M="";if(n&&E.onChange){var z=n.option,N=n.options,G=n.removedValue,ie=n.removedValues,Q=n.value,X=function(P){return Array.isArray(P)?null:P},ne=G||z||X(Q),ae=ne?g(ne):"",le=N||ie||void 0,Oe=le?le.map(g):[],J=Ye({isDisabled:ne&&p(ne,s),label:ae,labels:Oe},n);M=E.onChange(J)}return M},[n,E,p,s,g]),L=f.useMemo(function(){var M="",z=r||i,N=!!(r&&s&&s.includes(r));if(z&&E.onFocus){var G={focused:z,label:g(z),isDisabled:p(z,s),isSelected:N,options:o,context:z===r?"menu":"value",selectValue:s,isAppleDevice:c};M=E.onFocus(G)}return M},[r,i,g,p,E,o,s,c]),D=f.useMemo(function(){var M="";if(w&&v.length&&!S&&E.onFilter){var z=x({count:o.length});M=E.onFilter({inputValue:h,resultsMessage:z})}return M},[o,h,w,E,v,x,S]),C=(n==null?void 0:n.action)==="initial-input-focus",I=f.useMemo(function(){var M="";if(E.guidance){var z=i?"value":w?"menu":"input";M=E.guidance({"aria-label":R,context:z,isDisabled:r&&p(r,s),isMulti:m,isSearchable:b,tabSelectsValue:O,isInitialFocus:C})}return M},[R,r,i,m,p,b,w,E,s,O,C]),T=Be(f.Fragment,null,Be("span",{id:"aria-selection"},k),Be("span",{id:"aria-focused"},L),Be("span",{id:"aria-results"},D),Be("span",{id:"aria-guidance"},I));return Be(f.Fragment,null,Be(cc,{id:u},C&&T),Be(cc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!C&&T))},Kw=jw,_s=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Zw=new RegExp("["+_s.map(function(e){return e.letters}).join("")+"]","g"),yf={};for(var ms=0;ms<_s.length;ms++)for(var ps=_s[ms],vs=0;vs<ps.letters.length;vs++)yf[ps.letters[vs]]=ps.base;var Cf=function(t){return t.replace(Zw,function(n){return yf[n]})},Jw=qw(Cf),dc=function(t){return t.replace(/^\s+|\s+$/g,"")},Qw=function(t){return"".concat(t.label," ").concat(t.value)},ey=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:Qw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,l=i.ignoreAccents,s=i.stringify,a=i.trim,u=i.matchFrom,c=a?dc(r):r,d=a?dc(s(n)):s(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),l&&(c=Jw(c),d=Cf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},ty=["innerRef"];function ny(e){var t=e.innerRef,n=Cr(e,ty),r=Tb(n,"onExited","in","enter","exit","appear");return Be("input",Ze({ref:t},r,{css:Nc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var ry=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function iy(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,l=f.useRef(!1),s=f.useRef(!1),a=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(b,w){if(u.current!==null){var v=u.current,x=v.scrollTop,O=v.scrollHeight,S=v.clientHeight,R=u.current,_=w>0,E=O-S-x,k=!1;E>w&&l.current&&(r&&r(b),l.current=!1),_&&s.current&&(o&&o(b),s.current=!1),_&&w>E?(n&&!l.current&&n(b),R.scrollTop=O,k=!0,l.current=!0):!_&&-w>x&&(i&&!s.current&&i(b),R.scrollTop=0,k=!0,s.current=!0),k&&ry(b)}},[n,r,i,o]),d=f.useCallback(function(b){c(b,b.deltaY)},[c]),g=f.useCallback(function(b){a.current=b.changedTouches[0].clientY},[]),h=f.useCallback(function(b){var w=a.current-b.changedTouches[0].clientY;c(b,w)},[c]),m=f.useCallback(function(b){if(b){var w=Rb?{passive:!1}:!1;b.addEventListener("wheel",d,w),b.addEventListener("touchstart",g,w),b.addEventListener("touchmove",h,w)}},[h,g,d]),p=f.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",g,!1),b.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var b=u.current;return m(b),function(){p(b)}}},[t,m,p]),function(b){u.current=b}}var fc=["boxSizing","height","overflow","paddingRight","position"],hc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function gc(e){e.cancelable&&e.preventDefault()}function mc(e){e.stopPropagation()}function pc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function vc(){return"ontouchstart"in window||navigator.maxTouchPoints}var bc=!!(typeof window<"u"&&window.document&&window.document.createElement),Zi=0,gi={capture:!1,passive:!1};function oy(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),l=f.useCallback(function(a){if(bc){var u=document.body,c=u&&u.style;if(r&&fc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Zi<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(hc).forEach(function(m){var p=hc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&vc()&&(u.addEventListener("touchmove",gc,gi),a&&(a.addEventListener("touchstart",pc,gi),a.addEventListener("touchmove",mc,gi))),Zi+=1}},[r]),s=f.useCallback(function(a){if(bc){var u=document.body,c=u&&u.style;Zi=Math.max(Zi-1,0),r&&Zi<1&&fc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&vc()&&(u.removeEventListener("touchmove",gc,gi),a&&(a.removeEventListener("touchstart",pc,gi),a.removeEventListener("touchmove",mc,gi)))}},[r]);return f.useEffect(function(){if(t){var a=o.current;return l(a),function(){s(a)}}},[t,l,s]),function(a){o.current=a}}var ay=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},sy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ly(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,l=e.onBottomLeave,s=e.onTopArrive,a=e.onTopLeave,u=iy({isEnabled:i,onBottomArrive:o,onBottomLeave:l,onTopArrive:s,onTopLeave:a}),c=oy({isEnabled:n}),d=function(h){u(h),c(h)};return Be(f.Fragment,null,n&&Be("div",{onClick:ay,css:sy}),t(d))}var uy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},cy=function(t){var n=t.name,r=t.onFocus;return Be("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:uy,value:"",onChange:function(){}})},dy=cy;function gl(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 fy(){return gl(/^iPhone/i)}function Sf(){return gl(/^Mac/i)}function hy(){return gl(/^iPad/i)||Sf()&&navigator.maxTouchPoints>1}function gy(){return fy()||hy()}function my(){return Sf()||gy()}var py=function(t){return t.label},vy=function(t){return t.label},by=function(t){return t.value},wy=function(t){return!!t.isDisabled},yy={clearIndicator:rw,container:Yb,control:cw,dropdownIndicator:tw,group:gw,groupHeading:pw,indicatorsContainer:Kb,indicatorSeparator:ow,input:yw,loadingIndicator:lw,loadingMessage:Nb,menu:Lb,menuList:zb,menuPortal:Ub,multiValue:Mw,multiValueLabel:Rw,multiValueRemove:Ew,noOptionsMessage:$b,option:_w,placeholder:Aw,singleValue:Vw,valueContainer:Gb},Cy={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%)"},Sy=4,xf=4,xy=38,ky=xf*2,My={baseUnit:xf,controlHeight:xy,menuGutter:ky},bs={borderRadius:Sy,colors:Cy,spacing:My},Ry={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:sc(),captureMenuScroll:!sc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ey(),formatGroupLabel:py,getOptionLabel:vy,getOptionValue:by,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:wy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!kb(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function wc(e,t,n,r){var i=Rf(e,t,n),o=Ef(e,t,n),l=Mf(e,t),s=wa(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:l,value:s,index:r}}function ra(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(l,s){return wc(e,l,t,s)}).filter(function(l){return Cc(e,l)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=wc(e,n,t,r);return Cc(e,o)?o:void 0}).filter(Eb)}function kf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Hs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function yc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Hs(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Ey(e,t){return kf(ra(e,t))}function Cc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,l=t.label,s=t.value;return(!Tf(e)||!o)&&If(e,{label:l,value:s,data:i},r)}function Iy(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function Ty(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ws=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},Mf=function(t,n){return t.getOptionLabel(n)},wa=function(t,n){return t.getOptionValue(n)};function Rf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Ef(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=wa(e,t);return n.some(function(i){return wa(e,i)===r})}function If(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Tf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Dy=1,Df=function(e){xg(n,e);var t=Rg(n);function n(r){var i;if(Mg(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=my(),i.controlRef=null,i.getControlRef=function(a){i.controlRef=a},i.focusedOptionRef=null,i.getFocusedOptionRef=function(a){i.focusedOptionRef=a},i.menuListRef=null,i.getMenuListRef=function(a){i.menuListRef=a},i.inputRef=null,i.getInputRef=function(a){i.inputRef=a},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(a,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(a,u),d(a,u)},i.setValue=function(a,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(a,{action:u,option:c})},i.selectOption=function(a){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(a,h),p=i.isOptionDisabled(a,h);if(m){var b=i.getOptionValue(a);i.setValue(h.filter(function(w){return i.getOptionValue(w)!==b}),"deselect-option",a)}else if(!p)d?i.setValue([].concat(Hs(h),[a]),"select-option",a):i.setValue(a,"select-option");else{i.ariaOnChange(a,{action:"select-option",option:a,name:g});return}c&&i.blurInput()},i.removeValue=function(a){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(a),g=c.filter(function(m){return i.getOptionValue(m)!==d}),h=Jo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:a}),i.focusInput()},i.clearValue=function(){var a=i.state.selectValue;i.onChange(Jo(i.props.isMulti,[],null),{action:"clear",removedValues:a})},i.popValue=function(){var a=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=Jo(a,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(a){return ws(i.state.focusableOptionsWithIds,a)},i.getFocusableOptionsWithIds=function(){return yc(ra(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];return wb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(a){return Mf(i.props,a)},i.getOptionValue=function(a){return wa(i.props,a)},i.getStyles=function(a,u){var c=i.props.unstyled,d=yy[a](u,c);d.boxSizing="border-box";var g=i.props.styles[a];return g?g(d,u):d},i.getClassNames=function(a,u){var c,d;return(c=(d=i.props.classNames)[a])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(a){return"".concat(i.state.instancePrefix,"-").concat(a)},i.getComponents=function(){return Bw(i.props)},i.buildCategorizedOptions=function(){return ra(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return kf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(a,u){i.setState({ariaSelection:Ye({value:a},u)})},i.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(a){i.blockOptionHover=!1},i.onControlMouseDown=function(a){if(!a.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},i.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),a.preventDefault()}},i.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(i.clearValue(),a.preventDefault(),i.openAfterFocus=!1,a.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(a){typeof i.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&Ra(a.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(a)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(a){var u=a.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(a){var u=a.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(a){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(a.target)&&i.menuListRef&&!i.menuListRef.contains(a.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(a){i.userIsDragging||i.onControlMouseDown(a)},i.onClearIndicatorTouchEnd=function(a){i.userIsDragging||i.onClearIndicatorMouseDown(a)},i.onDropdownIndicatorTouchEnd=function(a){i.userIsDragging||i.onDropdownIndicatorMouseDown(a)},i.handleInputChange=function(a){var u=i.props.inputValue,c=a.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(a){i.props.onFocus&&i.props.onFocus(a),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(a){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(a),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(a){if(!(i.blockOptionHover||i.state.focusedOption===a)){var u=i.getFocusableOptions(),c=u.indexOf(a);i.setState({focusedOption:a,focusedOptionId:c>-1?i.getFocusedOptionId(a):null})}},i.shouldHideSelectedOptions=function(){return Tf(i.props)},i.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),i.focus()},i.onKeyDown=function(a){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,b=u.menuIsOpen,w=u.onKeyDown,v=u.tabSelectsValue,x=u.openMenuOnFocus,O=i.state,S=O.focusedOption,R=O.focusedValue,_=O.selectValue;if(!p&&!(typeof w=="function"&&(w(a),a.defaultPrevented))){switch(i.blockOptionHover=!0,a.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||a.shiftKey||!b||!v||!S||x&&i.isOptionSelected(S,_))return;i.selectOption(S);break;case"Enter":if(a.keyCode===229)break;if(b){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":b?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!b){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":b?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":b?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!b)return;i.focusOption("pageup");break;case"PageDown":if(!b)return;i.focusOption("pagedown");break;case"Home":if(!b)return;i.focusOption("first");break;case"End":if(!b)return;i.focusOption("last");break;default:return}a.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Dy),i.state.selectValue=oc(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),l=i.buildFocusableOptions(),s=l.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=l[s],i.state.focusedOptionId=ws(o,l[s])}return i}return kg(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&ac(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,l=o.isDisabled,s=o.menuIsOpen,a=this.state.isFocused;(a&&!l&&i.isDisabled||a&&s&&!i.menuIsOpen)&&this.focusInput(),a&&l&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!l&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ac(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,l=this.state,s=l.selectValue,a=l.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(s[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,l=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=l.indexOf(s);s||(a=-1);var u=l.length-1,c=-1;if(l.length){switch(i){case"previous":a===0?c=0:a===-1?c=u:c=a-1;break;case"next":a>-1&&a<u&&(c=a+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:l[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,l=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var a=0,u=s.indexOf(l);l||(u=-1),i==="up"?a=u>0?u-1:s.length-1:i==="down"?a=(u+1)%s.length:i==="pageup"?(a=u-o,a<0&&(a=0)):i==="pagedown"?(a=u+o,a>s.length-1&&(a=s.length-1)):i==="last"&&(a=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bs):Ye(Ye({},bs),this.props.theme):bs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,l=this.getStyles,s=this.getClassNames,a=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:l,getClassNames:s,getValue:a,hasValue:p,isMulti:g,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,l=i.isMulti;return o===void 0?l:o}},{key:"isOptionDisabled",value:function(i,o){return Rf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Ef(this.props,i,o)}},{key:"filterOption",value:function(i,o){return If(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:l,selectValue:s})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,l=i.isSearchable,s=i.inputId,a=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,b=p.inputIsHidden,w=p.ariaSelection,v=this.commonProps,x=s||this.getElementId("input"),O=Ye(Ye(Ye({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?(w==null?void 0:w.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?f.createElement(m,Ze({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:a},O)):f.createElement(ny,Ze({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:va,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),l=o.MultiValue,s=o.MultiValueContainer,a=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,b=h.isMulti,w=h.inputValue,v=h.placeholder,x=this.state,O=x.selectValue,S=x.focusedValue,R=x.isFocused;if(!this.hasValue()||!m)return w?null:f.createElement(d,Ze({},g,{key:"placeholder",isDisabled:p,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),v);if(b)return O.map(function(E,k){var L=E===S,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return f.createElement(l,Ze({},g,{components:{Container:s,Label:a,Remove:u},isFocused:L,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(I){I.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(w)return null;var _=O[0];return f.createElement(c,Ze({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,l=this.commonProps,s=this.props,a=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||a||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ze({},l,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,l=this.commonProps,s=this.props,a=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,Ze({},l,{innerProps:d,isDisabled:a,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,l=i.IndicatorSeparator;if(!o||!l)return null;var s=this.commonProps,a=this.props.isDisabled,u=this.state.isFocused;return f.createElement(l,Ze({},s,{isDisabled:a,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var l=this.commonProps,s=this.props.isDisabled,a=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ze({},l,{innerProps:u,isDisabled:s,isFocused:a}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),l=o.Group,s=o.GroupHeading,a=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,b=this.props,w=b.captureMenuScroll,v=b.inputValue,x=b.isLoading,O=b.loadingMessage,S=b.minMenuHeight,R=b.maxMenuHeight,_=b.menuIsOpen,E=b.menuPlacement,k=b.menuPosition,L=b.menuPortalTarget,D=b.menuShouldBlockScroll,C=b.menuShouldScrollIntoView,I=b.noOptionsMessage,T=b.onMenuScrollToTop,M=b.onMenuScrollToBottom;if(!_)return null;var z=function(ae,le){var Oe=ae.type,J=ae.data,F=ae.isDisabled,P=ae.isSelected,B=ae.label,he=ae.value,Te=p===J,Fe=F?void 0:function(){return i.onOptionHover(J)},ge=F?void 0:function(){return i.selectOption(J)},ze="".concat(i.getElementId("option"),"-").concat(le),Ie={id:ze,onClick:ge,onMouseMove:Fe,onMouseOver:Fe,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return f.createElement(h,Ze({},m,{innerProps:Ie,data:J,isDisabled:F,isSelected:P,key:ze,label:B,type:Oe,value:he,isFocused:Te,innerRef:Te?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(ne){if(ne.type==="group"){var ae=ne.data,le=ne.options,Oe=ne.index,J="".concat(i.getElementId("group"),"-").concat(Oe),F="".concat(J,"-heading");return f.createElement(l,Ze({},m,{key:J,data:ae,options:le,Heading:s,headingProps:{id:F,data:ne.data},label:i.formatGroupLabel(ne.data)}),ne.options.map(function(P){return z(P,"".concat(Oe,"-").concat(P.index))}))}else if(ne.type==="option")return z(ne,"".concat(ne.index))});else if(x){var G=O({inputValue:v});if(G===null)return null;N=f.createElement(d,m,G)}else{var ie=I({inputValue:v});if(ie===null)return null;N=f.createElement(g,m,ie)}var Q={minMenuHeight:S,maxMenuHeight:R,menuPlacement:E,menuPosition:k,menuShouldScrollIntoView:C},X=f.createElement(Fb,Ze({},m,Q),function(ne){var ae=ne.ref,le=ne.placerProps,Oe=le.placement,J=le.maxHeight;return f.createElement(a,Ze({},m,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:Oe}),f.createElement(ly,{captureEnabled:w,onTopArrive:T,onBottomArrive:M,lockEnabled:D},function(F){return f.createElement(u,Ze({},m,{innerRef:function(B){i.getMenuListRef(B),F(B)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:J,focusedOption:p}),N)}))});return L||k==="fixed"?f.createElement(c,Ze({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:E,menuPosition:k}),X):X}},{key:"renderFormField",value:function(){var i=this,o=this.props,l=o.delimiter,s=o.isDisabled,a=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!s)return f.createElement(dy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(a)if(l){var g=d.map(function(p){return i.getOptionValue(p)}).join(l);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(p,b){return f.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:i.getOptionValue(p)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,l=o.ariaSelection,s=o.focusedOption,a=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Kw,Ze({},i,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:s,focusedValue:a,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,l=i.IndicatorsContainer,s=i.SelectContainer,a=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return f.createElement(s,Ze({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),f.createElement(o,Ze({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),f.createElement(a,Ze({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(l,Ze({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var l=o.prevProps,s=o.clearFocusValueOnUpdate,a=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,b=i.inputValue,w=i.isMulti,v=oc(m),x={};if(l&&(m!==l.value||h!==l.options||p!==l.menuIsOpen||b!==l.inputValue)){var O=p?Ey(i,v):[],S=p?yc(ra(i,v),"".concat(g,"-option")):[],R=s?Iy(o,v):null,_=Ty(o,O),E=ws(S,_);x={selectValue:v,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:S,focusedValue:R,clearFocusValueOnUpdate:!1}}var k=a!=null&&i!==l?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},L=u,D=c&&d;return c&&!D&&(L={value:Jo(w,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),Ye(Ye(Ye({},x),k),{},{prevProps:i,ariaSelection:L,prevWasFocused:D})}}]),n}(f.Component);Df.defaultProps=Ry;var Oy=f.forwardRef(function(e,t){var n=nb(e);return f.createElement(Df,Ze({ref:t},n))}),Py=Oy;const _y=e=>{const{Menu:t}=wf,{children:n,...r}=e;return f.createElement(t,{...r},n)},Ly=bn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Fy=bn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Ay=bn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Hy=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:i,value:o}=t.data,[l,s]=f.useState(o),[a,u]=f.useState(r??""),c=Jm(),d=f.useMemo(()=>i.map(g=>typeof g=="string"||g===null||g===void 0?{value:g,label:(g==null?void 0:g.toString())??""}:g),[i]);return t.readonly?f.createElement(Ay,null,f.createElement(ei,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):f.createElement(Ly,null,f.createElement(Py,{className:"glide-select",inputValue:a,onInputChange:u,menuPlacement:"auto",value:d.find(g=>g.value===l),styles:{control:g=>({...g,border:0,boxShadow:"none"}),option:(g,{isFocused:h})=>({...g,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:h?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...g[":active"],color:c.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:g=>({...g,colors:{...g.colors,neutral0:c.bgCell,neutral5:c.bgCell,neutral10:c.bgCell,neutral20:c.bgCellMedium,neutral30:c.bgCellMedium,neutral40:c.bgCellMedium,neutral50:c.textLight,neutral60:c.textMedium,neutral70:c.textMedium,neutral80:c.textDark,neutral90:c.textDark,neutral100:c.textDark,primary:c.accentColor,primary75:c.accentColor,primary50:c.accentColor,primary25:c.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:g=>f.createElement(Fy,null,f.createElement(_y,{className:"click-outside-ignore",...g}))},options:d,onChange:async g=>{g!==null&&(s(g.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:g.value}}))}}))},zy={kind:te.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,l=t.data.allowedValues.find(a=>typeof a=="string"||a===null||a===void 0?a===o:a.value===o),s=typeof l=="string"?l:(l==null?void 0:l.label)??"";return s&&(n.fillStyle=r.textDark,n.fillText(s,i.x+r.cellHorizontalPadding,i.y+i.height/2+cr(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Hy,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 Vy(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],l=i*t;return e.replace(n,`${Number(l.toPrecision(3))}${o}`)}return e}const $y={marginRight:8},Ny={display:"flex",alignItems:"center",flexGrow:1},By={kind:te.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:l,value:s,label:a,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,g=l-o,h=(s-o)/g,m=`${Vy(r.baseFontStyle,.9)} ${r.fontFamily}`,b=Ys(n,m)/2;n.save();let w=0;a!==void 0&&(n.font=m,w=ni(u??a,n,m).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-w;if(v>=b){const x=n.createLinearGradient(c,d,c+v,d);x.addColorStop(0,r.accentColor),x.addColorStop(h,r.accentColor),x.addColorStop(h,r.bgBubble),x.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=x,ec(n,c,d-b/2,v,b,b/2),n.fill(),n.beginPath(),ec(n,c+.5,d-b/2+.5,v-1,b-1,(b-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return a!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(a,i.x+i.width-r.cellHorizontalPadding,d+cr(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),l=t.step.toString(),s=a=>{e.onChange({...e.value,data:{...t,value:Number(a.target.value)}})};return f.createElement("label",{style:Ny},f.createElement("input",{style:$y,type:"range",value:r,min:i,max:o,step:l,onChange:s,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}}},Wy=bn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ys=(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}`)}},Uy=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,l=t.min instanceof Date?ys(n,t.min,o):t.min,s=t.max instanceof Date?ys(n,t.max,o):t.max,a=ys(n,t.date,o);return e.value.readonly?qt.createElement(ei,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):qt.createElement(Wy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:a,min:l,max:s,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},qy={kind:te.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return qs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Uy}),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)}}},Yy="None";function Sc(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 Xy=e=>{const{cell:t,theme:n,ctx:r}=e;qs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Yy,t.contentAlign),r.fillStyle=n.textDark};function Gy(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:l,ctx:s,rect:a}=r,u=r.col;if(Ci(o))Sc(s,a,l);else if(ka(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Xy(r),c.isRequired&&c.isEditable&&Sc(s,a,l);return}i()},[e]),n=f.useMemo(()=>[eb,zy,By,qy,...I1],[]);return{drawCell:t,customRenderers:n}}function jy(){const e=Jr();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:mi(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:mi(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:mi(e.colors.darkenedBgMix100,.9),bgHeaderHovered:mi(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(pn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${pn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${pn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:mi(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(pn(e.spacing.sm)),cellVerticalPadding:Math.round(pn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(pn("1.25rem")),bubblePadding:Math.round(pn(e.spacing.sm)),bubbleMargin:Math.round(pn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(pn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(pn("25rem")),minColumnWidth:Math.round(pn("3.125rem")),maxColumnWidth:Math.round(pn("62.5rem")),maxColumnAutoWidth:Math.round(pn("31.25rem")),defaultRowHeight:Math.round(pn("2.1875rem")),defaultHeaderHeight:Math.round(pn("2.1875rem")),bgRowHovered:og(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Ky=As.getLogger("useDataEditor");function Zy(e,t,n,r,i,o,l,s,a){const u=f.useCallback(([p,b],w)=>{const v=e[p];if(!v.isEditable)return;const x=v.indexNumber,O=n.current.getOriginalRowIndex(i(b)),S=r([p,b]),R=v.getCellValue(S),_=v.getCellValue(w);if(!Ci(S)&&_===R)return;const E=v.getCell(_,!0);Ci(E)?Ky.warn(`Not applying the cell edit since it causes this error:
|
195
|
+
${E.data}`):(n.current.setCell(x,O,{...E,lastUpdated:performance.now()}),s())},[e,n,i,r,s]),c=f.useCallback(()=>{if(t)return;const p=new Map;e.forEach(b=>{p.set(b.indexNumber,b.getCell(b.defaultValue))}),n.current.addRow(p),l()},[e,n,t,l]),d=f.useCallback(()=>{t||(c(),s())},[c,s,t]),g=f.useCallback(p=>{var b;if(p.rows.length>0){if(t)return!0;const w=p.rows.toArray().map(v=>n.current.getOriginalRowIndex(i(v)));return n.current.deleteRows(w),l(),a(),s(),!1}if((b=p.current)!=null&&b.range){const w=[],v=p.current.range;for(let x=v.y;x<v.y+v.height;x++)for(let O=v.x;O<v.x+v.width;O++){const S=e[O];S.isEditable&&!S.isRequired&&(w.push({cell:[O,x]}),u([O,x],S.getCell(null)))}return w.length>0&&(s(),o(w)),!1}return!0},[e,n,t,o,i,s,u,a,l]),h=f.useCallback((p,b)=>{const[w,v]=p,x=[];for(let O=0;O<b.length;O++){const S=b[O];if(O+v>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<S.length;R++){const _=S[R],E=O+v,k=R+w;if(k>=e.length)break;const L=e[k];if(L.isEditable){const D=L.getCell(_,!0);if(ht(D)&&!Ci(D)){const C=L.indexNumber,I=n.current.getOriginalRowIndex(i(E)),T=L.getCellValue(r([k,E]));L.getCellValue(D)!==T&&(n.current.setCell(C,I,{...D,lastUpdated:performance.now()}),x.push({cell:[k,E]}))}}}x.length>0&&(s(),o(x))}return!1},[e,n,t,i,r,c,s,o]),m=f.useCallback((p,b)=>{const w=p[0];if(w>=e.length)return!0;const v=e[w];if(v.validateInput){const x=v.validateInput(v.getCellValue(b));return x===!0||x===!1?x:v.getCell(x)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:m}}const Of=",",to='"',Jy='"',Pf=`
|
196
|
+
`,Qy="\uFEFF",eC=new RegExp(`[${[Of,to,Pf].join("")}]`),xc=As.getLogger("useDataExporter");function kc(e){return e.map(t=>tC(t)).join(Of)+Pf}function tC(e){if(Xe(e))return"";const t=Ct(e);return eC.test(t)?`${to}${t.replace(new RegExp(to,"g"),Jy+to)}${to}`:t}async function Mc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Qy));const o=n.map(l=>l.name);await e.write(i.encode(kc(o)));for(let l=0;l<r;l++){const s=[];n.forEach((a,u,c)=>{s.push(a.getCellValue(t([u,l])))}),await e.write(i.encode(kc(s)))}await e.close()}function nC(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const l=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fs(()=>import("./es6.DB9CkkEz.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:l,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Mc(u,e,t,n)}catch(s){if(s instanceof Error&&s.name==="AbortError")return;try{xc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",s);let a="";const u=new WritableStream({write:h=>{a+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Mc(u.getWriter(),e,t,n);const c=new Blob([a],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Cg({enforceDownloadInNewTab:r,url:d,filename:l});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(a){xc.error("Failed to export data as CSV",a)}}},[t,n,e,r])}}function rC(e,t,n,r){return{getCellContent:f.useCallback(([o,l])=>{var s;if(o>t.length-1)return Ft("Column index out of bounds","This error should never happen. Please report this bug.");if(l>n-1)return Ft("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],u=a.indexNumber,c=r.current.getOriginalRowIndex(l),d=r.current.isAddedRow(c);if(a.isEditable||d){const m=r.current.getCell(u,c);if(ht(m))return{...a.getCell(a.getCellValue(m),!1),lastUpdated:m.lastUpdated};if(d)return Ft("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${u}; row=${c}`)}const g=e.getCell(c,u),h=ag(e,c,u);return z1(a,g,h,(s=e.styler)==null?void 0:s.cssStyles)}catch(a){return Ft("Error during cell creation",`This error should never happen. Please report this bug.
|
197
|
+
Error: ${a}`)}},[t,n,e,r])}}function iC(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,l]=o.location;n(l)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function oC(e,t,n,r,i){const[o,l]=f.useState({columns:bt.empty(),rows:bt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Mn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Mn.SelectionMode.SINGLE_ROW)),a=s&&e.selectionMode.includes(Mn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Mn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Mn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Mn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=f.useCallback(b=>{const w=!Ya(b.rows.toArray(),o.rows.toArray()),v=!Ya(b.columns.toArray(),o.columns.toArray()),x=!Ya(b.current,o.current);let O=s&&w||u&&v,S=b;if((s||u)&&b.current!==void 0&&x&&(S={...b,rows:o.rows,columns:o.columns},O=!1),w&&b.rows.length>0&&v&&b.columns.length===0&&(S={...S,columns:o.columns},O=!0),v&&b.columns.length>0&&w&&b.rows.length===0&&(S={...S,rows:o.rows},O=!0),v&&S.columns.length>=0){let R=S.columns;r.forEach((_,E)=>{_.isIndex&&(R=R.remove(E))}),R.length<S.columns.length&&(S={...S,columns:R})}l(S),O&&i(S)},[o,s,u,i,r]),p=f.useCallback((b=!1,w=!1)=>{const v={columns:w?o.columns:bt.empty(),rows:b?o.rows:bt.empty(),current:void 0};l(v),(!b&&s||!w&&u)&&i(v)},[o,s,u,i]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:a,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function aC(e,t,n,r,i,o,l){const s=e.rowHeight??t.defaultRowHeight,a=t.defaultHeaderHeight+s+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===Mn.EditingMode.DYNAMIC?1:0,d=n+c;let g=Math.max(d*s+u*t.defaultHeaderHeight+2*t.tableBorderWidth,a),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,a),g=Math.max(e.height,g)),o&&(h=Math.min(h,o),g=Math.min(g,o),e.height||(h=g));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let b,w=p;e.useContainerWidth?b=p:e.width&&(b=Math.min(Math.max(e.width,m),p),w=Math.min(Math.max(e.width,w),p));const[v,x]=f.useState({width:b||"100%",height:h});return f.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&x(O=>({...O,width:p}))},[p]),f.useLayoutEffect(()=>{x(O=>({...O,width:b||"100%"}))},[b]),f.useLayoutEffect(()=>{x(O=>({...O,height:h}))},[h,n]),f.useLayoutEffect(()=>{if(l){const O=e.useContainerWidth||ht(e.width)&&e.width>0;x({width:O?w:"100%",height:g})}else x({width:b||"100%",height:h})},[l]),{minHeight:a,maxHeight:g,minWidth:m,maxWidth:w,rowHeight:s,resizableSize:v,setResizableSize:x}}const sC=600,lC="⚠️ Please fill out this cell.";function uC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),l=f.useCallback(a=>{if(clearTimeout(o.current),o.current=0,i(void 0),(a.kind==="header"||a.kind==="cell")&&a.location){const u=a.location[0],c=a.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(a.kind==="header"&&ht(g))d=g.help;else if(a.kind==="cell"){const h=t([u,c]);Ci(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&ka(h)?d=lC:h1(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:a.bounds.x+a.bounds.width/2,top:a.bounds.y})},sC))}},[e,t,i,o,n]),s=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:s,onItemHovered:l}}function cC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),l=Jr(),{colors:s,fontSizes:a,radii:u,fontWeights:c}=l,d=f.useCallback(()=>{o(!1),r()},[r,o]);return lt(Sa,{content:lt(sg,{"data-testid":"stDataFrameTooltipContent",children:lt(lg,{style:{fontSize:a.sm},source:n,allowHTML:!1})}),placement:ya.top,accessibilityType:Lc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Ca(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:a.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:lt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const dC=f.memo(cC),Rc=ki("div",{target:"e1u61huh0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Ec=150,fC=15e4,Ic=6;function hC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:l,expand:s,collapse:a,width:u,height:c}=ug(gg),d=f.useRef(null),g=f.useRef(null),h=f.useRef(null),m=jy(),{getRowThemeOverride:p,onItemHovered:b}=iC(m),{libConfig:{enforceDownloadInNewTab:w=!1}}=f.useContext(cg),[v,x]=f.useState(!0),[O,S]=f.useState(!1),[R,_]=f.useState(!1),[E,k]=f.useState(!1),[L,D]=f.useState(),[C,I]=f.useState(!1),T=f.useCallback(()=>I(ve=>!ve),[]),M=f.useCallback(()=>I(!1),[]),z=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),N=f.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Xe(e.editingMode)&&(e.editingMode=Mn.EditingMode.READ_ONLY);const{READ_ONLY:G,DYNAMIC:ie}=Mn.EditingMode,Q=t.dimensions,X=Math.max(0,Q.numDataRows),ne=X===0&&!(e.editingMode===ie&&Q.numDataColumns>0),ae=X>fC,le=!ae&&!ne&&e.editingMode!==ie,Oe=!ne&&e.editingMode===ie&&!n,J=f.useRef(new Go(X)),[F,P]=f.useState(J.current.getNumRows());f.useEffect(()=>{J.current=new Go(X),P(J.current.getNumRows())},[X]);const B=f.useCallback(()=>{J.current=new Go(X),P(J.current.getNumRows())},[X]),[he,Te]=f.useState(e.columnOrder);f.useEffect(()=>{Te(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:Fe,allColumns:ge,setColumnConfigMapping:ze}=N1(e,t,n,he);f.useEffect(()=>{if(e.editingMode===G)return;const ve=r.getStringValue({id:e.id,formId:e.formId});ve&&(J.current.fromJson(ve,Fe),P(J.current.getNumRows()))},[]);const{getCellContent:Ie}=rC(t,Fe,F,J),{columns:je,sortColumn:wt,getOriginalIndex:nt,getCellContent:oe}=Z1(X,Fe,Ie),He=f.useCallback(ve=>{const ut={selection:{rows:[],columns:[]}};ut.selection.rows=ve.rows.toArray().map(tn=>nt(tn)),ut.selection.columns=ve.columns.toArray().map(tn=>ao(je[tn]));const Zt=JSON.stringify(ut),Lt=r.getStringValue({id:e.id,formId:e.formId});(Lt===void 0||Lt!==Zt)&&r.setStringValue({id:e.id,formId:e.formId},Zt,{fromUi:!0},o)},[je,e.id,e.formId,r,o,nt]),{debouncedCallback:me}=$u(He,Ec),{gridSelection:ue,isRowSelectionActivated:ce,isMultiRowSelectionActivated:Ve,isColumnSelectionActivated:_e,isMultiColumnSelectionActivated:rt,isRowSelected:de,isColumnSelected:pe,isCellSelected:st,clearSelection:ke,processSelectionChange:Qe}=oC(e,ne,n,je,me);f.useEffect(()=>{ke(!0,!0)},[l]);const yt=f.useCallback(ve=>{var ut;(ut=g.current)==null||ut.updateCells(ve)},[]);f.useEffect(()=>{var ut,Zt,Lt,tn;if(!ce&&!_e)return;const ve=r.getStringValue({id:e.id,formId:e.formId});if(ve){const Pn=je.map(nr=>ao(nr)),ri=JSON.parse(ve);let dr=bt.empty(),fr=bt.empty();(Zt=(ut=ri.selection)==null?void 0:ut.rows)==null||Zt.forEach(nr=>{dr=dr.add(nr)}),(tn=(Lt=ri.selection)==null?void 0:Lt.columns)==null||tn.forEach(nr=>{fr=fr.add(Pn.indexOf(nr))}),(dr.length>0||fr.length>0)&&Qe({rows:dr,columns:fr,current:void 0})}},[]);const mt=f.useCallback(()=>{F!==J.current.getNumRows()&&P(J.current.getNumRows())},[F]),$e=f.useCallback(()=>{const ve=J.current.toJson(je);let ut=r.getStringValue({id:e.id,formId:e.formId});ut===void 0&&(ut=new Go(0).toJson([])),ve!==ut&&r.setStringValue({id:e.id,formId:e.formId},ve,{fromUi:!0},o)},[je,e.id,e.formId,r,o]),{debouncedCallback:Dt}=$u($e,Ec),{exportToCsv:Xt}=nC(oe,je,F,w),{onCellEdited:It,onPaste:zt,onRowAppended:Qt,onDelete:Ot,validateCell:Rn}=Zy(je,e.editingMode!==ie,J,oe,nt,yt,mt,Dt,ke),Wt=f.useMemo(()=>ne?[0]:Oe?[F]:[],[ne,Oe,F]),{tooltip:pt,clearTooltip:un,onItemHovered:hn}=uC(je,oe,Wt),{drawCell:Pe,customRenderers:At}=Gy(je),{provideEditor:gn}=Q1(),mn=f.useCallback(ve=>({...ve,hasMenu:!ne}),[ne]),wn=f.useMemo(()=>je.map(ve=>mn(Ds(ve))),[je,mn]),{columns:ot,onColumnResize:Gt}=q1(wn),Pt=t.dimensions.numHeaderRows>1,{minHeight:on,maxHeight:Rt,minWidth:Vt,maxWidth:et,rowHeight:_t,resizableSize:Tt,setResizableSize:$t}=aC(e,m,F,Pt,u||0,c,l),Nt=f.useCallback(([ve,ut])=>({...g1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(je.length-1,0)]}),[je,m.glideTheme.textLight]),En=f.useCallback(()=>{B(),ke()},[B,ke]);fg({element:e,widgetMgr:r,onFormCleared:En});const{pinColumn:tr,unpinColumn:On,freezeColumns:$}=W1(je,ne,u||0,m.minColumnWidth,ke,ze),{changeColumnFormat:tt}=B1(ze),{hideColumn:Ne,showColumn:Ht}=J1(ke,ze),{onColumnMoved:Sn}=U1(je,$,tr,On,Te);return f.useEffect(()=>{setTimeout(()=>{var ve,ut;if(h.current&&g.current){const Zt=(ut=(ve=h.current)==null?void 0:ve.querySelector(".dvn-stack"))==null?void 0:ut.getBoundingClientRect();Zt&&(_(Zt.height>h.current.clientHeight),k(Zt.width>h.current.clientWidth))}},1)},[Tt,F,ot]),f.useEffect(()=>{ge.length==je.length&&I(!1)},[ge.length,je.length]),An(Rc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:N,ref:h,onMouseDown:ve=>{if(h.current&&N){const ut=h.current.getBoundingClientRect();E&&ut.height-(Ic+1)<ve.clientY-ut.top&&ve.stopPropagation(),R&&ut.width-(Ic+1)<ve.clientX-ut.left&&ve.stopPropagation()}},onBlur:ve=>{!v&&!z&&!ve.currentTarget.contains(ve.relatedTarget)&&ke(!0,!0)},children:[An(mg,{isFullScreen:l,disableFullscreenMode:i,locked:de&&!ce||st||z&&v||C,onExpand:s,onCollapse:a,target:Rc,children:[(ce&&de||_e&&pe)&<(hi,{label:"Clear selection",icon:Sg,onClick:()=>{ke(),un()}}),Oe&&de&<(hi,{label:"Delete row(s)",icon:Eg,onClick:()=>{Ot&&(Ot(ue),un())}}),Oe&&!de&<(hi,{label:"Add row",icon:Bc,onClick:()=>{var ve;Qt&&(x(!0),Qt(),un(),(ve=g.current)==null||ve.scrollTo(0,F,"vertical"))}}),!ne&&ge.length>je.length&<(a1,{columns:ge,columnOrder:he,setColumnOrder:Te,hideColumn:Ne,showColumn:Ht,isOpen:C,onClose:M,children:lt(hi,{label:"Show/hide columns",icon:Uc,onClick:T})}),!ae&&!ne&<(hi,{label:"Download as CSV",icon:Ig,onClick:Xt}),!ne&<(hi,{label:"Search",icon:Wc,onClick:()=>{O?S(!1):(x(!0),S(!0)),un()}})]}),lt(dg,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Tt,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:on,maxHeight:Rt,minWidth:Vt,maxWidth:et,size:Tt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,_t],snapGap:_t/3,onResizeStop:(ve,ut,Zt,Lt)=>{if(d.current){const tn=2*m.tableBorderWidth;$t({width:d.current.size.width,height:Rt-d.current.size.height===tn?d.current.size.height+tn:d.current.size.height})}},children:lt(Kv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:ot,rows:ne?1:F,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:_t,headerHeight:m.defaultHeaderHeight,getCellContent:ne?Nt:oe,onColumnResize:z?void 0:Gt,resizeIndicator:"header",freezeColumns:$,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:z?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:_e?void 0:Sn,onItemHovered:ve=>{b==null||b(ve),hn==null||hn(ve)},keybindings:{downFill:!0},onKeyDown:ve=>{(ve.ctrlKey||ve.metaKey)&&ve.key==="f"&&(S(ut=>!ut),ve.stopPropagation(),ve.preventDefault())},showSearch:O,searchResults:O?void 0:[],onSearchClose:()=>{S(!1),un()},onHeaderClicked:(ve,ut)=>{!le||_e||(O&&S(!1),ce&&de?ke():ke(!0,!0),wt(ve,"auto"))},gridSelection:ue,onGridSelectionChange:ve=>{(v||z)&&(Qe(ve),pt!==void 0&&un())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:ve=>{ve.kind==="out-of-bounds"&&v?x(!1):ve.kind!=="out-of-bounds"&&!v&&x(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...N&&{paddingBottom:E?-6:void 0,paddingRight:R?-6:void 0}},provideEditor:gn,drawCell:Pe,customRenderers:At,imageEditorOverride:E1,headerIcons:m.headerIcons,validateCell:Rn,onHeaderMenuClick:(ve,ut)=>{D({columnIdx:ve,headerBounds:ut})},onPaste:!1,...ce&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader,textMedium:m.glideTheme.textLight}},rowSelectionMode:Ve?"multi":"auto",rowSelect:n?"none":Ve?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},..._e&&{columnSelect:n?"none":rt?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!ne&&e.editingMode!==G&&!n&&{fillHandle:!z,onCellEdited:It,onPaste:zt,onDelete:Ot},...!ne&&e.editingMode===ie&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:Qt,onHeaderClicked:void 0}})}),pt&&pt.content&<(dC,{top:pt.top,left:pt.left,content:pt.content,clearTooltip:un}),L&&$c.createPortal(lt(n1,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,columnKind:Fe[L.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:le?ve=>{O&&S(!1),ke(!(ce&&de),!0),wt(L.columnIdx,ve,!0)}:void 0,isColumnPinned:Fe[L.columnIdx].isPinned,onUnpinColumn:()=>{On(Fe[L.columnIdx].id)},onPinColumn:()=>{tr(Fe[L.columnIdx].id)},onHideColumn:()=>{Ne(Fe[L.columnIdx].id)},onChangeFormat:ve=>{tt(Fe[L.columnIdx].id,ve),setTimeout(()=>{var ut;(ut=g.current)==null||ut.remeasureColumns(bt.fromSingleSelection(L.columnIdx))},100)},onAutosize:()=>{var ve;(ve=g.current)==null||ve.remeasureColumns(bt.fromSingleSelection(L.columnIdx))}}),document.querySelector("#portal"))]})}const gC=hg(hC),mC=f.memo(gC),TC=Object.freeze(Object.defineProperty({__proto__:null,default:mC},Symbol.toStringTag,{value:"Module"}));export{D0 as C,Sd as T,bi as a,Lg as b,TC as c,pi as i,Zm as m,bn as s};
|